File: event_trace.h

package info (click to toggle)
ndctl 81-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,436 kB
  • sloc: ansic: 41,432; sh: 3,931; makefile: 28
file content (42 lines) | stat: -rw-r--r-- 1,318 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2022 Intel Corporation. All rights reserved. */
#ifndef __UTIL_EVENT_TRACE_H__
#define __UTIL_EVENT_TRACE_H__

#include <json-c/json.h>
#include <ccan/list/list.h>
#include <ccan/short_types/short_types.h>

struct jlist_node {
	struct json_object *jobj;
	struct list_node list;
};

struct cxl_poison_ctx {
	struct json_object *jpoison;
	struct cxl_region *region;
	struct cxl_memdev *memdev;
};

struct event_ctx {
	const char *system;
	struct list_head jlist_head;
	const char *event_name; /* optional */
	int event_pid; /* optional */
	struct cxl_poison_ctx *poison_ctx; /* optional */
	unsigned long json_flags;
	int (*parse_event)(struct tep_event *event, struct tep_record *record,
			   struct event_ctx *ctx);
};

int trace_event_parse(struct tracefs_instance *inst, struct event_ctx *ectx);
int trace_event_enable(struct tracefs_instance *inst, const char *system,
		       const char *event);
int trace_event_disable(struct tracefs_instance *inst);
u8 trace_get_field_u8(struct tep_event *event, struct tep_record *record,
		      const char *name);
u32 trace_get_field_u32(struct tep_event *event, struct tep_record *record,
			const char *name);
u64 trace_get_field_u64(struct tep_event *event, struct tep_record *record,
			const char *name);
#endif