Messages in this thread | | | From | Namhyung Kim <> | Date | Fri, 25 Jul 2014 00:46:25 +0900 | Subject | Re: [PATCH 3/6] perf tools: Save column length in perf_hpp_fmt |
| |
On Thu, Jul 24, 2014 at 9:10 PM, Jiri Olsa <jolsa@redhat.com> wrote: > On Wed, Jul 09, 2014 at 02:28:11PM +0900, Namhyung Kim wrote: >> Save column length in the hpp format and pass it to print functions. >> This is a preparation for users to control column width in the output. > > SNIP > >> + >> +void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists) >> +{ >> + int idx; >> + >> + if (perf_hpp__is_sort_entry(fmt)) >> + return perf_hpp__reset_sort_width(fmt, hists); >> + >> + for (idx = 0; idx < PERF_HPP__MAX_INDEX; idx++) { >> + if (fmt == &perf_hpp__format[idx]) >> + break; >> + } >> + >> + if (idx == PERF_HPP__MAX_INDEX) >> + return; >> + >> + switch (idx) { >> + case PERF_HPP__OVERHEAD: >> + case PERF_HPP__OVERHEAD_SYS: >> + case PERF_HPP__OVERHEAD_US: >> + case PERF_HPP__OVERHEAD_ACC: >> + fmt->len = 8; >> + break; >> + >> + case PERF_HPP__OVERHEAD_GUEST_SYS: >> + case PERF_HPP__OVERHEAD_GUEST_US: >> + fmt->len = 9; >> + break; > > just curious.. why is it 9 for guest %, while we use 8 for host? > I understand that was the current state
It's the strlen of header - "guest sys". :)
Thanks, Namhyung
| |