Skip to content

Commit

Permalink
context_tracking: Rename context_tracking_active() to context_trackin…
Browse files Browse the repository at this point in the history
…g_cpu_is_enabled()

We currently have a confusing couple of API naming with the existing
context_tracking_active() and context_tracking_is_enabled().

Lets keep the latter one, context_tracking_is_enabled(), for global
context tracking state check and use context_tracking_cpu_is_enabled()
for local state check.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Frederic Weisbecker committed Dec 2, 2013
1 parent 58135f5 commit d0df09e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions include/linux/context_tracking_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ static inline bool context_tracking_is_enabled(void)
{
return static_key_false(&context_tracking_enabled);
}
static inline bool context_tracking_in_user(void)

static inline bool context_tracking_cpu_is_enabled(void)
{
return __this_cpu_read(context_tracking.state) == IN_USER;
return __this_cpu_read(context_tracking.active);
}

static inline bool context_tracking_active(void)
static inline bool context_tracking_in_user(void)
{
return __this_cpu_read(context_tracking.active);
return __this_cpu_read(context_tracking.state) == IN_USER;
}
#else
static inline bool context_tracking_in_user(void) { return false; }
Expand Down
2 changes: 1 addition & 1 deletion include/linux/vtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static inline bool vtime_accounting_enabled(void) { return true; }
static inline bool vtime_accounting_enabled(void)
{
if (context_tracking_is_enabled()) {
if (context_tracking_active())
if (context_tracking_cpu_is_enabled())
return true;
}

Expand Down

0 comments on commit d0df09e

Please sign in to comment.