| 
									
										
										
										
											2012-09-10 18:50:19 +02:00
										 |  |  | #ifndef __PERF_VDSO__
 | 
					
						
							|  |  |  | #define __PERF_VDSO__
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <linux/types.h>
 | 
					
						
							|  |  |  | #include <string.h>
 | 
					
						
							|  |  |  | #include <stdbool.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define VDSO__MAP_NAME "[vdso]"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-23 13:45:23 +03:00
										 |  |  | #define DSO__NAME_VDSO    "[vdso]"
 | 
					
						
							|  |  |  | #define DSO__NAME_VDSO32  "[vdso32]"
 | 
					
						
							|  |  |  | #define DSO__NAME_VDSOX32 "[vdsox32]"
 | 
					
						
							| 
									
										
										
										
											2014-07-22 16:17:57 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-09-10 18:50:19 +02:00
										 |  |  | static inline bool is_vdso_map(const char *filename) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return !strcmp(filename, VDSO__MAP_NAME); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-22 16:17:57 +03:00
										 |  |  | struct dso; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | bool dso__is_vdso(struct dso *dso); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-22 16:17:53 +03:00
										 |  |  | struct machine; | 
					
						
							| 
									
										
										
										
											2014-07-22 16:18:00 +03:00
										 |  |  | struct thread; | 
					
						
							| 
									
										
										
										
											2014-07-22 16:17:53 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
											  
											
												perf machine: Fix up vdso methods names
To make it consistent with the other dso lifetime routines.
For instance:
 struct dso *vdso__new(struct machine *machine, const char *short_name,
		        const char *long_name)
Becomes:
 struct dso *machine__addnew_vdso(struct machine *machine, const
				  char *short_name, const char *long_name)
Because:
1) There is no 'struct vdso' for us to have vdso__ prefixed routines.
2) Because it will not really just create a new instance of 'struct
   dso', it'll call dso__new() but it will also insert it into the
   DSO's list/rbtree, and we have a method name for that: 'addnew',
   just like we have dsos__addnew().
3) So it is really a 'struct machine' operation, it is the first
   argument, etc.
This way the place where this is used gets consistent:
                if (vdso) {
                        pgoff = 0;
-                       dso = vdso__dso_findnew(machine, thread);
+                       dso = machine__findnew_vdso(machine, thread);
                } else
                        dso = machine__findnew_dso(machine, filename);
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/n/tip-r3w3tvh8exm9xfz3p4tz9qbz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
											
										 
											2015-05-29 11:54:08 -03:00
										 |  |  | struct dso *machine__findnew_vdso(struct machine *machine, struct thread *thread); | 
					
						
							|  |  |  | void machine__exit_vdso(struct machine *machine); | 
					
						
							| 
									
										
										
										
											2012-09-10 18:50:19 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | #endif /* __PERF_VDSO__ */
 |