This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [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 :)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]