Skip to content

Commit

Permalink
Merge pull request ceph#7142 from xiexingguo/xxg-wip-crush
Browse files Browse the repository at this point in the history
crushtool: improve usage/tip messages

Reviewed-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Jan 18, 2016
2 parents 7621a69 + e063edd commit f0475a3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 33 deletions.
31 changes: 16 additions & 15 deletions src/test/cli/crushtool/help.t
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
[--outfn|-o outfile]
specify output for for (de)compilation
--compile|-c map.txt compile a map from source
--enable-unsafe-tunables compile with unsafe tunables
--enable-unsafe-tunables
compile with unsafe tunables
--build --num_osds N layer1 ...
build a new map, where each 'layer' is
'name (uniform|straw|list|tree) size'
'name (uniform|straw|list|tree) size'

Options for the tunables adjustments stage

Expand Down Expand Up @@ -75,7 +76,7 @@
number generator in place of the CRUSH
algorithm
--show-utilization show OSD usage
--show utilization-all
--show-utilization-all
include zero weight items
--show-statistics show chi squared statistics
--show-mappings show mappings
Expand All @@ -92,23 +93,23 @@
Options for the output stage

[--outfn|-o outfile]
specify output for for modified crush map
specify output for modified crush map

$ crushtool --help-output
data output from testing routine ...
absolute_weights
the decimal weight of each OSD
data layout: ROW MAJOR
OSD id (int), weight (int)
absolute_weights
the decimal weight of each OSD
data layout: ROW MAJOR
OSD id (int), weight (int)
batch_device_expected_utilization_all
the expected number of objects each OSD should receive per placement batch
which may be a decimal value
data layout: COLUMN MAJOR
round (int), objects expected on OSD 0...OSD n (float)
the expected number of objects each OSD should receive per placement batch
which may be a decimal value
data layout: COLUMN MAJOR
round (int), objects expected on OSD 0...OSD n (float)
batch_device_utilization_all
the number of objects stored on each OSD during each placement round
data layout: COLUMN MAJOR
round (int), objects stored on OSD 0...OSD n (int)
the number of objects stored on each OSD during each placement round
data layout: COLUMN MAJOR
round (int), objects stored on OSD 0...OSD n (int)
device_utilization_all
the number of objects stored on each OSD at the end of placements
data_layout: ROW MAJOR
Expand Down
38 changes: 20 additions & 18 deletions src/tools/crushtool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ static int get_fd_data(int fd, bufferlist &bl)
void data_analysis_usage()
{
cout << "data output from testing routine ...\n";
cout << " absolute_weights\n";
cout << " the decimal weight of each OSD\n";
cout << " data layout: ROW MAJOR\n";
cout << " OSD id (int), weight (int)\n";
cout << " absolute_weights\n";
cout << " the decimal weight of each OSD\n";
cout << " data layout: ROW MAJOR\n";
cout << " OSD id (int), weight (int)\n";
cout << " batch_device_expected_utilization_all\n";
cout << " the expected number of objects each OSD should receive per placement batch\n";
cout << " which may be a decimal value\n";
cout << " data layout: COLUMN MAJOR\n";
cout << " round (int), objects expected on OSD 0...OSD n (float)\n";
cout << " the expected number of objects each OSD should receive per placement batch\n";
cout << " which may be a decimal value\n";
cout << " data layout: COLUMN MAJOR\n";
cout << " round (int), objects expected on OSD 0...OSD n (float)\n";
cout << " batch_device_utilization_all\n";
cout << " the number of objects stored on each OSD during each placement round\n";
cout << " data layout: COLUMN MAJOR\n";
cout << " round (int), objects stored on OSD 0...OSD n (int)\n";
cout << " the number of objects stored on each OSD during each placement round\n";
cout << " data layout: COLUMN MAJOR\n";
cout << " round (int), objects stored on OSD 0...OSD n (int)\n";
cout << " device_utilization_all\n";
cout << " the number of objects stored on each OSD at the end of placements\n";
cout << " data_layout: ROW MAJOR\n";
Expand Down Expand Up @@ -128,10 +128,11 @@ void usage()
cout << " [--outfn|-o outfile]\n";
cout << " specify output for for (de)compilation\n";
cout << " --compile|-c map.txt compile a map from source\n";
cout << " --enable-unsafe-tunables compile with unsafe tunables\n";
cout << " --enable-unsafe-tunables\n";
cout << " compile with unsafe tunables\n";
cout << " --build --num_osds N layer1 ...\n";
cout << " build a new map, where each 'layer' is\n";
cout << " 'name (uniform|straw|list|tree) size'\n";
cout << " 'name (uniform|straw|list|tree) size'\n";
cout << "\n";
cout << "Options for the tunables adjustments stage\n";
cout << "\n";
Expand Down Expand Up @@ -181,7 +182,7 @@ void usage()
cout << " number generator in place of the CRUSH\n";
cout << " algorithm\n";
cout << " --show-utilization show OSD usage\n";
cout << " --show utilization-all\n";
cout << " --show-utilization-all\n";
cout << " include zero weight items\n";
cout << " --show-statistics show chi squared statistics\n";
cout << " --show-mappings show mappings\n";
Expand All @@ -198,7 +199,7 @@ void usage()
cout << "Options for the output stage\n";
cout << "\n";
cout << " [--outfn|-o outfile]\n";
cout << " specify output for for modified crush map\n";
cout << " specify output for modified crush map\n";
cout << "\n";
}

Expand Down Expand Up @@ -643,7 +644,7 @@ int main(int argc, const char **argv)
break;
}
if (buckettype < 0) {
cerr << "unknown bucket type '" << l.buckettype << "'" << std::endl << std::endl;
cerr << "unknown bucket type '" << l.buckettype << "'" << std::endl;
exit(EXIT_FAILURE);
}

Expand Down Expand Up @@ -678,8 +679,9 @@ int main(int argc, const char **argv)
int id;
int r = crush.add_bucket(0, buckettype, CRUSH_HASH_DEFAULT, type, j, items, weights, &id);
if (r < 0) {
dout(2) << "Couldn't add bucket: " << cpp_strerror(r) << dendl;
}
cerr << " Couldn't add bucket: " << cpp_strerror(r) << std::endl;
return r;
}

char format[20];
format[sizeof(format)-1] = '\0';
Expand Down

0 comments on commit f0475a3

Please sign in to comment.