Skip to content

Commit b84cd47

Browse files
author
Fox Snowpatch
committed
1 parent 182544a commit b84cd47

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tools/perf/util/dso.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <stdbool.h>
1010
#include <stdio.h>
1111
#include <linux/bitops.h>
12+
#include <string.h>
1213
#include "build-id.h"
1314
#include "debuginfo.h"
1415
#include "mutex.h"
@@ -20,6 +21,7 @@ struct perf_env;
2021

2122
#define DSO__NAME_KALLSYMS "[kernel.kallsyms]"
2223
#define DSO__NAME_KCORE "[kernel.kcore]"
24+
#define DSO__NAME_GUEST_KALLSYMS "[guest.kernel.kallsyms"
2325

2426
/**
2527
* enum dso_binary_type - The kind of DSO generally associated with a memory
@@ -915,6 +917,14 @@ static inline bool dso__is_kallsyms(const struct dso *dso)
915917
{
916918
enum dso_binary_type bt = dso__binary_type(dso);
917919

920+
if (bt == DSO_BINARY_TYPE__NOT_FOUND) {
921+
return RC_CHK_ACCESS(dso)->kernel &&
922+
((strncmp(RC_CHK_ACCESS(dso)->long_name, DSO__NAME_KALLSYMS,
923+
strlen(DSO__NAME_KALLSYMS)) == 0) ||
924+
(strncmp(RC_CHK_ACCESS(dso)->long_name, DSO__NAME_GUEST_KALLSYMS,
925+
strlen(DSO__NAME_GUEST_KALLSYMS)) == 0));
926+
}
927+
918928
return bt == DSO_BINARY_TYPE__KALLSYMS || bt == DSO_BINARY_TYPE__GUEST_KALLSYMS;
919929
}
920930

0 commit comments

Comments
 (0)