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
16f201ff
Commit
16f201ff
authored
Oct 27, 2017
by
yonghong-song
Committed by
GitHub
Oct 27, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1384 from pchaigno/fix-mdflush-linux-4.14
mdflush: fix for Linux 4.14
parents
6e45749b
3ffc80eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
tools/mdflush.py
tools/mdflush.py
+12
-1
No files found.
tools/mdflush.py
View file @
16f201ff
...
...
@@ -36,8 +36,19 @@ int kprobe__md_flush_request(struct pt_regs *ctx, void *mddev, struct bio *bio)
u32 pid = bpf_get_current_pid_tgid();
data.pid = pid;
bpf_get_current_comm(&data.comm, sizeof(data.comm));
/*
* The following deals with a kernel version change (in mainline 4.14, although
* it may be backported to earlier kernels) with how the disk name is accessed.
* 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 bio_dev
bpf_probe_read(&data.disk, sizeof(data.disk), bio->bi_disk->disk_name);
#else
bpf_probe_read(&data.disk, sizeof(data.disk),
bio->bi_bdev->bd_disk->disk_name);
bio->bi_bdev->bd_disk->disk_name);
#endif
events.perf_submit(ctx, &data, sizeof(data));
return 0;
}
...
...
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