[PATCH 3/7] sched: Out of line __update_load_avg

2017-03-14 Thread Andi Kleen
From: Andi Kleen This is a very complex function, which is called in multiple places. It is unlikely that inlining or not inlining it makes any difference for its run time. This saves around 13k text in my kernel textdata bss dec hex filename 9083992 5367600 6544

Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig

2017-03-14 Thread Andi Kleen
> > Or define some quirk table just for this purpose? > > Nope. It's about identifying the bus. PCI just has no good way to identify busses. > > The bus which contains the uncore devices: > > The Uncore devices reside on CPUBUSNO(1), which is the PCI bus assigned > for the processor socket.

Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig

2017-03-14 Thread Andi Kleen
> And the way how this function is used is a horrible hack. It's called from > a random driver at some random point in time. > > The proper solution is to identify the bus at the point where the bus is > discovered and switch it to mmconfig if possible. But how would you know that it is safe? AFA

Re: WTH is going on with memory hotplug sysf interface (was: Re: [RFC PATCH] mm, hotplug: get rid of auto_online_blocks)

2017-03-13 Thread Andi Kleen
> and ARCH_SPARSEMEM_DEFAULT is enabeld on 64b. So I guess whatever was > the reason to add this code back in 2006 is not true anymore. So I am > really wondering. Do we absolutely need to assign pages which are not > onlined yet to the ZONE_NORMAL unconditionally? Why cannot we put them > out of a

Re: perf: Improve support for uncore JSON event lists

2017-03-13 Thread Andi Kleen
> > Available from > > > > git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc.git > > perf/builtin-json-29 > > hi, > I can't see the branch.. It's there https://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc.git/log/?h=perf/builtin-json-29 -Andi > > [jolsa@krava perf]$ git r

[PATCH 2/2] x86/fpu: Support disabling AVX and AVX512

2017-03-11 Thread Andi Kleen
From: Andi Kleen For performance testing it is useful to be able to disable AVX and AVX512. User programs check in XGETBV if AVX is supported by the OS. If we don't initialize the XSAVE state for AVX it will appear as if the OS is not supporting AVX. Implement disable options for AVX and A

[PATCH 1/2] x86/xsave: Move xsave initialization to after parsing early parameters

2017-03-11 Thread Andi Kleen
From: Andi Kleen Move the XSAVE initialization code to be after parsing early parameters. I don't see any reason why the FPU code needs to be initialized that early, nothing else in the initialization phase uses XSAVE. This is useful to be able to handle command line parameters in the

Re: [PATCH 2/2] x86/fpu: Support disabling AVX and AVX512

