lkml.org 
[lkml]   [2014]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/6] perf tools: Left-align output contents
    Date
    Now perf left-aligns column headers but the contents does not.  It
    should have same alignment.

    Signed-off-by: Namhyung Kim <namhyung@kernel.org>
    ---
    tools/perf/util/sort.c | 6 +++---
    1 file changed, 3 insertions(+), 3 deletions(-)

    diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
    index 14e5a039bc45..9a531743c8c2 100644
    --- a/tools/perf/util/sort.c
    +++ b/tools/perf/util/sort.c
    @@ -70,7 +70,7 @@ static int hist_entry__thread_snprintf(struct hist_entry *he, char *bf,
    size_t size, unsigned int width)
    {
    const char *comm = thread__comm_str(he->thread);
    - return repsep_snprintf(bf, size, "%*s:%5d", width - 6,
    + return repsep_snprintf(bf, size, "%-*s:%5d", width - 6,
    comm ?: "", he->thread->tid);
    }

    @@ -106,7 +106,7 @@ sort__comm_sort(struct hist_entry *left, struct hist_entry *right)
    static int hist_entry__comm_snprintf(struct hist_entry *he, char *bf,
    size_t size, unsigned int width)
    {
    - return repsep_snprintf(bf, size, "%*s", width, comm__str(he->comm));
    + return repsep_snprintf(bf, size, "%-*s", width, comm__str(he->comm));
    }

    struct sort_entry sort_comm = {
    @@ -305,7 +305,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry *he, char *bf,
    size_t size,
    unsigned int width __maybe_unused)
    {
    - return repsep_snprintf(bf, size, "%s", he->srcline);
    + return repsep_snprintf(bf, size, "%-s", he->srcline);
    }

    struct sort_entry sort_srcline = {
    --
    2.0.0


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