Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renames global symbol allocator to cpu_profile_allocator. #717

Merged
merged 2 commits into from
Jul 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/freertos_drivers/common/cpu_profile.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public:
/// How many times did we apply the backtrace hack to work around
/// single-entry backtraces.
unsigned singleLenHack{0};
} allocator;
} cpu_profile_allocator;

/// Linked list entry type for a call-stack backtrace.
struct trace
Expand Down Expand Up @@ -142,7 +142,7 @@ struct trace *add_new_trace(unsigned hash)
{
unsigned total_size =
sizeof(struct trace) + strace_len * sizeof(stacktrace[0]);
struct trace *t = (struct trace *)allocator.alloc(total_size);
struct trace *t = (struct trace *)cpu_profile_allocator.alloc(total_size);
if (!t)
return nullptr;
memcpy(t + 1, stacktrace, strace_len * sizeof(stacktrace[0]));
Expand Down Expand Up @@ -226,14 +226,14 @@ _Unwind_Reason_Code trace_func(struct _Unwind_Context *context, void *arg)
if (strace_len == 1 && saved_lr != _Unwind_GetGR(context, 14))
{
_Unwind_SetGR(context, 14, saved_lr);
allocator.singleLenHack++;
cpu_profile_allocator.singleLenHack++;
return _URC_NO_REASON;
}
return _URC_END_OF_STACK;
}
if (strace_len >= MAX_STRACE - 1)
{
++allocator.limitReached;
++cpu_profile_allocator.limitReached;
return _URC_END_OF_STACK;
}
// stacktrace[strace_len++] = ip;
Expand Down