diff options
author | Jiri Olsa <jolsa@kernel.org> | 2019-05-12 18:55:18 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-06-03 12:58:27 +0300 |
commit | 6a9f4efe78af6069a11946c64d3d4c86cb42046b (patch) | |
tree | eb9acf8e1678524d620a69ec75498a5dfa6dc86a /arch/x86/events/core.c | |
parent | b657688069a24c3c81b6de22e0e57e1785d9211f (diff) | |
download | linux-6a9f4efe78af6069a11946c64d3d4c86cb42046b.tar.xz |
perf/x86: Use update attribute groups for default attributes
Using the new pmu::update_attrs attribute group for default
attributes - freeze_on_smi, allow_tsx_force_abort.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190512155518.21468-10-jolsa@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/events/core.c')
-rw-r--r-- | arch/x86/events/core.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index dd0996ba75c3..f0e4804515d8 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1618,32 +1618,6 @@ static struct attribute_group x86_pmu_format_group __ro_after_init = { .attrs = NULL, }; -/* Merge two pointer arrays */ -__init struct attribute **merge_attr(struct attribute **a, struct attribute **b) -{ - struct attribute **new; - int j, i; - - for (j = 0; a && a[j]; j++) - ; - for (i = 0; b && b[i]; i++) - j++; - j++; - - new = kmalloc_array(j, sizeof(struct attribute *), GFP_KERNEL); - if (!new) - return NULL; - - j = 0; - for (i = 0; a && a[i]; i++) - new[j++] = a[i]; - for (i = 0; b && b[i]; i++) - new[j++] = b[i]; - new[j] = NULL; - - return new; -} - ssize_t events_sysfs_show(struct device *dev, struct device_attribute *attr, char *page) { struct perf_pmu_events_attr *pmu_attr = \ @@ -1824,14 +1798,6 @@ static int __init init_hw_perf_events(void) if (!x86_pmu.events_sysfs_show) x86_pmu_events_group.attrs = &empty_attrs; - if (x86_pmu.attrs) { - struct attribute **tmp; - - tmp = merge_attr(x86_pmu_attr_group.attrs, x86_pmu.attrs); - if (!WARN_ON(!tmp)) - x86_pmu_attr_group.attrs = tmp; - } - pmu.attr_update = x86_pmu.attr_update; pr_info("... version: %d\n", x86_pmu.version); |