Re: [PATCH 2/2] libtracefs: Have tracefs_cpu_stop() always suggesting nudging

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

 



On Thu,  5 Jan 2023 16:52:52 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>
> 
> The man page of tracefs_cpu_stop() states that if it returns 0 that it
> guaranteed to wake up a reader. Well, that doesn't appear to always be the
> case. Return 1 until we can figure it out.
> 

Hmm, I got my application working again without this change.

I'll hold off from applying it. Perhaps it was the application fault and
not the library.

-- Steve

> Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
> ---
>  src/tracefs-record.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/src/tracefs-record.c b/src/tracefs-record.c
> index f998883134b8..9baec6780974 100644
> --- a/src/tracefs-record.c
> +++ b/src/tracefs-record.c
> @@ -429,15 +429,11 @@ int tracefs_cpu_stop(struct tracefs_cpu *tcpu)
>  		return ret;
>  
>  	/* Calling ioctl() on recent kernels will wake up the waiters */
> -	ret = ioctl(tcpu->fd, 0);
> -	if (ret < 0)
> -		ret = 1;
> -	else
> -		ret = 0;
> +	ioctl(tcpu->fd, 0);
>  
>  	set_nonblock(tcpu);
>  
> -	return ret;
> +	return 1;
>  }
>  
>  /**




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

  Powered by Linux