Merge remote-tracking branch 'torvalds/master' into perf/core
To pick up fixes. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -49,6 +49,7 @@ Following tests are defined (with perf commands):
|
||||
perf record --call-graph fp kill (test-record-graph-fp)
|
||||
perf record --group -e cycles,instructions kill (test-record-group)
|
||||
perf record -e '{cycles,instructions}' kill (test-record-group1)
|
||||
perf record -e '{cycles/period=1/,instructions/period=2/}:S' kill (test-record-group2)
|
||||
perf record -D kill (test-record-no-delay)
|
||||
perf record -i kill (test-record-no-inherit)
|
||||
perf record -n kill (test-record-no-samples)
|
||||
|
29
tools/perf/tests/attr/test-record-group2
Normal file
29
tools/perf/tests/attr/test-record-group2
Normal file
@@ -0,0 +1,29 @@
|
||||
[config]
|
||||
command = record
|
||||
args = --no-bpf-event -e '{cycles/period=1234000/,instructions/period=6789000/}:S' kill >/dev/null 2>&1
|
||||
ret = 1
|
||||
|
||||
[event-1:base-record]
|
||||
fd=1
|
||||
group_fd=-1
|
||||
config=0|1
|
||||
sample_period=1234000
|
||||
sample_type=87
|
||||
read_format=12
|
||||
inherit=0
|
||||
freq=0
|
||||
|
||||
[event-2:base-record]
|
||||
fd=2
|
||||
group_fd=1
|
||||
config=0|1
|
||||
sample_period=6789000
|
||||
sample_type=87
|
||||
read_format=12
|
||||
disabled=0
|
||||
inherit=0
|
||||
mmap=0
|
||||
comm=0
|
||||
freq=0
|
||||
enable_on_exec=0
|
||||
task=0
|
@@ -45,10 +45,13 @@ volatile long the_var;
|
||||
#if defined (__x86_64__)
|
||||
extern void __test_function(volatile long *ptr);
|
||||
asm (
|
||||
".pushsection .text;"
|
||||
".globl __test_function\n"
|
||||
".type __test_function, @function;"
|
||||
"__test_function:\n"
|
||||
"incq (%rdi)\n"
|
||||
"ret\n");
|
||||
"ret\n"
|
||||
".popsection\n");
|
||||
#else
|
||||
static void __test_function(volatile long *ptr)
|
||||
{
|
||||
|
@@ -153,8 +153,10 @@ static int __compute_metric(const char *name, struct value *vals,
|
||||
return -ENOMEM;
|
||||
|
||||
cpus = perf_cpu_map__new("0");
|
||||
if (!cpus)
|
||||
if (!cpus) {
|
||||
evlist__delete(evlist);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
perf_evlist__set_maps(&evlist->core, cpus, NULL);
|
||||
|
||||
@@ -163,10 +165,11 @@ static int __compute_metric(const char *name, struct value *vals,
|
||||
false, false,
|
||||
&metric_events);
|
||||
if (err)
|
||||
return err;
|
||||
goto out;
|
||||
|
||||
if (perf_evlist__alloc_stats(evlist, false))
|
||||
return -1;
|
||||
err = perf_evlist__alloc_stats(evlist, false);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
/* Load the runtime stats with given numbers for events. */
|
||||
runtime_stat__init(&st);
|
||||
@@ -178,13 +181,14 @@ static int __compute_metric(const char *name, struct value *vals,
|
||||
if (name2 && ratio2)
|
||||
*ratio2 = compute_single(&metric_events, evlist, &st, name2);
|
||||
|
||||
out:
|
||||
/* ... clenup. */
|
||||
metricgroup__rblist_exit(&metric_events);
|
||||
runtime_stat__exit(&st);
|
||||
perf_evlist__free_stats(evlist);
|
||||
perf_cpu_map__put(cpus);
|
||||
evlist__delete(evlist);
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
static int compute_metric(const char *name, struct value *vals, double *ratio)
|
||||
|
@@ -274,6 +274,7 @@ static int __test__pmu_event_aliases(char *pmu_name, int *count)
|
||||
int res = 0;
|
||||
bool use_uncore_table;
|
||||
struct pmu_events_map *map = __test_pmu_get_events_map();
|
||||
struct perf_pmu_alias *a, *tmp;
|
||||
|
||||
if (!map)
|
||||
return -1;
|
||||
@@ -347,6 +348,10 @@ static int __test__pmu_event_aliases(char *pmu_name, int *count)
|
||||
pmu_name, alias->name);
|
||||
}
|
||||
|
||||
list_for_each_entry_safe(a, tmp, &aliases, list) {
|
||||
list_del(&a->list);
|
||||
perf_pmu_free_alias(a);
|
||||
}
|
||||
free(pmu);
|
||||
return res;
|
||||
}
|
||||
|
@@ -173,6 +173,7 @@ int test__pmu(struct test *test __maybe_unused, int subtest __maybe_unused)
|
||||
ret = 0;
|
||||
} while (0);
|
||||
|
||||
perf_pmu__del_formats(&formats);
|
||||
test_format_dir_put(format);
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user