Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
8600ffcb
Commit
8600ffcb
authored
Jun 27, 2017
by
Vicent Marti
Committed by
Brenden Blanco
Jun 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proc: Enhance bcc_mapping_is_file_backed
Cleanup the `strncmp` code and add a few more ignored map names
parent
e0d99edf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
src/cc/bcc_proc.c
src/cc/bcc_proc.c
+11
-7
No files found.
src/cc/bcc_proc.c
View file @
8600ffcb
...
...
@@ -61,14 +61,18 @@ char *bcc_procutils_which(const char *binpath) {
return
0
;
}
#define STARTS_WITH(mapname, prefix) (!strncmp(mapname, prefix, sizeof(prefix)-1))
int
bcc_mapping_is_file_backed
(
const
char
*
mapname
)
{
return
mapname
[
0
]
&&
strncmp
(
mapname
,
"//anon"
,
sizeof
(
"//anon"
)
-
1
)
&&
strncmp
(
mapname
,
"/dev/zero"
,
sizeof
(
"/dev/zero"
)
-
1
)
&&
strncmp
(
mapname
,
"/anon_hugepage"
,
sizeof
(
"/anon_hugepage"
)
-
1
)
&&
strncmp
(
mapname
,
"[stack"
,
sizeof
(
"[stack"
)
-
1
)
&&
strncmp
(
mapname
,
"/SYSV"
,
sizeof
(
"/SYSV"
)
-
1
)
&&
strncmp
(
mapname
,
"[heap]"
,
sizeof
(
"[heap]"
)
-
1
);
return
mapname
[
0
]
&&
!
(
STARTS_WITH
(
mapname
,
"//anon"
)
||
STARTS_WITH
(
mapname
,
"/dev/zero"
)
||
STARTS_WITH
(
mapname
,
"/anon_hugepage"
)
||
STARTS_WITH
(
mapname
,
"[stack"
)
||
STARTS_WITH
(
mapname
,
"/SYSV"
)
||
STARTS_WITH
(
mapname
,
"[heap]"
)
||
STARTS_WITH
(
mapname
,
"[vsyscall]"
)
||
STARTS_WITH
(
mapname
,
"[vdso]"
));
}
int
bcc_procutils_each_module
(
int
pid
,
bcc_procutils_modulecb
callback
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment