-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(block I/O): Implement Block I/O tracing #197
Conversation
TODO: Currently the size of the read/writes is in sectors. Multiply by 512 byte (unform sector size Linux uses in the generic block layer) to get the real size of the read/writes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the class now called perf::bio::Writer
is a misnomer. It doesn't write events, it caches them. The class called Matcher
is the actual writer here.
man/lo2s.1.pod
Outdated
|
||
=item B<--block-io> | ||
|
||
Record block I/O events. These are based on the block:block_rq_insert for begin events and block:block_rq_complete for end events specifically. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Record block I/O events. These are based on the block:block_rq_insert for begin events and block:block_rq_complete for end events specifically. | |
Record block I/O events using the block:block_rq_insert tracepoint for begin events and block:block_rq_complete tracepoint for end events. |
src/config.cpp
Outdated
@@ -120,6 +120,7 @@ void parse_program_options(int argc, const char** argv) | |||
auto& kernel_tracepoint_options = parser.group("Kernel tracepoint options"); | |||
auto& x86_adapt_options = parser.group("x86_adapt options"); | |||
auto& x86_energy_options = parser.group("x86_energy options"); | |||
auto& io_options = parser.group("I/O tracing options"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto& io_options = parser.group("I/O tracing options"); | |
auto& io_options = parser.group("I/O recording options"); |
src/monitor/main_monitor.cpp
Outdated
matcher_ = std::make_unique<perf::bio::Matcher>(trace_); | ||
for (const auto& cpu : Topology::instance().cpus()) | ||
{ | ||
bio_monitors_.emplace_back(std::make_unique<BioMonitor>(trace_, Cpu(cpu.id), matcher_)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since C++17, emplace_back returns a reference
, I'd rather use that to start()
src/perf/bio/writer.cpp
Outdated
events_.push_back(BioEvent(makedev(record->dev >> 20, record->dev & ((1U << 20) - 1)), | ||
record->sector, sample->time, type_, mode, record->nr_sector)); | ||
|
||
if (events_.size() == 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this compare to config.block_cache_size
instead?
06e97df
to
a271d55
Compare
include/lo2s/monitor/bio_monitor.hpp
Outdated
|
||
std::string group() const override | ||
{ | ||
return "bio::BioMonitor"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return "bio::BioMonitor"; | |
return "lo2s::BioMonitor"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or does it add lo2s::
somewhere else?
In any case, I think the bio is redundant, isn't it?
#include <map> | ||
#include <vector> | ||
|
||
extern "C" namespace lo2s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extern "C" namespace lo2s | |
namespace lo2s |
Why?
Use Nonblocking instead of blocking becaue it is more accurate to block I/O. |
The generated trace isn't perfect yet. In particular, the system tree is a bit borked.
|
|
Yes. |
Always write system tree node, locations, location_groups for disks, add partitions to location_group. This information can be retrieved from /sys/dev/block/*/uevent, by using DISKSEQ and DEVTYPE |
Nvm. I did it for you. |
b696ce5
to
31f3464
Compare
- introduce --block-io and --block-cache-size options - write insert, issue and complete as non blocking events - uses - write insert, issue and complete as a non blocking event - based on block:block_rq_insert block:block_rq_issue and block:block_rq_complete tracepoints
31f3464
to
f07ef8b
Compare
Introduces the --block-io switch to record block I/O events
The implementation is discussed in detail in #196
This closes #196