Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367555

Summary: Perf: use regex to parse events
Product: [Tools] Linux Tools Reporter: Wainer dos Santos Moschetta <wainersm>
Component: perfAssignee: Daniel Henrique Barboza <danielhb>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: obusatto
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch to fix the problem obusatto: iplog+

Description Wainer dos Santos Moschetta CLA 2011-12-26 12:22:03 EST
Build Identifier: 

Events parser used to rely on line length of 'perf list' output. However, length might change between perf versions, 45 or 53.

Relying on line length is error prone. I'm going to attach a patch which changes way it parses events: using regex instead.

The patch was tested on:

SLES 11 SP1 (perf version 0.0.2.PERF)
Ubuntu 10.04.3 (perf version 0.0.2.PERF)
RHEL 6.2 (perf version 2.6.32-220.el6.ppc64.debug)

It would be nice someone testing on newer kernels (e.g. on Fedora 16)

Reproducible: Always
Comment 1 Wainer dos Santos Moschetta CLA 2011-12-26 12:23:12 EST
Created attachment 208804 [details]
Patch to fix the problem
Comment 2 Daniel Henrique Barboza CLA 2011-12-26 13:13:59 EST
Patch looks ok to me.
Comment 3 Otavio Pontes CLA 2011-12-27 06:43:29 EST
Resolved in commit 63afc3c97a7df4ebf67662145f7b9b6d4af68038