Skip to content

Commit 9cd7e57

Browse files
authored
Remove deprecated debug output functions from 13 source files. (#9676)
1 parent 2acf9a4 commit 9cd7e57

File tree

14 files changed

+267
-197
lines changed

14 files changed

+267
-197
lines changed

include/tscore/Diags.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,16 @@ is_dbg_ctl_enabled(DbgCtl const &ctl)
188188
} \
189189
} while (false)
190190

191+
// A BufferWriter version of Dbg().
192+
#define Dbg_bw(ctl__, fmt, ...) \
193+
do { \
194+
if (unlikely(diags()->on())) { \
195+
if (ctl__.ptr()->on) { \
196+
DbgPrint(ctl__, "%s", ts::bwprint(ts::bw_dbg, fmt, __VA_ARGS__).c_str()); \
197+
} \
198+
} \
199+
} while (false)
200+
191201
// A BufferWriter version of Debug().
192202
#define Debug_bw(tag__, fmt, ...) \
193203
do { \

iocore/eventsystem/ConfigProcessor.cc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929

3030
ConfigProcessor configProcessor;
3131

32+
namespace
33+
{
34+
35+
DbgCtl dbg_ctl_config{"config"};
36+
37+
}
38+
3239
class ConfigInfoReleaser : public Continuation
3340
{
3441
public:
@@ -81,8 +88,8 @@ ConfigProcessor::set(unsigned int id, ConfigInfo *info, unsigned timeout_secs)
8188
idx = id - 1;
8289
old_info = infos[idx].exchange(info);
8390

84-
Debug("config", "Set for slot %d 0x%" PRId64 " was 0x%" PRId64 " with ref count %d", id, (int64_t)info, (int64_t)old_info,
85-
(old_info) ? old_info->refcount() : 0);
91+
Dbg(dbg_ctl_config, "Set for slot %d 0x%" PRId64 " was 0x%" PRId64 " with ref count %d", id, (int64_t)info, (int64_t)old_info,
92+
(old_info) ? old_info->refcount() : 0);
8693

8794
if (old_info) {
8895
// The ConfigInfoReleaser now takes our refcount, but
@@ -132,7 +139,7 @@ ConfigProcessor::release(unsigned int id, ConfigInfo *info)
132139

133140
if (info && info->refcount_dec() == 0) {
134141
// When we release, we should already have replaced this object in the index.
135-
Debug("config", "Release config %d 0x%" PRId64, id, (int64_t)info);
142+
Dbg(dbg_ctl_config, "Release config %d 0x%" PRId64, id, (int64_t)info);
136143
ink_release_assert(info != this->infos[idx]);
137144
delete info;
138145
}

iocore/eventsystem/ConfigProcessor.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,13 @@ template <typename UpdateClass> struct ConfigUpdateHandler {
105105
{
106106
ConfigUpdateHandler *self = static_cast<ConfigUpdateHandler *>(cookie);
107107

108-
Debug("config", "%s(%s)", __PRETTY_FUNCTION__, name);
108+
Dbg(_dbg_ctl, "%s(%s)", __PRETTY_FUNCTION__, name);
109109
return ConfigScheduleUpdate<UpdateClass>(self->mutex);
110110
}
111111

112112
Ptr<ProxyMutex> mutex;
113+
114+
inline static DbgCtl _dbg_ctl{"config"};
113115
};
114116

115117
extern ConfigProcessor configProcessor;

iocore/eventsystem/RecProcess.cc

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,36 +43,38 @@ static Event *raw_stat_sync_cont_event;
4343
static Event *config_update_cont_event;
4444
static Event *sync_cont_event;
4545

46+
static DbgCtl dbg_ctl_statsproc{"statsproc"};
47+
4648
//-------------------------------------------------------------------------
4749
// Simple setters for the intervals to decouple this from the proxy
4850
//-------------------------------------------------------------------------
4951
void
5052
RecProcess_set_raw_stat_sync_interval_ms(int ms)
5153
{
52-
Debug("statsproc", "g_rec_raw_stat_sync_interval_ms -> %d", ms);
54+
Dbg(dbg_ctl_statsproc, "g_rec_raw_stat_sync_interval_ms -> %d", ms);
5355
g_rec_raw_stat_sync_interval_ms = ms;
5456
if (raw_stat_sync_cont_event) {
55-
Debug("statsproc", "Rescheduling raw-stat syncer");
57+
Dbg(dbg_ctl_statsproc, "Rescheduling raw-stat syncer");
5658
raw_stat_sync_cont_event->schedule_every(HRTIME_MSECONDS(g_rec_raw_stat_sync_interval_ms));
5759
}
5860
}
5961
void
6062
RecProcess_set_config_update_interval_ms(int ms)
6163
{
62-
Debug("statsproc", "g_rec_config_update_interval_ms -> %d", ms);
64+
Dbg(dbg_ctl_statsproc, "g_rec_config_update_interval_ms -> %d", ms);
6365
g_rec_config_update_interval_ms = ms;
6466
if (config_update_cont_event) {
65-
Debug("statsproc", "Rescheduling config syncer");
67+
Dbg(dbg_ctl_statsproc, "Rescheduling config syncer");
6668
config_update_cont_event->schedule_every(HRTIME_MSECONDS(g_rec_config_update_interval_ms));
6769
}
6870
}
6971
void
7072
RecProcess_set_remote_sync_interval_ms(int ms)
7173
{
72-
Debug("statsproc", "g_rec_remote_sync_interval_ms -> %d", ms);
74+
Dbg(dbg_ctl_statsproc, "g_rec_remote_sync_interval_ms -> %d", ms);
7375
g_rec_remote_sync_interval_ms = ms;
7476
if (sync_cont_event) {
75-
Debug("statsproc", "Rescheduling remote syncer");
77+
Dbg(dbg_ctl_statsproc, "Rescheduling remote syncer");
7678
sync_cont_event->schedule_every(HRTIME_MSECONDS(g_rec_remote_sync_interval_ms));
7779
}
7880
}
@@ -86,7 +88,7 @@ struct raw_stat_sync_cont : public Continuation {
8688
exec_callbacks(int /* event */, Event * /* e */)
8789
{
8890
RecExecRawStatSyncCbs();
89-
Debug("statsproc", "raw_stat_sync_cont() processed");
91+
Dbg(dbg_ctl_statsproc, "raw_stat_sync_cont() processed");
9092

9193
return EVENT_CONT;
9294
}
@@ -101,7 +103,7 @@ struct config_update_cont : public Continuation {
101103
exec_callbacks(int /* event */, Event * /* e */)
102104
{
103105
RecExecConfigUpdateCbs(REC_PROCESS_UPDATE_REQUIRED);
104-
Debug("statsproc", "config_update_cont() processed");
106+
Dbg(dbg_ctl_statsproc, "config_update_cont() processed");
105107

106108
return EVENT_CONT;
107109
}
@@ -132,7 +134,7 @@ struct sync_cont : public Continuation {
132134
{
133135
RecSyncStatsFile();
134136

135-
Debug("statsproc", "sync_cont() processed");
137+
Dbg(dbg_ctl_statsproc, "sync_cont() processed");
136138

137139
return EVENT_CONT;
138140
}
@@ -173,17 +175,17 @@ RecProcessStart()
173175
return REC_ERR_OKAY;
174176
}
175177

176-
Debug("statsproc", "Starting sync continuations:");
178+
Dbg(dbg_ctl_statsproc, "Starting sync continuations:");
177179
raw_stat_sync_cont *rssc = new raw_stat_sync_cont(new_ProxyMutex());
178-
Debug("statsproc", "raw-stat syncer");
180+
Dbg(dbg_ctl_statsproc, "raw-stat syncer");
179181
raw_stat_sync_cont_event = eventProcessor.schedule_every(rssc, HRTIME_MSECONDS(g_rec_raw_stat_sync_interval_ms), ET_TASK);
180182

181183
config_update_cont *cuc = new config_update_cont(new_ProxyMutex());
182-
Debug("statsproc", "config syncer");
184+
Dbg(dbg_ctl_statsproc, "config syncer");
183185
config_update_cont_event = eventProcessor.schedule_every(cuc, HRTIME_MSECONDS(g_rec_config_update_interval_ms), ET_TASK);
184186

185187
sync_cont *sc = new sync_cont(new_ProxyMutex());
186-
Debug("statsproc", "remote syncer");
188+
Dbg(dbg_ctl_statsproc, "remote syncer");
187189
sync_cont_event = eventProcessor.schedule_every(sc, HRTIME_MSECONDS(g_rec_remote_sync_interval_ms), ET_TASK);
188190

189191
g_started = true;

iocore/eventsystem/RecRawStatsImpl.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ struct RecRawStatBlockOpsImpl : RecRawStatBlockOps {
3636
int raw_stat_clear_sum(RecRawStatBlock *rsb, int id) override;
3737
int raw_stat_get_total(RecRawStatBlock *rsb, int id, RecRawStat *total) override;
3838
int raw_stat_sync_to_global(RecRawStatBlock *rsb, int id) override;
39+
40+
private:
41+
inline static DbgCtl _dbg_ctl{"stats"};
3942
};
4043

4144
RecRawStatBlock *
@@ -166,7 +169,7 @@ RecRawStatBlockOpsImpl::raw_stat_sync_to_global(RecRawStatBlock *rsb, int id)
166169
int
167170
RecRawStatBlockOpsImpl::raw_stat_clear(RecRawStatBlock *rsb, int id)
168171
{
169-
Debug("stats", "raw_stat_clear(): rsb pointer:%p id:%d", rsb, id);
172+
Dbg(_dbg_ctl, "raw_stat_clear(): rsb pointer:%p id:%d", rsb, id);
170173

171174
// the globals need to be reset too
172175
// lock so the setting of the globals and last values are atomic
@@ -199,7 +202,7 @@ RecRawStatBlockOpsImpl::raw_stat_clear(RecRawStatBlock *rsb, int id)
199202
int
200203
RecRawStatBlockOpsImpl::raw_stat_clear_sum(RecRawStatBlock *rsb, int id)
201204
{
202-
Debug("stats", "raw_stat_clear_sum(): rsb pointer:%p id:%d", rsb, id);
205+
Dbg(_dbg_ctl, "raw_stat_clear_sum(): rsb pointer:%p id:%d", rsb, id);
203206

204207
// the globals need to be reset too
205208
// lock so the setting of the globals and last values are atomic
@@ -229,7 +232,7 @@ RecRawStatBlockOpsImpl::raw_stat_clear_sum(RecRawStatBlock *rsb, int id)
229232
int
230233
RecRawStatBlockOpsImpl::raw_stat_clear_count(RecRawStatBlock *rsb, int id)
231234
{
232-
Debug("stats", "raw_stat_clear_count(): rsb pointer:%p id:%d", rsb, id);
235+
Dbg(_dbg_ctl, "raw_stat_clear_count(): rsb pointer:%p id:%d", rsb, id);
233236

234237
// the globals need to be reset too
235238
// lock so the setting of the globals and last values are atomic

0 commit comments

Comments
 (0)