Lines Matching +full:protect +full:- +full:exec

4  *    Copyright (C) 2008-2009, Thomas Gleixner <tglx@linutronix.de>
5 * Copyright (C) 2008-2011, Red Hat, Inc., Ingo Molnar
6 * Copyright (C) 2008-2011, Red Hat, Inc., Peter Zijlstra
12 * For licencing details see kernel-base/COPYING
21 * Kernel-internal data types and definitions:
98 * -1ULL means invalid/unknown.
108 * The hw_idx index is between -1 (unknown) and max depth,
128 int idx; /* index in shared_regs->regs[] */
132 * struct hw_perf_event - performance event hardware details:
154 /* for tp_event->class */
199 #define PERF_HES_UPTODATE 0x02 /* event->count up-to-date */
277 * struct pmu - generic performance monitoring unit
290 * various common per-pmu feature flags
304 * Fully disable/enable this PMU, can be used to protect from the PMI
314 * -ENOENT -- @event is not for this PMU
316 * -ENODEV -- @event is for this PMU but PMU not present
317 * -EBUSY -- @event is for this PMU but PMU temporarily unavailable
318 * -EINVAL -- @event is for this PMU but @event is not valid
319 * -EOPNOTSUPP -- @event is for this PMU, @event is valid, but not supported
320 * -EACCES -- @event is for this PMU, @event is valid, but no privileges
322 * 0 -- @event is for this PMU and valid
336 * Flags for ->add()/->del()/ ->start()/->stop(). There are
345 * transaction, see the ->*_txn() methods.
354 * ->add() called without PERF_EF_START should result in the same state
355 * as ->add() followed by ->stop().
357 * ->del() must always PERF_EF_UPDATE stop an event. If it calls
358 * ->stop() that must deal with already being stopped without
368 * returns !0. ->start() will be used to continue.
373 * is on -- will be called from NMI context with the PMU generates
376 * ->stop() with PERF_EF_UPDATE will read the counter and update
377 * period/count values like ->read() would.
379 * ->start() with PERF_EF_RELOAD will reprogram the counter
380 * value, must be preceded by a ->stop() with PERF_EF_UPDATE.
398 * Start the transaction, after this ->add() doesn't need to
405 * If ->start_txn() disabled the ->add() schedulability test
406 * then ->commit_txn() is required to perform one. On success
408 * open until ->cancel_txn() is called.
414 * Will cancel the transaction, assumes ->del() is called
415 * for each successful ->add() during the transaction.
423 * if no implementation is provided it will default to: event->hw.idx + 1.
428 * context-switches callback
439 * PMU specific parts of task perf event context (i.e. ctx->task_ctx_data)
449 * Set up pmu-private data structures for an AUX area
456 * Free pmu-private AUX data structures
462 * state, so that preempting ->start()/->stop() callbacks does
476 * supplied filters are valid, -errno otherwise.
486 * translate hw-agnostic filters into hardware configuration in
489 * Runs as a part of filter sync sequence that is done in ->start()
503 * or non-zero for "match".
509 * Filter events for PMU-specific reasons.
526 * struct perf_addr_filter - address range filter definition
528 * @path: object file's path for file-based filters
533 * This is a hardware-agnostic filter configuration as specified by the user.
544 * struct perf_addr_filters_head - container for address range filters
548 * @nr_file_filters: number of file-based filters
565 * enum perf_event_state - the states of an event:
568 PERF_EVENT_STATE_DEAD = -4,
569 PERF_EVENT_STATE_EXIT = -3,
570 PERF_EVENT_STATE_ERROR = -2,
571 PERF_EVENT_STATE_OFF = -1,
622 if ((event)->group_leader == (event)) \
623 list_for_each_entry((sibling), &(event)->sibling_list, sibling_list)
626 * struct perf_event - performance event kernel representation:
632 * modifications require ctx->lock
638 * Locked for modification by both ctx->mutex and ctx->lock; holding
676 * been scheduled in, if this is a per-task event)
690 * ctx_time already accounts for ctx->timestamp. Therefore to
712 * Protect attach/detach and child_list:
748 /* vma address array for file-based filders */
796 * struct perf_event_context - event context structure
803 * Protect the states of the events in the list,
808 * Protect the list of events. Locking either mutex or lock
864 * struct perf_event_cpu_context - per cpu event context structure
887 * Per-CPU storage for iterators used in visit_groups_merge. The default
918 * This is a per-cpu dynamically allocated data structure.
939 ctx ? lockdep_is_held(&ctx->lock) in perf_cgroup_from_task()
1052 data->addr = addr; in perf_sample_data_init()
1053 data->raw = NULL; in perf_sample_data_init()
1054 data->br_stack = NULL; in perf_sample_data_init()
1055 data->period = period; in perf_sample_data_init()
1056 data->weight.full = 0; in perf_sample_data_init()
1057 data->data_src.val = PERF_MEM_NA; in perf_sample_data_init()
1058 data->txn = 0; in perf_sample_data_init()
1087 if (likely(event->overflow_handler == perf_event_output_forward)) in is_default_overflow_handler()
1089 if (unlikely(event->overflow_handler == perf_event_output_backward)) in is_default_overflow_handler()
1108 struct perf_event_attr *attr = &event->attr; in event_has_any_exclude_flag()
1110 return attr->exclude_idle || attr->exclude_user || in event_has_any_exclude_flag()
1111 attr->exclude_kernel || attr->exclude_hv || in event_has_any_exclude_flag()
1112 attr->exclude_guest || attr->exclude_host; in event_has_any_exclude_flag()
1117 return event->attr.sample_period != 0; in is_sampling_event()
1125 return event->event_caps & PERF_EV_CAP_SOFTWARE; in is_software_event()
1133 return event->ctx->pmu->task_ctx_nr == perf_sw_context; in in_software_context()
1138 return pmu->capabilities & PERF_PMU_CAP_EXCLUSIVE; in is_exclusive_pmu()
1151 * When generating a perf sample in-line, instead of from an interrupt /
1153 * like: SW_CONTEXT_SWITCHES, SW_MIGRATIONS and the tie-in with tracepoints.
1156 * - ip for PERF_SAMPLE_IP
1157 * - cs for user_mode() tests
1158 * - sp for PERF_SAMPLE_CALLCHAIN
1159 * - eflags for MISC bits and CALLCHAIN (see: perf_hw_regs())
1201 task->sched_migrated = 1; in perf_event_task_migrate()
1211 task->sched_migrated) { in perf_event_task_sched_in()
1213 task->sched_migrated = 0; in perf_event_task_sched_in()
1247 extern void perf_event_comm(struct task_struct *tsk, bool exec);
1273 if (ctx->contexts < sysctl_perf_event_max_contexts_per_stack) { in perf_callchain_store_context()
1274 struct perf_callchain_entry *entry = ctx->entry; in perf_callchain_store_context()
1275 entry->ip[entry->nr++] = ip; in perf_callchain_store_context()
1276 ++ctx->contexts; in perf_callchain_store_context()
1279 ctx->contexts_maxed = true; in perf_callchain_store_context()
1280 return -1; /* no more room, stop walking the stack */ in perf_callchain_store_context()
1286 if (ctx->nr < ctx->max_stack && !ctx->contexts_maxed) { in perf_callchain_store()
1287 struct perf_callchain_entry *entry = ctx->entry; in perf_callchain_store()
1288 entry->ip[entry->nr++] = ip; in perf_callchain_store()
1289 ++ctx->nr; in perf_callchain_store()
1292 return -1; /* no more room, stop walking the stack */ in perf_callchain_store()
1320 return sysctl_perf_event_paranoid > -1; in perf_is_paranoid()
1326 return -EACCES; in perf_allow_kernel()
1334 return -EACCES; in perf_allow_cpu()
1341 if (sysctl_perf_event_paranoid > -1 && !perfmon_capable()) in perf_allow_tracepoint()
1342 return -EPERM; in perf_allow_tracepoint()
1365 return event->attr.sample_type & PERF_SAMPLE_BRANCH_STACK; in has_branch_stack()
1370 return event->attr.branch_sample_type != 0; in needs_branch_stack()
1375 return event->pmu->setup_aux; in has_aux()
1380 return !!event->attr.write_backward; in is_write_backward()
1385 return event->pmu->nr_addr_filters; in has_addr_filter()
1394 struct perf_addr_filters_head *ifh = &event->addr_filters; in perf_event_addr_filters()
1396 if (event->parent) in perf_event_addr_filters()
1397 ifh = &event->parent->addr_filters; in perf_event_addr_filters()
1444 unsigned long size) { return -EINVAL; } in perf_aux_output_skip()
1460 static inline struct file *perf_event_get(unsigned int fd) { return ERR_PTR(-EINVAL); } in perf_event_get()
1463 return ERR_PTR(-EINVAL); in perf_get_event()
1467 return ERR_PTR(-EINVAL); in perf_event_attrs()
1472 return -EINVAL; in perf_event_read_local()
1475 static inline int perf_event_task_disable(void) { return -EINVAL; } in perf_event_task_disable()
1476 static inline int perf_event_task_enable(void) { return -EINVAL; } in perf_event_task_enable()
1479 return -EINVAL; in perf_event_refresh()
1501 static inline void perf_event_comm(struct task_struct *tsk, bool exec) { } in perf_event_comm() argument
1510 static inline int perf_swevent_get_recursion_context(void) { return -1; } in perf_swevent_get_recursion_context()
1515 static inline int __perf_event_disable(void *info) { return -1; } in __perf_event_disable()
1520 return -EINVAL; in perf_event_period()
1536 return frag->pad < sizeof(u64); in perf_raw_frag_last()