2011-01-11 20:56:53 -02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#ifndef __PERF_EVLIST_H
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#define __PERF_EVLIST_H 1
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include <linux/list.h>
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-12 22:39:13 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "../perf.h"
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-15 10:40:59 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "event.h"
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-11 20:56:53 -02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-11 22:30:02 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								struct pollfd;
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-30 10:46:46 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								struct thread_map;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								struct cpu_map;
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-11 22:30:02 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-12 22:39:13 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#define PERF_EVLIST__HLIST_BITS 8
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-11 20:56:53 -02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								struct perf_evlist {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									struct list_head entries;
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-12 22:39:13 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									struct hlist_head heads[PERF_EVLIST__HLIST_SIZE];
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-11 20:56:53 -02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									int		 nr_entries;
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-11 22:30:02 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									int		 nr_fds;
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-12 22:39:13 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									int		 mmap_len;
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-29 09:08:13 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									bool		 overwrite;
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-29 14:01:45 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									union perf_event event_copy;
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-12 22:39:13 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									struct perf_mmap *mmap;
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-11 22:30:02 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									struct pollfd	 *pollfd;
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-30 11:59:43 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									struct thread_map *threads;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									struct cpu_map	  *cpus;
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-11 20:56:53 -02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								};
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								struct perf_evsel;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-30 11:59:43 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								struct perf_evlist *perf_evlist__new(struct cpu_map *cpus,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												     struct thread_map *threads);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										       struct thread_map *threads);
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-18 21:41:45 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								void perf_evlist__exit(struct perf_evlist *evlist);
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-11 20:56:53 -02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								void perf_evlist__delete(struct perf_evlist *evlist);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								int perf_evlist__add_default(struct perf_evlist *evlist);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-10 11:15:54 -03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								void perf_evlist__id_add(struct perf_evlist *evlist, struct perf_evsel *evsel,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											 int cpu, int thread, u64 id);
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-04 22:29:39 -03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-30 11:59:43 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								int perf_evlist__alloc_pollfd(struct perf_evlist *evlist);
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-12 17:03:24 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd);
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-11 22:30:02 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-12 22:39:13 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-29 14:01:45 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								union perf_event *perf_evlist__read_on_cpu(struct perf_evlist *self, int cpu);
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-15 10:40:59 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-30 11:59:43 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								int perf_evlist__alloc_mmap(struct perf_evlist *evlist);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								int perf_evlist__mmap(struct perf_evlist *evlist, int pages, bool overwrite);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								void perf_evlist__munmap(struct perf_evlist *evlist);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								static inline void perf_evlist__set_maps(struct perf_evlist *evlist,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
													 struct cpu_map *cpus,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
													 struct thread_map *threads)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									evlist->cpus	= cpus;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									evlist->threads	= threads;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								int perf_evlist__create_maps(struct perf_evlist *evlist, pid_t target_pid,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											     pid_t target_tid, const char *cpu_list);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								void perf_evlist__delete_maps(struct perf_evlist *evlist);
							 | 
						
					
						
							
								
									
										
										
										
											2011-02-26 04:51:54 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								int perf_evlist__set_filters(struct perf_evlist *evlist);
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-30 10:46:46 -02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-11 20:56:53 -02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif /* __PERF_EVLIST_H */
							 |