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
c1cb9a37
Commit
c1cb9a37
authored
Jun 21, 2016
by
4ast
Committed by
GitHub
Jun 21, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #576 from markdrayton/perf-pid-map-fixes
Fix nits for /tmp/perf-pid.map support
parents
6862875c
db724e2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
src/cc/bcc_perf_map.c
src/cc/bcc_perf_map.c
+4
-3
No files found.
src/cc/bcc_perf_map.c
View file @
c1cb9a37
...
@@ -33,12 +33,13 @@ int bcc_perf_map_nspid(int pid) {
...
@@ -33,12 +33,13 @@ int bcc_perf_map_nspid(int pid) {
// return the original PID if the NSpid line is missing
// return the original PID if the NSpid line is missing
int
nspid
=
pid
;
int
nspid
=
pid
;
size_t
size
;
size_t
size
=
0
;
char
*
line
=
NULL
;
char
*
line
=
NULL
;
while
(
getline
(
&
line
,
&
size
,
status
)
!=
-
1
)
while
(
getline
(
&
line
,
&
size
,
status
)
!=
-
1
)
{
if
(
strstr
(
line
,
"NSpid:"
)
!=
NULL
)
if
(
strstr
(
line
,
"NSpid:"
)
!=
NULL
)
// PID namespaces can be nested -- last number is innermost PID
// PID namespaces can be nested -- last number is innermost PID
nspid
=
(
int
)
strtol
(
strrchr
(
line
,
'\t'
),
NULL
,
10
);
nspid
=
(
int
)
strtol
(
strrchr
(
line
,
'\t'
),
NULL
,
10
);
}
free
(
line
);
free
(
line
);
return
nspid
;
return
nspid
;
...
@@ -70,7 +71,7 @@ int bcc_perf_map_foreach_sym(const char *path, bcc_perf_map_symcb callback,
...
@@ -70,7 +71,7 @@ int bcc_perf_map_foreach_sym(const char *path, bcc_perf_map_symcb callback,
return
-
1
;
return
-
1
;
char
*
line
=
NULL
;
char
*
line
=
NULL
;
size_t
size
;
size_t
size
=
0
;
long
long
begin
,
len
;
long
long
begin
,
len
;
while
(
getline
(
&
line
,
&
size
,
file
)
!=
-
1
)
{
while
(
getline
(
&
line
,
&
size
,
file
)
!=
-
1
)
{
char
*
cursor
=
line
;
char
*
cursor
=
line
;
...
...
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