-
-
Notifications
You must be signed in to change notification settings - Fork 7
Fixes profiler build and adds workflow #147
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #define PROFILER 1 | ||
| #define PROFILER | ||
|
|
||
| #include "common.h" | ||
| #include "profiler_c.h" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| #include <sys/time.h> | ||
| #include <stdint.h> | ||
| #define PROFILER | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major 🧩 Analysis chainHardcoded PROFILER macro conflicts with optional profiling builds. The hardcoded Please verify:
Run this script to check how rdtsc.h uses the PROFILER macro: If profiling should be optional, consider removing this hardcoded define and ensuring CMake passes 🏁 Script executed: #!/bin/bash
# Check if rdtsc.h has conditional compilation based on PROFILER
# Search for PROFILER usage in rdtsc.h
rg -n -C3 'PROFILER' lib/profiler/include/ lib/profiler/src/Length of output: 2939 Remove hardcoded PROFILER macros from source files 🤖 Prompt for AI Agents |
||
| #include "rdtsc.h" | ||
|
|
||
| #ifdef __arm__ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
Two concerns: hardcoded macro and potential breaking change.
Hardcoded definition: Similar to
rdtsc.c, the hardcoded#define PROFILERconflicts with the CI workflow's optional profiling builds. Consider defining this via CMake compiler flags instead.Macro semantics change: Removing the numeric value changes the macro from value-based (
#define PROFILER 1) to presence-based (#define PROFILER). This is fine if all usage is#ifdef PROFILER, but could break code using#if PROFILER == 1or similar value checks.Run this script to verify how PROFILER is used throughout the codebase:
🏁 Script executed:
Length of output: 2846
Remove hardcoded PROFILER definitions from source
Delete
#define PROFILERfrom lib/profiler/src/{profiler.c, rdtsc.c, repetition_tester.c} and control profiling via build flags (e.g. add-DPROFILERin CMake).🤖 Prompt for AI Agents