Page MenuHomeFreeBSD

libpmcstat: Extract parts of pmcstat_image_get_elf_params
AcceptedPublic

Authored by jrtc27 on Apr 17 2023, 7:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 11 2024, 7:45 PM
Unknown Object (File)
Mar 28 2024, 1:00 AM
Unknown Object (File)
Feb 10 2024, 5:44 PM
Unknown Object (File)
Dec 23 2023, 1:43 AM
Unknown Object (File)
Dec 13 2023, 4:05 AM
Unknown Object (File)
Dec 8 2023, 12:50 PM
Unknown Object (File)
Nov 30 2023, 7:07 AM
Unknown Object (File)
Nov 29 2023, 5:41 PM
Subscribers

Details

Summary

These parts of the function will also be needed when parsing separate
debug files, so extract them to new internal functions that can be
reused when doing so in a future commit.

As part of this, fix up all the warning messages to use the right path
when fd refers to FSROOT/boot/modules/NAME; previously it always used
the FSROOT/KERNELPATH/NAME string which could get confusing. Also fix a
style issue for the done label.

MFC after: 1 month

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 50976
Build 47867: arc lint + arc unit

Event Timeline

Initialise minva/maxva in the right place

jhb added inline comments.
lib/libpmcstat/libpmcstat_image.c
427

Why are we not exporting the full path for kernel modules? The kernel linker stores the full path of the module (and has for many years now). We should probably fix that (and since you are bumping the major version of PMC maybe go ahead and fix that as part of this series?)

This revision is now accepted and ready to land.Apr 18 2023, 5:40 PM
lib/libpmcstat/libpmcstat_image.c
427

Can that be relied upon, or is pathname sometimes still not full? Otherwise looks straightforward, just two places to switch I believe.

lib/libpmcstat/libpmcstat_image.c
427

kgdb has relied upon it for over a decade I think (maybe 15 years?)

16 years actually: https://github.com/freebsd/freebsd-src/commit/1676805c186f5dea36d331a982480d7d9693b126

hwpmc just predates this change I think and was never updated to catch up