From: Victor Julien Date: Wed, 18 Sep 2024 09:15:00 +0000 (+0200) Subject: time: getter for SCTime_t timestamp of a thread X-Git-Tag: suricata-8.0.0-beta1~594 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=677c0fd41c35a2e85ddbdda7f551bf431fb94cb4;p=thirdparty%2Fsuricata.git time: getter for SCTime_t timestamp of a thread --- diff --git a/src/tm-threads.c b/src/tm-threads.c index 87696f37f1..11199bc130 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -2247,6 +2247,14 @@ void TmThreadsInitThreadsTimestamp(const SCTime_t ts) SCMutexUnlock(&thread_store_lock); } +SCTime_t TmThreadsGetThreadTime(const int idx) +{ + BUG_ON(idx == 0); + const int i = idx - 1; + Thread *t = &thread_store.threads[i]; + return t->pktts; +} + void TmThreadsGetMinimalTimestamp(struct timeval *ts) { struct timeval local = { 0 }; diff --git a/src/tm-threads.h b/src/tm-threads.h index 63fbef85b0..1e9d43c218 100644 --- a/src/tm-threads.h +++ b/src/tm-threads.h @@ -284,6 +284,7 @@ void TmThreadsInjectFlowById(Flow *f, const int id); void TmThreadsInitThreadsTimestamp(const SCTime_t ts); void TmThreadsSetThreadTimestamp(const int id, const SCTime_t ts); void TmThreadsGetMinimalTimestamp(struct timeval *ts); +SCTime_t TmThreadsGetThreadTime(const int idx); uint16_t TmThreadsGetWorkerThreadMax(void); bool TmThreadsTimeSubsysIsReady(void);