Ignore:
Timestamp:
03/31/15 16:02:53 (7 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
4007dbb
Parents:
58bfabf
Message:

Add a quick mockup of shanes interface using functions for each message

I.e. set a function for MESSAGE_PACKET etc. which only receives packets.

Ported tracestats_parallel to use this interface.

Note it is not yet complete, however should give a feel of how it will work.
And provide a good work around to the thread issues on older machines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace_parallel.h

    rd3849c7 r76291d1  
    465465DLLEXPORT int trace_pstart(libtrace_t *libtrace, void* global_blob,
    466466                           fn_per_pkt per_pkt, fn_reporter reporter);
     467
     468
     469/**
     470 * @param libtrace The parallel trace
     471 * @param t The thread
     472 * @param data The data associated with the message
     473 * @param global The global storage
     474 * @param tls The thread local storage
     475 */
     476typedef void* (*fn_handler)(libtrace_t *libtrace,
     477                               libtrace_thread_t *t,
     478                               libtrace_generic_t data,
     479                               void *global,
     480                               void *tls);
     481
     482/** Registers a built-in message with a handler.
     483 * Note we do not include the sending thread as an argument to the reporter.
     484 * If set to NULL, the message will be sent to default perpkt handler.
     485 *
     486 * @param libtrace The input trace to start
     487 * @param message The message to intercept
     488 * @param handler the handler to be called when the message is received
     489 * @return 0 if successful otherwise -1.
     490 */
     491DLLEXPORT int trace_set_handler(libtrace_t *libtrace, enum libtrace_messages message, fn_handler handler);
    467492
    468493/** Pauses a trace previously started with trace_pstart()
Note: See TracChangeset for help on using the changeset viewer.