Skip to contentSkip to conversation

perf dso: Fix symtab_type for kmod compression

PATCH Applied [email protected] 3 participants 4 messages Oct 10, 2024 – Oct 17, 2024 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf dso: Fix symtab_type for kmod compression

From: Veronika Molnarova <[email protected]>

During the rework of the dso structure in patch ee756ef7491eafd an increment was forgotten for the symtab_type in case the data for the kernel module are compressed. This affects the probing of the kernel modules, which fails if the data are not already cached.

Increment the value of the symtab_type to its compressed variant so the data could be recovered successfully.

Fixes ee756ef7491eafd7 ("perf dso: Add reference count checking and accessor functions")
---
 tools/perf/util/machine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/machine.c +1 -1
index fad227b625d155c5..4f0ac998b0ccfd7a 100644
@@ -1343,7 +1343,7 @@ static int maps__set_module_path(struct maps *maps, const char *path, struct kmo
 	 * we need to update the symtab_type if needed.
 	 */
 	if (m->comp && is_kmod_dso(dso)) {
-		dso__set_symtab_type(dso, dso__symtab_type(dso));
+		dso__set_symtab_type(dso, dso__symtab_type(dso)+1);
 		dso__set_comp(dso, m->comp);
 	}
 	map__put(map);
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Thu, Oct 10, 2024 at 04:48:36PM +0200, [email protected] wrote:

From: Veronika Molnarova <[email protected]>

During the rework of the dso structure in patch ee756ef7491eafd an increment was forgotten for the symtab_type in case the data for the kernel module are compressed. This affects the probing of the kernel modules, which fails if the data are not already cached.

It's easy to miss something buried in a mass conversion. :(

Quoted 6 lines

Increment the value of the symtab_type to its compressed variant so the data could be recovered successfully.

Fixes ee756ef7491eafd7 ("perf dso: Add reference count checking and accessor functions")

Thanks,
Namhyung

Quoted 20 lines
---
 tools/perf/util/machine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/machine.c +1 -1
index fad227b625d155c5..4f0ac998b0ccfd7a 100644
@@ -1343,7 +1343,7 @@ static int maps__set_module_path(struct maps *maps, const char *path, struct kmo
 	 * we need to update the symtab_type if needed.
 	 */
 	if (m->comp && is_kmod_dso(dso)) {
-		dso__set_symtab_type(dso, dso__symtab_type(dso));
+		dso__set_symtab_type(dso, dso__symtab_type(dso)+1);
 		dso__set_comp(dso, m->comp);
 	}
 	map__put(map);
Signature · 1 line
2.43.0
Acked-by Tested-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 7 lines · On Thu, 10 Oct 2024, [email protected] wrote:

From: Veronika Molnarova <[email protected]>

During the rework of the dso structure in patch ee756ef7491eafd an increment was forgotten for the symtab_type in case the data for the kernel module are compressed. This affects the probing of the kernel modules, which fails if the data are not already cached.

Quoted 5 lines

Increment the value of the symtab_type to its compressed variant so the data could be recovered successfully.

Fixes ee756ef7491eafd7 ("perf dso: Add reference count checking and accessor functions")
Quoted 21 lines
---
 tools/perf/util/machine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/machine.c +1 -1
index fad227b625d155c5..4f0ac998b0ccfd7a 100644
@@ -1343,7 +1343,7 @@ static int maps__set_module_path(struct maps *maps, const char *path, struct kmo
 	 * we need to update the symtab_type if needed.
 	 */
 	if (m->comp && is_kmod_dso(dso)) {
-		dso__set_symtab_type(dso, dso__symtab_type(dso));
+		dso__set_symtab_type(dso, dso__symtab_type(dso)+1);
 		dso__set_comp(dso, m->comp);
 	}
 	map__put(map);
Signature · 1 line
2.43.0
maintainer Applied
#3 lore raw
In reply to [email protected]
Quoted 9 lines · On Thu, 10 Oct 2024 16:48:36 +0200, [email protected] wrote:

During the rework of the dso structure in patch ee756ef7491eafd an increment was forgotten for the symtab_type in case the data for the kernel module are compressed. This affects the probing of the kernel modules, which fails if the data are not already cached.

Increment the value of the symtab_type to its compressed variant so the data could be recovered successfully.

[...]

Applied to perf-tools-next, thanks!

Best regards,
Namhyung