Event related methods.
More...
#include <stdint.h>
#include "fld.h"
#include "metadata.h"
#include "pkt.h"
Go to the source code of this file.
|
| enum | actf_event_prop {
ACTF_EVENT_PROP_HEADER
, ACTF_EVENT_PROP_COMMON_CTX
, ACTF_EVENT_PROP_SPECIFIC_CTX
, ACTF_EVENT_PROP_PAYLOAD
,
ACTF_EVENT_N_PROPS
} |
| | Event properties.
|
|
| const actf_fld * | actf_event_fld (const actf_event *ev, const char *key) |
| | Search the top-level struct of all event properties for a field with name key.
|
|
const actf_fld * | actf_event_fldn (const actf_event *ev, const char *key, size_t len) |
| | Same as actf_event_fld() but with an explicit key length.
|
| const actf_fld * | actf_event_prop_fld (const actf_event *ev, const char *key, enum actf_event_prop prop) |
| | Search the top-level struct of an event property for a field with name key.
|
|
const actf_fld * | actf_event_prop_fldn (const actf_event *ev, const char *key, size_t len, enum actf_event_prop prop) |
| | Same as actf_event_prop_fld() but with an explicit key length.
|
| const struct actf_fld * | actf_event_prop (const struct actf_event *ev, enum actf_event_prop prop) |
| | Get the top-level struct of an event property.
|
| uint64_t | actf_event_tstamp (const actf_event *ev) |
| | Get the timestamp of an event in cycles.
|
| int64_t | actf_event_tstamp_ns_from_origin (const actf_event *ev) |
| | Get the timestamp of an event in nanoseconds from origin.
|
| const actf_event_cls * | actf_event_event_cls (const actf_event *ev) |
| | Get the class of an event.
|
| actf_pkt * | actf_event_pkt (const actf_event *ev) |
| | Get the packet of an event.
|
| void | actf_event_copy (actf_event *dest, const actf_event *src) |
| | Perform a shallow copy of an event.
|
◆ actf_event_fld()
Search the top-level struct of all event properties for a field with name key.
The event properties will be searched in the following order:
- event header
- event common context
- event specific context
- event payload
- Parameters
-
| ev | the event |
| key | the key to search for |
- Returns
- the first found field or NULL
◆ actf_event_prop_fld()
Search the top-level struct of an event property for a field with name key.
- Parameters
-
| ev | the event |
| key | the key to search for |
| prop | the event property to search through |
- Returns
- the field or NULL
◆ actf_event_prop()
Get the top-level struct of an event property.
- Parameters
-
| ev | the event |
| prop | the event property |
- Returns
- the top-level field of the event property
◆ actf_event_tstamp()
| uint64_t actf_event_tstamp |
( |
const actf_event * | ev | ) |
|
Get the timestamp of an event in cycles.
The returned timestamp is the raw timestamp in cycles without clock class offsets applied to it. In most cases, you probably want to use actf_event_tstamp_ns_from_origin() instead.
- Parameters
-
- Returns
- the raw timestamp of the event or zero if the event has no timestamp.
◆ actf_event_tstamp_ns_from_origin()
| int64_t actf_event_tstamp_ns_from_origin |
( |
const actf_event * | ev | ) |
|
Get the timestamp of an event in nanoseconds from origin.
The returned timestamp includes any clock offset of the related clock class.
- Parameters
-
- Returns
- the nanosecond timestamp of the event or zero if the event has no timestamp.
◆ actf_event_event_cls()
Get the class of an event.
- Parameters
-
- Returns
- the event's class
◆ actf_event_pkt()
Get the packet of an event.
- Parameters
-
- Returns
- the event's packet
◆ actf_event_copy()
Perform a shallow copy of an event.
- Parameters
-
| dest | the event to be copied to |
| src | the event to be copied |