return "dumped "+std::to_string(total)+" records\n";
}
- uint64_t* pleaseWipeCache(const DNSName& canon, bool subtree)
+ uint64_t* pleaseWipeCache(const DNSName& canon, bool subtree, uint16_t qtype)
{
- return new uint64_t(t_RC->doWipeCache(canon, subtree));
+ return new uint64_t(t_RC->doWipeCache(canon, subtree, qtype));
}
- uint64_t* pleaseWipePacketCache(const DNSName& canon, bool subtree)
+ uint64_t* pleaseWipePacketCache(const DNSName& canon, bool subtree, uint16_t qtype)
{
- return new uint64_t(t_packetCache->doWipePacketCache(canon,0xffff, subtree));
+ return new uint64_t(t_packetCache->doWipePacketCache(canon, qtype, subtree));
}
template<typename T>
- static string doWipeCache(T begin, T end)
+ static string doWipeCache(T begin, T end, uint16_t qtype)
{
vector<pair<DNSName, bool> > toWipe;
for(T i=begin; i != end; ++i) {
int count=0, pcount=0, countNeg=0;
for (auto wipe : toWipe) {
- count+= broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeCache, wipe.first, wipe.second));
- pcount+= broadcastAccFunction<uint64_t>(boost::bind(pleaseWipePacketCache, wipe.first, wipe.second));
+ count+= broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeCache, wipe.first, wipe.second, qtype));
+ pcount+= broadcastAccFunction<uint64_t>(boost::bind(pleaseWipePacketCache, wipe.first, wipe.second, qtype));
countNeg+=broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeAndCountNegCache, wipe.first, wipe.second));
}
g_luaconfs.modify([who, why](LuaConfigItems& lci) {
lci.negAnchors[who] = why;
});
- broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeCache, who, true));
- broadcastAccFunction<uint64_t>(boost::bind(pleaseWipePacketCache, who, true));
+ broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeCache, who, true, 0xffff));
+ broadcastAccFunction<uint64_t>(boost::bind(pleaseWipePacketCache, who, true, 0xffff));
broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeAndCountNegCache, who, true));
return "Added Negative Trust Anchor for " + who.toLogString() + " with reason '" + why + "'\n";
}
g_luaconfs.modify([entry](LuaConfigItems& lci) {
lci.negAnchors.erase(entry);
});
- broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeCache, entry, true));
- broadcastAccFunction<uint64_t>(boost::bind(pleaseWipePacketCache, entry, true));
+ broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeCache, entry, true, 0xffff));
+ broadcastAccFunction<uint64_t>(boost::bind(pleaseWipePacketCache, entry, true, 0xffff));
broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeAndCountNegCache, entry, true));
if (!first) {
first = false;
auto ds=std::dynamic_pointer_cast<DSRecordContent>(DSRecordContent::make(what));
lci.dsAnchors[who].insert(*ds);
});
- broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeCache, who, true));
- broadcastAccFunction<uint64_t>(boost::bind(pleaseWipePacketCache, who, true));
+ broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeCache, who, true, 0xffff));
+ broadcastAccFunction<uint64_t>(boost::bind(pleaseWipePacketCache, who, true, 0xffff));
broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeAndCountNegCache, who, true));
g_log<<Logger::Warning<<endl;
return "Added Trust Anchor for " + who.toStringRootDot() + " with data " + what + "\n";
g_luaconfs.modify([entry](LuaConfigItems& lci) {
lci.dsAnchors.erase(entry);
});
- broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeCache, entry, true));
- broadcastAccFunction<uint64_t>(boost::bind(pleaseWipePacketCache, entry, true));
+ broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeCache, entry, true, 0xffff));
+ broadcastAccFunction<uint64_t>(boost::bind(pleaseWipePacketCache, entry, true, 0xffff));
broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeAndCountNegCache, entry, true));
if (!first) {
first = false;
addGetStat("user-msec", getUserTimeMsec);
addGetStat("sys-msec", getSysTimeMsec);
+#ifdef __linux__
+ addGetStat("cpu-iowait", boost::bind(getCPUIOWait, string()));
+ addGetStat("cpu-steal", boost::bind(getCPUSteal, string()));
+#endif
+
for(unsigned int n=0; n < g_numThreads; ++n)
addGetStat("cpu-msec-thread-"+std::to_string(n), boost::bind(&doGetThreadCPUMsec, n));
"top-bogus-remotes show top remotes receiving bogus answers\n"
"unload-lua-script unload Lua script\n"
"version return Recursor version number\n"
- "wipe-cache domain0 [domain1] .. wipe domain data from cache\n";
+ "wipe-cache domain0 [domain1] .. wipe domain data from cache\n"
+ "wipe-cache-typed type domain0 [domain1] .. wipe domain data with qtype from cache\n";
if(cmd=="get-all")
return getAllStats();
return doDumpThrottleMap(begin, end);
if(cmd=="wipe-cache" || cmd=="flushname")
- return doWipeCache(begin, end);
+ return doWipeCache(begin, end, 0xffff);
+
+ if(cmd=="wipe-cache-typed") {
+ uint16_t qtype = QType::chartocode(begin->c_str());
+ ++begin;
+ return doWipeCache(begin, end, qtype);
+ }
if(cmd=="reload-lua-script")
return doQueueReloadLuaScript(begin, end);