Re: [PATCH] Fix types of arguments to dtrace syscall return probes

2011-11-10 Thread Paul Ambrose
If there is anything I can do for kern/160307 or other Dtrace issue ,
please let me know

2011/11/8 Ryan Stone ryst...@gmail.com:
 On Mon, Nov 7, 2011 at 9:16 AM, Paul Ambrose ambrose...@gmail.com wrote:
 diff --git a/sys/kern/kern_ctf.c b/sys/kern/kern_ctf.c
 index bdff96e..2737860 100644
 --- a/sys/kern/kern_ctf.c
 +++ b/sys/kern/kern_ctf.c
 @@ -90,7 +90,7 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc)
         * ctfcnt to -1. See below.
         */
        if (ef-ctfcnt  0)
 -               return (0);
 +               return (EFTYPE);

        /* Now check if we've already loaded the CTF data.. */
        if (ef-ctfcnt  0) {
 ---

 I have committed this as r227342.  Thanks for the fix.

 And I post another fix for the ${NORMAL_CTFCONVERT} issue, could you
 check it for me?

 Yes, I can take a look.

  kern/160307, I check the /boot/kernel/kernel with ctfdump, and found
 the kernel image has right ctf information, do you
 have any idea?

 Offhand, no.  I'll try to find some time to look at your PRs.

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [PATCH] Fix types of arguments to dtrace syscall return probes

2011-11-08 Thread Ryan Stone
On Mon, Nov 7, 2011 at 9:16 AM, Paul Ambrose ambrose...@gmail.com wrote:
 diff --git a/sys/kern/kern_ctf.c b/sys/kern/kern_ctf.c
 index bdff96e..2737860 100644
 --- a/sys/kern/kern_ctf.c
 +++ b/sys/kern/kern_ctf.c
 @@ -90,7 +90,7 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc)
         * ctfcnt to -1. See below.
         */
        if (ef-ctfcnt  0)
 -               return (0);
 +               return (EFTYPE);

        /* Now check if we've already loaded the CTF data.. */
        if (ef-ctfcnt  0) {
 ---

I have committed this as r227342.  Thanks for the fix.

 And I post another fix for the ${NORMAL_CTFCONVERT} issue, could you
 check it for me?

Yes, I can take a look.

  kern/160307, I check the /boot/kernel/kernel with ctfdump, and found
 the kernel image has right ctf information, do you
 have any idea?

Offhand, no.  I'll try to find some time to look at your PRs.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [PATCH] Fix types of arguments to dtrace syscall return probes

2011-11-07 Thread Paul Ambrose
Thank you for your work. I will give it a try in stable/9.  I have
another two PR:
  kern/160307 and bin/160275 that maybe you can help;
 the reason of bin/160275 is complicated, but the fix for kernel crash
caused by module without ctf section(for example, nvidia.ko) missed
somthing
(my mistake)
in kern/kern_ctf.c

int link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc)

struct nameidata nd;
struct thread *td = curthread;
uint8_t ctf_hdr[CTF_HDR_SIZE];
#endif
int error = 0;

if (lf == NULL || lc == NULL)
return (EINVAL);

/* Set the defaults for no CTF present. That's not a crime! */
bzero(lc, sizeof(*lc));

#ifdef DDB_CTF
/*
 * First check if we've tried to load CTF data previously and the
 * CTF ELF section wasn't found. We flag that condition by setting
 * ctfcnt to -1. See below.
 */
if (ef-ctfcnt  0)//second
time with same module,
return (0);

/* Now check if we've already loaded the CTF data.. */
if (ef-ctfcnt  0) {
/* We only need to load once. */
lc-ctftab = ef-ctftab;
lc-ctfcnt = ef-ctfcnt;
lc-symtab = ef-ddbsymtab;
lc-strtab = ef-ddbstrtab;
lc-strcnt = ef-ddbstrcnt;
lc-nsym   = ef-ddbsymcnt;
lc-ctfoffp = (uint32_t **) ef-ctfoff;
lc-typoffp = (uint32_t **) ef-typoff;
lc-typlenp = ef-typlen;
return (0);
}

/*
 * We need to try reading the CTF data. Flag no CTF data present
 * by default and if we actually succeed in reading it, we'll
 * update ctfcnt to the number of bytes read.
 */
ef-ctfcnt = -1;
-
fisrt time, set ctfcnt to -1, if module does not has ctf section, and
ef-ctfcnt does NOT update  with a valid value(0) later,
then second time enter this function with same module(ef), previous
if (ef-ctfcnt  0)
return (0);// should not be 0 here
pass over   first time  ctf section check,  I think we need another fix .

diff --git a/sys/kern/kern_ctf.c b/sys/kern/kern_ctf.c
index bdff96e..2737860 100644
--- a/sys/kern/kern_ctf.c
+++ b/sys/kern/kern_ctf.c
@@ -90,7 +90,7 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc)
 * ctfcnt to -1. See below.
 */
if (ef-ctfcnt  0)
-   return (0);
+   return (EFTYPE);

/* Now check if we've already loaded the CTF data.. */
if (ef-ctfcnt  0) {
---
And I post another fix for the ${NORMAL_CTFCONVERT} issue, could you
check it for me?

  kern/160307, I check the /boot/kernel/kernel with ctfdump, and found
the kernel image has right ctf information, do you
have any idea?

And thank you again for your work!
--
[PATCH] Fix kernel panics when using dtrace fbt return probes on i386

[PATCH] Fix types of arguments to dtrace syscall return probes

walltimestamp curpsinfo-pr_psargs has  no args from Shawn Webb
latt...@gmail.com.

 commit ec734d4fb07fec8d1b5fb8d1d4c8caa0fada4eea
Author: rstone rst...@freebsd.org
Replace fasttrap_copyout() with uwrite().  FreeBSD copyout() is not able to
write to the .text section of a process.

commit 83b04575eb8f73e557f245bb2814ac6db0a89696
Author: rstone rst...@freebsd.org
Fix the DTrace pid return trap interrupt vector.  Previously we were using
31, but that vector is reserved.



2011/11/6 Ryan Stone ryst...@gmail.com:
 Currently if you try to use the args[] array passed to a syscall
 return probe, you get variables with the wrong type.  This is because
 the systrace implementation is currently using the same function to
 provide the same argument types for both the entry and return probes,
 which is completely wrong.  For example:

 # dtrace -v -l -n syscall::mmap:return
   ID   PROVIDER            MODULE                          FUNCTION NAME
 32159    syscall                                                mmap return

        Probe Description Attributes
                Identifier Names: Private
                Data Semantics:   Private
                Dependency Class: ISA

        Argument Attributes
                Identifier Names: Private
                Data Semantics:   Private
                Dependency Class: ISA

        Argument Types
                args[0]: caddr_t
                args[1]: size_t
                args[2]: int
                args[3]: int
                args[4]: int