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
b7009638
Commit
b7009638
authored
Mar 01, 2018
by
yonghong-song
Committed by
GitHub
Mar 01, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1615 from palmtenor/lua_biosnoop
Port fixes of biosnoop from Python to Lua
parents
bfec33a4
1469877b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
tools/biosnoop.lua
tools/biosnoop.lua
+15
-5
No files found.
tools/biosnoop.lua
100644 → 100755
View file @
b7009638
...
@@ -94,11 +94,21 @@ int trace_req_completion(struct pt_regs *ctx, struct request *req)
...
@@ -94,11 +94,21 @@ int trace_req_completion(struct pt_regs *ctx, struct request *req)
req->rq_disk->disk_name);
req->rq_disk->disk_name);
}
}
if (req->cmd_flags & REQ_WRITE) {
/*
data.rwflag=1;
* The following deals with a kernel version change (in mainline 4.7, although
} else {
* it may be backported to earlier kernels) with how block request write flags
data.rwflag=0;
* are tested. We handle both pre- and post-change versions here. Please avoid
}
* kernel version tests like this as much as possible: they inflate the code,
* test, and maintenance burden.
*/
#ifdef REQ_WRITE
data.rwflag = !!(req->cmd_flags & REQ_WRITE);
#elif defined(REQ_OP_SHIFT)
data.rwflag = !!((req->cmd_flags >> REQ_OP_SHIFT) == REQ_OP_WRITE);
#else
data.rwflag = !!((req->cmd_flags & REQ_OP_MASK) == REQ_OP_WRITE);
#endif
events.perf_submit(ctx,&data,sizeof(data));
events.perf_submit(ctx,&data,sizeof(data));
start.delete(&req);
start.delete(&req);
infobyreq.delete(&req);
infobyreq.delete(&req);
...
...
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