[PATCH 3/3] perf tools metric: Don't include duration_time in group

2019-06-28 Thread Andi Kleen
From: Andi Kleen The Memory_BW metric generates groups including duration_time, which maps to a software event. For some reason this makes the group always not count. Always put duration_time outside a group when generating metrics. It's always the same time, so no need to group it. S

[PATCH 2/3] perf list: Avoid extra : for --raw metrics

2019-06-28 Thread Andi Kleen
From: Andi Kleen When printing the metrics raw, don't print : after the metricgroups. This helps the command line completion to complete those too. Signed-off-by: Andi Kleen --- tools/perf/util/metricgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf

[PATCH 1/3] perf vendor events intel: Metric fixes for SKX/CLX

2019-06-28 Thread Andi Kleen
From: Andi Kleen - Add a missing filter for the DRAM_Latency / DRAM_Parallel_Reads metrics - Remove the useless PMM_* metrics from Skylake Signed-off-by: Andi Kleen --- .../arch/x86/cascadelakex/clx-metrics.json| 4 ++-- .../arch/x86/skylakex/skx-metrics.json| 22

Re: [PATCH v3 1/4] perf pmu: Support more complex PMU event aliasing

2019-06-28 Thread Andi Kleen
> + /* > + * Match more complex aliases where the alias name is a comma-delimited > + * list of tokens, orderly contained in the matching PMU name. > + * > + * Example: For alias "socket,pmuname" and PMU "socketX_pmunameY", we > + * match "socket" in "socketX_p

[PATCH] perf tools: Fix bison warnings for pure parser

2019-06-27 Thread Andi Kleen
From: Andi Kleen bison 3.4.1 complains during a perf build: util/parse-events.y:1.1-12: warning: deprecated directive, use ‘%define api.pure’ [-Wdeprecated] 1 | %pure-parser | ^~~~ CC /home/andi/lsrc/obj-perf/ui/browsers/map.o util/parse-events.y: warning: fix-its can

[PATCH v1 4/4] perf stat: Fix metrics with --no-merge

2019-06-24 Thread Andi Kleen
From: Andi Kleen Since 8c5421c016a4 ("perf pmu: Display pmu name when printing ...") using --no-merge adds the PMU name to the evsel name. This breaks the metric value lookup because the parser doesn't know about this. Remove the extra postfixes for the metric evaluation. Fixe

[PATCH v1 3/4] perf stat: Fix group lookup for metric group

2019-06-24 Thread Andi Kleen
From: Andi Kleen The metric group code tries to find a group it added earlier in the evlist. Fix the lookup to handle groups with partially overlaps correctly. When a sub string match fails and we reset the match, we have to compare the first element again. I also renamed the find_evsel

[PATCH v1 2/4] perf stat: Don't merge events in the same PMU

2019-06-24 Thread Andi Kleen
From: Andi Kleen Event merging is mainly to collapse similar events in lots of different duplicated PMUs. It can break metric displaying. It's possible for two metrics to have the same event, and when the two events happen in a row the second wouldn't be displayed. This would also no

[PATCH v1 1/4] perf stat: Make metric event lookup more robust

2019-06-24 Thread Andi Kleen
From: Andi Kleen After setting up metric groups through the event parser, the metricgroup code looks them up again in the event list. Make sure we only look up events that haven't been used by some other metric. The data structures currently cannot handle more than one metric per event.

Some bug fixes for perf stat metrics

2019-06-24 Thread Andi Kleen
Fix some bugs and regressions in perf stat --metrics support. Also available in git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc perf/metric-fixes-1

Re: [RFC] perf/x86/intel: Disable check_msr for real hw

2019-06-24 Thread Andi Kleen
> Tom, plz correctme if I'm wrongm but AFAIK because the LBR tracing is > enabled during the boot the lbr_from/lbr_to registers will fail the > check_msr 'val_new != val_tmp' check Ok this should be handleable. It should be enough to check the ctrl register, if that working likely we don't need to

Re: [RFC] perf/x86/intel: Disable check_msr for real hw

2019-06-24 Thread Andi Kleen
> > The other hypervisors are relatively obscure, but eventually > > someone will hit problems. > > any idea if there's any other flag/way we could use to detect those? I'm not aware of a generic way to detect any hypervisor unfortunately. There are hypervisor reserved cpuid ranges, in theory yo

[tip:x86/cpu] x86/elf: Enumerate kernel FSGSBASE capability in AT_HWCAP2

2019-06-22 Thread tip-bot for Andi Kleen
Commit-ID: f987c955c74501c9295a81372c7d363cbe07c8a6 Gitweb: https://git.kernel.org/tip/f987c955c74501c9295a81372c7d363cbe07c8a6 Author: Andi Kleen AuthorDate: Wed, 8 May 2019 03:02:32 -0700 Committer: Thomas Gleixner CommitDate: Sat, 22 Jun 2019 11:38:56 +0200 x86/elf: Enumerate

[tip:x86/cpu] x86/fsgsbase/64: Add intrinsics for FSGSBASE instructions

2019-06-22 Thread tip-bot for Andi Kleen
Commit-ID: 8b71340d702ec5d587443b38a852671c4fb6a723 Gitweb: https://git.kernel.org/tip/8b71340d702ec5d587443b38a852671c4fb6a723 Author: Andi Kleen AuthorDate: Wed, 8 May 2019 03:02:20 -0700 Committer: Thomas Gleixner CommitDate: Sat, 22 Jun 2019 11:38:52 +0200 x86/fsgsbase/64: Add

Re: [RFC] perf/x86/intel: Disable check_msr for real hw

2019-06-21 Thread Andi Kleen
On Fri, Jun 14, 2019 at 01:28:53PM +0200, Jiri Olsa wrote: > hi, > the HPE server can do POST tracing and have enabled LBR > tracing during the boot, which makes check_msr fail falsly. > > It looks like check_msr code was added only to check on guests > MSR access, would it be then ok to disable c

Re: [PATCH 3/3] resource: Introduce resource cache

2019-06-20 Thread Andi Kleen
Dan Williams writes: > > The underlying issue is that the x86-PAT implementation wants to > ensure that conflicting mappings are not set up for the same physical > address. This is mentioned in the developer manuals as problematic on > some cpus. Andi, is lookup_memtype() and track_pfn_insert() st

Re: [PATCH v1] KVM: x86: PMU Whitelist

2019-06-20 Thread Andi Kleen
Eric Hankland writes: > > +int kvm_vcpu_ioctl_set_pmu_whitelist(struct kvm_vcpu *vcpu, > +struct kvm_pmu_whitelist __user *whtlst) > +{ > + struct kvm_pmu *pmu = vcpu_to_pmu(vcpu); > + struct kvm_pmu_whitelist *old = pmu->whitelist; > + struct

[tip:perf/core] perf tools x86: Add support for recording and printing XMM registers

2019-05-18 Thread tip-bot for Andi Kleen
Commit-ID: ca138a7aabc68bf727918bb40ce08157cd5ec0a5 Gitweb: https://git.kernel.org/tip/ca138a7aabc68bf727918bb40ce08157cd5ec0a5 Author: Andi Kleen AuthorDate: Mon, 6 May 2019 07:19:24 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 15 May 2019 16:36:47 -0300 perf tools x86

[tip:x86/urgent] x86/kprobes: Make trampoline_handler() global and visible

2019-05-08 Thread tip-bot for Andi Kleen
Commit-ID: 0e72499c3cc0cead32f88b94a02204d2b80768bf Gitweb: https://git.kernel.org/tip/0e72499c3cc0cead32f88b94a02204d2b80768bf Author: Andi Kleen AuthorDate: Fri, 29 Mar 2019 17:47:41 -0700 Committer: Ingo Molnar CommitDate: Wed, 8 May 2019 13:13:58 +0200 x86/kprobes: Make

[tip:x86/timers] x86/timer: Don't inline __const_udelay()

2019-04-19 Thread tip-bot for Andi Kleen
Commit-ID: 81423c37415fe45057d64196ae0ce8e17a9c7148 Gitweb: https://git.kernel.org/tip/81423c37415fe45057d64196ae0ce8e17a9c7148 Author: Andi Kleen AuthorDate: Fri, 29 Mar 2019 17:47:38 -0700 Committer: Thomas Gleixner CommitDate: Fri, 19 Apr 2019 17:49:47 +0200 x86/timer: Don't i

[tip:x86/asm] x86/cpu/amd: Exclude 32bit only assembler from 64bit build

2019-04-19 Thread tip-bot for Andi Kleen
Commit-ID: 26b31f46f036ad89de20cbbb732b76289411eddb Gitweb: https://git.kernel.org/tip/26b31f46f036ad89de20cbbb732b76289411eddb Author: Andi Kleen AuthorDate: Fri, 29 Mar 2019 17:47:36 -0700 Committer: Thomas Gleixner CommitDate: Fri, 19 Apr 2019 17:47:35 +0200 x86/cpu/amd: Exclude

[tip:x86/asm] x86/asm: Mark all top level asm statements as .text

2019-04-19 Thread tip-bot for Andi Kleen
Commit-ID: c03e27506a564ec7db1b179e7464835901f49751 Gitweb: https://git.kernel.org/tip/c03e27506a564ec7db1b179e7464835901f49751 Author: Andi Kleen AuthorDate: Fri, 29 Mar 2019 17:47:35 -0700 Committer: Thomas Gleixner CommitDate: Fri, 19 Apr 2019 17:46:55 +0200 x86/asm: Mark all top

[tip:x86/urgent] x86/cpu/bugs: Use __initconst for 'const' init data

2019-04-19 Thread tip-bot for Andi Kleen
Commit-ID: 1de7edbb59c8f1b46071f66c5c97b8a59569eb51 Gitweb: https://git.kernel.org/tip/1de7edbb59c8f1b46071f66c5c97b8a59569eb51 Author: Andi Kleen AuthorDate: Fri, 29 Mar 2019 17:47:43 -0700 Committer: Thomas Gleixner CommitDate: Fri, 19 Apr 2019 17:11:39 +0200 x86/cpu/bugs: Use

[tip:x86/core] x86/kprobes: Make trampoline_handler() global and visible

2019-04-19 Thread tip-bot for Andi Kleen
Commit-ID: 6ea26c21941cc313bc05f340019fe454900d21bd Gitweb: https://git.kernel.org/tip/6ea26c21941cc313bc05f340019fe454900d21bd Author: Andi Kleen AuthorDate: Fri, 29 Mar 2019 17:47:41 -0700 Committer: Thomas Gleixner CommitDate: Fri, 19 Apr 2019 17:55:30 +0200 x86/kprobes: Make

[tip:x86/platform] x86/hyperv: Make hv_vcpu_is_preempted() visible

2019-04-19 Thread tip-bot for Andi Kleen
Commit-ID: 02143c2931c3c0faf088c5859a10de6c2b4f2d96 Gitweb: https://git.kernel.org/tip/02143c2931c3c0faf088c5859a10de6c2b4f2d96 Author: Andi Kleen AuthorDate: Fri, 29 Mar 2019 17:47:40 -0700 Committer: Thomas Gleixner CommitDate: Fri, 19 Apr 2019 17:58:57 +0200 x86/hyperv: Make

[tip:x86/platform] x86/kvm: Make steal_time visible

2019-04-19 Thread tip-bot for Andi Kleen
Commit-ID: 14e581c381b942ce5463a7e61326d8ce1c843be7 Gitweb: https://git.kernel.org/tip/14e581c381b942ce5463a7e61326d8ce1c843be7 Author: Andi Kleen AuthorDate: Fri, 29 Mar 2019 17:47:42 -0700 Committer: Thomas Gleixner CommitDate: Fri, 19 Apr 2019 17:58:57 +0200 x86/kvm: Make

[tip:x86/hyperv] x86/hyperv: Make hv_vcpu_is_preempted() visible

2019-04-19 Thread tip-bot for Andi Kleen
Commit-ID: d3748c8533f576969837f11e69c39d3f080c0e2b Gitweb: https://git.kernel.org/tip/d3748c8533f576969837f11e69c39d3f080c0e2b Author: Andi Kleen AuthorDate: Fri, 29 Mar 2019 17:47:40 -0700 Committer: Thomas Gleixner CommitDate: Fri, 19 Apr 2019 17:52:49 +0200 x86/hyperv: Make

[tip:perf/core] perf/x86/lbr: Avoid reading the LBRs when adaptive PEBS handles them

2019-04-16 Thread tip-bot for Andi Kleen
Commit-ID: d3617b98b04583df222f34992e65712862a77bf1 Gitweb: https://git.kernel.org/tip/d3617b98b04583df222f34992e65712862a77bf1 Author: Andi Kleen AuthorDate: Tue, 2 Apr 2019 12:45:03 -0700 Committer: Ingo Molnar CommitDate: Tue, 16 Apr 2019 12:26:17 +0200 perf/x86/lbr: Avoid reading

[tip:perf/core] perf/x86/intel: Extract memory code PEBS parser for reuse

2019-04-16 Thread tip-bot for Andi Kleen
Commit-ID: 48f38aa4cc5a48bc0fe85c5c4b1ab171fbb539b6 Gitweb: https://git.kernel.org/tip/48f38aa4cc5a48bc0fe85c5c4b1ab171fbb539b6 Author: Andi Kleen AuthorDate: Tue, 2 Apr 2019 12:45:00 -0700 Committer: Ingo Molnar CommitDate: Tue, 16 Apr 2019 12:19:39 +0200 perf/x86/intel: Extract

[tip:perf/core] perf vendor events intel: Update Silvermont to v14

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: 1c3a2c864d2da0454bca1e41d3e0090c18678909 Gitweb: https://git.kernel.org/tip/1c3a2c864d2da0454bca1e41d3e0090c18678909 Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 14:56:26 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 15:23:48 -0300 perf vendor

[tip:perf/core] perf vendor events intel: Update GoldmontPlus to v1.01

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: c53dd58988385c3f0861ea1d487489bad8cc69a7 Gitweb: https://git.kernel.org/tip/c53dd58988385c3f0861ea1d487489bad8cc69a7 Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 14:55:53 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 15:23:46 -0300 perf vendor

[tip:perf/core] perf vendor events intel: Update Bonnell to V4

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: b1580f542ca7d4bec387559b05e62b1b2f5f08d2 Gitweb: https://git.kernel.org/tip/b1580f542ca7d4bec387559b05e62b1b2f5f08d2 Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 14:55:07 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 15:23:42 -0300 perf vendor

[tip:perf/core] perf vendor events intel: Update Haswell events to v28

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: efc351f1b55070887184549ec3b8b47a3570ae78 Gitweb: https://git.kernel.org/tip/efc351f1b55070887184549ec3b8b47a3570ae78 Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 08:42:14 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 15:23:38 -0300 perf vendor

[tip:perf/core] perf vendor events intel: Update IvyBridge events to v21

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: 2111da70ff1094ed65d15f00e6285b668f689b87 Gitweb: https://git.kernel.org/tip/2111da70ff1094ed65d15f00e6285b668f689b87 Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 08:41:35 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 15:23:35 -0300 perf vendor

[tip:perf/core] perf vendor events intel: Update JakeTown events to v20

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: e6b32be4455f57884bf2a312692c1f4135e35e02 Gitweb: https://git.kernel.org/tip/e6b32be4455f57884bf2a312692c1f4135e35e02 Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 08:40:51 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 15:23:31 -0300 perf vendor

[tip:perf/core] perf vendor events intel: Update IvyTown events to v20

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: 009edd9ae0e77e5cbc6d8767e02be15b4e8b55c5 Gitweb: https://git.kernel.org/tip/009edd9ae0e77e5cbc6d8767e02be15b4e8b55c5 Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 08:40:32 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 15:23:29 -0300 perf vendor

[tip:perf/core] perf vendor events intel: Update HaswellX events to v20

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: e313477f7e76f23c3e2d45428f9456ba675bc702 Gitweb: https://git.kernel.org/tip/e313477f7e76f23c3e2d45428f9456ba675bc702 Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 08:39:49 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 15:23:26 -0300 perf vendor

[tip:perf/core] perf vendor events intel: Update BroadwellX events to v14

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: 9f0f4a242c24221ed006f449c3f67b863b12985c Gitweb: https://git.kernel.org/tip/9f0f4a242c24221ed006f449c3f67b863b12985c Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 08:39:28 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 15:23:24 -0300 perf vendor

[tip:perf/core] perf vendor events intel: Update Broadwell-DE events to v7

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: d2243329ef3c5107d00dee4327a9884a394ef715 Gitweb: https://git.kernel.org/tip/d2243329ef3c5107d00dee4327a9884a394ef715 Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 08:37:33 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 15:23:14 -0300 perf vendor

[tip:perf/core] perf stat: Implement duration_time as a proper event

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: f0fbb114e3025f3f737a1e1c5c39c5b2b2e671bd Gitweb: https://git.kernel.org/tip/f0fbb114e3025f3f737a1e1c5c39c5b2b2e671bd Author: Andi Kleen AuthorDate: Tue, 26 Mar 2019 15:18:21 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 14:49:24 -0300 perf stat

[tip:perf/core] perf evsel: Support printing evsel name for 'duration_time'

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: 3371f389e4be6efc496ca395b21911a8f2c2d23f Gitweb: https://git.kernel.org/tip/3371f389e4be6efc496ca395b21911a8f2c2d23f Author: Andi Kleen AuthorDate: Tue, 26 Mar 2019 15:18:22 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 14:49:24 -0300 perf evsel

[tip:perf/core] perf list: Output tool events

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: 5e0861baa3fa73e8bd861a4b7ba7fa992b1dff82 Gitweb: https://git.kernel.org/tip/5e0861baa3fa73e8bd861a4b7ba7fa992b1dff82 Author: Andi Kleen AuthorDate: Tue, 26 Mar 2019 15:18:23 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 14:49:25 -0300 perf list

[tip:perf/core] perf stat: Revert checks for duration_time

2019-04-05 Thread tip-bot for Andi Kleen
Commit-ID: c2b3c170db610896e4e633cba2135045333811c2 Gitweb: https://git.kernel.org/tip/c2b3c170db610896e4e633cba2135045333811c2 Author: Andi Kleen AuthorDate: Tue, 26 Mar 2019 15:18:20 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 14:49:24 -0300 perf stat

Re: [PATCH 10/17] delta: Fix buffer overrun in delta_ipc_open

2019-04-01 Thread Andi Kleen
On Mon, Apr 01, 2019 at 01:37:56PM +, Hugues FRUCHET wrote: > Hi Andi, > > We have already discussed about that here: > https://lore.kernel.org/patchwork/patch/866406/ > > Now that strscpy is largely deployed within kernel, could you retest > with the change I suggested ? strscpy is not the

[PATCH v2 4/9] x86/timer: Don't inline __const_udelay

2019-03-29 Thread Andi Kleen
From: Andi Kleen LTO will happily inline __const_udelay everywhere it is used. Forcing it noinline saves ~44k text in a LTO build. 139995601740864 1499136 172395601070e08 vmlinux-with-udelay-inline 139547641736768 1499136 171906681064f0c vmlinux-wo-udelay-inline

[PATCH v2 1/9] x86/asm: Mark all top level asm statements as .text

2019-03-29 Thread Andi Kleen
From: Andi Kleen With gcc toplevel assembler statements that do not mark themselves as .text may end up in other sections. I had LTO boot crashes because various assembler statements ended up in the middle of the initcall section. It's also a latent problem without LTO, although it's

[PATCH v2 3/9] x86/paravirt: Replace paravirt patches with data

2019-03-29 Thread Andi Kleen
From: Andi Kleen For LTO all top level assembler statements need to be global because LTO might put it into a different assembler file than the referencing C code. To avoid making all the paravirt patch snippets global replace them with data containing the patch instructions. Since these are

[PATCH v2 2/9] x86/cpu/amd: Ifdef 32bit only assembler for 32bit

2019-03-29 Thread Andi Kleen
From: Andi Kleen The "vide" inline assembler is only needed on 32bit kernels for old 32bit only CPUs. Ifdef it to not include it into 64bit kernels. Signed-off-by: Andi Kleen --- arch/x86/kernel/cpu/amd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/cpu/am

[PATCH v2 7/9] x86/kprobes: Make trampoline_handler global and visible

2019-03-29 Thread Andi Kleen
From: Andi Kleen This function is referenced from assembler, so in LTO it needs to be global and visible to not be optimized away. Cc: mhira...@kernel.org Acked-by: Masami Hiramatsu Signed-off-by: Andi Kleen --- arch/x86/kernel/kprobes/core.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v2 6/9] x86/hyperv: Make hv_vcpu_is_preempted visible

2019-03-29 Thread Andi Kleen
From: Andi Kleen This function is referrenced from assembler, so need to be marked visible for LTO. Cc: yi.y@linux.intel.com Cc: k...@microsoft.com Cc: haiya...@microsoft.com Reviewed-by: Yi Sun Fixes: 3a025de64bf8 x86/hyperv: Enable PV qspinlock for Hyper-V Signed-off-by: Andi Kleen

[PATCH v2 8/9] x86/kvm: Make steal_time visible

2019-03-29 Thread Andi Kleen
From: Andi Kleen This per cpu variable is accessed from assembler code, so needs to be visible. Cc: pbonz...@redhat.com Signed-off-by: Andi Kleen --- arch/x86/kernel/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index

[PATCH v2 9/9] x86/cpu/bugs: Fix __initconst usage in bugs.c

2019-03-29 Thread Andi Kleen
From: Andi Kleen Fix some of the recently added const tables to use __initconst for const data instead of __initdata which causes section attribute conflicts. Fixes: fa1202ef2243 ("x86/speculation: Add command line control") Signed-off-by: Andi Kleen --- arch/x86/kernel/cpu/

[PATCH v2 5/9] x86/xen: Mark xen_vcpu_stolen as __visible

2019-03-29 Thread Andi Kleen
From: Andi Kleen This function is referenced from assembler, so needs to be marked __visible for LTO. Cc: jgr...@suse.com Cc: boris.ostrov...@oracle.com Signed-off-by: Andi Kleen --- drivers/xen/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/time.c b

Re: [PATCH 02/17] x86, lto: Mark all top level asm statements as .text

2019-03-27 Thread Andi Kleen
> > I checked the code general and with the .globl in NATIVE_LABEL the > > With or without? I removed that as well. With. LTO would still need the .globls because the variable and the asm statement can end up in different assembler files, and resolution would rely on the linker. -Andi

Re: [PATCH 02/17] x86, lto: Mark all top level asm statements as .text

2019-03-27 Thread Andi Kleen
> + asm(".pushsection .rodata, \"a\"\n" \ > > + NATIVE_LABEL("start_", ops, name) \ > > + code

Re: [PATCH 02/17] x86, lto: Mark all top level asm statements as .text

2019-03-27 Thread Andi Kleen
> Why on earth is this needed for LTO? > > From the GCC manual: > > "This attribute, attached to a global variable or function, nullifies the > effect of the -fw hole-program command-line option, so the object remains > visible outside the current compilation unit." > > Neither the variable

Re: [PATCH 02/17] x86, lto: Mark all top level asm statements as .text

2019-03-27 Thread Andi Kleen
On Wed, Mar 27, 2019 at 03:20:08PM +0100, Thomas Gleixner wrote: > +void __init foo(void) > +{ > + pr_info("foo\n"); > +} > > right before the kretprobe_trampoline and compiling it with GCC 6. > > So one would assume that kretprobe_trampoline now ends up in > .init.text. But it ends up in t

Re: [PATCH V4 04/23] perf/x86/intel: Support adaptive PEBSv4

2019-03-27 Thread Andi Kleen
> We need to call perf_event_overflow() for the last record of each event. > It's hard to detect which record is the last record of the event with one > pass walking. > > Also, I'm not sure how much we can save with one pass walking. The > optimization should only benefit large PEBS. The total num

Re: [PATCH 2/4] perf, tools: Implement duration_time as a proper event

2019-03-27 Thread Andi Kleen
> > so now that we have time in a separate event, we could > get rid of the isolated update_stats(&walltime_nsecs_stats) calls > and move them to perf_stat__update_shadow_stats? In theory yes, but it would require perf stat always setting up the duration_time event implicitely and then special ha

Re: [PATCH 02/17] x86, lto: Mark all top level asm statements as .text

2019-03-26 Thread Andi Kleen
Following up to myself here... > > If it's the former, then we must backport those fixes. > > > > Could you please verify with the GCC people as you seem to have a > > reproducer of some sort. > > Okay. I filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89839 > > I thought I had already done

Re: [PATCH 02/17] x86, lto: Mark all top level asm statements as .text

2019-03-26 Thread Andi Kleen
> Well, we better should know the real reason for this wreckage. I mean, the > default section for text is suprisingly .text. I don't see a reason why > this would be any different for an assembly function implemented in a C > file. What happens is that when the function before the asm changes the

Re: New feature/ABI review process [was Re: [RESEND PATCH v6 04/12] x86/fsgsbase/64:..]

2019-03-26 Thread Andi Kleen
> > If you want to advocate the more complex design of mixed SWAPGS/FSGSBASE > then provide numbers and not hand-waving. Numbers of real-world workloads, > not numbers of artificial test cases which exercise the rare worst case. Well you're proposing the much more complicated solution, not me. S

Re: [PATCH V4 04/23] perf/x86/intel: Support adaptive PEBSv4

2019-03-26 Thread Andi Kleen
> + for (at = base; at < top; at += cpuc->pebs_record_size) { > + u64 pebs_status; > + > + pebs_status = get_pebs_status(at) & cpuc->pebs_enabled; > + pebs_status &= mask; > + > + for_each_set_bit(bit, (unsigned long *)&pebs_status, size) > +

[PATCH 1/4] perf, tools: Revert checks for duration_time

2019-03-26 Thread Andi Kleen
From: Andi Kleen This reverts e864c5ca145e perf stat: Hide internal duration_time counter but doing it manually since the code has now moved to a different file. The next patch will properly implement duration_time as a full event, so no need to hide it anymore. Signed-off-by: Andi Kleen

[PATCH 3/4] perf, tools: Support name for duration_time

2019-03-26 Thread Andi Kleen
From: Andi Kleen Implement printing the correct name for duration_time Signed-off-by: Andi Kleen --- tools/perf/util/evsel.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 7835e05f0c0a..6872394b6f55

[PATCH 4/4] perf, tools, list: Output tool events

2019-03-26 Thread Andi Kleen
From: Andi Kleen Add support to perf list to output tool internal events, currently only duration_time. Signed-off-by: Andi Kleen --- tools/perf/builtin-list.c | 6 -- tools/perf/util/parse-events.c | 20 tools/perf/util/parse-events.h | 1 + 3 files changed

[PATCH 2/4] perf, tools: Implement duration_time as a proper event

2019-03-26 Thread Andi Kleen
From: Andi Kleen The perf metric expression use duration_time internally to normalize events. Normal perf stat without -x also prints the duration time. But when using -x, the interval is not output anywhere, which is inconvenient for any post processing which often wants to normalize values to

perf: Add duration_time to perf stat

2019-03-26 Thread Andi Kleen
Currently it's not possible to get the wall clock time of a measurement in CSV mode output, it's only in the non CSV perf stat output. Often this is needed to normalize event counts to time. Add a new duration_time event that can be specified and reports the wall clock time in ns.

Re: [PATCH 02/17] x86, lto: Mark all top level asm statements as .text

2019-03-26 Thread Andi Kleen
On Tue, Mar 26, 2019 at 06:03:59PM +0100, Thomas Gleixner wrote: > Andi, > > On Thu, 21 Mar 2019, Andi Kleen wrote: > > > With gcc 8 toplevel assembler statements that do not mark themselves > > as .text may end up in other sections. > > Which is clearly a change

Re: [PATCH 14/17] crypto: Don't mark AES tables const and cacheline_aligned

2019-03-26 Thread Andi Kleen
On Tue, Mar 26, 2019 at 09:42:13AM +0100, Rasmus Villemoes wrote: > On 21/03/2019 23.00, Andi Kleen wrote: > > From: Andi Kleen > > > > cacheline_aligned is a special section. It cannot be const at the same > > time because it's not read-only. It doesn'

Re: [RESEND PATCH v6 04/12] x86/fsgsbase/64: Enable FSGSBASE instructions in the helper functions

2019-03-25 Thread Andi Kleen
>So on user space to kernel space transitions swapping in kernel GS should >simply do: > userGS = RDGSBASE() > WRGSBASE(kernelGS) This would also need to find kernelGS first, by doing RDPID and then reading it from memory in the right index (which might be a full cache miss if y

Re: [RFC] [PATCH v2 0/5] Intel Virtual PMU Optimization

2019-03-25 Thread Andi Kleen
> It isn't going anywhere anyway, its insane. You let perf do all its > normal things and then discard the results by avoiding the wrmsr. > > Then you fudge a second wrmsr path somewhere. > > Please, just make the existing event dtrt. I still think the right way is to force an event to a counter

Re: [RFC] [PATCH v2 0/5] Intel Virtual PMU Optimization

2019-03-23 Thread Andi Kleen
> > We optimize the current vPMU to work in this manner: > > > > (1) rely on the existing host perf (perf_event_create_kernel_counter) > > to allocate counters for in-use vPMC and always try to reuse events; > > (2) vPMU captures guest accesses to the eventsel and fixctrl msr directly > >

Re: [PATCH 11/17] x86/kprobes: Make trampoline_handler global and visible

2019-03-23 Thread Andi Kleen
On Sat, Mar 23, 2019 at 06:45:21PM +0900, Masami Hiramatsu wrote: > On Thu, 21 Mar 2019 15:00:03 -0700 > Andi Kleen wrote: > > > From: Andi Kleen > > > > This function is referenced from assembler, so in LTO > > it needs to be global and visible to not be o

[tip:perf/urgent] perf stat: Fix --no-scale

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 75998bb263bf48c1c85d78cd2d2f3a97d3747cab Gitweb: https://git.kernel.org/tip/75998bb263bf48c1c85d78cd2d2f3a97d3747cab Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 15:50:01 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 19 Mar 2019 16:52:03 -0300 perf stat: Fix

[tip:perf/urgent] perf script: Support relative time

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 90b10f47c0ee2a70bd036d9da5e810f522b54a8f Gitweb: https://git.kernel.org/tip/90b10f47c0ee2a70bd036d9da5e810f522b54a8f Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 15:50:00 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 19 Mar 2019 16:52:03 -0300 perf script

[tip:perf/urgent] perf list: Filter metrics too

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 6f40b2a5dac4b448fe1e8d94dc4238cd95cd5e34 Gitweb: https://git.kernel.org/tip/6f40b2a5dac4b448fe1e8d94dc4238cd95cd5e34 Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 15:49:53 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 19 Mar 2019 11:56:19 -0300 perf list

[tip:perf/urgent] perf report: Indicate JITed code better in report

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: a4e7e6efabc57e85e0737c2eaa391525c0ae36f3 Gitweb: https://git.kernel.org/tip/a4e7e6efabc57e85e0737c2eaa391525c0ae36f3 Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 15:49:59 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 19 Mar 2019 16:52:03 -0300 perf report

[tip:perf/urgent] perf report: Show all sort keys in help output

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 702fb9b415e7c99bd671fc0d1da26574c125471a Gitweb: https://git.kernel.org/tip/702fb9b415e7c99bd671fc0d1da26574c125471a Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 15:49:57 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 19 Mar 2019 16:15:42 -0300 perf report

[tip:perf/urgent] perf record: Clarify help for --switch-output

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: c38dab7df7ee4fdecd51e390d4d33d5ef5cff49d Gitweb: https://git.kernel.org/tip/c38dab7df7ee4fdecd51e390d4d33d5ef5cff49d Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 15:49:56 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 19 Mar 2019 16:15:42 -0300 perf record

[tip:perf/urgent] perf record: Allow to limit number of reported perf.data files

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 03724b2e9c45d931eff0f304f2d3363ade65ca89 Gitweb: https://git.kernel.org/tip/03724b2e9c45d931eff0f304f2d3363ade65ca89 Author: Andi Kleen AuthorDate: Thu, 14 Mar 2019 15:49:55 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 19 Mar 2019 11:56:20 -0300 perf record

[tip:perf/urgent] perf report: Implement browsing of individual samples

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 4968ac8fb7c378e2bc40b7e9bd97768fa8c7aa32 Gitweb: https://git.kernel.org/tip/4968ac8fb7c378e2bc40b7e9bd97768fa8c7aa32 Author: Andi Kleen AuthorDate: Mon, 11 Mar 2019 07:44:58 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 16:33:19 -0300 perf report

[tip:perf/urgent] perf tools report: Add custom scripts to script menu

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: e3b74de50a5f8bbfacbd772874c8b5d9220ebcdb Gitweb: https://git.kernel.org/tip/e3b74de50a5f8bbfacbd772874c8b5d9220ebcdb Author: Andi Kleen AuthorDate: Mon, 11 Mar 2019 07:45:00 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 16:33:20 -0300 perf tools

[tip:perf/urgent] perf ui browser: Fix ui popup argv browser for many entries

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 59c24980dffbea2106fe65e64ea77834d657ee9c Gitweb: https://git.kernel.org/tip/59c24980dffbea2106fe65e64ea77834d657ee9c Author: Andi Kleen AuthorDate: Mon, 11 Mar 2019 07:45:02 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 16:33:20 -0300 perf ui

[tip:perf/urgent] perf tools: Add some new tips describing the new options

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: ca52babe033f2a0a535ce7c814e54a44cead1f15 Gitweb: https://git.kernel.org/tip/ca52babe033f2a0a535ce7c814e54a44cead1f15 Author: Andi Kleen AuthorDate: Mon, 11 Mar 2019 07:44:59 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 16:33:19 -0300 perf tools

[tip:perf/urgent] perf report: Support builtin perf script in scripts menu

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 6f3da20e151f4121548cf598730ae0f9559ae45d Gitweb: https://git.kernel.org/tip/6f3da20e151f4121548cf598730ae0f9559ae45d Author: Andi Kleen AuthorDate: Mon, 11 Mar 2019 07:44:57 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 16:33:19 -0300 perf report

[tip:perf/urgent] perf script: Add array bound checking to list_scripts

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 905e4aff31382c3f9b2014d1361f4a1be4479ba2 Gitweb: https://git.kernel.org/tip/905e4aff31382c3f9b2014d1361f4a1be4479ba2 Author: Andi Kleen AuthorDate: Mon, 11 Mar 2019 07:45:01 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 16:33:19 -0300 perf script

[tip:perf/urgent] perf script: Filter COMM/FORK/.. events by CPU

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: e87e548126cdc66fd4f194b38b59f351b6e5d3e8 Gitweb: https://git.kernel.org/tip/e87e548126cdc66fd4f194b38b59f351b6e5d3e8 Author: Andi Kleen AuthorDate: Mon, 11 Mar 2019 07:44:52 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 16:13:05 -0300 perf script

[tip:perf/urgent] perf report: Support running scripts for current time range

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 1d6c49df74b0706af13a7d707638f0db374eaf88 Gitweb: https://git.kernel.org/tip/1d6c49df74b0706af13a7d707638f0db374eaf88 Author: Andi Kleen AuthorDate: Mon, 11 Mar 2019 07:44:56 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 16:33:19 -0300 perf report

[tip:perf/urgent] perf report: Support time sort key

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 3723908d05834c76fd5cc9ecd17b0851342e1df4 Gitweb: https://git.kernel.org/tip/3723908d05834c76fd5cc9ecd17b0851342e1df4 Author: Andi Kleen AuthorDate: Mon, 11 Mar 2019 07:44:54 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 16:32:31 -0300 perf report

[tip:perf/urgent] perf report: Use less for scripts output

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 75065a85a9705ad4c0135f07fd4467d46ff342a3 Gitweb: https://git.kernel.org/tip/75065a85a9705ad4c0135f07fd4467d46ff342a3 Author: Andi Kleen AuthorDate: Fri, 8 Mar 2019 21:56:20 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 14:03:43 -0300 perf report

[tip:perf/urgent] perf report: Parse time quantum

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 2a1292cbd4e5c81edbf815a410fa2072c341db1e Gitweb: https://git.kernel.org/tip/2a1292cbd4e5c81edbf815a410fa2072c341db1e Author: Andi Kleen AuthorDate: Tue, 5 Mar 2019 06:47:48 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 11:56:03 -0300 perf report

[tip:perf/urgent] perf time-utils: Add utility function to print time stamps in nanoseconds

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: f8c856cb2c947f4fad0a2dff5e95cdcddb801303 Gitweb: https://git.kernel.org/tip/f8c856cb2c947f4fad0a2dff5e95cdcddb801303 Author: Andi Kleen AuthorDate: Tue, 5 Mar 2019 06:47:53 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 11:56:02 -0300 perf time-utils

[tip:perf/urgent] perf report: Support output in nanoseconds

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 52bab8868211b7c504146f6239e101421d4d125b Gitweb: https://git.kernel.org/tip/52bab8868211b7c504146f6239e101421d4d125b Author: Andi Kleen AuthorDate: Tue, 5 Mar 2019 06:47:47 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 11:56:02 -0300 perf report

[tip:perf/urgent] perf script: Support insn output for normal samples

2019-03-22 Thread tip-bot for Andi Kleen
Commit-ID: 3ab481a1cfe1511b94e142b648e2c5ade9175ed3 Gitweb: https://git.kernel.org/tip/3ab481a1cfe1511b94e142b648e2c5ade9175ed3 Author: Andi Kleen AuthorDate: Tue, 5 Mar 2019 06:47:45 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Mar 2019 11:56:02 -0300 perf script

Re: [PATCH V3 01/23] perf/x86: Support outputting XMM registers

2019-03-22 Thread Andi Kleen
> > diff --git a/arch/x86/include/uapi/asm/perf_regs.h > > b/arch/x86/include/uapi/asm/perf_regs.h > > index f3329cabce5c..b33995313d17 100644 > > --- a/arch/x86/include/uapi/asm/perf_regs.h > > +++ b/arch/x86/include/uapi/asm/perf_regs.h > > @@ -28,7 +28,29 @@ enum perf_event_x86_regs { > > P

Re: [PATCH 01/17] kbuild: Disable -Waddress-of-packed-member for gcc 9

2019-03-22 Thread Andi Kleen
> Lol... we're actively moving away from the C standard on many places. Yes and also packed is not part of the C standard. > Why does the silly compiler think it is a problem to take the address of > a member of a packed structure? That sounds like something that's > perfectly fine and useful. P

Re: [PATCH 01/17] kbuild: Disable -Waddress-of-packed-member for gcc 9

2019-03-22 Thread Andi Kleen
On Fri, Mar 22, 2019 at 02:58:51PM +0100, Arnd Bergmann wrote: > On Thu, Mar 21, 2019 at 11:00 PM Andi Kleen wrote: > > > > From: Andi Kleen > > > > This warning is very noisy in a default build with gcc 9. > > Move it into W=2 only. > > > > Cc: a...

[PATCH 14/17] crypto: Don't mark AES tables const and cacheline_aligned

2019-03-21 Thread Andi Kleen
From: Andi Kleen cacheline_aligned is a special section. It cannot be const at the same time because it's not read-only. It doesn't give any MMU protection. If we wanted const cacheline aligned we would need to define a new dedicated section. But I assume it's not really needed s

[PATCH 12/17] afs: Avoid section confusion in CM_NAME

2019-03-21 Thread Andi Kleen
From: Andi Kleen __tracepoint_str cannot be const because the tracepoint_str section is not read-only. Remove the stray const. Cc: dhowe...@redhat.com Cc: v...@zeniv.linux.org.uk Signed-off-by: Andi Kleen --- fs/afs/cmservice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

<    1   2   3   4   5   6   7   8   9   10   >