Skip to content

Commit b90683d

Browse files
committed
crimson/admin/osd_admin: add logs when calling hooks
Signed-off-by: Matan Breizman <[email protected]>
1 parent 566a915 commit b90683d

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

src/crimson/admin/osd_admin.cc

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ class OsdStatusHook : public AdminSocketHook {
5858
std::string_view format,
5959
ceph::bufferlist&& input) const final
6060
{
61+
LOG_PREFIX(AdminSocketHook::OsdStatusHook);
62+
DEBUG("");
6163
unique_ptr<Formatter> f{Formatter::create(format, "json-pretty", "json-pretty")};
6264
f->open_object_section("status");
6365
osd.dump_status(f.get());
@@ -85,6 +87,8 @@ class SendBeaconHook : public AdminSocketHook {
8587
std::string_view format,
8688
ceph::bufferlist&& input) const final
8789
{
90+
LOG_PREFIX(AdminSocketHook::SendBeaconHook);
91+
DEBUG("");
8892
return osd.send_beacon().then([] {
8993
return seastar::make_ready_future<tell_result_t>();
9094
});
@@ -118,7 +122,8 @@ class RunOSDBenchHook : public AdminSocketHook {
118122
std::string_view format,
119123
ceph::bufferlist&& input) const final
120124
{
121-
LOG_PREFIX(RunOSDBenchHook::call);
125+
LOG_PREFIX(AdminSocketHook::RunOSDBenchHook::call);
126+
DEBUG("");
122127
int64_t count = cmd_getval_or<int64_t>(cmdmap, "count", 1LL << 30);
123128
int64_t bsize = cmd_getval_or<int64_t>(cmdmap, "size", 4LL << 20);
124129
int64_t osize = cmd_getval_or<int64_t>(cmdmap, "object_size", 0);
@@ -209,6 +214,8 @@ class FlushPgStatsHook : public AdminSocketHook {
209214
std::string_view format,
210215
ceph::bufferlist&& input) const final
211216
{
217+
LOG_PREFIX(AdminSocketHook::FlushPgStatsHook);
218+
DEBUG("");
212219
uint64_t seq = osd.send_pg_stats();
213220
unique_ptr<Formatter> f{Formatter::create(format, "json-pretty", "json-pretty")};
214221
f->dump_unsigned("stat_seq", seq);
@@ -233,6 +240,8 @@ class DumpPGStateHistory final: public AdminSocketHook {
233240
std::string_view format,
234241
ceph::bufferlist&& input) const final
235242
{
243+
LOG_PREFIX(AdminSocketHook::DumpPGStateHistory);
244+
DEBUG("");
236245
std::unique_ptr<Formatter> fref{
237246
Formatter::create(format, "json-pretty", "json-pretty")};
238247
Formatter *f = fref.get();
@@ -271,6 +280,8 @@ class DumpPerfCountersHook final: public AdminSocketHook {
271280
std::string_view format,
272281
ceph::bufferlist&& input) const final
273282
{
283+
LOG_PREFIX(AdminSocketHook::DumpPerfCountersHook);
284+
DEBUG("");
274285
std::unique_ptr<Formatter> f{Formatter::create(format,
275286
"json-pretty",
276287
"json-pretty")};
@@ -303,6 +314,8 @@ class AssertAlwaysHook : public AdminSocketHook {
303314
std::string_view format,
304315
ceph::bufferlist&& input) const final
305316
{
317+
LOG_PREFIX(AdminSocketHook::AssertAlwaysHook);
318+
DEBUG("");
306319
if (local_conf().get_val<bool>("debug_asok_assert_abort")) {
307320
ceph_assert_always(0);
308321
return seastar::make_ready_future<tell_result_t>();
@@ -328,6 +341,8 @@ class DumpMetricsHook : public AdminSocketHook {
328341
std::string_view format,
329342
ceph::bufferlist&& input) const final
330343
{
344+
LOG_PREFIX(AdminSocketHook::DumpMetricsHook);
345+
DEBUG("");
331346
std::unique_ptr<Formatter> fref{Formatter::create(format, "json-pretty", "json-pretty")};
332347
auto *f = fref.get();
333348
std::string prefix;
@@ -493,6 +508,8 @@ class InjectDataErrorHook : public AdminSocketHook {
493508
std::string_view format,
494509
ceph::bufferlist&& input) const final
495510
{
511+
LOG_PREFIX(AdminSocketHook::InjectDataErrorHook);
512+
DEBUG("");
496513
ghobject_t obj;
497514
try {
498515
obj = test_ops_get_object_name(*shard_services.get_map(), cmdmap);
@@ -535,6 +552,8 @@ class InjectMDataErrorHook : public AdminSocketHook {
535552
std::string_view format,
536553
ceph::bufferlist&& input) const final
537554
{
555+
LOG_PREFIX(AdminSocketHook::InjectMDataErrorHook);
556+
DEBUG("");
538557
ghobject_t obj;
539558
try {
540559
obj = test_ops_get_object_name(*shard_services.get_map(), cmdmap);
@@ -573,6 +592,8 @@ class DumpInFlightOpsHook : public AdminSocketHook {
573592
std::string_view format,
574593
ceph::bufferlist&& input) const final
575594
{
595+
LOG_PREFIX(AdminSocketHook::DumpInFlightOpsHook);
596+
DEBUG("");
576597
unique_ptr<Formatter> fref{
577598
Formatter::create(format, "json-pretty", "json-pretty")};
578599
auto *f = fref.get();
@@ -606,6 +627,8 @@ class DumpHistoricOpsHook : public AdminSocketHook {
606627
std::string_view format,
607628
ceph::bufferlist&& input) const final
608629
{
630+
LOG_PREFIX(AdminSocketHook::DumpHistoricOpsHook);
631+
DEBUG("");
609632
unique_ptr<Formatter> f{Formatter::create(format, "json-pretty", "json-pretty")};
610633
f->open_object_section("historic_ops");
611634
op_registry.dump_historic_client_requests(f.get());
@@ -630,7 +653,8 @@ class DumpSlowestHistoricOpsHook : public AdminSocketHook {
630653
std::string_view format,
631654
ceph::bufferlist&& input) const final
632655
{
633-
logger().warn("{}", __func__);
656+
LOG_PREFIX(AdminSocketHook::DumpSlowestHistoricOpsHook);
657+
DEBUG("");
634658
unique_ptr<Formatter> f{Formatter::create(format, "json-pretty", "json-pretty")};
635659
f->open_object_section("historic_slow_ops");
636660
op_registry.dump_slowest_historic_client_requests(f.get());
@@ -654,7 +678,8 @@ class DumpRecoveryReservationsHook : public AdminSocketHook {
654678
std::string_view format,
655679
ceph::bufferlist&& input) const final
656680
{
657-
logger().debug("{}", __func__);
681+
LOG_PREFIX(AdminSocketHook::DumpRecoveryReservationsHook);
682+
DEBUG("");
658683
unique_ptr<Formatter> f{Formatter::create(format, "json-pretty", "json-pretty")};
659684
return seastar::do_with(std::move(f), [this](auto&& f) {
660685
f->open_object_section("reservations");

0 commit comments

Comments
 (0)