2017-03-11 Thread Andi Kleen
On Sat, Mar 11, 2017 at 11:46:37AM +0100, Thomas Gleixner wrote: > > +enum xsave_features { > > + XSAVE_X87, > > + XSAVE_SSE, > > + XSAVE_AVX, > > + XSAVE_MPX_BOUNDS, > > + XSAVE_MPX_CSR, > > + XSAVE_AVX512_OPMASK, > > + XSAVE_AVX512_HI256, > > + XSAVE_AVX512_ZMM_HI256, > > + XSAV

[PATCH] x86/mce: Don't print all MCEs when mcelog is active

2017-03-10 Thread Andi Kleen
From: Andi Kleen Since cd9c57c x86/MCE: Dump MCE to dmesg if no consumers in 4.9 all MCEs are printed even when mcelog is running. This fixes the code again to not print when mcelog is running, because it already takes care of the logging and predicting. This fixes spamming all xterms for

[PATCH 1/2] x86/xsave: Move xsave initialization to after parsing early parameters

2017-03-10 Thread Andi Kleen
From: Andi Kleen Move the XSAVE initialization code to be after parsing early parameters. I don't see any reason why the FPU code needs to be initialized that early, nothing else in the initialization phase uses XSAVE. This is useful to be able to handle command line parameters in the

[PATCH 2/2] x86/fpu: Support disabling AVX and AVX512

2017-03-10 Thread Andi Kleen
From: Andi Kleen For performance testing it is useful to be able to disable AVX and AVX512. User programs check in XGETBV if AVX is supported by the OS. If we don't initialize the XSAVE state for AVX it will appear as if the OS is not supporting AVX. For kernel users we can also clea

Re: tty layer NULL pointer reference with 4.10

2017-03-10 Thread Andi Kleen
Andi Kleen writes: > Hi, > > I had a large systems with lots of cores stop responding to new ssh > requests. It turned out it crashed in the tty layer. The system > has a serial console and had some active sshs and screen Correction. This may have been a linux-next kernel, not 4.

tty layer NULL pointer reference with 4.10

2017-03-10 Thread Andi Kleen
Hi, I had a large systems with lots of cores stop responding to new ssh requests. It turned out it crashed in the tty layer. The system has a serial console and had some active sshs and screen [24922.097093] BUG: unable to handle kernel paging request at 2260 [24922.64] IP: n_tty_

[PATCH 09/13] perf, tools: Support MetricExpr header in JSON event list

2017-03-10 Thread Andi Kleen
From: Andi Kleen Add support for parsing the MetricExpr header in the JSON event lists and storing them in the alias structure. Used in the next patch. v2: Change DividedBy to MetricExpr v3: Really catch all uses of DividedBy Signed-off-by: Andi Kleen --- tools/perf/pmu-events/jevents.c

[PATCH 10/13] perf, tools, stat: Output JSON MetricExpr metric

2017-03-10 Thread Andi Kleen
From: Andi Kleen Add generic infrastructure to perf stat to output ratios for "MetricExpr" entries in the event lists. Many events are more useful as ratios than in raw form, typically some count in relation to total ticks. Transfer the MetricExpr information from the alias to the

[PATCH 04/13] perf, tools: Factor out PMU matching in parser

2017-03-10 Thread Andi Kleen
From: Andi Kleen Factor out the PMU name matching in the event parser into a separate function, to use the same code for other grammar rules later. Signed-off-by: Andi Kleen --- tools/perf/util/parse-events.c | 46 ++ tools/perf/util/parse-events.h | 5

[PATCH 13/13] perf, tools, list: Move extra details printing to new option

2017-03-10 Thread Andi Kleen
From: Andi Kleen Move the printing of perf expressions and internal events to a new clearer --details flag, instead of lumping it together with other debug options in --debug. This makes it clearer to use. Before perf list --debug ... unc_m_power_critical_throttle_cycles [Cycles all

[PATCH 01/13] perf, tools, stat: Factor out callback for collecting event values

2017-03-10 Thread Andi Kleen
From: Andi Kleen To be used in next patch to support automatic summing of alias events. v2: Move check for bad results to next patch v3: Remove trivial addition. Signed-off-by: Andi Kleen --- tools/perf/builtin-stat.c | 103 +++--- 1 file changed, 80

[PATCH 12/13] perf, tools: Add support for MetricName JSON attribute

2017-03-10 Thread Andi Kleen
From: Andi Kleen Add support for a new JSON event attribute to name MetricExpr for better output in perf stat. If the event has no MetricName it uses the normal event name instead to describe the metric. Before % perf stat -a -I 1000 -e '{unc_p_clockticks,unc_p_freq_max_os_cycles}'

[PATCH 07/13] perf, tools: Add a simple expression parser for JSON

2017-03-10 Thread Andi Kleen
From: Andi Kleen Add a simple expression parser good enough to parse JSON relation expressions. The parser is implemented using bison. This is just intended as an simple parser for internal usage in the event lists, not the beginning of a "perf scripting language" v2: Use expr__ pref

[PATCH 06/13] perf, tools: Special case uncore_ prefix

2017-03-10 Thread Andi Kleen
From: Andi Kleen Special case uncore_ prefix in PMU match, to allow for shorter event uncore specifications. Before perf stat -a -e uncore_cbox/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1 After perf stat -a -e cbox/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1 Signed-off-by: Andi Kleen

[PATCH 05/13] perf, tools: Expand PMU events by prefix match

2017-03-10 Thread Andi Kleen
From: Andi Kleen When the user specifies a pmu directly, expand it automatically with a prefix match for all available PMUs, similar as we do for the normal aliases now. This allows to specify attributes for duplicated boxes quickly. For example uncore_cbox_{0,6}/.../ can be now specified as

[PATCH 08/13] perf, tools: Update Intel uncore JSON event files

2017-03-10 Thread Andi Kleen
From: Andi Kleen - Add MetricName to describe Metric - Remove redundant "derived from" in descriptions - Rename UNC_M_CAS_COUNT to LLC_MISSES.READ Signed-off-by: Andi Kleen --- .../arch/x86/broadwellde/uncore-cache.json | 28 ++-- .../arch/x86/broadwellde/uncore-m

[PATCH 11/13] perf, tools, list: Support printing MetricExpr with --debug

2017-03-10 Thread Andi Kleen
From: Andi Kleen Output the metric expr in perf list when --debug is specified, so that the user can check the formula. Before: % perf list ... unc_m_power_channel_ppd [Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd. Unit

perf: Improve support for uncore JSON event lists

2017-03-10 Thread Andi Kleen
This patch kit further improves support for Intel uncore events in the Linux perf user tool. The basic support has been already merged earlier, but this makes it nicer to use. - Collapse counts from duplicated boxes to make the output easier to read. - Support specifying events for multiple duplic

[PATCH 02/13] perf, tools, stat: Collapse identically named events

2017-03-10 Thread Andi Kleen
From: Andi Kleen The uncore PMU has a lot of duplicated PMUs for different subsystems. When expanding an uncore alias we usually end up with a large number of identically named aliases, which makes perf stat output difficult to read. Automatically sum them up in perf stat, unless --no-merge is

[PATCH 03/13] perf, tools, stat: Handle partially bad results with merging

2017-03-10 Thread Andi Kleen
From: Andi Kleen When any result that is being merged is bad, mark them all bad to give consistent output in interval mode. No before/after, because the issue was only found in theoretical review and it is hard to reproduce Signed-off-by: Andi Kleen --- tools/perf/builtin-stat.c | 10

Re: [PATCH] mm,hugetlb: compute page_size_log properly

2017-03-08 Thread Andi Kleen
> One example of the problems with extra layers what this patch fixes: > mmap_pgoff() should never be using SHM_HUGE_* logic. This was > introduced by: > >091d0d55b28 (shm: fix null pointer deref when userspace specifies invalid > hugepage size) > > It is obviously harmless but lets just rip

Re: [PATCH 01/10] perf, tools, stat: Factor out callback for collecting event values

2017-03-03 Thread Andi Kleen
On Fri, Mar 03, 2017 at 11:33:03AM +0100, Jiri Olsa wrote: > On Tue, Feb 28, 2017 at 10:49:15PM -0800, Andi Kleen wrote: > > SNIP > > > +static void collect_data(struct perf_evsel *counter, > > + void (*cb)(struct perf_ev

[PATCH 3/4] x86, pci: Add interface to force mmconfig

2017-03-02 Thread Andi Kleen
From: Andi Kleen This fills in the pci_bus_force_mmconfig interface that was added earlier for x86 to allow drivers to optimize config space accesses. The implementation is straight forward and uses the existing mmconfig access functions, just forcing mmconfig access. Signed-off-by: Andi Kleen

[PATCH 1/4] pci: Allow lockless access path to PCI mmconfig

2017-03-02 Thread Andi Kleen
From: Andi Kleen The Intel uncore driver can do a lot of PCI config accesses to read performance counters. I had a situation on a 4S system where it was spending 40+% of CPU time grabbing the pci_cfg_lock due to that. For 64bit x86 with MMCONFIG there isn't really any reason to take a lock

[PATCH 4/4] perf/x86/intel/uncore: Enable forced mmconfig for Intel uncore

2017-03-02 Thread Andi Kleen
From: Andi Kleen On Intel systems some uncore counters are located in PCI config space. On 4S systems with many uncore events being sampled at a high frequency we can see significant overhead from the type 1 accesses: both from the IO port accesses and also from lock contention on the locks

[PATCH 2/4] pci: Add generic pci_bus_force_mmconfig interface

2017-03-02 Thread Andi Kleen
From: Andi Kleen x86 traditionally used mmconfig only for extended config space accesses with offsets larger than 256. For lower offsets it uses the classic Type 1 IO port access. This is quite slow and also requires taking a global spin lock to protect the Type 1 IO port mailbox. IIRC (I added

[PATCH 08/10] perf, tools, stat: Output JSON MetricExpr metric

2017-03-01 Thread Andi Kleen
From: Andi Kleen Add generic infrastructure to perf stat to output ratios for "MetricExpr" entries in the event lists. Many events are more useful as ratios than in raw form, typically some count in relation to total ticks. Transfer the MetricExpr information from the alias to the

[PATCH 02/10] perf, tools, stat: Collapse identically named events

2017-03-01 Thread Andi Kleen
From: Andi Kleen The uncore PMU has a lot of duplicated PMUs for different subsystems. When expanding an uncore alias we usually end up with a large number of identically named aliases, which makes perf stat output difficult to read. Automatically sum them up in perf stat, unless --no-merge is

[PATCH 06/10] perf, tools: Add a simple expression parser for JSON

2017-03-01 Thread Andi Kleen
From: Andi Kleen Add a simple expression parser good enough to parse JSON relation expressions. The parser is implemented using bison. This is just intended as an simple parser for internal usage in the event lists, not the beginning of a "perf scripting language" v2: Use expr__ pref

[PATCH 07/10] perf, tools: Support MetricExpr header in JSON event list

2017-02-28 Thread Andi Kleen
From: Andi Kleen Add support for parsing the MetricExpr header in the JSON event lists and storing them in the alias structure. Used in the next patch. v2: Change DividedBy to MetricExpr v3: Really catch all uses of DividedBy Signed-off-by: Andi Kleen --- tools/perf/pmu-events/jevents.c

[PATCH 10/10] perf, tools: Add support for MetricName JSON attribute

2017-02-28 Thread Andi Kleen
From: Andi Kleen Add support for a new JSON event attribute to name MetricExpr for better output in perf stat. If the event has no MetricName it uses the normal event name instead to describe the metric. So far no names are added. Signed-off-by: Andi Kleen --- tools/perf/pmu-events/jevents.c

perf: Improve support for uncore JSON event lists

2017-02-28 Thread Andi Kleen
This patch kit further improves support for Intel uncore events in the Linux perf user tool. The basic support has been already merged earlier, but this makes it nicer to use. - Collapse counts from duplicated boxes to make the output easier to read. - Support specifying events for multiple duplic

[PATCH 01/10] perf, tools, stat: Factor out callback for collecting event values

2017-02-28 Thread Andi Kleen
From: Andi Kleen To be used in next patch to support automatic summing of alias events. v2: Move check for bad results to next patch Signed-off-by: Andi Kleen --- tools/perf/builtin-stat.c | 104 -- 1 file changed, 81 insertions(+), 23 deletions

[PATCH 05/10] perf, tools: Special case uncore_ prefix

2017-02-28 Thread Andi Kleen
From: Andi Kleen Special case uncore_ prefix in PMU match, to allow for shorter event uncore specifications. Before perf stat -a -e uncore_cbox/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1 After perf stat -a -e cbox/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1 Signed-off-by: Andi Kleen

[PATCH 04/10] perf, tools: Expand PMU events by prefix match

2017-02-28 Thread Andi Kleen
From: Andi Kleen When the user specifies a pmu directly, expand it automatically with a prefix match for all available PMUs, similar as we do for the normal aliases now. This allows to specify attributes for duplicated boxes quickly. For example uncore_cbox_{0,6}/.../ can be now specified as

[PATCH 03/10] perf, tools: Factor out PMU matching in parser

2017-02-28 Thread Andi Kleen
From: Andi Kleen Factor out the PMU name matching in the event parser into a separate function, to use the same code for other grammar rules later. Signed-off-by: Andi Kleen --- tools/perf/util/parse-events.c | 46 ++ tools/perf/util/parse-events.h | 5

[PATCH 09/10] perf, tools, list: Support printing MetricExpr with -v

2017-02-28 Thread Andi Kleen
From: Andi Kleen Output the metric expr in perf list when -v is specified, so that the user can check the formula. Before: % perf list -v ... unc_m_power_channel_ppd [Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd. Unit

Re: [PATCH 01/10] perf, tools, stat: Factor out callback for collecting event values

2017-02-24 Thread Andi Kleen
On Fri, Feb 24, 2017 at 09:37:20AM +0100, Jiri Olsa wrote: > On Thu, Feb 23, 2017 at 04:10:12PM -0800, Andi Kleen wrote: > > From: Andi Kleen > > > > To be used in next patch to support automatic summing of alias > > events. > > > > Signed-off-by: Andi Kl

[PATCH] perf, tools, script: Add brstackinsn for branch stacks

2017-02-23 Thread Andi Kleen
From: Andi Kleen Implement printing instruction sequences as hex dump for branch stacks. This relies on the x86 instruction decoder used by the PT decoder to find the lengths of instructions to dump them individually. This is good enough for pattern matching. This allows to study hot paths for

[PATCH 02/10] perf, tools, stat: Collapse identically named events

2017-02-23 Thread Andi Kleen
From: Andi Kleen The uncore PMU has a lot of duplicated PMUs for different subsystems. When expanding an uncore alias we usually end up with a large number of identically named aliases, which makes perf stat output difficult to read. Automatically sum them up in perf stat, unless --no-merge is

[PATCH 06/10] perf, tools: Add a simple expression parser for JSON

2017-02-23 Thread Andi Kleen
From: Andi Kleen Add a simple expression parser good enough to parse JSON relation expressions. The parser is implemented using bison. v2: Use expr__ prefix instead of expr_ Support multiple free variables for parser Signed-off-by: Andi Kleen --- tools/perf/tests/Build | 1 + tools

[PATCH 07/10] perf, tools: Support MetricExpr header in JSON event list

2017-02-23 Thread Andi Kleen
From: Andi Kleen Add support for parsing the MetricExpr header in the JSON event lists and storing them in the alias structure. Used in the next patch. v2: Change DividedBy to MetricExpr v3: Really catch all uses of DividedBy Signed-off-by: Andi Kleen --- tools/perf/pmu-events/jevents.c

[PATCH 03/10] perf, tools: Factor out PMU matching in parser

2017-02-23 Thread Andi Kleen
From: Andi Kleen Factor out the PMU name matching in the event parser into a separate function, to use the same code for other grammar rules later. Signed-off-by: Andi Kleen --- tools/perf/util/parse-events.c | 46 ++ tools/perf/util/parse-events.h | 5

[PATCH 08/10] perf, tools, stat: Output JSON MetricExpr metric

2017-02-23 Thread Andi Kleen
From: Andi Kleen Add generic infrastructure to perf stat to output ratios for "MetricExpr" entries in the event lists. Many events are more useful as ratios than in raw form, typically some count in relation to total ticks. Transfer the MetricExpr information from the alias to the

[PATCH 01/10] perf, tools, stat: Factor out callback for collecting event values

2017-02-23 Thread Andi Kleen
From: Andi Kleen To be used in next patch to support automatic summing of alias events. Signed-off-by: Andi Kleen --- tools/perf/builtin-stat.c | 114 -- 1 file changed, 91 insertions(+), 23 deletions(-) diff --git a/tools/perf/builtin-stat.c b

[PATCH 09/10] perf, tools, list: Support printing MetricExpr with -v

2017-02-23 Thread Andi Kleen
From: Andi Kleen Output the metric expr in perf list when -v is specified, so that the user can check the formula. Before: % perf list -v ... unc_m_power_channel_ppd [Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd. Unit

[PATCH 10/10] perf, tools: Add support for MetricName JSON attribute

2017-02-23 Thread Andi Kleen
From: Andi Kleen Add support for a new JSON event attribute to name MetricExpr for better output in perf stat. If the event has no MetricName it uses the normal event name instead to describe the metric. So far no names are added. Signed-off-by: Andi Kleen --- tools/perf/pmu-events/jevents.c

[PATCH 04/10] perf, tools: Expand PMU events by prefix match

2017-02-23 Thread Andi Kleen
From: Andi Kleen When the user specifies a pmu directly, expand it automatically with a prefix match for all available PMUs, similar as we do for the normal aliases now. This allows to specify attributes for duplicated boxes quickly. For example uncore_cbox_{0,6}/.../ can be now specified as

[PATCH 05/10] perf, tools: Special case uncore_ prefix

2017-02-23 Thread Andi Kleen
From: Andi Kleen Special case uncore_ prefix in PMU match, to allow for shorter event uncore specifications. Before perf stat -a -e uncore_cbox/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1 After perf stat -a -e cbox/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1 Signed-off-by: Andi Kleen

Re: [BUG] msr-trace.h:42 suspicious rcu_dereference_check() usage!

2017-02-23 Thread Andi Kleen
> > diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c > > index 0888a879120f..d6c6aa80675f 100644 > > --- a/arch/x86/kernel/process.c > > +++ b/arch/x86/kernel/process.c > > @@ -357,7 +357,7 @@ static void amd_e400_idle(void) > > if (!amd_e400_c1e_detected) { > > u3

Re: [PATCH] perf/x86: fix event counter update issue

2017-02-22 Thread Andi Kleen
> No. It related to the counter width. The number of bits we can use should be > 1 bit less than the total width. Otherwise, there will be problem. > For big cores such as haswell, broadwell, skylake, the counter width is 48 > bit. > So we can only use 47 bits. > For Silvermont and KNL, the counte

[tip:perf/core] perf list: Add debug support for outputing alias string

2017-02-10 Thread tip-bot for Andi Kleen
Commit-ID: f23610245c1aa0e912476e642bd5107d04122230 Gitweb: http://git.kernel.org/tip/f23610245c1aa0e912476e642bd5107d04122230 Author: Andi Kleen AuthorDate: Fri, 27 Jan 2017 18:03:40 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 8 Feb 2017 08:55:04 -0300 perf list: Add

[tip:perf/core] perf jevents: Add support for parsing uncore json files

2017-02-10 Thread tip-bot for Andi Kleen
Commit-ID: fedb2b518239cbc00abcf0d200e0be8436251c11 Gitweb: http://git.kernel.org/tip/fedb2b518239cbc00abcf0d200e0be8436251c11 Author: Andi Kleen AuthorDate: Fri, 27 Jan 2017 18:03:37 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 8 Feb 2017 08:55:03 -0300 perf jevents

[tip:perf/core] perf vendor events intel: Add uncore events for Sandy Bridge Server

2017-02-09 Thread tip-bot for Andi Kleen
Commit-ID: dd32cb5d8fd42316bf8c2b9f7e5c51a38625f755 Gitweb: http://git.kernel.org/tip/dd32cb5d8fd42316bf8c2b9f7e5c51a38625f755 Author: Andi Kleen AuthorDate: Sat, 17 Sep 2016 18:10:03 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 8 Feb 2017 16:37:35 -0300 perf vendor

[tip:perf/core] perf pmu: Support per pmu json aliases

2017-02-09 Thread tip-bot for Andi Kleen
Commit-ID: 15b22ed369aa23ef4d083ffb9621650c353d3ddd Gitweb: http://git.kernel.org/tip/15b22ed369aa23ef4d083ffb9621650c353d3ddd Author: Andi Kleen AuthorDate: Fri, 27 Jan 2017 18:03:38 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 8 Feb 2017 08:55:03 -0300 perf pmu

[tip:perf/core] perf pmu: Support event aliases for non cpu// pmus

2017-02-09 Thread tip-bot for Andi Kleen
Commit-ID: 231bb2aa32498cbebef1306889a02114e9dfc934 Gitweb: http://git.kernel.org/tip/231bb2aa32498cbebef1306889a02114e9dfc934 Author: Andi Kleen AuthorDate: Fri, 27 Jan 2017 18:03:39 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 8 Feb 2017 08:55:04 -0300 perf pmu

[tip:perf/core] perf jevents: Parse eventcode as number

2017-02-09 Thread tip-bot for Andi Kleen
Commit-ID: d581141970ef3965c1624960fa928d765afd8a3e Gitweb: http://git.kernel.org/tip/d581141970ef3965c1624960fa928d765afd8a3e Author: Andi Kleen AuthorDate: Fri, 27 Jan 2017 18:03:36 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 8 Feb 2017 08:55:02 -0300 perf jevents

Re: [PATCH 2/2] perf tools: Support end symbols with no size for filters

2017-02-09 Thread Andi Kleen
> > - no_size = !!size; > > Erk! Isn't the logic is the wrong way around here. Sorry! > i.e. should be: Yes it works with that change too. > > diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c > index c5a6e0b12452..78bd632f144d 100644 > --- a/tools/perf/util/auxtr

Re: Intel PT decoder switch case fallthrough cases reported by gcc 7

2017-02-09 Thread Andi Kleen
> But what about my question? Do you think the changes are ok? I actually > made all be fallthrough, i.e. considered that the existing code was ok. Yes the changes are fine. -Andi

Re: [PATCH 10/10] perf, tools, stat: Output JSON MetricExpr metric

2017-02-09 Thread Andi Kleen
On Thu, Feb 09, 2017 at 07:37:55PM +0100, Jiri Olsa wrote: > > The last time I proposed separate files Ingo vetoed it. > > He wanted everything built in. > > sure, he veto it for event files.. expressions could be built > in same way as we have events now That's exactly what I implemented. The ex

Re: Intel PT decoder switch case fallthrough cases reported by gcc 7

2017-02-09 Thread Andi Kleen
On Thu, Feb 09, 2017 at 01:50:39PM -0300, Arnaldo Carvalho de Melo wrote: > Hi, > > I've updated the container with Fedora Rawhide I use to build > tools/perf/ and samples/bcc/ and it now comes with gcc 7, where I get > things like: FWIW, but it just shows that you should never ship softwar

Re: [PATCH 10/10] perf, tools, stat: Output JSON MetricExpr metric

2017-02-09 Thread Andi Kleen
On Thu, Feb 09, 2017 at 12:39:37PM +0100, Jiri Olsa wrote: > and this makes me think, that this is not the right approach > > adding extra copy of an event when you want to add new expression? I don't want to add new expressions. I don't even need arbitrary expressions, just DividedBy to get per

Re: [PATCH 10/10] perf, tools, stat: Output JSON MetricExpr metric

2017-02-08 Thread Andi Kleen
On Wed, Feb 08, 2017 at 12:31:34PM +0100, Jiri Olsa wrote: > On Fri, Jan 27, 2017 at 06:03:45PM -0800, Andi Kleen wrote: > > From: Andi Kleen > > > > Add generic infrastructure to perf stat to output ratios for "MetricExpr" > > entries in the event lists.

Re: [PATCH] perf/x86/intel/pt: Allow disabling branch tracing

2017-02-06 Thread Andi Kleen
On Mon, Feb 06, 2017 at 06:05:29PM +0200, Alexander Shishkin wrote: > Andi Kleen writes: > > > Alexander Shishkin writes: > > > >> Now that Intel PT supports more types of trace content than just branch > >> tracing, it may be useful to allow the user to di

Re: [PATCH] perf/x86/intel/pt: Allow disabling branch tracing

2017-02-06 Thread Andi Kleen
Alexander Shishkin writes: > Now that Intel PT supports more types of trace content than just branch > tracing, it may be useful to allow the user to disable branch tracing > when it is not needed. > > The special case is BDW, where not setting BranchEn is not supported. > > This is slightly tric

[PATCH 1/2] perf/core: Allow global address filtering for kernel code

2017-02-03 Thread Andi Kleen
From: Andi Kleen The address filter code disallows filtering for per-cpu events, because it would require dynamically changing user address filters in context switches. For the special case of filtering on kernel code only, we can allow it, as the kernel code always stays at the same addresses

[PATCH 2/2] perf tools: Support end symbols with no size for filters

2017-02-03 Thread Andi Kleen
From: Andi Kleen Currently a filter like --filter "filter _text / _end" doesn't work because _end doesn't have a size. The filter resolution always wants to use the end of the function as end. Allow this case by assuming the filter just spawns to the start of the end sym

Re: [PATCH 00/12] Cqm2: Intel Cache quality monitoring fixes

2017-02-01 Thread Andi Kleen
> > I'm not sure this is a real requirement. It's just an optimization, > > right? If you can assign policies to threads, you can implicitly set it > > per CPU through affinity (or the other way around). > > That's difficult when distinct users/systems do monitoring and system > management. What

Re: [PATCH 00/12] Cqm2: Intel Cache quality monitoring fixes

2017-02-01 Thread Andi Kleen
"Luck, Tony" writes: > 9)Measure per logical CPU (pick active RMID in same precedence for > task/cpu as CAT picks CLOSID) > 10) Put multiple CPUs into a group I'm not sure this is a real requirement. It's just an optimization, right? If you can assign policies to threads, you can implicitl

[PATCH 08/10] perf, tools: Add a simple expression parser for JSON

2017-01-27 Thread Andi Kleen
From: Andi Kleen Add a simple expression parser good enough to parse JSON relation expressions. The parser is implemented using bison. Signed-off-by: Andi Kleen --- tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 ++ tools/perf/tests/expr.c | 48

[PATCH 05/10] perf, tools: Add debug support for outputing alias string

2017-01-27 Thread Andi Kleen
From: Andi Kleen For debugging and testing it is useful to see the converted alias string. Add support to perf stat/record and perf list to print the alias conversion. The text string is saved in the alias structure. For perf stat/record it is folded into the normal -v. For perf list -v was

[PATCH 07/10] perf, tools: Expand PMU events by prefix match

2017-01-27 Thread Andi Kleen
From: Andi Kleen When the user specifies a pmu directly, expand it automatically with a prefix match, similar as we do for the normal aliases now. This allows to specify attributes for duplicated boxes quickly. For example uncore_cbox_{0,6}/.../ can be now specified as cbox/.../ and it gets

[PATCH 10/10] perf, tools, stat: Output JSON MetricExpr metric

2017-01-27 Thread Andi Kleen
From: Andi Kleen Add generic infrastructure to perf stat to output ratios for "MetricExpr" entries in the event lists. Many events are more useful as ratios than in raw form, typically some count in relation to total ticks. Transfer the MetricExpr information from the alias to the

[PATCH 09/10] perf, tools: Support MetricExpr header in JSON event list

2017-01-27 Thread Andi Kleen
From: Andi Kleen Add support for parsing the MetricExpr header in the JSON event lists and storing them in the alias structure. Used in the next patch. v2: Change DividedBy to MetricExpr Signed-off-by: Andi Kleen --- tools/perf/pmu-events/jevents.c| 18 ++ tools/perf/pmu

[PATCH 06/10] perf, tools: Collapse identically named events in perf stat

2017-01-27 Thread Andi Kleen
From: Andi Kleen The uncore PMU has a lot of duplicated PMUs for different subsystems. When expanding an uncore alias we usually end up with a large number of identically named aliases, which makes perf stat output difficult to read. Automatically sum them up in perf stat, unless --no-merge is

[PATCH 02/10] perf, tools: Add support for parsing uncore json files

2017-01-27 Thread Andi Kleen
From: Andi Kleen Handle the Unit field, which is needed to find the right PMU for an event. We call it "pmu" and convert it to the perf pmu name with an uncore prefix. Handle the ExtSel field, which just extends the event mask with an additional bit. Handle the Filter field

[PATCH 03/10] perf, tools: Support per pmu json aliases

2017-01-27 Thread Andi Kleen
From: Andi Kleen Add support for registering json aliases per PMU. Any alias with an unit matching the prefix is registered to the PMU. Uncore has multiple instances of most units, so all these aliases get registered for each individual PMU (this is important later to run the event on every

[PATCH 01/10] perf, tools: Parse eventcode as number in jevents

2017-01-27 Thread Andi Kleen
From: Andi Kleen The next patch needs to modify event code. Previously eventcode was just passed through as a string. Now parse it as a number. v2: Don't special case 0 Acked-by: Jiri Olsa Signed-off-by: Andi Kleen --- tools/perf/pmu-events/jevents.c | 10 +- 1 file chang

[PATCH 04/10] perf, tools: Support event aliases for non cpu// pmus

2017-01-27 Thread Andi Kleen
From: Andi Kleen The code for handling pmu aliases without specifying the PMU hardcoded only supported the cpu PMU. This patch extends it to work for all PMUs. We always duplicate the event for all PMUs that have an matching alias. This allows to automatically expand an alias for all instances

Support Intel uncore event lists

2017-01-27 Thread Andi Kleen
This adds uncore support on top of the recently merged JSON event list infrastructure for core events. Uncore is everything outside the core, including memory controllers, PCI, interconnect etc. Uncore is more complicated to handle than core events because it uses many duplicated PMUs, which leads

Re: [PATCH 4/5] perf, tools, script: Add support for printing assembler

2017-01-23 Thread Andi Kleen
> Do you know if there is any tool comparing the output of objdump -d to what is > produced by a similar xed based tool? I'm not aware of such a tool, but could be written using the "xed" tool in the xed distribution. However I would trust xed over objdump, it is used widely in Intel tools with li

Re: New attempt at adding an disassembler to perf

2017-01-19 Thread Andi Kleen
> > [jolsa@krava perf]$ git branch -r | grep xed- > ak/perf/xed-3 > ak/perf/xed-4 Pushed. -Andi

New attempt at adding an disassembler to perf

2017-01-18 Thread Andi Kleen
A native disassembler in perf is very useful, in particular with perf script to trace instruction streams, but also for other analysis. Previously I attempted to do this using the udis86 library, but that was rejected because: - udis86 was not maintained anymore and lacking recent instructions -

[PATCH 5/5] perf, tools, script: Add brstackasm output for branch stacks

2017-01-18 Thread Andi Kleen
From: Andi Kleen Implement printing full disassembled sequences for branch stacks in perf script. This allows to directly print hot paths for individual samples, together with branch misprediction and cycle count / IPC information if available (on Skylake systems). This only works when no

[PATCH 4/5] perf, tools, script: Add support for printing assembler

2017-01-18 Thread Andi Kleen
From: Andi Kleen When dumping PT traces with perf script it is very useful to see the assembler for each sample, so that it is easily possible to follow the control flow. As using objdump is difficult and inefficient from perf script this patch uses the Intel xed library to implement assembler

[PATCH 1/5] perf, tools: Add probing for xed

2017-01-18 Thread Andi Kleen
From: Andi Kleen Add autoprobing for the xed disassembler library. Can be downloaded from https://github.com/intelxed/xed v2: Hide. Require XED=1 to enable. Add XED_DIR v3: Remove -lxed from probe all. Don't touch FEATURE_DISPLAY. v4: Move to FEATURE_FLAGS_BASIC Signed-off-by: Andi

[PATCH 2/5] perf, tools: Add one liner warning for disabled features

2017-01-18 Thread Andi Kleen
From: Andi Kleen Add a one liner warning for perf features that need to be enabled explicitly by the user, so that they know they are missing something. Currently enabled for XED and BABELTRACE. Signed-off-by: Andi Kleen --- tools/perf/Makefile.config | 10 ++ 1 file changed, 10

[PATCH 3/5] perf, tools: Add disassembler for x86 using the XED library

2017-01-18 Thread Andi Kleen
From: Andi Kleen Add a generic disassembler function for x86 using the XED library, and a fallback function for architectures that don't implement one. Other architectures can implement their own disassembler functions. The previous version of this patch used udis86, but was rejected be

Re: [PATCH 04/11] perf, tools: Support per pmu json aliases

2017-01-18 Thread Andi Kleen
> > index 8bffe99d8e3f..4bfc98953aba 100644 > > --- a/tools/perf/util/pmu.c > > +++ b/tools/perf/util/pmu.c > > @@ -587,14 +587,13 @@ static struct perf_pmu *pmu_lookup(const char *name) > > if (pmu_format(name, &format)) > > return NULL; > > > > - if (pmu_aliases(name, &aliases

Re: [PATCH 07/11] perf, tools: Collapse identically named events in perf stat

2017-01-18 Thread Andi Kleen
> will it always show 'not supported', as I haven't found this in the > changelog I guess you did not know about this behaviour? Not guaranteed. Will fix that. > > could you also please document it somewhere Ok. -Andi

Re: [PATCH 07/11] perf, tools: Collapse identically named events in perf stat

2017-01-18 Thread Andi Kleen
> > % perf stat -a -e unc_c_llc_lookup.any sleep 1 > > > > Performance counter stats for 'system wide': > > > > 2,685,120 Bytes unc_c_llc_lookup.any > > > >1.002648032 seconds time elapsed > > > if one of them is not supported, we get wrong output: I would argue the outpu

Re: [PATCH 06/11] perf, tools: Add debug support for outputing alias string

2017-01-18 Thread Andi Kleen
On Wed, Jan 18, 2017 at 01:16:06PM +0100, Jiri Olsa wrote: > On Tue, Jan 03, 2017 at 07:08:28AM -0800, Andi Kleen wrote: > > SNIP > > > diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c > > index 4bfc98953aba..e0c43698fd62 100644 > > --- a/tools/perf/util/p

[tip:perf/core] perf pmu: Factor out scale conversion code

2017-01-18 Thread tip-bot for Andi Kleen
Commit-ID: d02fc6bcd53721cf8588633409157c232f2418e0 Gitweb: http://git.kernel.org/tip/d02fc6bcd53721cf8588633409157c232f2418e0 Author: Andi Kleen AuthorDate: Tue, 3 Jan 2017 07:08:23 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 16 Jan 2017 14:59:15 -0300 perf pmu: Factor

<    13   14   15   16   17   18   19   20   21   22   >