We already support instrumentation based profiling, but some clients
like Rust still use GCDA so we need to support it as well.
Details
- Reviewers
davidxl mcgrathr jakehehrlich vsk
Diff Detail
- Repository
- rCRT Compiler Runtime
Event Timeline
compiler-rt/lib/profile/GCDAProfiling.c | ||
---|---|---|
258 | slightly prefer #if defined(Fuchia) Original code #endif | |
453 | This big chunk of platform specific code reduces readability. Perhaps wrap it into a helper function. You can even add new file and put all platform specific code in there (starting from Fuchia -- other platforms can follow later). |
This looks ok to me. In the longer term, I think compiler-rt would benefit from borrowing/extending llvm's generic file interface to abstract over platform differences. It doesn't seem ideal to me that libprofile/xray etc. have lots of platform-specific file I/O code.
I'd like to split the platform specific aspects to separate files, e.g. GCDAProfilingPlatformUnix.c, GCDAProfilingPlatformWindows.c and GCDAProfilingPlatformFuchsia.c as suggested by @davidxl, but I'd rather do it in a follow up change.
slightly prefer
#if defined(Fuchia)
// for now empty
#else /* other platforms */
Original code
#endif