suricata icon indicating copy to clipboard operation
suricata copied to clipboard

output/plugin: Use Suri thread-id for plugins

Open jlucovsky opened this issue 1 year ago • 2 comments

Continuation of #9709

Issue: 6408

Use the Suricata thread id for plugin thread initialization to give the plugin a better correlating factor to the actual Suricata threads.

Link to redmine ticket: 6408

Describe changes:

  • Pass the actual thread id to the ThreadInit function instead of the "slot number"

Update:

  • Update example plugin to use ThreadId type
  • Add ThreadId type for plugin interface

Provide values to any of the below to override the defaults.

To use a pull request use a branch name like pr/N where N is the pull request number.

Alternatively, SV_BRANCH may also be a link to an OISF/suricata-verify pull-request.

SV_REPO=
SV_BRANCH=
SU_REPO=
SU_BRANCH=
LIBHTP_REPO=
LIBHTP_BRANCH=

jlucovsky avatar Jan 14 '24 14:01 jlucovsky

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (1dcf69b) 82.19% compared to head (16722da) 82.07%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10159      +/-   ##
==========================================
- Coverage   82.19%   82.07%   -0.12%     
==========================================
  Files         974      974              
  Lines      271825   271832       +7     
==========================================
- Hits       223416   223117     -299     
- Misses      48409    48715     +306     
Flag Coverage Δ
fuzzcorpus 62.64% <9.09%> (-0.38%) :arrow_down:
suricata-verify 61.39% <18.18%> (-0.02%) :arrow_down:
unittests 62.85% <0.00%> (+<0.01%) :arrow_up:

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

codecov[bot] avatar Jan 14 '24 15:01 codecov[bot]

Information: QA ran without warnings.

Pipeline 17506

suricata-qa avatar Jan 14 '24 17:01 suricata-qa

@jlucovsky Can you rebase? Was there anything else that needed to be resolved here? I'm keen to get this documented.

jasonish avatar Mar 07 '24 20:03 jasonish

Merged with #10636 in https://github.com/OISF/suricata/pull/10652

jlucovsky avatar Mar 19 '24 14:03 jlucovsky