'\" t .\" Title: libtracefs .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 10/08/2022 .\" Manual: libtracefs Manual .\" Source: libtracefs 1.5.0 .\" Language: English .\" .TH "LIBTRACEFS" "3" "10/08/2022" "libtracefs 1\&.5\&.0" "libtracefs Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" tracefs_option_enable, tracefs_option_disable, tracefs_option_name \- Various trace option functions\&. .SH "SYNOPSIS" .sp .nf \fB#include \fR int \fBtracefs_option_enable\fR(struct tracefs_instance *\fIinstance\fR, enum tracefs_option_id \fIid\fR); int \fBtracefs_option_disable\fR(struct tracefs_instance *\fIinstance\fR, enum tracefs_option_id \fIid\fR); const char *\fBtracefs_option_name\fR(enum tracefs_option_id \fIid\fR); .fi .SH "DESCRIPTION" .sp This set of APIs can be used to enable and disable ftrace options and to get the name of an option\&. .sp The \fBtracefs_option_enable()\fR function enables the option with \fIid\fR in the given \fIinstance\fR\&. If \fIinstance\fR is NULL, the option is enabled in the top trace instance\&. .sp The \fBtracefs_option_disable()\fR function disables the option with \fIid\fR in the given \fIinstance\fR\&. If \fIinstance\fR is NULL, the option is disabled in the top trace instance\&. .sp The \fBtracefs_option_name()\fR function returns a string, representing the option with \fIid\fR\&. The string must \fBnot\fR be freed\&. .SH "RETURN VALUE" .sp The \fBtracefs_option_enable()\fR and \fBtracefs_option_disable()\fR functions return 0 if the state of the option is set successfully, or \-1 in case of an error\&. .sp The \fBtracefs_option_name()\fR function returns string with option name, or "unknown" in case of an error\&. The returned string must \fBnot\fR be freed\&. .SH "EXAMPLE" .sp .if n \{\ .RS 4 .\} .nf #include \&.\&.\&. if (tracefs_option_enable(NULL, TRACEFS_OPTION_ANNOTATE)) { /* Failed to enable annotate option in top trace instance */ } \&.\&.\&. if (tracefs_option_disable(NULL, TRACEFS_OPTION_CONTEXT_INFO)) { /* Failed to disable context info option in top trace instance */ } \&.\&.\&. char *name = tracefs_option_name(TRACEFS_OPTION_FUNC_STACKTRACE); if (strcmp(name, "unknown")) { /* Cannot get the name of the option */ } .fi .if n \{\ .RE .\} .SH "FILES" .sp .if n \{\ .RS 4 .\} .nf \fBtracefs\&.h\fR Header file to include in order to have access to the library APIs\&. \fB\-ltracefs\fR Linker switch to add when building a program that uses the library\&. .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBlibtracefs\fR(3), \fBlibtraceevent\fR(3), \fBtrace\-cmd\fR(1) .SH "AUTHOR" .sp .if n \{\ .RS 4 .\} .nf \fBSteven Rostedt\fR <\m[blue]\fBrostedt@goodmis\&.org\fR\m[]\&\s-2\u[1]\d\s+2> \fBTzvetomir Stoyanov\fR <\m[blue]\fBtz\&.stoyanov@gmail\&.com\fR\m[]\&\s-2\u[2]\d\s+2> .fi .if n \{\ .RE .\} .SH "REPORTING BUGS" .sp Report bugs to <\m[blue]\fBlinux\-trace\-devel@vger\&.kernel\&.org\fR\m[]\&\s-2\u[3]\d\s+2> .SH "LICENSE" .sp libtracefs is Free Software licensed under the GNU LGPL 2\&.1 .SH "RESOURCES" .sp \m[blue]\fBhttps://git\&.kernel\&.org/pub/scm/libs/libtrace/libtracefs\&.git/\fR\m[] .SH "COPYING" .sp Copyright (C) 2020 VMware, Inc\&. Free use of this software is granted under the terms of the GNU Public License (GPL)\&. .SH "NOTES" .IP " 1." 4 rostedt@goodmis.org .RS 4 \%mailto:rostedt@goodmis.org .RE .IP " 2." 4 tz.stoyanov@gmail.com .RS 4 \%mailto:tz.stoyanov@gmail.com .RE .IP " 3." 4 linux-trace-devel@vger.kernel.org .RS 4 \%mailto:linux-trace-devel@vger.kernel.org .RE