tools/RadosDump.cc
tools/rados/RadosImport.cc
tools/rados/PoolDump.cc
+ common/util.cc
common/obj_bencher.cc)
add_executable(rados ${rados_srcs})
target_link_libraries(rados librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} libradosstriper)
}
f->close_section();
}
+
+// Convert non-printable characters to '\###'
+void cleanbin(string &str)
+{
+ bool cleaned = false;
+ string clean;
+
+ for (string::iterator it = str.begin(); it != str.end(); ++it) {
+ if (!isprint(*it)) {
+ clean.push_back('\\');
+ clean.push_back('0' + ((*it >> 6) & 7));
+ clean.push_back('0' + ((*it >> 3) & 7));
+ clean.push_back('0' + (*it & 7));
+ cleaned = true;
+ } else {
+ clean.push_back(*it);
+ }
+ }
+
+ if (cleaned)
+ str = clean;
+ return;
+}
/// @param type the service type of given @p services, for example @p osd or @p mon.
void dump_services(Formatter* f, const map<string, list<int> >& services, const char* type);
+void cleanbin(string &str);
#endif /* CEPH_UTIL_H */
#include "rebuild_mondb.h"
#include "ceph_objectstore_tool.h"
#include "include/compat.h"
+#include "include/util.h"
namespace po = boost::program_options;
using namespace std;
super_header sh;
uint64_t testalign;
-// Convert non-printable characters to '\###'
-static void cleanbin(string &str)
-{
- bool cleaned = false;
- string clean;
-
- for (string::iterator it = str.begin(); it != str.end(); ++it) {
- if (!isprint(*it)) {
- clean.push_back('\\');
- clean.push_back('0' + ((*it >> 6) & 7));
- clean.push_back('0' + ((*it >> 3) & 7));
- clean.push_back('0' + (*it & 7));
- cleaned = true;
- } else {
- clean.push_back(*it);
- }
- }
-
- if (cleaned)
- str = clean;
- return;
-}
-
static int get_fd_data(int fd, bufferlist &bl)
{
uint64_t total = 0;