mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 18:20:26 -05:00
libpmcstat: fix pmcstat -G on older-ish -CURRENT w/ drm-kmod
The linuxkpi_gplv2.ko module on older-ish -CURRENT had absolutely no .text contents, but it was still loaded. Instead of hitting the later assertion because 0 is not less than 0, we can just skip images like this as we should not have any samples from them. Reviewed by: gallatin (cherry picked from commit 77721403c91d67dbfd5a2c5c667e7f5d87acb3f6)
This commit is contained in:
parent
8dc42b80fd
commit
e5a4712e65
1 changed files with 8 additions and 0 deletions
|
|
@ -194,6 +194,14 @@ pmcstat_image_link(struct pmcstat_process *pp, struct pmcstat_image *image,
|
|||
assert(image->pi_type != PMCSTAT_IMAGE_UNKNOWN &&
|
||||
image->pi_type != PMCSTAT_IMAGE_INDETERMINABLE);
|
||||
|
||||
/*
|
||||
* It's possible to have images with nothing of value in .text
|
||||
* legitimately. We shouldn't have any samples from this image, so
|
||||
* don't bother with a map entry either.
|
||||
*/
|
||||
if (image->pi_start == 0 && image->pi_end == 0)
|
||||
return;
|
||||
|
||||
if ((pcmnew = malloc(sizeof(*pcmnew))) == NULL)
|
||||
err(EX_OSERR, "ERROR: Cannot create a map entry");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue