]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
time: getter for SCTime_t timestamp of a thread
authorVictor Julien <vjulien@oisf.net>
Wed, 18 Sep 2024 09:15:00 +0000 (11:15 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 10 Jan 2025 08:16:36 +0000 (09:16 +0100)
src/tm-threads.c
src/tm-threads.h

index 87696f37f15f6a3ce654ceedaa2b3d1cb27f24bd..11199bc130bf6962479246a16c4b4824b93d074c 100644 (file)
@@ -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 };
index 63fbef85b0a3302f56b02d6b691bda788c7758ac..1e9d43c21871e94f2a5edc6a6842f092ba998f16 100644 (file)
@@ -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);