Re: [PATCH v3] trace-cmd: Remove all die()s from trace-cmd library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 25 Mar 2021 10:39:32 +0200
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote:

> @@ -353,12 +353,12 @@ trace_load_plugins(struct tep_handle *tep, int flags)
>  	return list;
>  }
>  
> -void __noreturn __vdie(const char *fmt, va_list ap)
> +void __vlib_fatal(const char *fmt, va_list ap)
>  {
>  	int ret = errno;
>  
>  	if (errno)
> -		perror("trace-cmd");
> +		perror("libtracecmd");
>  	else
>  		ret = -1;
>  


> -void __weak __noreturn die(const char *fmt, ...)
> +void _lib_fatal(const char *fmt, ...)

Looks good, but I wonder if we should make these functions hidden, or at
least rename them to: tracecmd_lib_fatal(), and also make them weak, to
allow applications to override them (display pop ups, like KernelShark can
do).

-- Steve


>  {
>  	va_list ap;
>  
>  	va_start(ap, fmt);
> -	__vdie(fmt, ap);
> +	__vlib_fatal(fmt, ap);
>  	va_end(ap);
>  }
>  



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux