Skip to content

Commit

Permalink
Merge pull request iovisor#889 from totally/preprocess_4.10
Browse files Browse the repository at this point in the history
Fixes bio{snoop,top} on 4.10
  • Loading branch information
4ast committed Jan 9, 2017
2 parents e14519e + bc43a29 commit a043d5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 4 additions & 6 deletions tools/biosnoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,12 @@
* test, and maintenance burden.
*/
#ifdef REQ_WRITE
if (req->cmd_flags & 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
if ((req->cmd_flags >> REQ_OP_SHIFT) == REQ_OP_WRITE) {
data.rwflag = !!((req->cmd_flags & REQ_OP_MASK) == REQ_OP_WRITE);
#endif
data.rwflag = 1;
} else {
data.rwflag = 0;
}
events.perf_submit(ctx, &data, sizeof(data));
start.delete(&req);
Expand Down
4 changes: 3 additions & 1 deletion tools/biotop.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ def signal_ignore(signal, frame):
*/
#ifdef REQ_WRITE
info.rwflag = !!(req->cmd_flags & REQ_WRITE);
#else
#elif defined(REQ_OP_SHIFT)
info.rwflag = !!((req->cmd_flags >> REQ_OP_SHIFT) == REQ_OP_WRITE);
#else
info.rwflag = !!((req->cmd_flags & REQ_OP_MASK) == REQ_OP_WRITE);
#endif
whop = whobyreq.lookup(&req);
Expand Down

0 comments on commit a043d5c

Please sign in to comment.