Skip to content

Commit

Permalink
perf tools: Remove trail argument to color vsprintf
Browse files Browse the repository at this point in the history
Seems like it's always '\n' through color_fprintf_ln, which is not used
at all, removing.. ;-)

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1438649408-20807-2-git-send-email-andi@firstfloor.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Jiri Olsa authored and Arnaldo Carvalho de Melo committed Aug 5, 2015
1 parent c3a6a8c commit 8011de7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
16 changes: 2 additions & 14 deletions tools/perf/util/color.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static int __color_vsnprintf(char *bf, size_t size, const char *color,
}

static int __color_vfprintf(FILE *fp, const char *color, const char *fmt,
va_list args, const char *trail)
va_list args)
{
int r = 0;

Expand All @@ -87,8 +87,6 @@ static int __color_vfprintf(FILE *fp, const char *color, const char *fmt,
r += vfprintf(fp, fmt, args);
if (perf_use_color_default && *color)
r += fprintf(fp, "%s", PERF_COLOR_RESET);
if (trail)
r += fprintf(fp, "%s", trail);
return r;
}

Expand All @@ -100,7 +98,7 @@ int color_vsnprintf(char *bf, size_t size, const char *color,

int color_vfprintf(FILE *fp, const char *color, const char *fmt, va_list args)
{
return __color_vfprintf(fp, color, fmt, args, NULL);
return __color_vfprintf(fp, color, fmt, args);
}

int color_snprintf(char *bf, size_t size, const char *color,
Expand All @@ -126,16 +124,6 @@ int color_fprintf(FILE *fp, const char *color, const char *fmt, ...)
return r;
}

int color_fprintf_ln(FILE *fp, const char *color, const char *fmt, ...)
{
va_list args;
int r;
va_start(args, fmt);
r = __color_vfprintf(fp, color, fmt, args, "\n");
va_end(args);
return r;
}

/*
* This function splits the buffer by newlines and colors the lines individually.
*
Expand Down
1 change: 0 additions & 1 deletion tools/perf/util/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ int color_vsnprintf(char *bf, size_t size, const char *color,
int color_vfprintf(FILE *fp, const char *color, const char *fmt, va_list args);
int color_fprintf(FILE *fp, const char *color, const char *fmt, ...);
int color_snprintf(char *bf, size_t size, const char *color, const char *fmt, ...);
int color_fprintf_ln(FILE *fp, const char *color, const char *fmt, ...);
int color_fwrite_lines(FILE *fp, const char *color, size_t count, const char *buf);
int value_color_snprintf(char *bf, size_t size, const char *fmt, double value);
int percent_color_snprintf(char *bf, size_t size, const char *fmt, ...);
Expand Down

0 comments on commit 8011de7

Please sign in to comment.