From owner-p4-projects@FreeBSD.ORG Tue Jun 13 00:54:11 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 B051C16A476; Tue, 13 Jun 2006 00:54:11 +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 8CDA916A41A for ; Tue, 13 Jun 2006 00:54:11 +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 A6D5643D66 for ; Tue, 13 Jun 2006 00:54:07 +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 k5D0poRF052864 for ; Tue, 13 Jun 2006 00:51:50 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5D0poZm052861 for perforce@freebsd.org; Tue, 13 Jun 2006 00:51:50 GMT (envelope-from jb@freebsd.org) Date: Tue, 13 Jun 2006 00:51:50 GMT Message-Id: <200606130051.k5D0poZm052861@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 99101 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: Tue, 13 Jun 2006 00:54:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=99101 Change 99101 by jb@jb_freebsd2 on 2006/06/13 00:51:08 Use Sun's standard module naming. Affected files ... .. //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_module.c#9 edit .. //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_open.c#13 edit Differences ... ==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_module.c#9 (text) ==== @@ -846,18 +846,9 @@ #else GElf_Phdr ph; char name[MAXPATHLEN]; - char *p; int i = 0; - /* - * Create a module name based on the full path name of the - * kernel module, but with slashes and dots changed to be - * underscores to suit the parser. - */ - (void) strlcpy(name, k_stat->pathname, sizeof(name)); - for (p = name; *p != '\0'; p++) - if (*p == '/' || *p == '.') - *p = '_'; + (void) strlcpy(name, k_stat->name, sizeof(name)); (void) strlcpy(fname, k_stat->pathname, sizeof(fname)); #endif ==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_open.c#13 (text) ==== @@ -119,7 +119,7 @@ }; /* - * Global varaiables that are formatted on FreeBSD based on the kernel file name. + * Global variables that are formatted on FreeBSD based on the kernel file name. */ #if !defined(sun) static char curthread_str[MAXPATHLEN]; @@ -1098,25 +1098,23 @@ #if !defined(sun) { char bootfile[MAXPATHLEN]; + char *p; int i; size_t len = sizeof(bootfile); /* This call shouldn't fail, but use a default just in case. */ if (sysctlbyname("kern.bootfile", bootfile, &len, NULL, 0) != 0) - strlcpy(bootfile, "_boot_kernel_kernel", sizeof(bootfile)); + strlcpy(bootfile, "kernel", sizeof(bootfile)); - /* - * Convert the kernel file name to a DTrace module name because DTrace - * doesn't like slashes in module names. - */ - for (i = 0; i < len; i++) - if (bootfile[i] == '/') - bootfile[i] = '_'; + if ((p = strrchr(bootfile, '/')) != NULL) + p++; + else + p = bootfile; /* * Format the global variables based on the kernel module name. */ - snprintf(curthread_str, sizeof(curthread_str), "%s`struct thread *",bootfile); + snprintf(curthread_str, sizeof(curthread_str), "%s`struct thread *",p); } #endif