Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1618193
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v1 1/5] perf/core: Define the common branch type classification |
| Date | 2017-04-06 19:00 +0200 |
| Message-ID | <ttiVk-3pQ-21@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <tsxtn-5Xs-9@gated-at.bofh.it> <tt9yG-52M-25@gated-at.bofh.it> <ttaXL-63S-5@gated-at.bofh.it> <ttbTQ-6GC-29@gated-at.bofh.it> <ttgTw-1Cx-27@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Apr 06, 2017 at 10:43:19PM +0800, Jin, Yao wrote: > > > On 4/6/2017 5:25 PM, Peter Zijlstra wrote: > > On Thu, Apr 06, 2017 at 04:21:06PM +0800, Jin, Yao wrote: > > > Hi, otherwise we have to maintain 2 branch type copies between kernel and > > > user-space. > > > > > > For example, currently X86_BR_* are defined in lbr.c. To display the branch > > > type in user-space, the user-space has to maintain the same copy for > > > X86_BR_*. I didn't get a better idea. > > I still don't understand what you want; or why it would matter. > > > > Those specific macros are for hardware LBR filter emulation/fixup. What > > does that have to do with any userspace crud? > > I just want to provide a new feature that the user can directly check branch > type > in perf report, instead of looking it up in the binary. Binary could be not > available > later, so it's possible that userspace can't get the branch type. > > The X86_BR are generated when disassembling the branch instruction in > kernel. > They can be considered as the x86 branch types. > > It's easy to let kernel return the x86 branch types to userspace, and then > userspace > shows the branch type in perf report. > > While kernel and userspace have to maintain the X86_BR definitions. One copy > is in > kernel and the other copy is in userspace. To avoid the duplicate > definitions , I define > the common branch type in perf_event.h to share between kernel and > userspace. > That's why I do that. Argh, fix your mailer. That is unreadable. /me reflows... > I just want to provide a new feature that the user can directly check > branch type in perf report, instead of looking it up in the binary. > Binary could be not available later, so it's possible that userspace > can't get the branch type. > > The X86_BR are generated when disassembling the branch instruction in > kernel. They can be considered as the x86 branch types. > > It's easy to let kernel return the x86 branch types to userspace, and > then userspace shows the branch type in perf report. > > While kernel and userspace have to maintain the X86_BR definitions. > One copy is in kernel and the other copy is in userspace. To avoid the > duplicate definitions , I define the common branch type in > perf_event.h to share between kernel and userspace. That's why I do > that. See, that's so much better.. Oh, so you _ARE_ adding a kernel feature? I understood you only wanted to change perf-report. WTH didn't you Cc the maintainers? Also, if you do this, you need to Cc the PowerPC people, since they too implement PERF_SAMPLE_BRANCH_ bits.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v1 0/5] perf report: Show branch type Jin Yao <yao.jin@linux.intel.com> - 2017-03-31 09:30 +0200
[PATCH v1 1/5] perf/core: Define the common branch type classification Jin Yao <yao.jin@linux.intel.com> - 2017-03-31 09:30 +0200
Re: [PATCH v1 1/5] perf/core: Define the common branch type classification Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-04 16:20 +0200
Re: [PATCH v1 1/5] perf/core: Define the common branch type classification "Jin, Yao" <yao.jin@linux.intel.com> - 2017-04-04 18:00 +0200
Re: [PATCH v1 1/5] perf/core: Define the common branch type classification Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-04 18:20 +0200
Re: [PATCH v1 1/5] perf/core: Define the common branch type classification "Jin, Yao" <yao.jin@linux.intel.com> - 2017-04-06 02:10 +0200
Re: [PATCH v1 1/5] perf/core: Define the common branch type classification Peter Zijlstra <peterz@infradead.org> - 2017-04-06 09:00 +0200
Re: [PATCH v1 1/5] perf/core: Define the common branch type classification "Jin, Yao" <yao.jin@linux.intel.com> - 2017-04-06 10:30 +0200
Re: [PATCH v1 1/5] perf/core: Define the common branch type classification Peter Zijlstra <peterz@infradead.org> - 2017-04-06 11:30 +0200
Re: [PATCH v1 1/5] perf/core: Define the common branch type classification "Jin, Yao" <yao.jin@linux.intel.com> - 2017-04-06 16:50 +0200
Re: [PATCH v1 1/5] perf/core: Define the common branch type classification Peter Zijlstra <peterz@infradead.org> - 2017-04-06 19:00 +0200
Re: [PATCH v1 1/5] perf/core: Define the common branch type classification "Jin, Yao" <yao.jin@linux.intel.com> - 2017-04-07 04:20 +0200
[PATCH v1 5/5] perf report: Show branch type in callchain entry Jin Yao <yao.jin@linux.intel.com> - 2017-03-31 09:30 +0200
[PATCH v1 4/5] perf report: Show branch type statistics for stdio mode Jin Yao <yao.jin@linux.intel.com> - 2017-03-31 09:30 +0200
[PATCH v1 3/5] perf record: Create a new option save_type in --branch-filter Jin Yao <yao.jin@linux.intel.com> - 2017-03-31 09:30 +0200
csiph-web