Re: [PATCH 1/3] tracing: Remove dependency of saved_cmdlines_buffer on PID_MAX_DEFAULT

2024-05-13 Thread Michal Koutný
On Tue, Apr 09, 2024 at 11:01:26AM GMT, Steven Rostedt wrote: > > - tpid = pid & (PID_MAX_DEFAULT - 1); > > + tpid = pid % PID_MAP_SIZE; > > Does that compile to the same? This is a fast path. I didn't check. If fast is the intetion, I would change it to something like

Re: [PATCH 1/3] tracing: Remove dependency of saved_cmdlines_buffer on PID_MAX_DEFAULT

2024-04-09 Thread Steven Rostedt
On Mon, 8 Apr 2024 16:58:17 +0200 Michal Koutný wrote: > @@ -294,7 +295,7 @@ static void __trace_find_cmdline(int pid, char comm[]) > return; > } > > - tpid = pid & (PID_MAX_DEFAULT - 1); > + tpid = pid % PID_MAP_SIZE; Does that compile to the same? This is a fast

[PATCH 1/3] tracing: Remove dependency of saved_cmdlines_buffer on PID_MAX_DEFAULT

2024-04-08 Thread Michal Koutný
Calculations into map_pid_to_cmdline use PID_MAX_DEFAULT but they actually depend on the size of map_pid_to_cmdline. The size of the map may be arbitrary. First, refer to the map size where necessary, second, pick a good value for the size of the map. Since the buffer is allocated at boot (i.e.