lkml.org 
[lkml]   [2009]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH tracing/kprobes v4] perf: Add perf probe subcommand for kprobe-event setup helper
On Thu, Oct 08, 2009 at 05:17:38PM -0400, Masami Hiramatsu wrote:
> +static void semantic_error(const char *msg)
> +{
> + fprintf(stderr, "Semantic error: %s\n", msg);
> + exit(1);
> +}
> +
> +static void perror_exit(const char *msg)
> +{
> + perror(msg);
> + exit(1);
> +}



We have that already btw:

tools/perf/util/util.h:
extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));


> +static void msg_exit(int ret, const char *fmt, ...)
> +{
> + va_list ap;
> +
> + va_start(ap, fmt);
> + fprintf(stderr, "Error: ");
> + vfprintf(stderr, fmt, ap);
> + va_end(ap);
> +
> + fprintf(stderr, "\n");
> + exit(ret);
> +}


And somehow ditto :)



\
 
 \ /
  Last update: 2009-10-12 20:11    [W:0.291 / U:0.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site