lkml.org 
[lkml]   [2021]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V7 05/14] rtla/osnoise: Add the hist mode
On Fri, 29 Oct 2021 21:26:08 +0200
Daniel Bristot de Oliveira <bristot@kernel.org> wrote:


> +/*
> + * osnoise_init_trace_hist - enable events used to collect histogram
> + */
> +static int osnoise_init_trace_hist(struct osnoise_tool *tool)
> +{
> + struct osnoise_hist_params *params = tool->params;
> + struct osnoise_hist_data *data = tool->data;
> + int bucket_size;
> + char buff[128];
> + int retval = 0;
> +
> + /*
> + * Set the size of the bucket.
> + */
> + bucket_size = params->output_divisor * params->bucket_size;
> + snprintf(buff, sizeof(buff), "duration.buckets=%d", bucket_size);
> +
> + data->trace_hist = tracefs_hist_alloc(tool->trace.tep, "osnoise", "sample_threshold",
> + buff, TRACEFS_HIST_KEY_NORMAL);

FYI, we changed the API (haven't tagged it yet, so we can do that :-) and
the above needs to be:

data->trace_hist = tracefs_hist1d_alloc(tool->trace.tep, "osnoise", "sample_threshold",

-- Steve

> + if (!data->trace_hist)
> + return 1;
> +
> + retval = tracefs_hist_add_key(data->trace_hist, "cpu", 0);
> + if (retval)
> + goto out_err;
> +
> + retval = tracefs_hist_start(tool->trace.inst, data->trace_hist);
> + if (retval)
> + goto out_err;
> +
> + return 0;
> +
> +out_err:
> + osnoise_destroy_trace_hist(tool);
> + return 1;
> +}
> +

\
 
 \ /
  Last update: 2021-11-24 23:12    [W:0.151 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site