'\" t .\" Title: libtracefs .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 01/15/2021 .\" Manual: libtracefs Manual .\" Source: libtracefs 1.0.2 .\" Language: English .\" .TH "LIBTRACEFS" "3" "01/15/2021" "libtracefs 1\&.0\&.2" "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_tracers, tracefs_get_clock, tracefs_list_free \- Helper functions for working with trace file system\&. .SH "SYNOPSIS" .sp .nf \fB#include \fR char **\fBtracefs_tracers\fR(const char *\fItracing_dir\fR); char *\fBtracefs_get_clock\fR(struct tracefs_instance *\fIinstance\fR); void \fBtracefs_list_free\fR(char **\fIlist\fR); .fi .SH "DESCRIPTION" .sp Various useful functions for working with trace file system\&. .sp The \fItracefs_tracers()\fR function returns array of strings with the names of supported tracer plugins, located in the given \fItracing_dir\fR directory\&. This could be NULL or the location of the tracefs mount point for the trace systems of the local machine, or it may be a path to a copy of the tracefs directory from another machine\&. The last entry in the array as a NULL pointer\&. The array must be freed with \fItracefs_list_free()\fR API\&. .sp The \fItracefs_get_clock()\fR function returns name of the current trace clock, used in the given \fIinstance\fR\&. If \fIinstance\fR is NULL, the clock of the main trace instance is returned\&. The returned string must be freed with free()\&. .sp The \fItracefs_list_free()\fR function frees an array of strings, returned by \fItracefs_event_systems()\fR, \fItracefs_system_events()\fR and \fItracefs_tracers()\fR APIs\&. .SH "RETURN VALUE" .sp The \fItracefs_tracers()\fR returns array of strings\&. The last element in that array is a NULL pointer\&. The array must be freed with \fItracefs_list_free()\fR API\&. In case of an error, NULL is returned\&. .sp The \fItracefs_get_clock()\fR returns string, that must be freed with free(), or NULL in case of an error\&. .SH "EXAMPLE" .sp .if n \{\ .RS 4 .\} .nf #include char **tracers = tracefs_tracers(NULL); if (tracers) { /* Got tracer plugins from the top trace instance */ \&.\&.\&. tracefs_list_free(tracers); } \&.\&.\&.\&. char *clock = tracefs_get_clock(NULL); if (clock) { /* Got current trace clock of the top trace instance */ \&.\&.\&. free(clock); } .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 \fIlibtracefs(3)\fR, \fIlibtraceevent(3)\fR, \fItrace\-cmd(1)\fR .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