Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Nov 2006 07:09:50 GMT
From:      John Birrell <jb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 109220 for review
Message-ID:  <200611040709.kA479oZp020856@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=109220

Change 109220 by jb@jb_freebsd8 on 2006/11/04 07:08:54

	Merge the DTrace stuff back in.

Affected files ...

.. //depot/projects/dtrace/src/sys/sys/linker.h#12 edit

Differences ...

==== //depot/projects/dtrace/src/sys/sys/linker.h#12 (text+ko) ====

@@ -33,6 +33,7 @@
 
 #include <machine/elf.h>
 #include <sys/kobj.h>
+#include <sys/sdt.h>
 
 #ifdef MALLOC_DECLARE
 MALLOC_DECLARE(M_LINKER);
@@ -59,6 +60,8 @@
     size_t		size;
 } linker_symval_t;
 
+typedef int (*linker_function_nameval_callback_t)(linker_file_t, linker_symval_t *, void *);
+
 struct common_symbol {
     STAILQ_ENTRY(common_symbol) link;
     char*		name;
@@ -73,6 +76,7 @@
 #define LINKER_FILE_LINKED	0x1	/* file has been fully linked */
     TAILQ_ENTRY(linker_file) link;	/* list of all loaded files */
     char*		filename;	/* file which was loaded */
+    char*		pathname;	/* file name with full path */
     int			id;		/* unique id */
     caddr_t		address;	/* load address */
     size_t		size;		/* size of file */
@@ -81,6 +85,18 @@
     STAILQ_HEAD(, common_symbol) common; /* list of common symbols */
     TAILQ_HEAD(, module) modules;	/* modules in this file */
     TAILQ_ENTRY(linker_file) loaded;	/* preload dependency support */
+    int			loadcnt;	/* load counter value */
+
+    /*
+     * Function Boundary Tracing (FBT) or Statically Defined Tracing (SDT)
+     * fields.
+     */
+    int			nenabled;	/* number of enabled probes. */
+    int			fbt_nentries;	/* number of fbt entries created. */
+    sdt_probedesc_t	*sdt_probes;
+    int			sdt_nentries;
+    size_t		sdt_nprobes;
+    size_t		sdt_size;
 };
 
 /*
@@ -133,6 +149,11 @@
 				  int _deps);
 
 /*
+ * Lookup a symbol in all files, returning it's value.
+ */
+caddr_t linker_file_lookup_value(const char* _name);
+
+/*
  * Lookup a linker set in a file.  Return pointers to the first entry,
  * last + 1, and count of entries.  Use: for (p = start; p < stop; p++) {}
  * void *start is really: "struct yoursetmember ***start;"
@@ -141,6 +162,12 @@
 			   void *_start, void *_stop, int *_count);
 
 /*
+ * List all functions in a file.
+ */
+int linker_file_function_listall(linker_file_t, int (*)(linker_file_t,
+    linker_symval_t *, void *), void *);
+
+/*
  * Functions soley for use by the linker class handlers.
  */
 int linker_add_class(linker_class_t _cls);
@@ -237,6 +264,7 @@
 int	elf_reloc_local(linker_file_t _lf, Elf_Addr base, const void *_rel, int _type, elf_lookup_fn _lu);
 const Elf_Sym *elf_get_sym(linker_file_t _lf, Elf_Size _symidx);
 const char *elf_get_symname(linker_file_t _lf, Elf_Size _symidx);
+int sdt_reloc_resolve(uint8_t *, sdt_probedesc_t *);
 
 int elf_cpu_load_file(linker_file_t);
 int elf_cpu_unload_file(linker_file_t);
@@ -245,6 +273,18 @@
 #define ELF_RELOC_REL	1
 #define ELF_RELOC_RELA	2
 
+/*
+ * This is version 1 of the KLD file status structure. It is identified
+ * by it's _size_ in the version field.
+ */
+struct kld_file_stat_1 {
+    int		version;	/* set to sizeof(linker_file_stat) */
+    char        name[MAXPATHLEN];
+    int		refs;
+    int		id;
+    caddr_t	address;	/* load address */
+    size_t	size;		/* size in bytes */
+};
 #endif /* _KERNEL */
 
 struct kld_file_stat {
@@ -254,6 +294,7 @@
     int		id;
     caddr_t	address;	/* load address */
     size_t	size;		/* size in bytes */
+    char        pathname[MAXPATHLEN];
 };
 
 struct kld_sym_lookup {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611040709.kA479oZp020856>