[PATCH] powerpc/perf: Add kernel support for new MSR[HV PR] bits in trace-imc.

2020-07-03 Thread Anju T Sudhakar
. Add support in kernel to use these bits to set the cpumode for each sample. Signed-off-by: Anju T Sudhakar --- arch/powerpc/include/asm/imc

[PATCH 2/2] powerpc/perf: Add support for outputting extended regs in perf intr_regs

2020-04-29 Thread Anju T Sudhakar
-by: Anju T Sudhakar --- arch/powerpc/include/asm/perf_event_server.h | 5 +++ arch/powerpc/include/uapi/asm/perf_regs.h | 13 +++- arch/powerpc/perf/core-book3s.c | 1 + arch/powerpc/perf/perf_regs.c | 29 ++-- arch/powerpc/perf/power9-pmu.c

[PATCH 0/2] powerpc/perf: Add support for perf extended regs in powerpc

2020-04-29 Thread Anju T Sudhakar
for this issue, patch 1/2 set NO_AUXTRACE for powerpc. (Any other solutions are welcome.) Patch 2/2 also add extended regs to sample_reg_mask in the tool side to use with `-I?` option. Anju T Sudhakar (2): tools/perf: set no_auxtrace for powerpc powerpc/perf: Add support for outputting extended

[PATCH 1/2] tools/perf: set no_auxtrace for powerpc

2020-04-29 Thread Anju T Sudhakar
. Currently powerpc architecture is not having support for auxtrace. So as a workaround for this issue, set NO_AUXTRACE for powerpc. Signed-off-by: Anju T Sudhakar --- tools/perf/arch/powerpc/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch

[PATCH v4 2/2] powerpc/powernv: Re-enable imc trace-mode in kernel

2020-03-12 Thread Anju T Sudhakar
enable imc-trace mode in kernel. The previous patch(1/2) in this series will address the mode switching issue by implementing a global lock, and will restrict the usage of accumulation and trace-mode at a time. Signed-off-by: Anju T Sudhakar --- arch/powerpc/platforms/powernv/opal-imc.c | 9 +---

[PATCH v4 1/2] powerpc/perf: Implement a global lock to avoid races between trace, core and thread imc events.

2020-03-12 Thread Anju T Sudhakar
at a time. i.e. to run any core-imc events, thread/trace imc events should not be enabled/monitored. Signed-off-by: Anju T Sudhakar --- Changes from v3->v4: - Added mutex lock for thread, core and trace imc cpu offline path. Changes from v2->v3: - Addressed the off-line comments from M

[PATCH v3 2/2] powerpc/powernv: Re-enable imc trace-mode in kernel

2020-02-27 Thread Anju T Sudhakar
enable imc-trace mode in kernel. The previous patch(1/2) in this series will address the mode switching issue by implementing a global lock, and will restrict the usage of accumulation and trace-mode at a time. Signed-off-by: Anju T Sudhakar --- arch/powerpc/platforms/powernv/opal-imc.c | 9 +---

[PATCH v3 1/2] powerpc/perf: Implement a global lock to avoid races between trace, core and thread imc events.

2020-02-27 Thread Anju T Sudhakar
at a time. i.e. to run any core-imc events, thread/trace imc events should not be enabled/monitored. Signed-off-by: Anju T Sudhakar --- Changes from v2->v3: - Addressed the off-line comments from Michael Ellerman - Optimized the *_event_init code path for trace, core and thread imc - Hand

Re: [PATCH v5 07/10] powerpc/perf: open access for CAP_PERFMON privileged process

2020-01-22 Thread Anju T Sudhakar
to CAP_PERFMON capability. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes the operations more secure. Signed-off-by: Alexey Budankov --- Acked-by: Anju T Sudhakar

[PATCH v2 3/5] powerpc/perf: Add an interface sub-folder to imc pmu

2020-01-21 Thread Anju T Sudhakar
From: Madhavan Srinivasan Patch adds an interface attribute folder to imc pmu. This is intended to include pmu intreface capabilities which will be useful to userspace likes selftest testcases. Patch adds a "glob_lck" file to notify to userspace of global lock mechanism added to imc devices like

[PATCH v2 2/5] powerpc/perf: Implement a global lock to avoid races between trace, core and thread imc events.

2020-01-21 Thread Anju T Sudhakar
at a time. i.e. to run any core-imc events, thread/trace imc events should not be enabled/monitored. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 177 +++- 1 file changed, 153 insertions(+), 24 deletions(-) diff --git a/arch/powerpc/perf/imc

[PATCH v2 5/5] selftest/powerpc/pmu: Testcase for imc global lock mechanism

2020-01-21 Thread Anju T Sudhakar
From: Madhavan Srinivasan Signed-off-by: Madhavan Srinivasan --- .../pmu/mem_counters/imc_global_lock_test.c | 49 ++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/powerpc/pmu/mem_counters/imc_global_lock_test.c

