diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2022-01-17 22:00:04 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2022-01-18 11:13:51 -0500 |
commit | 71689cababf54c6bd2341809e793caf8aa7dedd5 (patch) | |
tree | c5537e002b18f82c79b1e7003759178618cd94e1 /include | |
parent | 1ee0283abc95e44f42c9007bf3a0f20f26224a75 (diff) | |
download | libtracefs-71689cababf54c6bd2341809e793caf8aa7dedd5.tar.gz |
libtracefs: Add tracefs_instance_get_affinity() APIs
Add the APIs:
tracefs_instance_get_affinity()
tracefs_instance_get_affinity_set()
tracefs_instance_get_affinity_raw()
These functions can retrieve the CPU affinity that denotes what an
instance (or toplevel) has for CPUs that are enabled for tracing.
The first API returns a nice human readable list of CPUs:
"1,4,6-8"
To denote CPUs 1,4,6,7,8
The _set() version uses CPU_SETS and the _raw() version just reads
directly from the tracing_cpumask file.
Link: https://lore.kernel.org/linux-trace-devel/20220118030005.1603821-2-rostedt@goodmis.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/tracefs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/tracefs.h b/include/tracefs.h index 9c53b84..1848ad0 100644 --- a/include/tracefs.h +++ b/include/tracefs.h @@ -49,6 +49,10 @@ int tracefs_instance_set_affinity_raw(struct tracefs_instance *instance, const char *mask); int tracefs_instance_set_affinity(struct tracefs_instance *instance, const char *cpu_str); +char *tracefs_instance_get_affinity(struct tracefs_instance *instance); +char *tracefs_instance_get_affinity_raw(struct tracefs_instance *instance); +int tracefs_instance_get_affinity_set(struct tracefs_instance *instance, + cpu_set_t *set, size_t set_size); char **tracefs_instances(const char *regex); bool tracefs_instance_exists(const char *name); |