Changeset 5c07bfe for lib


Ignore:
Timestamp:
02/28/18 15:08:44 (3 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
cachetimestamps, develop, etsilive, master, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
Children:
e375e0f
Parents:
9375d2e
Message:

Add trace_get_perpkt_thread_id() API function.

Allows callers to access their specific thread ID inside a
process_packet callback. Handy for printing debug messages, as
well as indexing arrays of per-thread storage.

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace_parallel.h

    ree6e802 r5c07bfe  
    13371337DLLEXPORT int trace_get_perpkt_threads(libtrace_t* t);
    13381338
     1339/** Returns the internal unique ID for a packet processing thread.
     1340 *
     1341 * @param thread The thread being queried.
     1342 * @return The ID number of the thread or -1 if the thread is not a processing
     1343 * thread or is otherwise invalid.
     1344 */
     1345DLLEXPORT int trace_get_perpkt_thread_id(libtrace_thread_t *thread);
     1346
    13391347/**
    13401348 * Sets a combiner function for an input trace.
  • lib/trace_parallel.c

    re8db2d4 r5c07bfe  
    287287}
    288288
     289DLLEXPORT int trace_get_perpkt_thread_id(libtrace_thread_t *thread) {
     290        return thread->perpkt_num;
     291}
     292
    289293/**
    290294 * Changes the overall traces state and signals the condition.
Note: See TracChangeset for help on using the changeset viewer.