lkml.org 
[lkml]   [2014]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 6/7] perf tools: Add name field into perf_hpp_fmt
    Date
    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


    \
     
     \ /
      Last update: 2014-07-28 03:21    [W:2.875 / U:0.900 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site