diff options
| author | Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com> | 2026-02-16 22:27:07 +0500 |
|---|---|---|
| committer | Gabriele Monaco <gmonaco@redhat.com> | 2026-02-20 13:12:00 +0100 |
| commit | 75f3cf0d1561b0a1cfa97ee35d78ca0118e584d5 (patch) | |
| tree | 5ee5bba40a6d73b56b826df9841b61c65d2ae06d /rust/kernel | |
| parent | 403faa575738a7f92267b2ca2ee56cd1b9373078 (diff) | |
rv: Fix multiple definition of __pcpu_unique_da_mon_this
The refactoring in commit 30984ccf31b7 ("rv: Refactor da_monitor to
minimise macros") replaced per-monitor unique variable names
(da_mon_##name) with a fixed name (da_mon_this).
While this works for 'static' variables (each translation unit gets its
own copy), DEFINE_PER_CPU internally generates a non-static dummy
variable __pcpu_unique_<n> for each per-cpu definition. The requirement
for this variable to be unique although static exists for modules on
specific architectures (alpha) and if the kernel is built with
CONFIG_DEBUG_FORCE_WEAK_PER_CPU (e.g. Fedora's debug kernel).
When multiple per-cpu monitors (e.g. sco and sts) are built-in
simultaneously, they all produce the same __pcpu_unique_da_mon_this
symbol, causing a link error:
ld: kernel/trace/rv/monitors/sts/sts.o: multiple definition of
`__pcpu_unique_da_mon_this';
kernel/trace/rv/monitors/sco/sco.o: first defined here
Fix this by introducing a DA_MON_NAME macro that expands to a
per-monitor unique name (da_mon_<MONITOR_NAME>) via the existing
CONCATENATE helper. This restores the uniqueness that was present
before the refactoring.
Fixes: 30984ccf31b7 ("rv: Refactor da_monitor to minimise macros")
Reviewed-by: Gabriele Monaco <gmonaco@redhat.com>
Signed-off-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Link: https://lore.kernel.org/r/20260216172707.1441516-1-mikhail.v.gavrilov@gmail.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
Diffstat (limited to 'rust/kernel')
0 files changed, 0 insertions, 0 deletions