[PATCH v2 4/5] selftest/powerpc/pmc: Support to include interface test for Memory Counter PMUs

2020-01-21 Thread Anju T Sudhakar
From: Madhavan Srinivasan Patch to add support to include interface tests for memory counter PMUs as part of selftest. These PMUs are primarily used to understand socket/chip/core resourage usage. In PowerNV envirnoment, the perf interface registered to access these counters are called "In

[PATCH v2 1/5] powerpc/powernv: Re-enable imc trace-mode in kernel

2020-01-21 Thread Anju T Sudhakar
enable imc-trace mode in kernel. The following patch in this series will address the mode switching issue by implementing a global lock, and will restrict the usage of accumulation and trace-mode at a time. Signed-off-by: Anju T Sudhakar --- arch/powerpc/platforms/powernv/opal-imc.c | 9 +--

[PATCH v2 0/5] Re-enable IMC trace-mode

2020-01-21 Thread Anju T Sudhakar
m crash). This patch series re-enables IMC trace mode and fixes the mode switching issue by global lock mechanism. Patch 3/5,4/5 and 5/5 provides a selftest to verify the global-lock mechanism. Changes from v1 -> v2: - - Added self test patches to the series. Anju T

[PATCH 2/2] powerpc/perf: Implement a global lock to avoid races between trace, core and thread imc events.

2020-01-20 Thread Anju T Sudhakar
at a time. i.e. to run any core-imc events, thread/trace imc events should not be enabled/monitored. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 177 +++- 1 file changed, 153 insertions(+), 24 deletions(-) diff --git a/arch/powerpc/perf/imc

[PATCH 1/2] powerpc/powernv: Re-enable imc trace-mode in kernel

2020-01-20 Thread Anju T Sudhakar
enable imc-trace mode in kernel. The following patch in this series will address the mode switching issue by implementing a global lock, and will restrict the usage of accumulation and trace-mode at a time. Signed-off-by: Anju T Sudhakar --- arch/powerpc/platforms/powernv/opal-imc.c | 9 +--

[PATCH v3] platforms/powernv: Avoid re-registration of imc debugfs directory

2019-11-26 Thread Anju T Sudhakar
directory registration in the opal_imc_counters_probe() function, i.e invoke export_imc_mode_and_cmd() function from the probe function. Signed-off-by: Anju T Sudhakar --- Changes from v2 -> v3: * Invoke export_imc_mode_and_cmd(), which does the imc debugfs directory registration and deletion, f

[tip: perf/urgent] perf kvm: Move kvm-stat header file from conditional inclusion to common include section

2019-09-20 Thread tip-bot2 for Anju T Sudhakar
The following commit has been merged into the perf/urgent branch of tip: Commit-ID: 8067b3da970baa12e6045400fdf009673b8dd3c2 Gitweb: https://git.kernel.org/tip/8067b3da970baa12e6045400fdf009673b8dd3c2 Author:Anju T Sudhakar AuthorDate:Thu, 18 Jul 2019 23:47:47 +05:30

[tip: perf/urgent] perf kvm: Add arch neutral function to choose event for perf kvm record

2019-09-20 Thread tip-bot2 for Anju T Sudhakar
The following commit has been merged into the perf/urgent branch of tip: Commit-ID: 124eb5f82bf9395419b20205c4dcc1b8fcda7f29 Gitweb: https://git.kernel.org/tip/124eb5f82bf9395419b20205c4dcc1b8fcda7f29 Author:Anju T Sudhakar AuthorDate:Thu, 18 Jul 2019 23:47:48 +05:30

[tip: perf/urgent] perf kvm stat: Set 'trace_cycles' as default event for 'perf kvm record' in powerpc

2019-09-20 Thread tip-bot2 for Anju T Sudhakar
The following commit has been merged into the perf/urgent branch of tip: Commit-ID: 2bff2b828502b5e5d5ea5a52643d3542053df03f Gitweb: https://git.kernel.org/tip/2bff2b828502b5e5d5ea5a52643d3542053df03f Author:Anju T Sudhakar AuthorDate:Thu, 18 Jul 2019 23:47:49 +05:30

[PATCH v2] platform/powernv: Avoid re-registration of imc debugfs directory

2019-09-03 Thread Anju T Sudhakar
'imc' directory, and do not invoke debugfs_create_dir(), if the debugfs interface for imc already exists. This patch is based on: https://lists.ozlabs.org/pipermail/linuxppc-dev/2019-August/195898.html Signed-off-by: Anju T Sudhakar Tested-by: Nageswara R Sastry --- Changes from v1 ->

Re: [PATCH] platform/powernv: Avoid re-registration of imc debugfs directory

