Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tx track modif 7087 v15 #11966

Closed
wants to merge 2 commits into from

Conversation

catenacyber
Copy link
Contributor

Link to ticket: https://redmine.openinfosecfoundation.org/issues/
https://redmine.openinfosecfoundation.org/issues/7087

Describe changes:

  • app-layer: track modified/processed txs

#11915 with using updated_tc and ts instead of updated[0]

Completes Ticket 7013
To optimize detection, and logging, to avoid going through
all the live transactions when only a few were modified.

Ticket: 7087
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 94.73684% with 7 lines in your changes missing coverage. Please review.

Project coverage is 82.76%. Comparing base (378f678) to head (d44457b).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11966      +/-   ##
==========================================
- Coverage   82.76%   82.76%   -0.01%     
==========================================
  Files         910      910              
  Lines      249014   249132     +118     
==========================================
+ Hits       206105   206197      +92     
- Misses      42909    42935      +26     
Flag Coverage Δ
fuzzcorpus 60.80% <92.48%> (+0.02%) ⬆️
livemode 18.69% <0.00%> (-0.02%) ⬇️
pcap 44.11% <70.67%> (+0.25%) ⬆️
suricata-verify 62.18% <78.94%> (+0.01%) ⬆️
unittests 59.00% <40.60%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 23111

/// It can then be skipped until new data arrives.
/// There is a boolean for both directions : to server and to client
pub updated_tc: bool,
pub updated_ts: bool,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a better struct layout

master

	/* typedef AppLayerTxData */ struct AppLayerTxData {
		struct AppLayerTxConfig {
			/* typedef uint8_t -> __uint8_t */ unsigned char log_flags;      /*     8     1 */
		}config; /*     8     1 */

		/* XXX 3 bytes hole, try to pack */

		struct LoggerFlags {
			/* typedef uint32_t -> __uint32_t */ unsigned int flags;         /*    12     4 */
		}logged; /*    12     4 */
		/* typedef uint32_t -> __uint32_t */ unsigned int       files_opened;    /*    16     4 */
		/* typedef uint32_t -> __uint32_t */ unsigned int       files_logged;    /*    20     4 */
		/* typedef uint32_t -> __uint32_t */ unsigned int       files_stored;    /*    24     4 */
		/* typedef uint16_t -> __uint16_t */ short unsigned int file_flags;      /*    28     2 */
		/* typedef uint8_t -> __uint8_t */ unsigned char      file_tx;           /*    30     1 */
		/* typedef uint8_t -> __uint8_t */ unsigned char      stream_logged;     /*    31     1 */
		/* typedef uint64_t -> __uint64_t */ long unsigned int  detect_flags_ts; /*    32     8 */
		/* typedef uint64_t -> __uint64_t */ long unsigned int  detect_flags_tc; /*    40     8 */
		DetectEngineState * de_state;                                            /*    48     8 */
		AppLayerDecoderEvents * events;                                          /*    56     8 */
	} tx_data; /*     8    56 */

this PR

	/* typedef AppLayerTxData */ struct AppLayerTxData {
		struct AppLayerTxConfig {
			/* typedef uint8_t -> __uint8_t */ unsigned char log_flags;      /*     8     1 */
		}config; /*     8     1 */

		/* XXX 3 bytes hole, try to pack */

		struct LoggerFlags {
			/* typedef uint32_t -> __uint32_t */ unsigned int flags;         /*    12     4 */
		}logged; /*    12     4 */
		/* typedef uint32_t -> __uint32_t */ unsigned int       files_opened;    /*    16     4 */
		/* typedef uint32_t -> __uint32_t */ unsigned int       files_logged;    /*    20     4 */
		/* typedef uint32_t -> __uint32_t */ unsigned int       files_stored;    /*    24     4 */
		/* typedef uint16_t -> __uint16_t */ short unsigned int file_flags;      /*    28     2 */
		/* typedef uint8_t -> __uint8_t */ unsigned char      file_tx;           /*    30     1 */
		/* typedef uint8_t -> __uint8_t */ unsigned char      stream_logged;     /*    31     1 */
		_Bool              updated_tc;                                           /*    32     1 */
		_Bool              updated_ts;                                           /*    33     1 */

		/* XXX 6 bytes hole, try to pack */

		/* typedef uint64_t -> __uint64_t */ long unsigned int  detect_flags_ts; /*    40     8 */
		/* typedef uint64_t -> __uint64_t */ long unsigned int  detect_flags_tc; /*    48     8 */
		DetectEngineState * de_state;                                            /*    56     8 */
		/* --- cacheline 1 boundary (64 bytes) --- */
		AppLayerDecoderEvents * events;                                          /*    64     8 */
	} tx_data; /*     8    64 */

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@catenacyber
Copy link
Contributor Author

Next in #11976

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants