[PATCH v10 09/30] tracing: Add events to trace remotes

Steven Rostedt rostedt at goodmis.org
Wed Jan 28 15:06:02 PST 2026


On Mon, 26 Jan 2026 10:43:58 +0000
Vincent Donnefort <vdonnefort at google.com> wrote:

> +
> +static int __cmp_events(const void *id, const void *evt)
> +{
> +	return (long)id - ((struct remote_event *)evt)->id;

Hmm, just to be safe, we should probably make everything int here, to not
have any overflow issues:

static int __cmp_events(const void *key, const void *data)
{
	const struct remote_event *evt = data;
	int id = (int)((long)key);

	return id - (int)evt->id;
}

-- Steve

> +}
> +
> +static struct remote_event *trace_remote_find_event(struct trace_remote *remote, unsigned short id)
> +{
> +	return bsearch((const void *)(unsigned long)id, remote->events, remote->nr_events,
> +		       sizeof(*remote->events), __cmp_events);
> +}




More information about the linux-arm-kernel mailing list