1libtracefs(3) 2============= 3 4NAME 5---- 6tracefs_option_enable, tracefs_option_disable, tracefs_option_name - 7Various trace option functions. 8 9SYNOPSIS 10-------- 11[verse] 12-- 13*#include <tracefs.h>* 14 15int *tracefs_option_enable*(struct tracefs_instance pass:[*]_instance_, enum tracefs_option_id _id_); 16int *tracefs_option_disable*(struct tracefs_instance pass:[*]_instance_, enum tracefs_option_id _id_); 17const char pass:[*]*tracefs_option_name*(enum tracefs_option_id _id_); 18-- 19 20DESCRIPTION 21----------- 22This set of APIs can be used to enable and disable ftrace options and to get the name of an option. 23 24The *tracefs_option_enable()* function enables the option with _id_ in the given _instance_. If 25_instance_ is NULL, the option is enabled in the top trace instance. 26 27The *tracefs_option_disable()* function disables the option with _id_ in the given _instance_. If 28_instance_ is NULL, the option is disabled in the top trace instance. 29 30The *tracefs_option_name()* function returns a string, representing the option with _id_. The string 31must *not* be freed. 32 33 34RETURN VALUE 35------------ 36The *tracefs_option_enable()* and *tracefs_option_disable()* functions return 0 if the state of the 37option is set successfully, or -1 in case of an error. 38 39The *tracefs_option_name()* function returns string with option name, or "unknown" in case of an 40error. The returned string must *not* be freed. 41 42EXAMPLE 43------- 44[source,c] 45-- 46#include <tracefs.h> 47... 48if (tracefs_option_enable(NULL, TRACEFS_OPTION_ANNOTATE)) { 49 /* Failed to enable annotate option in top trace instance */ 50} 51... 52if (tracefs_option_disable(NULL, TRACEFS_OPTION_CONTEXT_INFO)) { 53 /* Failed to disable context info option in top trace instance */ 54} 55... 56char *name = tracefs_option_name(TRACEFS_OPTION_FUNC_STACKTRACE); 57if (strcmp(name, "unknown")) { 58 /* Cannot get the name of the option */ 59} 60 61-- 62FILES 63----- 64[verse] 65-- 66*tracefs.h* 67 Header file to include in order to have access to the library APIs. 68*-ltracefs* 69 Linker switch to add when building a program that uses the library. 70-- 71 72SEE ALSO 73-------- 74*libtracefs*(3), 75*libtraceevent*(3), 76*trace-cmd*(1) 77 78AUTHOR 79------ 80[verse] 81-- 82*Steven Rostedt* <[email protected]> 83*Tzvetomir Stoyanov* <[email protected]> 84-- 85REPORTING BUGS 86-------------- 87Report bugs to <[email protected]> 88 89LICENSE 90------- 91libtracefs is Free Software licensed under the GNU LGPL 2.1 92 93RESOURCES 94--------- 95https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ 96 97COPYING 98------- 99Copyright \(C) 2020 VMware, Inc. Free use of this software is granted under 100the terms of the GNU Public License (GPL). 101