actf 0.0.1
An acute CTF reader
Loading...
Searching...
No Matches
/home/adwe/code/actf/event.h
Go to the documentation of this file.
1/*
2 * This file is a part of ACTF.
3 *
4 * Copyright (C) 2024 Adam Wendelin <adwe live se>
5 *
6 * ACTF is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * ACTF is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
14 * Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with ACTF. If not, see
18 * <https://www.gnu.org/licenses/>.
19 */
20
25#ifndef ACTF_EVENT_H
26#define ACTF_EVENT_H
27
28#include <stdint.h>
29
30#include "fld.h"
31#include "metadata.h"
32#include "pkt.h"
33
35typedef struct actf_event actf_event;
36
39 ACTF_EVENT_PROP_HEADER,
40 ACTF_EVENT_PROP_COMMON_CTX,
41 ACTF_EVENT_PROP_SPECIFIC_CTX,
42 ACTF_EVENT_PROP_PAYLOAD,
43 ACTF_EVENT_N_PROPS,
44};
45
60const actf_fld *actf_event_fld(const actf_event *ev, const char *key);
61
63const actf_fld *actf_event_fldn(const actf_event *ev, const char *key, size_t len);
64
73const actf_fld *actf_event_prop_fld(const actf_event *ev, const char *key,
74 enum actf_event_prop prop);
75
77const actf_fld *actf_event_prop_fldn(const actf_event *ev, const char *key,
78 size_t len, enum actf_event_prop prop);
79
86const struct actf_fld *actf_event_prop(const struct actf_event *ev, enum actf_event_prop prop);
87
99uint64_t actf_event_tstamp(const actf_event *ev);
100
112
119
126
132void actf_event_copy(actf_event *dest, const actf_event *src);
133
134#endif /* ACTF_EVENT_H */
uint64_t actf_event_tstamp(const actf_event *ev)
Get the timestamp of an event in cycles.
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 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.
void actf_event_copy(actf_event *dest, const actf_event *src)
Perform a shallow copy of an event.
actf_event_prop
Event properties.
Definition event.h:38
int64_t actf_event_tstamp_ns_from_origin(const actf_event *ev)
Get the timestamp of an event in nanoseconds from origin.
struct actf_event actf_event
An event.
Definition event.h:35
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_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.
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.
Field related methods.
A CTF2 metadata representation.
struct actf_event_cls actf_event_cls
An event class.
Definition metadata.h:65
Packet related methods.
struct actf_pkt actf_pkt
A packet.
Definition pkt.h:33
struct actf_fld actf_fld
A field.
Definition types.h:91