Re: [PATCH V8 01/10] powerpc, perf: Drop the branch sample when 'from' cannot be fetched

2015-06-10 Thread Anshuman Khandual
On 06/10/2015 08:51 AM, Daniel Axtens wrote:
 Hi Anshuman,
 
 Was there a cover letter for this series that I missed?

This is the continuation (rebased and reworked) of the series
posted at https://lkml.org/lkml/2014/5/5/153 (which is V6). I
remember to have incremented the count for the re-send of the
first four patches of the series to Peter Z for generic review
which got pulled in last year. These patches here are the
remaining powerpc part of the original series. Will list down
the current changes as well next time around along with the new
ones.

 
 On Mon, 2015-06-08 at 17:08 +0530, Anshuman Khandual wrote:
 BHRB is a rolling buffer. Hence we might end up in a situation where
 Could you spell out what BHRB stands for?

Branch History Rolling Buffer, would you like to have that in the
commit message as well ?

 
 we have read one target address but when we try to read the next entry
  indicating the from address of the targe, the buffer just overflows.
 target?

Yeah its target address.

 
 In this case, the captured from address will be zero which indicates
 the end of the buffer.

 In what sort of situations would this occur? It seems like something we
 would want to avoid if possible?

Its not avoidable. During regular flow of branch recording, the HW would
have written both the records correctly but then the new ones came in and
we just happen to loose one of them causing this situation.

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V8 01/10] powerpc, perf: Drop the branch sample when 'from' cannot be fetched

2015-06-10 Thread Daniel Axtens
Hi,

On Wed, 2015-06-10 at 17:32 +0530, Anshuman Khandual wrote:
 On 06/10/2015 08:51 AM, Daniel Axtens wrote:
  Hi Anshuman,
  
  Was there a cover letter for this series that I missed?
 
 This is the continuation (rebased and reworked) of the series
 posted at https://lkml.org/lkml/2014/5/5/153 (which is V6). I
 remember to have incremented the count for the re-send of the
 first four patches of the series to Peter Z for generic review
 which got pulled in last year. These patches here are the
 remaining powerpc part of the original series. Will list down
 the current changes as well next time around along with the new
 ones.
 
  
  On Mon, 2015-06-08 at 17:08 +0530, Anshuman Khandual wrote:
  BHRB is a rolling buffer. Hence we might end up in a situation where
  Could you spell out what BHRB stands for?
 
 Branch History Rolling Buffer, would you like to have that in the
 commit message as well ?
Yes please.
 
  
  we have read one target address but when we try to read the next entry
   indicating the from address of the targe, the buffer just overflows.
  target?
 
 Yeah its target address.
Ok, I was just trying to point out the spelling mistake above.
 
  
  In this case, the captured from address will be zero which indicates
  the end of the buffer.
 
  In what sort of situations would this occur? It seems like something we
  would want to avoid if possible?
 
 Its not avoidable. During regular flow of branch recording, the HW would
 have written both the records correctly but then the new ones came in and
 we just happen to loose one of them causing this situation.
OK.

Regards,
Daniel


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V8 01/10] powerpc, perf: Drop the branch sample when 'from' cannot be fetched

2015-06-09 Thread Daniel Axtens
Hi Anshuman,

Was there a cover letter for this series that I missed?

On Mon, 2015-06-08 at 17:08 +0530, Anshuman Khandual wrote:
 BHRB is a rolling buffer. Hence we might end up in a situation where
Could you spell out what BHRB stands for?

 we have read one target address but when we try to read the next entry
  indicating the from address of the targe, the buffer just overflows.
target?

 In this case, the captured from address will be zero which indicates
 the end of the buffer.
 
In what sort of situations would this occur? It seems like something we
would want to avoid if possible?

 This patch drops the entire branch record which would have otherwise
 confused the user space tools.
 
 Signed-off-by: Anshuman Khandual khand...@linux.vnet.ibm.com
 ---
  arch/powerpc/perf/core-book3s.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
 index 12b6384..c246e65 100644
 --- a/arch/powerpc/perf/core-book3s.c
 +++ b/arch/powerpc/perf/core-book3s.c
 @@ -452,7 +452,6 @@ static void power_pmu_bhrb_read(struct cpu_hw_events 
 *cpuhw)
*In this case we need to read the instruction from
*memory to determine the target/to address.
*/
 -
   if (val  BHRB_TARGET) {
   /* Target branches use two entries
* (ie. computed gotos/XL form)
 @@ -463,6 +462,8 @@ static void power_pmu_bhrb_read(struct cpu_hw_events 
 *cpuhw)
  
   /* Get from address in next entry */
   val = read_bhrb(r_index++);
 + if (!val)
 + break;
   addr = val  BHRB_EA;
   if (val  BHRB_TARGET) {
   /* Shouldn't have two targets in a



signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH V8 01/10] powerpc, perf: Drop the branch sample when 'from' cannot be fetched

2015-06-08 Thread Anshuman Khandual
BHRB is a rolling buffer. Hence we might end up in a situation where
we have read one target address but when we try to read the next entry
indicating the from address of the targe, the buffer just overflows.
In this case, the captured from address will be zero which indicates
the end of the buffer.

This patch drops the entire branch record which would have otherwise
confused the user space tools.

Signed-off-by: Anshuman Khandual khand...@linux.vnet.ibm.com
---
 arch/powerpc/perf/core-book3s.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 12b6384..c246e65 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -452,7 +452,6 @@ static void power_pmu_bhrb_read(struct cpu_hw_events *cpuhw)
 *In this case we need to read the instruction from
 *memory to determine the target/to address.
 */
-
if (val  BHRB_TARGET) {
/* Target branches use two entries
 * (ie. computed gotos/XL form)
@@ -463,6 +462,8 @@ static void power_pmu_bhrb_read(struct cpu_hw_events *cpuhw)
 
/* Get from address in next entry */
val = read_bhrb(r_index++);
+   if (!val)
+   break;
addr = val  BHRB_EA;
if (val  BHRB_TARGET) {
/* Shouldn't have two targets in a
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev