Re: [PATCH v8 4/7] perf symbols: Check the file before reading lazy symbol names
From: Alireza Haghdoost
Date: Mon Nov 23 2026 - 17:02:50 EST
Hi Namhyung,
On Sun, Nov 22, 2026 at 4:43 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> I think it's extremely rare that the symbol file is being modified while
> perf is running.
Agreed, and I think this patch is too much code for such a rare case.
> Is ctime really needed? I think dev/inode will catch new file creation
> and mtime is for in-place modifications.
ctime only matters when a file is overwritten in place with its mtime
kept, as with `cp -p`. But I'd rather drop the whole check than tune
it, so I suggest this for v9:
- Drop this patch and its tests.
- Document that --lazy-load-symbols gives the same names as eager
loading as long as the files are not changed while perf runs.
- Keep showing "[unknown]" when the file cannot be opened or read.
I measured v8 with and without the check on seven workloads. The time
and memory were the same within noise, since the check only adds one
fstat() per lookup. So dropping it makes the series about 190 lines
smaller (plus about 390 lines of tests) and saves nothing.
Thanks,
Alireza