Lines Matching +full:a +full:- +full:bit

1 /* SPDX-License-Identifier: GPL-2.0 */
17 * If arch does not support a ftrace feature:
40 * As we need a way to maintain state if we are tracing the function
41 * graph in irq because we want to trace a particular function that
52 * at a start of graph tracing, and we want to trace
54 * than zero, because of the preempted start of a previous
56 * if a softirq interrupted the start of graph tracing,
57 * followed by an interrupt preempting a start of graph
60 * that preempted a softirq start of a function that
62 * greater than 3, so the next two bits are a mask
70 * To implement set_graph_notrace, if this bit is set, we ignore
80 #define trace_recursion_set(bit) do { (current)->trace_recursion |= (1<<(bit)); } while (0) argument
81 #define trace_recursion_clear(bit) do { (current)->trace_recursion &= ~(1<<(bit)); } while (0) argument
82 #define trace_recursion_test(bit) ((current)->trace_recursion & (1<<(bit))) argument
85 (((current)->trace_recursion >> TRACE_GRAPH_DEPTH_START_BIT) & 3)
88 current->trace_recursion &= \
90 current->trace_recursion |= \
100 #define TRACE_CONTEXT_MASK ((1 << (TRACE_LIST_START + TRACE_CONTEXT_BITS)) - 1)
119 unsigned char bit = interrupt_context_level(); in trace_get_context_bit() local
121 return TRACE_CTX_NORMAL - bit; in trace_get_context_bit()
154 * Preemption is promised to be disabled when return bit >= 0.
159 unsigned int val = READ_ONCE(current->trace_recursion); in trace_test_and_set_recursion()
160 int bit; in trace_test_and_set_recursion() local
163 return -1; in trace_test_and_set_recursion()
165 bit = trace_get_context_bit() + start; in trace_test_and_set_recursion()
166 if (unlikely(val & (1 << bit))) { in trace_test_and_set_recursion()
168 * If an interrupt occurs during a trace, and another trace in trace_test_and_set_recursion()
171 * will think a recursion occurred, and the event will be dropped. in trace_test_and_set_recursion()
172 * Let a single instance happen via the TRANSITION_BIT to in trace_test_and_set_recursion()
175 bit = TRACE_CTX_TRANSITION + start; in trace_test_and_set_recursion()
176 if (val & (1 << bit)) { in trace_test_and_set_recursion()
178 return -1; in trace_test_and_set_recursion()
182 val |= 1 << bit; in trace_test_and_set_recursion()
183 current->trace_recursion = val; in trace_test_and_set_recursion()
188 return bit; in trace_test_and_set_recursion()
194 static __always_inline void trace_clear_recursion(int bit) in trace_clear_recursion() argument
198 trace_recursion_clear(bit); in trace_clear_recursion()
202 * ftrace_test_recursion_trylock - tests for recursion in same context
207 * Returns: -1 if a recursion happened.
217 * ftrace_test_recursion_unlock - called when function callback is complete
218 * @bit: The return of a successful ftrace_test_recursion_trylock()
220 * This is used at the end of a ftrace callback.
222 static __always_inline void ftrace_test_recursion_unlock(int bit) in ftrace_test_recursion_unlock() argument
224 trace_clear_recursion(bit); in ftrace_test_recursion_unlock()