2019-08-20 Thread Anju T Sudhakar
Hi, On 8/21/19 10:16 AM, Oliver O'Halloran wrote: On Wed, Aug 21, 2019 at 2:10 PM Anju T Sudhakar wrote: export_imc_mode_and_cmd() function which creates the debugfs interface for imc-mode and imc-command, is invoked when each nest pmu units is registered. When the first nest pmu unit

[PATCH] platform/powernv: Avoid re-registration of imc debugfs directory

2019-08-20 Thread Anju T Sudhakar
' directory, and do not invoke debugfs_create_dir(), if the debugfs interface for imc already exists. This patch is based on: https://lists.ozlabs.org/pipermail/linuxppc-dev/2019-July/192979.html Signed-off-by: Anju T Sudhakar Tested-by: Nageswara R Sastry --- arch/powerpc/platforms/powernv

Re: [RFC PATCH 3/4] powerpc/perf: fix imc allocation failure

2019-07-23 Thread Anju T Sudhakar
On 7/22/19 11:16 PM, Nicholas Piggin wrote: alloc_pages_node return value should be tested before applying page_address. Cc: Anju T Sudhakar Cc: Madhavan Srinivasan Signed-off-by: Nicholas Piggin --- Tested-by: Anju T Sudhakar

Re: [PATCH v2] powerpc/imc: Dont create debugfs files for cpu-less nodes

2019-07-23 Thread Anju T Sudhakar
Hi Qian, On 7/16/19 12:11 AM, Qian Cai wrote: On Thu, 2019-07-11 at 14:53 +1000, Michael Ellerman wrote: Hi Maddy, Madhavan Srinivasan writes: diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c index 186109bdd41b..e04b20625cb9 100644 ---

[PATCH v2 3/3] tools/perf: Set 'trace_cycles' as defaultevent for perf kvm record in powerpc

2019-07-18 Thread Anju T Sudhakar
Use 'trace_imc/trace_cycles' as the default event for 'perf kvm record' in powerpc. Signed-off-by: Anju T Sudhakar --- tools/perf/arch/powerpc/util/kvm-stat.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/perf/arch/powerpc/util/kvm-stat.c b/tools

[PATCH v2 2/3] tools/perf: Add arch neutral function to choose event for perf kvm record

2019-07-18 Thread Anju T Sudhakar
a function to pick an arch specific event for 'perf kvm record', instead of selecting 'cycles' as a default event for all architectures. For powerpc this function checks for any user specified event, and if there isn't any it returns invalid instead of proceeding with 'cycles' event. Signed-off-by: Anju T

[PATCH v2 1/3] tools/perf: Move kvm-stat header file from conditional inclusion to common include section

2019-07-18 Thread Anju T Sudhakar
. Signed-off-by: Anju T Sudhakar --- tools/perf/builtin-kvm.c | 2 +- tools/perf/util/kvm-stat.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index b33c83489120..5d2b34d290a3 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools

Re: power9 NUMA crash while reading debugfs imc_cmd

2019-06-28 Thread Anju T Sudhakar
On 6/28/19 9:04 AM, Qian Cai wrote: On Jun 27, 2019, at 11:12 PM, Michael Ellerman wrote: Qian Cai writes: Read of debugfs imc_cmd file for a memory-less node will trigger a crash below on this power9 machine which has the following NUMA layout. What type of machine is it? description:

[PATCH] powerpc/imc: Dont create debugfs files for cpu-less nodes

2019-06-28 Thread Anju T Sudhakar
fs interface for imc-mode and imc') Reported-by: Qian Cai Signed-off-by: Madhavan Srinivasan Signed-off-by: Anju T Sudhakar --- arch/powerpc/platforms/powernv/opal-imc.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platf

Re: [PATCH v2] powerpc/perf: Use cpumask_last() to determine the designated cpu for nest/core units.

2019-06-11 Thread Anju T Sudhakar
Hi Leonardo, On 6/11/19 12:17 AM, Leonardo Bras wrote: On Mon, 2019-06-10 at 12:02 +0530, Anju T Sudhakar wrote: Nest and core imc(In-memory Collection counters) assigns a particular cpu as the designated target for counter data collection. During system boot, the first online cpu in a chip

[PATCH RESEND 2/2] tools/perf: Set 'trace_cycles' as defaultevent for perf kvm record in powerpc

2019-06-10 Thread Anju T Sudhakar
Use 'trace_imc/trace_cycles' as the default event for 'perf kvm record' in powerpc. Signed-off-by: Anju T Sudhakar --- tools/perf/arch/powerpc/util/kvm-stat.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/perf/arch/powerpc/util/kvm-stat.c b/tools

[PATCH RESEND 1/2] tools/perf: Add arch neutral function to choose event for perf kvm record

2019-06-10 Thread Anju T Sudhakar
a function to pick an arch specific event for 'perf kvm record', instead of selecting 'cycles' as a default event for all architectures. For powerpc this function checks for any user specified event, and if there isn't any it returns invalid instead of proceeding with 'cycles' event. Signed-off-by: Anju T

