Re: [PATCH v2] trace-cmd: libtracecmd: Rename private functions to fix static building

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

 



On Tue, 19 Nov 2024 15:33:00 +0000
Metin Kaya <metin.kaya@xxxxxxx> wrote:

> diff --git a/tracecmd/trace-agent.c b/tracecmd/trace-agent.c
> index b6b44f58..6b8e40f4 100644
> --- a/tracecmd/trace-agent.c
> +++ b/tracecmd/trace-agent.c
> @@ -32,11 +32,11 @@ static void make_vsocks(int nr, int *fds, unsigned int *ports)
>  	int i, fd, ret;
>  
>  	for (i = 0; i < nr; i++) {
> -		fd = trace_vsock_make_any();
> +		fd = tcmd_vsock_make_any();
>  		if (fd < 0)
>  			die("Failed to open vsocket");
>  
> -		ret = trace_vsock_get_port(fd, &port);
> +		ret = tcmd_vsock_get_port(fd, &port);
>  		if (ret < 0)
>  			die("Failed to get vsocket address");
>  
> @@ -199,8 +199,8 @@ static void agent_handle(int sd, int nr_cpus, int page_size,
>  	if (ret < 0)
>  		die("Failed to receive trace request");
>  

> -	tsync_proto = tracecmd_tsync_get_proto(tsync_protos, get_clock(argc, argv),
> -					       tsync_role);
> +	tsync_proto = tcmd_tsync_get_proto(tsync_protos, get_clock(argc, argv),
> +					   tsync_role);

I'm fine with this change in general, except for converting any function
name that starts with "tracecmd_" that is in the tracecmd/ directory. Yes
it's marked as hidden, but these are functions that are not quite ready to
become API, but are planned to.

I used this as a general notation. If it starts with "tracecmd_" and marked
as __hidden, it means that it is still a WIP API. If it is marked with
"trace_" it is just a direct hook between trace-cmd and the libraries.

Care to send a v3?

Thanks,

-- Steve


>  
>  	if (use_fifos && open_agent_fifos(nr_cpus, fds))
>  		use_fifos = false;
> @@ -223,9 +223,9 @@ static void agent_handle(int sd, int nr_cpus, int page_size,
>  				remote_id = -1;
>  				local_id = -2;
>  			}
> -			fd = trace_vsock_make_any();
> +			fd = tcmd_vsock_make_any();
>  			if (fd >= 0 &&
> -			    trace_vsock_get_port(fd, &tsync_port) < 0) {
> +			    tcmd_vsock_get_port(fd, &tsync_port) < 0) {
>  				close(fd);
>  				fd = -1;
>  			}
> @@ -327,13 +327,13 @@ static void agent_serve(unsigned int port, bool do_daemon, int proxy_id,
>  		if (listen(sd, 5) < 0)
>  			die("Failed to listen on %d\n", port);
>  	} else
> -		sd = trace_vsock_make(port);
> +		sd = tcmd_vsock_make(port);
>  	if (sd < 0)
>  		die("Failed to open socket");
>  	tracecmd_tsync_init();
>  
>  	if (!network) {
> -		cid = trace_vsock_local_cid();
> +		cid = tcmd_vsock_local_cid();
>  		if (cid >= 0)
>  			printf("listening on @%u:%u\n", cid, port);
>  	}




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

  Powered by Linux