diff options
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index f3fefbcc4503..ad2ac1300420 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -1834,6 +1834,7 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, | |||
1834 | struct perf_evlist *evlist; | 1834 | struct perf_evlist *evlist; |
1835 | struct perf_evsel *evsel, *pos; | 1835 | struct perf_evsel *evsel, *pos; |
1836 | int err; | 1836 | int err; |
1837 | static struct perf_evsel_script *es; | ||
1837 | 1838 | ||
1838 | err = perf_event__process_attr(tool, event, pevlist); | 1839 | err = perf_event__process_attr(tool, event, pevlist); |
1839 | if (err) | 1840 | if (err) |
@@ -1842,6 +1843,19 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, | |||
1842 | evlist = *pevlist; | 1843 | evlist = *pevlist; |
1843 | evsel = perf_evlist__last(*pevlist); | 1844 | evsel = perf_evlist__last(*pevlist); |
1844 | 1845 | ||
1846 | if (!evsel->priv) { | ||
1847 | if (scr->per_event_dump) { | ||
1848 | evsel->priv = perf_evsel_script__new(evsel, | ||
1849 | scr->session->data); | ||
1850 | } else { | ||
1851 | es = zalloc(sizeof(*es)); | ||
1852 | if (!es) | ||
1853 | return -ENOMEM; | ||
1854 | es->fp = stdout; | ||
1855 | evsel->priv = es; | ||
1856 | } | ||
1857 | } | ||
1858 | |||
1845 | if (evsel->attr.type >= PERF_TYPE_MAX && | 1859 | if (evsel->attr.type >= PERF_TYPE_MAX && |
1846 | evsel->attr.type != PERF_TYPE_SYNTH) | 1860 | evsel->attr.type != PERF_TYPE_SYNTH) |
1847 | return 0; | 1861 | return 0; |