[PATCH v2] powerpc/perf: Use cpumask_last() to determine the designated cpu for nest/core units.

2019-06-10 Thread Anju T Sudhakar
and migration will happen only when the first_cpu in the mask goes offline. Example: With the patch, Time taken to offline cpu from 175-88: real0m9.330s user0m0.110s sys 0m0.000s Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan --- Changes from v1: Modified

[PATCH 2/2] tools/perf: Set 'trace_cycles' as defaultevent for perf kvm record in powerpc

2019-05-24 Thread Anju T Sudhakar
Use 'trace_imc/trace_cycles' as the default event for 'perf kvm record' in powerpc. Signed-off-by: Anju T Sudhakar --- tools/perf/arch/powerpc/util/kvm-stat.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/perf/arch/powerpc/util/kvm-stat.c b/tools

[PATCH 1/2] tools/perf: Add arch neutral function to choose event for perf kvm record

2019-05-24 Thread Anju T Sudhakar
a function to pick an arch specific event for 'perf kvm record', instead of selecting 'cycles' as a default event for all architectures. For powerpc this function checks for any user specified event, and if there isn't any it returns invalid instead of proceeding with 'cycles' event. Signed-off-by: Anju T

Re: [PATCH] powerpc/powernv: Return for invalid IMC domain

2019-05-22 Thread Anju T Sudhakar
Hi, On 5/21/19 5:18 PM, Michael Ellerman wrote: Anju T Sudhakar writes: Currently init_imc_pmu() can be failed either because an IMC unit with invalid domain(i.e an IMC node not supported by the kernel) is attempted a pmu-registration or something went wrong while registering a valid IMC unit

Re: [PATCH] powerpc/perf: Use cpumask_last() to determine the

2019-05-20 Thread Anju T Sudhakar
Hi, Somehow the subject of this patch didn't appear completely here. The Subject of this patch is as follows, `Subject [PATCH] powerpc/perf: Use cpumask_last() to determine the designated cpu for nest/core units.` Thanks, Anju On 5/20/19 2:35 PM, Anju T Sudhakar wrote: Nest and core imc

[PATCH] powerpc/perf: Use cpumask_last() to determine the

2019-05-20 Thread Anju T Sudhakar
if the last cpu in the mask goes offline. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 31fa753..fbfd6e7 100644 --- a/arch/powerpc/perf/imc

[PATCH] powerpc/powernv: Return for invalid IMC domain

2019-05-20 Thread Anju T Sudhakar
attempting a pmu registration. Fixes: 8f95faaac56c1 (`powerpc/powernv: Detect and create IMC device`) Reported-by: Pavaman Subramaniyam Signed-off-by: Anju T Sudhakar --- arch/powerpc/platforms/powernv/opal-imc.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/platforms

[PATCH] powerpc/imc: Add documentation for IMC and trace-mode

2019-05-10 Thread Anju T Sudhakar
Documentation for IMC(In-Memory Collection Counters) infrastructure and trace-mode of IMC. Signed-off-by: Anju T Sudhakar --- Documentation/powerpc/imc.txt | 195 ++ 1 file changed, 195 insertions(+) create mode 100644 Documentation/powerpc/imc.txt diff --git

Re: [PATCH v4 0/5] powerpc/perf: IMC trace-mode support

2019-04-16 Thread Anju T Sudhakar
On 4/16/19 3:14 PM, Anju T Sudhakar wrote: Hi, Kindly ignore this series, since patch 5/5 in this series doesn't incorporate the event-format change that I've done in v4 of this series. Apologies for the inconvenience. I will post the updated v5 soon. s/v5/v4 Thanks, Anju On 4/15

[PATCH v4 5/5] powerpc/perf: Trace imc PMU functions

2019-04-16 Thread Anju T Sudhakar
Add PMU functions to support trace-imc. Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 205 +++- 1 file changed, 204 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc

[PATCH v4 4/5] powerpc/perf: Trace imc events detection and cpuhotplug

2019-04-16 Thread Anju T Sudhakar
Patch detects trace-imc events, does memory initilizations for each online cpu, and registers cpuhotplug call-backs. Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 104 ++ arch/powerpc/platforms/powernv/opal

[PATCH v4 2/5] powerpc/perf: Rearrange setting of ldbar for thread-imc

2019-04-16 Thread Anju T Sudhakar
to accommodate trace-mode of IMC, reposition setting of ldbar for thread-imc to thread_imc_event_add(). Also reset ldbar at thread_imc_event_del(). Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 28 +--- 1 file changed

[PATCH v4 3/5] powerpc/perf: Add privileged access check for thread_imc

