diff --git a/src/LinuxTracing/TracerImpl.h b/src/LinuxTracing/TracerImpl.h index 52a76e9860a..e5ea061566a 100644 --- a/src/LinuxTracing/TracerImpl.h +++ b/src/LinuxTracing/TracerImpl.h @@ -70,14 +70,15 @@ class TracerImpl : public Tracer { void InitUprobesEventVisitor(); bool OpenUserSpaceProbes(absl::Span cpus); bool OpenUprobesToRecordAdditionalStackOn(absl::Span cpus); - bool OpenUprobes(const orbit_grpc_protos::InstrumentedFunction& function, - absl::Span cpus, absl::flat_hash_map* fds_per_cpu); + static bool OpenUprobes(const orbit_grpc_protos::InstrumentedFunction& function, + absl::Span cpus, + absl::flat_hash_map* fds_per_cpu); bool OpenUprobesWithStack(const orbit_grpc_protos::FunctionToRecordAdditionalStackOn& function, absl::Span cpus, absl::flat_hash_map* fds_per_cpu); - bool OpenUretprobes(const orbit_grpc_protos::InstrumentedFunction& function, - absl::Span cpus, - absl::flat_hash_map* fds_per_cpu); + static bool OpenUretprobes(const orbit_grpc_protos::InstrumentedFunction& function, + absl::Span cpus, + absl::flat_hash_map* fds_per_cpu); bool OpenMmapTask(absl::Span cpus); bool OpenSampling(absl::Span cpus); @@ -108,7 +109,7 @@ class TracerImpl : public Tracer { PerfEventRingBuffer* ring_buffer); [[nodiscard]] uint64_t ProcessLostEventAndReturnTimestamp(const perf_event_header& header, PerfEventRingBuffer* ring_buffer); - [[nodiscard]] uint64_t ProcessThrottleUnthrottleEventAndReturnTimestamp( + [[nodiscard]] static uint64_t ProcessThrottleUnthrottleEventAndReturnTimestamp( const perf_event_header& header, PerfEventRingBuffer* ring_buffer); void DeferEvent(PerfEvent&& event); diff --git a/src/MizarData/BaselineAndComparisonTest.cpp b/src/MizarData/BaselineAndComparisonTest.cpp index f63e8cef53d..a06adcc509e 100644 --- a/src/MizarData/BaselineAndComparisonTest.cpp +++ b/src/MizarData/BaselineAndComparisonTest.cpp @@ -250,7 +250,7 @@ class MockFunctionTimeComparator { const Comparison& /*comparison_counts*/, const Comparison& /*comparison_frame_stats*/) {} - [[nodiscard]] orbit_mizar_statistics::ComparisonResult Compare(SampledFunctionId sfid) const { + [[nodiscard]] static orbit_mizar_statistics::ComparisonResult Compare(SampledFunctionId sfid) { return {kStatistic, kSfidToPvalue.at(sfid)}; }; }; diff --git a/src/MizarData/MizarPairedDataTest.cpp b/src/MizarData/MizarPairedDataTest.cpp index 6c2f6533729..fdc2b28b502 100644 --- a/src/MizarData/MizarPairedDataTest.cpp +++ b/src/MizarData/MizarPairedDataTest.cpp @@ -199,8 +199,8 @@ class MockFrameTrackManager { explicit MockFrameTrackManager(const MockMizarData* data) { passed_data_ = data; } - [[nodiscard]] std::vector GetFrameStarts(FrameTrackId, TimestampNs, - TimestampNs) const { + [[nodiscard]] static std::vector GetFrameStarts(FrameTrackId, TimestampNs, + TimestampNs) { return kStarts; } }; diff --git a/src/OrbitGl/OrbitApp.cpp b/src/OrbitGl/OrbitApp.cpp index 24e0cdc1037..59c8c91824b 100644 --- a/src/OrbitGl/OrbitApp.cpp +++ b/src/OrbitGl/OrbitApp.cpp @@ -1513,7 +1513,7 @@ bool OrbitApp::IsCaptureConnected(const CaptureData& capture) const { selected_process->full_path() == capture_process->full_path(); } -bool OrbitApp::IsDevMode() const { return absl::GetFlag(FLAGS_devmode); } +bool OrbitApp::IsDevMode() { return absl::GetFlag(FLAGS_devmode); } void OrbitApp::SendDisassemblyToUi(const orbit_client_data::FunctionInfo& function_info, std::string disassembly, diff --git a/src/OrbitGl/PickingManager.cpp b/src/OrbitGl/PickingManager.cpp index b293a041755..b87d99a2abb 100644 --- a/src/OrbitGl/PickingManager.cpp +++ b/src/OrbitGl/PickingManager.cpp @@ -95,7 +95,7 @@ bool PickingManager::IsThisElementPicked(const Pickable* pickable) const { return picked && picked.get() == pickable; } -Color PickingManager::ColorFromPickingID(PickingId id) const { +Color PickingManager::ColorFromPickingID(PickingId id) { auto color_values = absl::bit_cast>(id.ToPixelValue()); return {color_values[0], color_values[1], color_values[2], color_values[3]}; } diff --git a/src/OrbitGl/TimelineTicks.cpp b/src/OrbitGl/TimelineTicks.cpp index a23c3cc07a2..bd735e685c5 100644 --- a/src/OrbitGl/TimelineTicks.cpp +++ b/src/OrbitGl/TimelineTicks.cpp @@ -89,7 +89,7 @@ std::optional TimelineTicks::GetPreviousMajorTick(uint64_t start_ns, return major_ticks[0] - major_tick_scale; } -uint32_t TimelineTicks::GetTimestampNumDigitsPrecision(uint64_t timestamp_ns) const { +uint32_t TimelineTicks::GetTimestampNumDigitsPrecision(uint64_t timestamp_ns) { constexpr uint32_t kMaxDigitsPrecision = 9; // 1ns = 0.000'000'001s uint64_t current_precision_ns = kNanosecondsPerSecond; @@ -109,7 +109,7 @@ uint64_t TimelineTicks::GetMinorTicksScale(uint64_t visible_ns) const { return *std::prev(kTimelineScales.lower_bound(major_scale)); } -uint64_t TimelineTicks::GetMajorTicksScale(uint64_t visible_ns) const { +uint64_t TimelineTicks::GetMajorTicksScale(uint64_t visible_ns) { // Biggest scale smaller than half the total range, as we want to see at least 2 major ticks. uint64_t half_visible_ns = visible_ns / 2; ORBIT_CHECK(half_visible_ns > 0); diff --git a/src/OrbitGl/TimerTrack.cpp b/src/OrbitGl/TimerTrack.cpp index 66db262f09a..7e2abd70118 100644 --- a/src/OrbitGl/TimerTrack.cpp +++ b/src/OrbitGl/TimerTrack.cpp @@ -54,7 +54,7 @@ TimerTrack::TimerTrack(CaptureViewElement* parent, app_{app}, timer_data_{timer_data} {} -std::string TimerTrack::GetExtraInfo(const TimerInfo& timer_info) const { +std::string TimerTrack::GetExtraInfo(const TimerInfo& timer_info) { std::string info; static bool show_return_value = absl::GetFlag(FLAGS_show_return_values); if (show_return_value && timer_info.type() == TimerInfo::kNone) { @@ -92,7 +92,7 @@ WorldXInfo ToWorldX(double start_us, double end_us, double inv_time_window, floa } // namespace -std::string TimerTrack::GetDisplayTime(const TimerInfo& timer) const { +std::string TimerTrack::GetDisplayTime(const TimerInfo& timer) { return orbit_display_formats::GetDisplayTime(absl::Nanoseconds(timer.end() - timer.start())); } diff --git a/src/OrbitGl/include/OrbitGl/CaptureViewElementTester.h b/src/OrbitGl/include/OrbitGl/CaptureViewElementTester.h index d30eb769122..70ac9af7765 100644 --- a/src/OrbitGl/include/OrbitGl/CaptureViewElementTester.h +++ b/src/OrbitGl/include/OrbitGl/CaptureViewElementTester.h @@ -40,7 +40,7 @@ class CaptureViewElementTester { // to be set. // In most cases, you'll want to use `SimulateDrawLoopAndCheckFlags` to combine flag checking // and an update / render loop. - void CheckDrawFlags(CaptureViewElement* element, bool draw, bool update_primitives); + static void CheckDrawFlags(CaptureViewElement* element, bool draw, bool update_primitives); // Run layout updates without rendering. This is equal to what would happen during // CaptureWindow::PreRender. You'll want to use this when you want to verify that a particular @@ -68,7 +68,7 @@ class CaptureViewElementTester { StaticTimeGraphLayout layout_; private: - void TestWidthPropagationToChildren(CaptureViewElement* element); + static void TestWidthPropagationToChildren(CaptureViewElement* element); MockBatcher batcher_; MockTextRenderer text_renderer_; diff --git a/src/OrbitGl/include/OrbitGl/OrbitApp.h b/src/OrbitGl/include/OrbitGl/OrbitApp.h index 89fee7b2aeb..0247ecf1d05 100644 --- a/src/OrbitGl/include/OrbitGl/OrbitApp.h +++ b/src/OrbitGl/include/OrbitGl/OrbitApp.h @@ -238,7 +238,7 @@ class OrbitApp final : public DataViewFactory, [[nodiscard]] bool IsCaptureConnected( const orbit_client_data::CaptureData& capture) const override; - [[nodiscard]] bool IsDevMode() const; + [[nodiscard]] static bool IsDevMode(); // Callbacks using CaptureStartedCallback = std::function&)>; diff --git a/src/OrbitGl/include/OrbitGl/PickingManager.h b/src/OrbitGl/include/OrbitGl/PickingManager.h index 4bb2da537c6..3d797226374 100644 --- a/src/OrbitGl/include/OrbitGl/PickingManager.h +++ b/src/OrbitGl/include/OrbitGl/PickingManager.h @@ -136,7 +136,7 @@ class PickingManager { private: [[nodiscard]] PickingId GetOrCreatePickableId(const std::shared_ptr& pickable, BatcherId batcher_id); - [[nodiscard]] Color ColorFromPickingID(PickingId id) const; + [[nodiscard]] static Color ColorFromPickingID(PickingId id); private: uint32_t pickable_id_counter_ = 0; diff --git a/src/OrbitGl/include/OrbitGl/PrimitiveAssembler.h b/src/OrbitGl/include/OrbitGl/PrimitiveAssembler.h index 02dfd2155fb..18fb5eecfed 100644 --- a/src/OrbitGl/include/OrbitGl/PrimitiveAssembler.h +++ b/src/OrbitGl/include/OrbitGl/PrimitiveAssembler.h @@ -140,8 +140,9 @@ class PrimitiveAssembler { const Color& picking_color, std::unique_ptr user_data = nullptr); - void GetBoxGradientColors(const Color& color, std::array* colors, - ShadingDirection shading_direction = ShadingDirection::kLeftToRight); + static void GetBoxGradientColors( + const Color& color, std::array* colors, + ShadingDirection shading_direction = ShadingDirection::kLeftToRight); Batcher* batcher_; PickingManager* picking_manager_; diff --git a/src/OrbitGl/include/OrbitGl/TimelineTicks.h b/src/OrbitGl/include/OrbitGl/TimelineTicks.h index 2a1d05fce1e..611ac9f821c 100644 --- a/src/OrbitGl/include/OrbitGl/TimelineTicks.h +++ b/src/OrbitGl/include/OrbitGl/TimelineTicks.h @@ -34,10 +34,10 @@ class TimelineTicks { [[nodiscard]] std::optional GetPreviousMajorTick(uint64_t start_ns, uint64_t end_ns) const; // Number of digits needed to show precisely parts of a second in a timestamp. - [[nodiscard]] uint32_t GetTimestampNumDigitsPrecision(uint64_t timestamp_ns) const; + [[nodiscard]] static uint32_t GetTimestampNumDigitsPrecision(uint64_t timestamp_ns); private: - [[nodiscard]] uint64_t GetMajorTicksScale(uint64_t visible_ns) const; + [[nodiscard]] static uint64_t GetMajorTicksScale(uint64_t visible_ns); [[nodiscard]] uint64_t GetMinorTicksScale(uint64_t visible_ns) const; }; diff --git a/src/OrbitGl/include/OrbitGl/TimerTrack.h b/src/OrbitGl/include/OrbitGl/TimerTrack.h index ac08446cd80..be58327568b 100644 --- a/src/OrbitGl/include/OrbitGl/TimerTrack.h +++ b/src/OrbitGl/include/OrbitGl/TimerTrack.h @@ -75,7 +75,7 @@ class TimerTrack : public Track { [[nodiscard]] Type GetType() const override { return Type::kTimerTrack; } [[nodiscard]] uint32_t GetProcessId() const override { return timer_data_->GetProcessId(); } - [[nodiscard]] std::string GetExtraInfo(const orbit_client_protos::TimerInfo& timer) const; + [[nodiscard]] static std::string GetExtraInfo(const orbit_client_protos::TimerInfo& timer); [[nodiscard]] const orbit_client_protos::TimerInfo* GetLeft( const orbit_client_protos::TimerInfo& timer_info) const override; @@ -139,7 +139,7 @@ class TimerTrack : public Track { const orbit_client_protos::TimerInfo& /*timer*/) const { return ""; } - [[nodiscard]] std::string GetDisplayTime(const orbit_client_protos::TimerInfo&) const; + [[nodiscard]] static std::string GetDisplayTime(const orbit_client_protos::TimerInfo&); void DrawTimesliceText(orbit_gl::TextRenderer& text_renderer, const orbit_client_protos::TimerInfo& timer, float min_x, Vec2 box_pos, diff --git a/src/OrbitQt/CallTreeViewItemModel.cpp b/src/OrbitQt/CallTreeViewItemModel.cpp index fcc378f6b7d..a9d47085b22 100644 --- a/src/OrbitQt/CallTreeViewItemModel.cpp +++ b/src/OrbitQt/CallTreeViewItemModel.cpp @@ -171,7 +171,7 @@ QVariant CallTreeViewItemModel::GetEditRoleData(const QModelIndex& index) const return {}; } -QVariant CallTreeViewItemModel::GetToolTipRoleData(const QModelIndex& index) const { +QVariant CallTreeViewItemModel::GetToolTipRoleData(const QModelIndex& index) { ORBIT_CHECK(index.isValid()); auto* item = static_cast(index.internalPointer()); auto* function_item = dynamic_cast(item); @@ -193,7 +193,7 @@ QVariant CallTreeViewItemModel::GetToolTipRoleData(const QModelIndex& index) con return {}; } -QVariant CallTreeViewItemModel::GetForegroundRoleData(const QModelIndex& index) const { +QVariant CallTreeViewItemModel::GetForegroundRoleData(const QModelIndex& index) { ORBIT_CHECK(index.isValid()); auto* item = static_cast(index.internalPointer()); auto* unwind_errors_item = dynamic_cast(item); @@ -214,7 +214,7 @@ QVariant CallTreeViewItemModel::GetForegroundRoleData(const QModelIndex& index) return {}; } -QVariant CallTreeViewItemModel::GetModulePathRoleData(const QModelIndex& index) const { +QVariant CallTreeViewItemModel::GetModulePathRoleData(const QModelIndex& index) { ORBIT_CHECK(index.isValid()); auto* item = static_cast(index.internalPointer()); auto* function_item = dynamic_cast(item); @@ -224,7 +224,7 @@ QVariant CallTreeViewItemModel::GetModulePathRoleData(const QModelIndex& index) return {}; } -QVariant CallTreeViewItemModel::GetModuleBuildIdRoleData(const QModelIndex& index) const { +QVariant CallTreeViewItemModel::GetModuleBuildIdRoleData(const QModelIndex& index) { ORBIT_CHECK(index.isValid()); auto* item = static_cast(index.internalPointer()); auto* function_item = dynamic_cast(item); diff --git a/src/OrbitQt/TrackTypeItemModel.cpp b/src/OrbitQt/TrackTypeItemModel.cpp index f28de700615..45d5ef1e12d 100644 --- a/src/OrbitQt/TrackTypeItemModel.cpp +++ b/src/OrbitQt/TrackTypeItemModel.cpp @@ -121,7 +121,7 @@ void TrackTypeItemModel::SetTrackManager(orbit_gl::TrackManager* track_manager) endInsertRows(); } -QString TrackTypeItemModel::GetTrackTypeDisplayName(Track::Type track_type) const { +QString TrackTypeItemModel::GetTrackTypeDisplayName(Track::Type track_type) { switch (track_type) { case Track::Type::kSchedulerTrack: return "Scheduler"; diff --git a/src/OrbitQt/include/OrbitQt/CallTreeViewItemModel.h b/src/OrbitQt/include/OrbitQt/CallTreeViewItemModel.h index d740b75c5f7..dd4041a97f1 100644 --- a/src/OrbitQt/include/OrbitQt/CallTreeViewItemModel.h +++ b/src/OrbitQt/include/OrbitQt/CallTreeViewItemModel.h @@ -54,10 +54,10 @@ class CallTreeViewItemModel : public QAbstractItemModel { private: [[nodiscard]] QVariant GetDisplayRoleData(const QModelIndex& index) const; [[nodiscard]] QVariant GetEditRoleData(const QModelIndex& index) const; - [[nodiscard]] QVariant GetToolTipRoleData(const QModelIndex& index) const; - [[nodiscard]] QVariant GetForegroundRoleData(const QModelIndex& index) const; - [[nodiscard]] QVariant GetModulePathRoleData(const QModelIndex& index) const; - [[nodiscard]] QVariant GetModuleBuildIdRoleData(const QModelIndex& index) const; + [[nodiscard]] static QVariant GetToolTipRoleData(const QModelIndex& index); + [[nodiscard]] static QVariant GetForegroundRoleData(const QModelIndex& index); + [[nodiscard]] static QVariant GetModulePathRoleData(const QModelIndex& index); + [[nodiscard]] static QVariant GetModuleBuildIdRoleData(const QModelIndex& index); [[nodiscard]] QVariant GetCopyableValueRoleData(const QModelIndex& index) const; [[nodiscard]] static QVariant GetExclusiveCallstackEventsRoleData(const QModelIndex& index); diff --git a/src/OrbitQt/include/OrbitQt/TrackTypeItemModel.h b/src/OrbitQt/include/OrbitQt/TrackTypeItemModel.h index 4e861929bd7..4f5162caf01 100644 --- a/src/OrbitQt/include/OrbitQt/TrackTypeItemModel.h +++ b/src/OrbitQt/include/OrbitQt/TrackTypeItemModel.h @@ -45,7 +45,7 @@ class TrackTypeItemModel : public QAbstractTableModel { orbit_gl::TrackManager* track_manager_ = nullptr; std::vector known_track_types_; - QString GetTrackTypeDisplayName(Track::Type track_type) const; + static QString GetTrackTypeDisplayName(Track::Type track_type); }; } // namespace orbit_qt diff --git a/src/OrbitQt/include/OrbitQt/orbitmainwindow.h b/src/OrbitQt/include/OrbitQt/orbitmainwindow.h index 0b311fef4b1..81a7490ab39 100644 --- a/src/OrbitQt/include/OrbitQt/orbitmainwindow.h +++ b/src/OrbitQt/include/OrbitQt/orbitmainwindow.h @@ -93,7 +93,7 @@ class OrbitMainWindow final : public QMainWindow, public orbit_gl::MainWindowInt void OnNewSelectionBottomUpView(std::unique_ptr selection_bottom_up_view); std::string OnGetSaveFileName(std::string_view extension); - void OnSetClipboard(std::string_view text); + static void OnSetClipboard(std::string_view text); void OpenCapture(std::string_view filepath); void OnCaptureCleared(); @@ -172,8 +172,8 @@ class OrbitMainWindow final : public QMainWindow, public orbit_gl::MainWindowInt void on_actionHelp_toggled(bool checked); void on_actionIntrospection_triggered(); - void on_actionCheckFalse_triggered(); - void on_actionStackOverflow_triggered(); + static void on_actionCheckFalse_triggered(); + static void on_actionStackOverflow_triggered(); void on_actionServiceCheckFalse_triggered(); void on_actionServiceStackOverflow_triggered(); diff --git a/src/OrbitTest/OrbitTestImpl.h b/src/OrbitTest/OrbitTestImpl.h index f93c504e6ed..6ae2ba66aaa 100644 --- a/src/OrbitTest/OrbitTestImpl.h +++ b/src/OrbitTest/OrbitTestImpl.h @@ -26,7 +26,7 @@ class OrbitTestImpl { void Loop(); void TestFunc(uint32_t depth = 0); void TestFunc2(uint32_t depth = 0); - void BusyWork(uint64_t microseconds); + static void BusyWork(uint64_t microseconds); void ManualInstrumentationApiTest(); void OutputOrbitApiState(); diff --git a/src/SessionSetup/include/SessionSetup/ConnectToTargetDialog.h b/src/SessionSetup/include/SessionSetup/ConnectToTargetDialog.h index 52671f1e70d..71d2227c1e0 100644 --- a/src/SessionSetup/include/SessionSetup/ConnectToTargetDialog.h +++ b/src/SessionSetup/include/SessionSetup/ConnectToTargetDialog.h @@ -56,7 +56,7 @@ class ConnectToTargetDialog : public QDialog { [[nodiscard]] ErrorMessageOr DeployOrbitServiceAndSetupProcessManager(); void SetStatusMessage(const QString& message); - void LogAndDisplayError(const ErrorMessage& message); + static void LogAndDisplayError(const ErrorMessage& message); }; } // namespace orbit_session_setup diff --git a/src/Symbols/SymbolHelper.cpp b/src/Symbols/SymbolHelper.cpp index 44ca236b117..5be51a6faad 100644 --- a/src/Symbols/SymbolHelper.cpp +++ b/src/Symbols/SymbolHelper.cpp @@ -352,7 +352,7 @@ ErrorMessageOr SymbolHelper::LoadFallbackSymbo } ErrorMessageOr SymbolHelper::FindDebugInfoFileLocally( - std::string_view filename, uint32_t checksum, absl::Span directories) const { + std::string_view filename, uint32_t checksum, absl::Span directories) { std::set search_paths; for (const auto& directory : directories) { search_paths.insert(directory / filename); diff --git a/src/Symbols/include/Symbols/SymbolHelper.h b/src/Symbols/include/Symbols/SymbolHelper.h index 60d6b68473d..c4174ca5835 100644 --- a/src/Symbols/include/Symbols/SymbolHelper.h +++ b/src/Symbols/include/Symbols/SymbolHelper.h @@ -54,9 +54,9 @@ class SymbolHelper : public SymbolCacheInterface { [[nodiscard]] static bool IsMatchingDebugInfoFile(const std::filesystem::path& file_path, uint32_t checksum); - [[nodiscard]] ErrorMessageOr FindDebugInfoFileLocally( + [[nodiscard]] static ErrorMessageOr FindDebugInfoFileLocally( std::string_view filename, uint32_t checksum, - absl::Span directories) const; + absl::Span directories); private: template