Skip to content

Commit

Permalink
Remove unused variables in hbt/src/perf_event/BPerfEventsGroup.cpp
Browse files Browse the repository at this point in the history
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.

This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: danzimm, meyering

Differential Revision: D52848001
  • Loading branch information
r-barnes authored and facebook-github-bot committed Jan 18, 2024
1 parent 2d7180d commit 081e3bf
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion hbt/src/perf_event/BPerfEventsGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ namespace facebook::hbt::perf_event {

constexpr auto kAttrMapVersion = 1;
constexpr auto kAttrMapSize = 16;
constexpr auto kMaxAttrPerMetric = 8;

static inline __u32 bpf_link_get_id(int fd) {
struct bpf_link_info link_info = {
Expand Down

0 comments on commit 081e3bf

Please sign in to comment.