Add a rule to map image names in the trace to image names in the replay cluster.
A rule of image1@snap1=image2@snap2 would map snap1 of image1 to snap2 of image2.
+.. option:: --dump-perf-counters
+
+ **Experimental**
+ Dump performance counters to standard out before an image is closed.
+ Performance counters may be dumped multiple times if multiple images are closed,
+ or if the same image is opened and closed multiple times.
+ Performance counters and their meaning may change between versions.
+
Examples
========
.\" Man page generated from reStructuredText.
.
-.TH "RBD-REPLAY" "8" "August 07, 2014" "dev" "Ceph"
+.TH "RBD-REPLAY" "8" "September 10, 2014" "dev" "Ceph"
.SH NAME
rbd-replay \- replay rados block device (RBD) workloads
.
Add a rule to map image names in the trace to image names in the replay cluster.
A rule of image1@snap1=image2@snap2 would map snap1 of image1 to snap2 of image2.
.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-dump\-perf\-counters
+\fBExperimental\fP
+Dump performance counters to standard out before an image is closed.
+Performance counters may be dumped multiple times if multiple images are closed,
+or if the same image is opened and closed multiple times.
+Performance counters and their meaning may change between versions.
+.UNINDENT
.SH EXAMPLES
.sp
To replay workload1 as fast as possible:
the Ceph documentation at \fI\%http://ceph.com/docs\fP for more information.
.SH SEE ALSO
.sp
-\fBceph\fP(8),
+\fBrbd\-replay\-prep\fP(8),
\fBrbd\fP(8)
.SH COPYRIGHT
2010-2014, Inktank Storage, Inc. and contributors. Licensed under Creative Commons BY-SA
void Replayer::erase_image(imagectx_id_t imagectx_id) {
boost::unique_lock<boost::shared_mutex> lock(m_images_mutex);
- delete m_images[imagectx_id];
+ librbd::Image* image = m_images[imagectx_id];
+ if (m_dump_perf_counters) {
+ string command = "perf dump";
+ cmdmap_t cmdmap;
+ string format = "json-pretty";
+ bufferlist out;
+ g_ceph_context->do_command(command, cmdmap, format, &out);
+ out.write_stream(cout);
+ cout << std::endl;
+ cout.flush();
+ }
+ delete image;
m_images.erase(imagectx_id);
}
void Replayer::clear_images() {
boost::unique_lock<boost::shared_mutex> lock(m_images_mutex);
+ if (m_dump_perf_counters && !m_images.empty()) {
+ string command = "perf dump";
+ cmdmap_t cmdmap;
+ string format = "json-pretty";
+ bufferlist out;
+ g_ceph_context->do_command(command, cmdmap, format, &out);
+ out.write_stream(cout);
+ cout << std::endl;
+ cout.flush();
+ }
pair<imagectx_id_t, librbd::Image*> p;
BOOST_FOREACH(p, m_images) {
delete p.second;
m_image_name_map = map;
}
+ void set_dump_perf_counters(bool dump_perf_counters) {
+ m_dump_perf_counters = dump_perf_counters;
+ }
+
const ImageNameMap &image_name_map() const {
return m_image_name_map;
}
float m_latency_multiplier;
bool m_readonly;
ImageNameMap m_image_name_map;
+ bool m_dump_perf_counters;
std::map<imagectx_id_t, librbd::Image*> m_images;
boost::shared_mutex m_images_mutex;
cout << " --read-only Only perform non-destructive operations." << std::endl;
cout << " --map-image <rule> Add a rule to map image names in the trace to" << std::endl;
cout << " image names in the replay cluster." << std::endl;
+ cout << " --dump-perf-counters *Experimental*" << std::endl;
+ cout << " Dump performance counters to standard out before" << std::endl;
+ cout << " an image is closed. Performance counters may be dumped" << std::endl;
+ cout << " multiple times if multiple images are closed, or if" << std::endl;
+ cout << " the same image is opened and closed multiple times." << std::endl;
+ cout << " Performance counters and their meaning may change between" << std::endl;
+ cout << " versions." << std::endl;
cout << std::endl;
cout << "Image mapping rules:" << std::endl;
cout << "A rule of image1@snap1=image2@snap2 would map snap1 of image1 to snap2 of" << std::endl;
ImageNameMap image_name_map;
std::string val;
std::ostringstream err;
+ bool dump_perf_counters = false;
for (i = args.begin(); i != args.end(); ) {
if (ceph_argparse_double_dash(args, i)) {
break;
} else if (ceph_argparse_flag(args, i, "-h", "--help", (char*)NULL)) {
usage(argv[0]);
return 0;
+ } else if (ceph_argparse_flag(args, i, "--dump-perf-counters", (char*)NULL)) {
+ dump_perf_counters = true;
} else if (get_remainder(*i, "-")) {
cerr << "Unrecognized argument: " << *i << std::endl;
return 1;
replayer.set_pool_name(pool_name);
replayer.set_readonly(readonly);
replayer.set_image_name_map(image_name_map);
+ replayer.set_dump_perf_counters(dump_perf_counters);
replayer.run(replay_file);
}