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)
Wed, Nov 20, 8:17 PM
Unknown Object (File)
Sun, Nov 17, 7:18 PM
Unknown Object (File)
Wed, Nov 13, 11:45 AM
Unknown Object (File)
Wed, Nov 13, 12:04 AM
Unknown Object (File)
Thu, Nov 7, 7:51 PM
Unknown Object (File)
Sep 30 2024, 3:35 PM
Unknown Object (File)
Sep 30 2024, 12:27 AM
Unknown Object (File)
Sep 29 2024, 11:02 AM
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