2019-04-16 Thread Anju T Sudhakar
From: Madhavan Srinivasan Add code to restrict user access to thread_imc pmu since some event report privilege level information. Fixes: f74c89bd80fb3 ('powerpc/perf: Add thread IMC PMU support') Signed-off-by: Madhavan Srinivasan Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc

[PATCH v4 1/5] powerpc/include: Add data structures and macros for IMC trace mode

2019-04-16 Thread Anju T Sudhakar
Add the macros needed for IMC (In-Memory Collection Counters) trace-mode and data structure to hold the trace-imc record data. Also, add the new type "OPAL_IMC_COUNTERS_TRACE" in 'opal-api.h', since there is a new switch case added in the opal-calls for IMC. Signed-off-by: Anju

[PATCH v4 0/5] powerpc/perf: IMC trace-mode support

2019-04-16 Thread Anju T Sudhakar
e PMI interrupts count remains the same. Changelog: -- >From v3 -> v4: * trace_imc_refc is introduced. So that even if, core-imc is disabled, trace-imc can be used. * trace_imc_pmu_sched_task is removed and opal start/stop

Re: [PATCH v4 0/5] powerpc/perf: IMC trace-mode support

2019-04-16 Thread Anju T Sudhakar
Hi, Kindly ignore this series, since patch 5/5 in this series doesn't incorporate the event-format change that I've done in v4 of this series. Apologies for the inconvenience. I will post the updated v5 soon. Thanks, Anju On 4/15/19 3:41 PM, Anju T Sudhakar wrote: IMC (In-Memory

[PATCH v4 5/5] powerpc/perf: Trace imc PMU functions

2019-04-15 Thread Anju T Sudhakar
Add PMU functions to support trace-imc. Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 183 1 file changed, 183 insertions(+) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index

[PATCH v4 4/5] powerpc/perf: Trace imc events detection and cpuhotplug

2019-04-15 Thread Anju T Sudhakar
Patch detects trace-imc events, does memory initilizations for each online cpu, and registers cpuhotplug call-backs. Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 104 ++ arch/powerpc/platforms/powernv/opal

[PATCH v4 3/5] powerpc/perf: Add privileged access check for thread_imc

2019-04-15 Thread Anju T Sudhakar
From: Madhavan Srinivasan Add code to restrict user access to thread_imc pmu since some event report privilege level information. Fixes: f74c89bd80fb3 ('powerpc/perf: Add thread IMC PMU support') Signed-off-by: Madhavan Srinivasan Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc

[PATCH v4 2/5] powerpc/perf: Rearrange setting of ldbar for thread-imc

2019-04-15 Thread Anju T Sudhakar
to accommodate trace-mode of IMC, reposition setting of ldbar for thread-imc to thread_imc_event_add(). Also reset ldbar at thread_imc_event_del(). Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 28 +--- 1 file changed

[PATCH v4 1/5] powerpc/include: Add data structures and macros for IMC trace mode

2019-04-15 Thread Anju T Sudhakar
Add the macros needed for IMC (In-Memory Collection Counters) trace-mode and data structure to hold the trace-imc record data. Also, add the new type "OPAL_IMC_COUNTERS_TRACE" in 'opal-api.h', since there is a new switch case added in the opal-calls for IMC. Signed-off-by: Anju

[PATCH v4 0/5] powerpc/perf: IMC trace-mode support

2019-04-15 Thread Anju T Sudhakar
e PMI interrupts count remains the same. Changelog: -- >From v3 -> v4: * trace_imc_refc is introduced. So that even if, core-imc is disabled, trace-imc can be used. * trace_imc_pmu_sched_task is removed and opal start/stop is invoked in trace_imc_event_add/del function. Suggestio

[PATCH v3 5/5] powerpc/perf: Trace imc PMU functions

2019-02-06 Thread Anju T Sudhakar
Add PMU functions to support trace-imc and define the format for trace-imc events. Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 197 +++- 1 file changed, 196 insertions(+), 1 deletion(-) diff --git a/arch

[PATCH v3 4/5] powerpc/perf: Trace imc events detection and cpuhotplug

2019-02-06 Thread Anju T Sudhakar
Patch detects trace-imc events, does memory initilizations for each online cpu, and registers cpuhotplug call-backs. Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 91 +++ arch/powerpc/platforms/powernv/opal

[PATCH v3 3/5] powerpc/perf: Add privileged access check for thread_imc

2019-02-06 Thread Anju T Sudhakar
From: Madhavan Srinivasan Add code to restrict user access to thread_imc pmu since some event report privilege level information. Fixes: f74c89bd80fb3 ('powerpc/perf: Add thread IMC PMU support') Signed-off-by: Madhavan Srinivasan Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc

[PATCH v3 2/5] powerpc/perf: Rearrange setting of ldbar for thread-imc

2019-02-06 Thread Anju T Sudhakar
to accommodate trace-mode of IMC, reposition setting of ldbar for thread-imc to thread_imc_event_add(). Also reset ldbar at thread_imc_event_del(). Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 28 +--- 1 file changed

[PATCH v3 0/5] powerpc/perf: IMC trace-mode support

2019-02-06 Thread Anju T Sudhakar
803803803 1306803 803 Performance monitoring interrupts The PMI interrupts count remains the same. Changelog: >From v2 -> v3 -- * Redefined the event format for tra

[PATCH v3 1/5] powerpc/include: Add data structures and macros for IMC trace mode

2019-02-06 Thread Anju T Sudhakar
Add the macros needed for IMC (In-Memory Collection Counters) trace-mode and data structure to hold the trace-imc record data. Also, add the new type "OPAL_IMC_COUNTERS_TRACE" in 'opal-api.h', since there is a new switch case added in the opal-calls for IMC. Signed-off-by: Anju

[PATCH v2] powerpc/perf: Fix loop exit condition in nest_imc_event_init

2018-12-17 Thread Anju T Sudhakar
: 885dcd709ba91 ( powerpc/perf: Add nest IMC PMU support) Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 2 +- arch/powerpc/platforms/powernv/opal-imc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf

[PATCH v2 2/5] powerpc/perf: Rearrange setting of ldbar for thread-imc

2018-12-14 Thread Anju T Sudhakar
to accommodate trace-mode of IMC, reposition setting of ldbar for thread-imc to thread_imc_event_add(). Also reset ldbar at thread_imc_event_del(). Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 28 +--- 1 file changed, 17 insertions(+), 11 deletions

[PATCH v2 5/5] powerpc/perf: Trace imc PMU functions

2018-12-14 Thread Anju T Sudhakar
Add PMU functions to support trace-imc. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 175 1 file changed, 175 insertions(+) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 1f09265c8fb0..32ff0e449fca 100644

[PATCH v2 3/5] powerpc/perf: Add privileged access check for thread_imc

2018-12-14 Thread Anju T Sudhakar
From: Madhavan Srinivasan Add code to restrict user access to thread_imc pmu since some event report privilege level information. Fixes: f74c89bd80fb3 ('powerpc/perf: Add thread IMC PMU support') Signed-off-by: Madhavan Srinivasan Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc

[PATCH v2 4/5] powerpc/perf: Trace imc events detection and cpuhotplug

2018-12-14 Thread Anju T Sudhakar
Patch detects trace-imc events, does memory initilizations for each online cpu, and registers cpuhotplug call-backs. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 91 +++ arch/powerpc/platforms/powernv/opal-imc.c | 3 + include/linux

[PATCH v2 1/5] powerpc/include: Add data structures and macros for IMC trace mode

2018-12-14 Thread Anju T Sudhakar
Add the macros needed for IMC (In-Memory Collection Counters) trace-mode and data structure to hold the trace-imc record data. Also, add the new type "OPAL_IMC_COUNTERS_TRACE" in 'opal-api.h', since there is a new switch case added in the opal-calls for IMC. Signed-off-by: Anju

[PATCH v2 0/5] powerpc/perf: IMC trace-mode support

2018-12-14 Thread Anju T Sudhakar
803803803 1306803 803 Performance monitoring interrupts The PMI interrupts count remains the same. Changelog: >From v1 -> v2 -- * Added privileged access check for threa

[PATCH 0/4] powerpc/perf: IMC trace-mode support

2018-11-28 Thread Anju T Sudhakar
804804804 804804804804804804803 803803803803803 1306803 803 Performance monitoring interrupts

[PATCH 4/4] powerpc/perf: Trace imc PMU functions

2018-11-28 Thread Anju T Sudhakar
Add PMU functions to support trace-imc. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 172 1 file changed, 172 insertions(+) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index d9ffe7f03f1e..18af7c3e2345 100644

[PATCH 3/4] powerpc/perf: Trace imc events detection and cpuhotplug

2018-11-28 Thread Anju T Sudhakar
Patch detects trace-imc events, does memory initilizations for each online cpu, and registers cpuhotplug call-backs. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 91 +++ arch/powerpc/platforms/powernv/opal-imc.c | 3 + include/linux

[PATCH 1/4] powerpc/include: Add data structures and macros for IMC trace mode

2018-11-28 Thread Anju T Sudhakar
Add the macros needed for IMC (In-Memory Collection Counters) trace-mode and data structure to hold the trace-imc record data. Also, add the new type "OPAL_IMC_COUNTERS_TRACE" in 'opal-api.h', since there is a new switch case added in the opal-calls for IMC. Signed-off-by: Anju

[PATCH 2/4] powerpc/perf: Rearrange setting of ldbar for thread-imc

2018-11-28 Thread Anju T Sudhakar
to accommodate trace-mode of IMC, reposition setting of ldbar for thread-imc to thread_imc_event_add(). Also reset ldbar at thread_imc_event_del(). Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 28 +--- 1 file changed, 17 insertions(+), 11 deletions

[PATCH] powerpc/perf: Return accordingly on invalid chip-id in

2018-11-27 Thread Anju T Sudhakar
: 885dcd709ba91 ("powerpc/perf: Add nest IMC PMU support") Reviewed-by: Madhavan Srinivasan Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 6954636b16d1..78

[PATCH] powerpc/perf: Fix loop exit condition in nest_imc_event_init

2018-11-27 Thread Anju T Sudhakar
-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 78514170cf71..e9dc771f3e3d 100644 --- a/arch/powerpc/perf/imc-pmu.c +++ b/arch/powerpc/perf/imc-pmu.c @@ -459,7

Re: [bug report] powerpc/perf: Add nest IMC PMU support

2018-10-24 Thread Anju T Sudhakar
Hi, On 10/18/18 3:03 PM, Dan Carpenter wrote: Hello Anju T Sudhakar, The patch 885dcd709ba9: "powerpc/perf: Add nest IMC PMU support" from Jul 19, 2017, leads to the following static checker warning: arch/powerpc/perf/imc-pmu.c:506 nest_imc_event_init() warn: 'p

[PATCH v2 4/4] powerpc/perf: Unregister thread-imc if core-imc not supported

2018-05-22 Thread Anju T Sudhakar
Since thread-imc internally use the core-imc hardware infrastructure and is depended on it, having thread-imc in the kernel in the absence of core-imc is trivial. Patch disables thread-imc, if core-imc is not registered. Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> Re

[PATCH v2 3/4] powerpc/perf: Return appropriate value for unknown domain

2018-05-22 Thread Anju T Sudhakar
Return proper error code for unknown domain during IMC initialization. Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> Reviewed-by: Madhavan Srinivasan <ma...@linux.vnet.ibm.com> --- arch/powerpc/perf/imc-pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v2 2/4] powerpc/perf: Replace the direct return with goto statement

