From owner-p4-projects@FreeBSD.ORG Sat Nov 4 07:09:51 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B9DEB16A47E; Sat, 4 Nov 2006 07:09:51 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 644B016A403 for ; Sat, 4 Nov 2006 07:09:51 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3054B43D49 for ; Sat, 4 Nov 2006 07:09:51 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kA479pHG020859 for ; Sat, 4 Nov 2006 07:09:51 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kA479oZp020856 for perforce@freebsd.org; Sat, 4 Nov 2006 07:09:50 GMT (envelope-from jb@freebsd.org) Date: Sat, 4 Nov 2006 07:09:50 GMT Message-Id: <200611040709.kA479oZp020856@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 109220 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Nov 2006 07:09:52 -0000 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 #include +#include #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 {