linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH 1/3] trace-cmd list: Have -o read the options directory instead of file
Date: Mon, 19 Apr 2021 08:16:55 -0400	[thread overview]
Message-ID: <20210419081655.7a85047e@gandalf.local.home> (raw)
In-Reply-To: <CAPpZLN7MJUQS0xbDJSK2F+T6LdsLn3q_f4+jRTgiV+ODa+1uAg@mail.gmail.com>

On Mon, 19 Apr 2021 07:50:02 +0300
Tzvetomir Stoyanov <tz.stoyanov@gmail.com> wrote:

> The libtracefs options APIs can be used, instead of walking through
> the directory:

No it can't! And this just confirms my fears about using the option mask
and not actually looking at what is on the system. We need a way to see
what's on the system and not just what libtracefs knows about.

> 
> struct tracefs_options_mask *all = tracefs_options_get_supported(NULL);
> struct tracefs_options_mask *enabled = tracefs_options_get_enabled(NULL);
> char *name;
> 
> for (int i = 1; i < TRACEFS_OPTION_MAX; i++) {
>         if (!tracefs_option_mask_is_set(all, i))
>                 continue;
>         name = tracefs_option_name(i);
>         if (!tracefs_option_mask_is_set(enabled, i))
>                 printf("%s\n", name);
>         else
>                 printf("no%s\n", name);
> }

The reason I wrote this was to test the func-no-repeat option that Yordan
wrote, and was sick of going to the /sys/kernel/tracing directory and doing
it by hand.

I want to know what the kernel supports, not what libtracefs supports!

-- Steve

  reply	other threads:[~2021-04-19 12:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 17:23 [PATCH 0/2] trace-cmd: Add more ways to view options Steven Rostedt
2021-04-16 17:23 ` [PATCH 1/3] trace-cmd list: Have -o read the options directory instead of file Steven Rostedt
2021-04-19  4:50   ` Tzvetomir Stoyanov
2021-04-19 12:16     ` Steven Rostedt [this message]
2021-04-16 17:23 ` [PATCH 2/3] trace-cmd stat: Update the usage and man pages Steven Rostedt
2021-04-16 17:23 ` [PATCH 3/3] trace-cmd stat: Add -o option to show options Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210419081655.7a85047e@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=tz.stoyanov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).