Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nrm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
argo
nrm
Commits
345bf774
Commit
345bf774
authored
Dec 19, 2017
by
Kamil Iskra
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'perf-integration' of xgitlab.cels.anl.gov:argo/nrm into perf-integration
parents
41a91901
94bd7a1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
bin/argo-perf-wrapper
bin/argo-perf-wrapper
+5
-3
No files found.
bin/argo-perf-wrapper
View file @
345bf774
...
...
@@ -12,6 +12,7 @@ import uuid
logger
=
logging
.
getLogger
(
'perf-wrapper'
)
class
PerfWrapper
(
object
):
"""Implements middleware between the Linux perf and
...
...
@@ -89,7 +90,7 @@ class PerfWrapper(object):
tmpdir
=
tempfile
.
mkdtemp
()
fifoname
=
os
.
path
.
join
(
tmpdir
,
'perf-fifo'
)
logger
.
info
(
"fifoname: %r"
,
fifoname
)
os
.
mkfifo
(
fifoname
,
0600
)
os
.
mkfifo
(
fifoname
,
0
o
600
)
argv
=
[
'perf'
,
'stat'
,
'-e'
,
'instructions'
,
'-x'
,
','
,
'-I'
,
str
(
args
.
frequency
),
'-o'
,
fifoname
,
'--'
]
...
...
@@ -107,11 +108,11 @@ class PerfWrapper(object):
# "for line in fifo" idiom didn't work for me here -- Python was
# buffering the output internally until perf was finished.
while
True
:
line
=
fifo
.
readline
()
;
line
=
fifo
.
readline
()
if
not
line
:
break
line
=
line
.
strip
()
;
line
=
line
.
strip
()
if
len
(
line
)
==
0
or
line
[
0
]
==
'#'
:
continue
tokens
=
line
.
split
(
','
)
...
...
@@ -138,6 +139,7 @@ class PerfWrapper(object):
os
.
remove
(
fifoname
)
os
.
rmdir
(
tmpdir
)
if
__name__
==
"__main__"
:
logging
.
basicConfig
(
level
=
logging
.
WARNING
)
wrapper
=
PerfWrapper
()
...
...
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