Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1473044
| From | Binoy Jayan <binoy.jayan@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 2/3] tracing: Add trace_irqsoff tracepoints |
| Date | 2016-08-31 08:10 +0200 |
| Message-ID | <sc6SJ-784-11@gated-at.bofh.it> (permalink) |
| References | (3 earlier) <sbNQ5-32D-3@gated-at.bofh.it> <sbRK1-5BB-15@gated-at.bofh.it> <sbRTH-5Ua-11@gated-at.bofh.it> <sbSd4-64E-17@gated-at.bofh.it> <sbSPM-6x2-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Daniel/Steven,
On 30 August 2016 at 20:32, Daniel Wagner <daniel.wagner@bmw-carit.de> wrote:
> On 08/30/2016 04:20 PM, Daniel Wagner wrote:
>> Just setting the size of the type is not enough. The hist_field_*
>> getter function want to know the offset too:
>
> With this hack here it should work. The COMM generic field is handled via
> the tracing_map_ops. We could do it also there but than we need to
> a condition in the trace_map_ops if it is COMM or CPU.
> This shortcut here avoids it:
> diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
> index f3a960e..77073b7 100644
> --- a/kernel/trace/trace_events_hist.c
> +++ b/kernel/trace/trace_events_hist.c
> @@ -556,6 +567,11 @@ static int create_key_field(struct hist_trigger_data *hist_data,
> key_size = MAX_FILTER_STR_VAL;
> else
> key_size = field->size;
> +
> + // strcmp(field_name, "cpu") would also work to figure
> + // out if this is a one of the generic fields.
> + if (field->filter_type == FILTER_CPU)
> + flags |= HIST_FIELD_FL_CPU;
> }
>
> hist_data->fields[key_idx] = create_hist_field(field, flags);
I applied Daniel's fix and it seems to work. Can we use the following instead
on top of your patch? Like how the other keys are compared against
respective fields?
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 46203b7..963a121 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -537,6 +537,12 @@ static int create_key_field(struct
hist_trigger_data *hist_data,
} else {
char *field_name = strsep(&field_str, ".");
+ /* Cannot keep these 2 lines in side the if() below
+ * as field_str would be NULL for the key 'cpu'
+ */
+ if (strcmp(field_name, "cpu") == 0)
+ flags |= HIST_FIELD_FL_CPU;
+
if (field_str) {
if (strcmp(field_str, "hex") == 0)
flags |= HIST_FIELD_FL_HEX;
@@ -568,11 +574,6 @@ static int create_key_field(struct
hist_trigger_data *hist_data,
else
key_size = field->size;
- // strcmp(field_name, "cpu") would also work to figure
- // out if this is a one of the generic fields.
- if (field->filter_type == FILTER_CPU)
- flags |= HIST_FIELD_FL_CPU;
-
}
hist_data->fields[key_idx] = create_hist_field(field, flags);
- Binoy
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 0/3] *** Latency histograms - IRQSOFF,PREEMPTOFF *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-08-29 09:00 +0200
[PATCH v3 2/3] tracing: Add trace_irqsoff tracepoints Binoy Jayan <binoy.jayan@linaro.org> - 2016-08-29 09:00 +0200
Re: [PATCH v3 2/3] tracing: Add trace_irqsoff tracepoints Daniel Wagner <daniel.wagner@bmw-carit.de> - 2016-08-29 11:50 +0200
Re: [PATCH v3 2/3] tracing: Add trace_irqsoff tracepoints Binoy Jayan <binoy.jayan@linaro.org> - 2016-08-30 11:50 +0200
Re: [PATCH v3 2/3] tracing: Add trace_irqsoff tracepoints Steven Rostedt <rostedt@goodmis.org> - 2016-08-30 16:00 +0200
Re: [PATCH v3 2/3] tracing: Add trace_irqsoff tracepoints Daniel Wagner <daniel.wagner@bmw-carit.de> - 2016-08-30 16:10 +0200
Re: [PATCH v3 2/3] tracing: Add trace_irqsoff tracepoints Daniel Wagner <daniel.wagner@bmw-carit.de> - 2016-08-30 16:30 +0200
Re: [PATCH v3 2/3] tracing: Add trace_irqsoff tracepoints Daniel Wagner <daniel.wagner@bmw-carit.de> - 2016-08-30 17:10 +0200
Re: [PATCH v3 2/3] tracing: Add trace_irqsoff tracepoints Steven Rostedt <rostedt@goodmis.org> - 2016-08-30 23:10 +0200
Re: [PATCH v3 2/3] tracing: Add trace_irqsoff tracepoints Binoy Jayan <binoy.jayan@linaro.org> - 2016-08-31 08:10 +0200
[PATCH v3 1/3] tracing: Deference pointers without RCU checks Binoy Jayan <binoy.jayan@linaro.org> - 2016-08-29 09:00 +0200
[PATCH v3 3/3] tracing: Histogram for missed timer offsets Binoy Jayan <binoy.jayan@linaro.org> - 2016-08-29 09:10 +0200
csiph-web