2018-05-22 Thread Anju T Sudhakar
Replace the direct return statement in imc_mem_init() with goto, to adhere to the kernel coding style. Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> Reviewed-by: Madhavan Srinivasan <ma...@linux.vnet.ibm.com> --- arch/powerpc/perf/imc-pmu.c | 18 ++ 1

[PATCH v2 1/4] powerpc/perf: Rearrange memory freeing in imc init

2018-05-22 Thread Anju T Sudhakar
to avoid such access. Also free the memory which is dynamically allocated during imc initialization, wherever required. Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> Reviewed-by: Madhavan Srinivasan <ma...@linux.vnet.ibm.com> --- arch/powerpc/perf/imc-pmu.c

[PATCH v2 0/4] powerpc/perf: IMC Cleanups

2018-05-22 Thread Anju T Sudhakar
it/powerpc/linux.git (merge branch) Anju T Sudhakar (4): powerpc/perf: Rearrange memory freeing in imc init powerpc/perf: Replace the direct return with goto statement powerpc/perf: Return appropriate value for unknown domain powerpc/perf: Unregister thread-imc if core-imc not supported ar

[PATCH] powerpc/perf: Remove sched_task function defined for thread-imc

2018-05-18 Thread Anju T Sudhakar
sk to event_[add/del] function Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> --- arch/powerpc/perf/imc-pmu.c | 108 +--- 1 file changed, 51 insertions(+), 57 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-p

