summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2026-03-19 02:45:57 +0300
committerNamhyung Kim <namhyung@kernel.org>2026-03-20 00:42:46 +0300
commit8ebb69e549aa900cb51c0876c4f6ea03e5ece438 (patch)
tree6c4571263faf7c86db114c937feec1cc8a27224a /tools
parentd84db579d75fd32ea6dd7814c8cf6b1c8b45ac05 (diff)
downloadlinux-8ebb69e549aa900cb51c0876c4f6ea03e5ece438.tar.xz
perf target: Constify simple check functions
Allow the target to be const in callers. Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Thomas Richter <tmricht@linux.ibm.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/target.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/util/target.h b/tools/perf/util/target.h
index 84ebb9c940c6..bc2bff9c6842 100644
--- a/tools/perf/util/target.h
+++ b/tools/perf/util/target.h
@@ -49,22 +49,22 @@ uid_t parse_uid(const char *str);
int target__strerror(struct target *target, int errnum, char *buf, size_t buflen);
-static inline bool target__has_task(struct target *target)
+static inline bool target__has_task(const struct target *target)
{
return target->tid || target->pid;
}
-static inline bool target__has_cpu(struct target *target)
+static inline bool target__has_cpu(const struct target *target)
{
return target->system_wide || target->cpu_list;
}
-static inline bool target__none(struct target *target)
+static inline bool target__none(const struct target *target)
{
return !target__has_task(target) && !target__has_cpu(target);
}
-static inline bool target__enable_on_exec(struct target *target)
+static inline bool target__enable_on_exec(const struct target *target)
{
/*
* Normally enable_on_exec should be set if:
@@ -75,12 +75,12 @@ static inline bool target__enable_on_exec(struct target *target)
return target__none(target) && !target->initial_delay;
}
-static inline bool target__has_per_thread(struct target *target)
+static inline bool target__has_per_thread(const struct target *target)
{
return target->system_wide && target->per_thread;
}
-static inline bool target__uses_dummy_map(struct target *target)
+static inline bool target__uses_dummy_map(const struct target *target)
{
bool use_dummy = false;