Staging
v0.8.1
swh:1:snp:a902887e4be9191b7c6c4406aa06b31c1ce2c7cc
Raw File
Tip revision: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5 authored by Linus Torvalds on 09 July 2023, 20:53:13 UTC
Linux 6.5-rc1
Tip revision: 06c2afb
tracepoint.h
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_TRACEPOINT_H
#define __PERF_TRACEPOINT_H

#include <dirent.h>
#include <string.h>

int tp_event_has_id(const char *dir_path, struct dirent *evt_dir);

#define for_each_event(dir_path, evt_dir, evt_dirent)		\
	while ((evt_dirent = readdir(evt_dir)) != NULL)		\
		if (evt_dirent->d_type == DT_DIR &&		\
		    (strcmp(evt_dirent->d_name, ".")) &&	\
		    (strcmp(evt_dirent->d_name, "..")) &&	\
		    (!tp_event_has_id(dir_path, evt_dirent)))

#define for_each_subsystem(sys_dir, sys_dirent)			\
	while ((sys_dirent = readdir(sys_dir)) != NULL)		\
		if (sys_dirent->d_type == DT_DIR &&		\
		    (strcmp(sys_dirent->d_name, ".")) &&	\
		    (strcmp(sys_dirent->d_name, "..")))

int is_valid_tracepoint(const char *event_string);

#endif /* __PERF_TRACEPOINT_H */
back to top