Re: [PATCH v2] powerpc/perf: Fix memory allocation for core-imc based on num_possible_cpus()

2018-05-16 Thread Anju T Sudhakar
On Wednesday 16 May 2018 12:18 PM, ppaidipe wrote: On 2018-05-16 12:05, Anju T Sudhakar wrote: Currently memory is allocated for core-imc based on cpu_present_mask, which has bit 'cpu' set iff cpu is populated. We use (cpu number / threads per core) as the array index to access the memory

[PATCH v2] powerpc/perf: Fix memory allocation for core-imc based on num_possible_cpus()

2018-05-16 Thread Anju T Sudhakar
this issue. Reported-by: Pridhiviraj Paidipeddi <ppaid...@linux.vnet.ibm.com> Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> Reviewed-by: Balbir Singh <bsinghar...@gmail.com> --- arch/powerpc/perf/imc-pmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --

Re: [PATCH] powerpc/perf: Fix memory allocation for core-imc based on num_possible_cpus()

2018-05-14 Thread Anju T Sudhakar
On Friday 11 May 2018 07:13 PM, Anju T Sudhakar wrote: Currently memory is allocated for core-imc based on cpu_present_mask, which has bit 'cpu' set iff cpu is populated. We use (cpu number / threads per core) as as array index to access the memory. So in a system with guarded cores, since

Re: [PATCH] powerpc/perf: Fix memory allocation for core-imc based on num_possible_cpus()

