mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +00:00
Give real variable names to SegmentProfiler objects when defining them (bugprone-unused-raii)
The reason behind this one is that without a real variable name, the profile objects are immediately desctructed and the profiling only happens for the small window when they were valid. If the intention is to profile the method where they were defined, this doesn't actually happen.
This commit is contained in:
parent
3572e38ec2
commit
c5748e4494
4 changed files with 5 additions and 5 deletions
|
@ -152,7 +152,7 @@ void EventMgr::Drain()
|
||||||
if ( event_queue_flush_point )
|
if ( event_queue_flush_point )
|
||||||
QueueEventFast(event_queue_flush_point, val_list{});
|
QueueEventFast(event_queue_flush_point, val_list{});
|
||||||
|
|
||||||
SegmentProfiler(segment_logger, "draining-events");
|
SegmentProfiler prof(segment_logger, "draining-events");
|
||||||
|
|
||||||
PLUGIN_HOOK_VOID(HOOK_DRAIN_EVENTS, HookDrainEvents());
|
PLUGIN_HOOK_VOID(HOOK_DRAIN_EVENTS, HookDrainEvents());
|
||||||
|
|
||||||
|
|
|
@ -309,7 +309,7 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const
|
||||||
#ifdef PROFILE_BRO_FUNCTIONS
|
#ifdef PROFILE_BRO_FUNCTIONS
|
||||||
DEBUG_MSG("Function: %s\n", Name());
|
DEBUG_MSG("Function: %s\n", Name());
|
||||||
#endif
|
#endif
|
||||||
SegmentProfiler(segment_logger, location);
|
SegmentProfiler prof(segment_logger, location);
|
||||||
|
|
||||||
if ( sample_logger )
|
if ( sample_logger )
|
||||||
sample_logger->FunctionSeen(this);
|
sample_logger->FunctionSeen(this);
|
||||||
|
@ -629,7 +629,7 @@ Val* BuiltinFunc::Call(val_list* args, Frame* parent) const
|
||||||
#ifdef PROFILE_BRO_FUNCTIONS
|
#ifdef PROFILE_BRO_FUNCTIONS
|
||||||
DEBUG_MSG("Function: %s\n", Name());
|
DEBUG_MSG("Function: %s\n", Name());
|
||||||
#endif
|
#endif
|
||||||
SegmentProfiler(segment_logger, Name());
|
SegmentProfiler prof(segment_logger, Name());
|
||||||
|
|
||||||
if ( sample_logger )
|
if ( sample_logger )
|
||||||
sample_logger->FunctionSeen(this);
|
sample_logger->FunctionSeen(this);
|
||||||
|
|
|
@ -212,7 +212,7 @@ void net_init(const std::optional<std::string>& interface,
|
||||||
|
|
||||||
void expire_timers(iosource::PktSrc* src_ps)
|
void expire_timers(iosource::PktSrc* src_ps)
|
||||||
{
|
{
|
||||||
SegmentProfiler(segment_logger, "expiring-timers");
|
SegmentProfiler prof(segment_logger, "expiring-timers");
|
||||||
|
|
||||||
current_dispatched +=
|
current_dispatched +=
|
||||||
timer_mgr->Advance(network_time,
|
timer_mgr->Advance(network_time,
|
||||||
|
|
|
@ -120,7 +120,7 @@ void NetSessions::Done()
|
||||||
|
|
||||||
void NetSessions::NextPacket(double t, const Packet* pkt)
|
void NetSessions::NextPacket(double t, const Packet* pkt)
|
||||||
{
|
{
|
||||||
SegmentProfiler(segment_logger, "dispatching-packet");
|
SegmentProfiler prof(segment_logger, "dispatching-packet");
|
||||||
|
|
||||||
if ( raw_packet )
|
if ( raw_packet )
|
||||||
mgr.QueueEventFast(raw_packet, {pkt->BuildPktHdrVal()});
|
mgr.QueueEventFast(raw_packet, {pkt->BuildPktHdrVal()});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue