Messages in this thread | | | From | Namhyung Kim <> | Subject | Re: [PATCH 6/7] perf tools: Add name field into perf_hpp_fmt | Date | Mon, 28 Jul 2014 09:35:08 +0900 |
| |
Hi Jiri,
On Fri, 25 Jul 2014 13:12:30 +0200, Jiri Olsa wrote: > On Fri, Jul 25, 2014 at 10:18:57AM +0900, Namhyung Kim wrote: > > SNIP > >> } >> >> -#define __HPP_WIDTH_FN(_type, _str) \ >> +#define __HPP_WIDTH_FN(_type) \ >> static int hpp__width_##_type(struct perf_hpp_fmt *fmt, \ >> struct perf_hpp *hpp __maybe_unused, \ >> struct perf_evsel *evsel) \ >> @@ -219,19 +219,19 @@ static int hpp__width_##_type(struct perf_hpp_fmt *fmt, \ >> if (symbol_conf.event_group) \ >> len = max(len, evsel->nr_members * fmt->len); \ >> \ >> - if (len < (int)strlen(_str)) \ >> - len = strlen(_str); \ >> + if (len < (int)strlen(fmt->name)) \ >> + len = strlen(fmt->name); \ > > hum, so with the '_str' string argument missing we dont need this > function to be generated by macro, right? could be one single function > called hpp__width_entry or something like that
You're right. Will change both!
Thanks, Namhyung
> >> \ >> return len; \ >> } >> >> -#define __HPP_HEADER_FN(_type, _str) \ >> +#define __HPP_HEADER_FN(_type) \ >> static int hpp__header_##_type(struct perf_hpp_fmt *fmt, \ >> struct perf_hpp *hpp, \ >> struct perf_evsel *evsel) \ >> { \ >> int len = hpp__width_##_type(fmt, hpp, evsel); \ >> - return scnprintf(hpp->buf, hpp->size, "%*s", len, _str); \ >> + return scnprintf(hpp->buf, hpp->size, "%*s", len, fmt->name); \ >> } >> > > same here ^^^ for hpp__header_##_type > > > jirka
| |