2018-05-14 Thread Anju T Sudhakar
Hi, On Saturday 12 May 2018 06:05 AM, Balbir Singh wrote: On Fri, May 11, 2018 at 11:43 PM, Anju T Sudhakar <a...@linux.vnet.ibm.com> wrote: Currently memory is allocated for core-imc based on cpu_present_mask, which has bit 'cpu' set iff cpu is populated. We use (cpu number / threa

[PATCH] powerpc/perf: Fix memory allocation for core-imc based on num_possible_cpus()

2018-05-11 Thread Anju T Sudhakar
. Reported-by: Pridhiviraj Paidipeddi <ppaid...@linux.vnet.ibm.com> Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> --- arch/powerpc/perf/imc-pmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c i

[PATCH 3/4] powerpc/perf: Return appropriate value for unknown domain

2018-04-09 Thread Anju T Sudhakar
Return proper error code for unknown domain during IMC initialization. Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> --- arch/powerpc/perf/imc-pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c

[PATCH 4/4] powerpc/perf: Unregister thread-imc if core-imc not supported

2018-04-09 Thread Anju T Sudhakar
Enable thread-imc in the kernel, only if core-imc is registered. Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> --- arch/powerpc/include/asm/imc-pmu.h| 1 + arch/powerpc/perf/imc-pmu.c | 12 arch/powerpc/platforms/powernv/opal-imc.c | 9 ++

[PATCH 2/4] powerpc/perf: Replace the direct return with goto statement

2018-04-09 Thread Anju T Sudhakar
Replace the direct return statement in imc_mem_init() with goto, to adhere to the kernel coding style. Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> --- arch/powerpc/perf/imc-pmu.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/p

[PATCH 1/4] powerpc/perf: Rearrange memory freeing in imc init

2018-04-09 Thread Anju T Sudhakar
to avoid such access. Also free the memory which is dynamically allocated during imc initialization, wherever required. Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> --- test matrix and static checker run details are updated in the cover letter patch is based on https://git.kernel.o

[PATCH 0/4] powerpc/perf: IMC Cleanups

2018-04-09 Thread Anju T Sudhakar
exec works The first three patches in this series addresses the comments by Dan Carpenter. Anju T Sudhakar (4): powerpc/perf: Rearrange memory freeing in imc init

Re: [PATCH v3] powerpc/kernel/sysfs: Export ldbar spr to sysfs

2018-03-12 Thread Anju T Sudhakar
Hi, On Tuesday 06 March 2018 04:35 PM, Michael Ellerman wrote: Anju T Sudhakar <a...@linux.vnet.ibm.com> writes: diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index 4437c70..caefb64 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c @@

Re: [bug report] powerpc/perf: Add nest IMC PMU support

2018-02-07 Thread Anju T Sudhakar
Hi Dan Carpenter, On Wednesday 31 January 2018 08:55 PM, Dan Carpenter wrote: Hello Anju T Sudhakar, The patch 885dcd709ba9: "powerpc/perf: Add nest IMC PMU support" from Jul 19, 2017, leads to the following static checker warning: arch/powerpc/perf/imc-pmu.c:1393 in

[PATCH v2] platform/powernv: Add debugfs interface for imc-mode and imc-command

2017-12-12 Thread Anju T Sudhakar
n the ima-catalog, that is used to export the imc mode/command, otherwise IMC_CNTL_BLK_OFFSET is used. Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> --- arch/powerpc/include/asm/imc-pmu.h| 7 +++ arch/powerpc/platforms/powernv/opal-imc.c |

[PATCH 2/3] powerpc/perf: IMC code cleanup with some code refactoring

2017-12-10 Thread Anju T Sudhakar
Factor out memory freeing part for attribute elements from imc_common_cpuhp_mem_free(). Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> --- arch/powerpc/perf/imc-pmu.c | 31 --- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/arch/powerp

[PATCH 3/3] powerpc/perf: Passs struct imc_events as a parameter to imc_parse_event()

2017-12-10 Thread Anju T Sudhakar
less memory") Suggested-by: Michael Ellerman <m...@ellerman.id.au> Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> --- arch/powerpc/include/asm/imc-pmu.h | 2 +- arch/powerpc/perf/imc-pmu.c| 66 +++--- 2 files changed, 41 insertions(+),

[PATCH 1/3] powerpc/perf: Remove thread_imc_pmu global variable from

2017-12-10 Thread Anju T Sudhakar
Remove the global variable 'thread_imc_pmu', since it is not used in the code. Signed-off-by: Anju T Sudhakar <a...@linux.vnet.ibm.com> --- arch/powerpc/perf/imc-pmu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 4

[PATCH 0/3] IMC code clean up and refactoring

2017-12-10 Thread Anju T Sudhakar
The first patch removes the unused variable in the code for IMC(In-memory collection counters). The second patch does some code refactoring. The third patch in the series make struct imc_events as a parameter to the function imc_parse_event(). Anju T Sudhakar (3): powerpc/perf: Remove

  1   2   3   >