Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
Tiny NFCs in rusage_{utils,profiler}
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 520158264
  • Loading branch information
ussuri authored and copybara-github committed Mar 28, 2023
1 parent b1e8503 commit 4738ad5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rusage_profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class RUsageProfiler {
// the caller, as if the caller printed them. That makes it easy to attribute
// the logged resource usage to the actual user rather than RUsageProfiler.
RUsageProfiler( //
RUsageScope scope, //
RUsageScope scope, // Which process/thread to monitor
MetricsMask metrics, // Which metrics to track
RaiiActionsMask raii_actions, // Which RAII logs to enable
SourceLocation location, // Pass SourceLocation{__FILE__, __LINE__}
Expand All @@ -344,7 +344,7 @@ class RUsageProfiler {
// the client can still request explicit snapshots at any time, interleaved
// with timelapse ones.
RUsageProfiler( //
RUsageScope scope, //
RUsageScope scope, // Which process/thread to monitor
MetricsMask metrics, // Which metrics to track
absl::Duration timelapse_interval, // Take timelapse snapshots this often
bool also_log_timelapses, // Log timelapse snapshots as taken
Expand Down
2 changes: 1 addition & 1 deletion rusage_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ RUsageScope RUsageScope::ThisThread() {
return RUsageScope{getpid(), static_cast<pid_t>(syscall(__NR_gettid))};
}

RUsageScope RUsageScope::Thread(pid_t tid) {
RUsageScope RUsageScope::ThisProcessThread(pid_t tid) {
return RUsageScope{getpid(), tid};
}

Expand Down
2 changes: 1 addition & 1 deletion rusage_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class RUsageScope {
static RUsageScope ThisProcess();
static RUsageScope Process(pid_t pid);
static RUsageScope ThisThread();
static RUsageScope ThisProcessThread(pid_t tid);
static RUsageScope Thread(pid_t pid, pid_t tid);
static RUsageScope Thread(pid_t tid);

// Copyable and movable.
RUsageScope(const RUsageScope&) = default;
Expand Down

0 comments on commit 4738ad5

Please sign in to comment.