@@ -253,9 +253,10 @@ DDRes aggregate_livealloc_stack(
253253 int64_t upscalled_value, DDProfContext &ctx, const PerfWatcher *watcher,
254254 DDProfPProf *pprof, const SymbolHdr &symbol_hdr) {
255255
256- if (upscalled_value)
256+ if (upscalled_value) {
257257 LG_DBG (" Upscaling from %ld to %ld" , alloc_info.second ._value ,
258258 upscalled_value);
259+ }
259260 // default to the sampled value
260261 const DDProfValuePack pack{
261262 upscalled_value ? upscalled_value : alloc_info.second ._value ,
@@ -269,7 +270,6 @@ DDRes aggregate_livealloc_stack(
269270}
270271
271272DDRes aggregate_live_allocations_common (DDProfContext &ctx,
272- LiveAllocation &live_allocations,
273273 unsigned watcher_pos, pid_t pid,
274274 LiveAllocation::PidStacks &pid_stacks) {
275275 UnwindState *us = ctx.worker_ctx .us ;
@@ -289,8 +289,8 @@ DDRes aggregate_live_allocations_common(DDProfContext &ctx,
289289
290290 // Step 1: Process existing samples
291291 for (const auto &alloc_info : pid_stacks._unique_stacks ) {
292- int64_t upscaled_value =
293- live_allocations. upscale_with_mapping (alloc_info, pid_stacks);
292+ const int64_t upscaled_value =
293+ ddprof::LiveAllocation:: upscale_with_mapping (alloc_info, pid_stacks);
294294 DDRES_CHECK_FWD (aggregate_livealloc_stack (alloc_info, upscaled_value, ctx,
295295 watcher, pprof, symbol_hdr));
296296 }
@@ -307,7 +307,7 @@ DDRes aggregate_live_allocations_common(DDProfContext &ctx,
307307 for (const auto &el : pid_stacks.entries ) {
308308 if (el.accounted_size == 0 ) {
309309 // Use the RSS value for this mapping as the "unsampled" value
310- int64_t unsampled_value = el.rss_kb * 1000 ; // RSS in bytes
310+ const int64_t unsampled_value = el.rss_kb * 1000 ; // RSS in bytes
311311 // Add the frame using the fake UnwindOutput
312312 const DDProfValuePack pack{unsampled_value, 1 , 0 };
313313 DDRES_CHECK_FWD (
@@ -335,8 +335,8 @@ DDRes aggregate_live_allocations_for_pid(DDProfContext &ctx, pid_t pid) {
335335 auto &pid_map = live_allocations._watcher_vector [watcher_pos];
336336 auto &pid_stacks = pid_map[pid]; // Get PidStacks for the specific pid
337337 // Call the common function to handle the aggregation
338- DDRES_CHECK_FWD (aggregate_live_allocations_common (
339- ctx, live_allocations , watcher_pos, pid, pid_stacks));
338+ DDRES_CHECK_FWD (
339+ aggregate_live_allocations_common ( ctx, watcher_pos, pid, pid_stacks));
340340 }
341341
342342 return {};
@@ -353,7 +353,7 @@ DDRes aggregate_live_allocations(DDProfContext &ctx) {
353353 auto &pid_stacks = pid_vt.second ;
354354 // Call the common function to handle the aggregation for each PID
355355 DDRES_CHECK_FWD (aggregate_live_allocations_common (
356- ctx, live_allocations, watcher_pos, pid_vt.first , pid_stacks));
356+ ctx, watcher_pos, pid_vt.first , pid_stacks));
357357 }
358358 }
359359
@@ -440,12 +440,6 @@ DDRes worker_library_init(DDProfContext &ctx,
440440 ctx.worker_ctx .exp [1 ] = nullptr ;
441441 ctx.worker_ctx .pprof [0 ] = nullptr ;
442442 ctx.worker_ctx .pprof [1 ] = nullptr ;
443-
444- // live allocation - create default unwind output
445- add_common_frame (ctx.worker_ctx .us , SymbolErrors::unsampled_mapping);
446- ctx.worker_ctx .live_allocation .set_default_unwind_output (
447- ctx.worker_ctx .us ->output );
448- ctx.worker_ctx .us ->output .clear ();
449443 }
450444 CatchExcept2DDRes ();
451445 return {};
0 commit comments