]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
Merge branch 'linus' into perf/urgent, to pick up dependent commits
authorIngo Molnar <mingo@kernel.org>
Fri, 3 Nov 2017 11:30:12 +0000 (12:30 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 3 Nov 2017 11:30:12 +0000 (12:30 +0100)
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/core.c
tools/perf/util/annotate.c
tools/perf/util/parse-events.l

index 9d93db81fa36e683724a50762b1afd0b4057bb7b..10cdb9c26b5d12d41ddacda43e335a9d635c66a7 100644 (file)
@@ -901,9 +901,11 @@ list_update_cgroup_event(struct perf_event *event,
        cpuctx_entry = &cpuctx->cgrp_cpuctx_entry;
        /* cpuctx->cgrp is NULL unless a cgroup event is active in this CPU .*/
        if (add) {
+               struct perf_cgroup *cgrp = perf_cgroup_from_task(current, ctx);
+
                list_add(cpuctx_entry, this_cpu_ptr(&cgrp_cpuctx_list));
-               if (perf_cgroup_from_task(current, ctx) == event->cgrp)
-                       cpuctx->cgrp = event->cgrp;
+               if (cgroup_is_descendant(cgrp->css.cgroup, event->cgrp->css.cgroup))
+                       cpuctx->cgrp = cgrp;
        } else {
                list_del(cpuctx_entry);
                cpuctx->cgrp = NULL;
index 4397a8b6e6cd902ac082e0539614ea2c5dd1374a..aa66791b1bfcba473bf665f16da69e37092a63fd 100644 (file)
@@ -606,9 +606,19 @@ static struct arch *arch__find(const char *name)
 int symbol__alloc_hist(struct symbol *sym)
 {
        struct annotation *notes = symbol__annotation(sym);
-       const size_t size = symbol__size(sym);
+       size_t size = symbol__size(sym);
        size_t sizeof_sym_hist;
 
+       /*
+        * Add buffer of one element for zero length symbol.
+        * When sample is taken from first instruction of
+        * zero length symbol, perf still resolves it and
+        * shows symbol name in perf report and allows to
+        * annotate it.
+        */
+       if (size == 0)
+               size = 1;
+
        /* Check for overflow when calculating sizeof_sym_hist */
        if (size > (SIZE_MAX - sizeof(struct sym_hist)) / sizeof(struct sym_hist_entry))
                return -1;
index dcfdafdc2f1c2f91b0090fc1f573fbdafde236de..6680e4fb79672c4aaa117554896005d5f4d45018 100644 (file)
@@ -154,6 +154,10 @@ do {                                                       \
        yycolumn += yyleng;                             \
 } while (0);
 
+#define USER_REJECT            \
+       yycolumn -= yyleng;     \
+       REJECT
+
 %}
 
 %x mem
@@ -335,8 +339,8 @@ r{num_raw_hex}              { return raw(yyscanner); }
 {num_hex}              { return value(yyscanner, 16); }
 
 {modifier_event}       { return str(yyscanner, PE_MODIFIER_EVENT); }
-{bpf_object}           { if (!isbpf(yyscanner)) REJECT; return str(yyscanner, PE_BPF_OBJECT); }
-{bpf_source}           { if (!isbpf(yyscanner)) REJECT; return str(yyscanner, PE_BPF_SOURCE); }
+{bpf_object}           { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_OBJECT); }
+{bpf_source}           { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_SOURCE); }
 {name}                 { return pmu_str_check(yyscanner); }
 "/"                    { BEGIN(config); return '/'; }
 -                      { return '-'; }