Re: [PATCH 1/3] trace-cmd list: Have -o read the options directory instead of file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 19 Apr 2021 07:50:02 +0300
Tzvetomir Stoyanov <tz.stoyanov@xxxxxxxxx> 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



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux