Hello Adam, As usually quick and accurate response! - thank you!. Thursday, March 31, 2005, 7:27:24 PM, you wrote: AL> Hey Robert, AL> Good question. It''s kind of tricky and it will change depending on the AL> ISA, but you can do it. AL> sparc 32-bit: AL> this->argN AL> *(uint32_t *)copyin(uregs[R_SP] + sizeof (uint32_t) * (N + 17), AL> sizeof (uint32_t)); AL> (only applies to args past the first 6) This one (above) works ok. AL> sparc 64-bit: AL> this->argN AL> *(uint32_t *)copyin(uregs[R_SP] + 0x7ff + AL> sizeof (uint64_t) * (N + 16), sizeof (uint64_t)); AL> (only applies to args past the first 6) this one I had to chane first uint32_t type to uint64_t and then it works. AL> x86: AL> this->argN AL> *(uint32_t *)copyin(uregs[R_SP] + sizeof (uint32_t) * (N + 1), AL> sizeof (uint32_t)); AL> amd64: AL> this->argN AL> *(uint64_t *)copyin(uregs[R_SP] + sizeof (uint64_t) * (N - 5), AL> sizeof (uint64_t)); AL> (only applies to args past the first 6) AL> If you run into any problems with those let me know. One tricky thing about AL> amd64 is that the compiler seems free to use as much or as little of the AL> 64 bits allotted to each argument so if you pass an int, the first 32-bits AL> will contain the value of the 32-bit int, and the upper 32-bits will be AL> garbage. Of course, you can just cast the value to an int, but it''s a AL> pitfall to watch out for. AL> We''re working on getting the args array working for the pid provider and AL> we''ll consider allowing more than just 10 args. Great! -- Best regards, Robert mailto:rmilkowski@task.gda.pl _______________________________________________ DTrace mailing list DTrace@opensolaris.org https://www.opensolaris.org/mailman/listinfo/dtrace
Hey Robert, Good question. It''s kind of tricky and it will change depending on the ISA, but you can do it. sparc 32-bit: this->argN *(uint32_t *)copyin(uregs[R_SP] + sizeof (uint32_t) * (N + 17), sizeof (uint32_t)); (only applies to args past the first 6) sparc 64-bit: this->argN *(uint32_t *)copyin(uregs[R_SP] + 0x7ff + sizeof (uint64_t) * (N + 16), sizeof (uint64_t)); (only applies to args past the first 6) x86: this->argN *(uint32_t *)copyin(uregs[R_SP] + sizeof (uint32_t) * (N + 1), sizeof (uint32_t)); amd64: this->argN *(uint64_t *)copyin(uregs[R_SP] + sizeof (uint64_t) * (N - 5), sizeof (uint64_t)); (only applies to args past the first 6) If you run into any problems with those let me know. One tricky thing about amd64 is that the compiler seems free to use as much or as little of the 64 bits allotted to each argument so if you pass an int, the first 32-bits will contain the value of the 32-bit int, and the upper 32-bits will be garbage. Of course, you can just cast the value to an int, but it''s a pitfall to watch out for. We''re working on getting the args array working for the pid provider and we''ll consider allowing more than just 10 args. Adam On Wed, Mar 30, 2005 at 02:52:13PM +0200, Robert Milkowski wrote:> Hello dtrace, > > args[] does not work with PID provider and only arg0-9 are > available. How can I access more then first 10 arguments? > > -- > Best regards, > Robert mailto:rmilkowski@task.gda.pl > > _______________________________________________ > DTrace mailing list > DTrace@opensolaris.org > https://www.opensolaris.org/mailman/listinfo/dtrace-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl _______________________________________________ DTrace mailing list DTrace@opensolaris.org https://www.opensolaris.org/mailman/listinfo/dtrace
Hello dtrace, args[] does not work with PID provider and only arg0-9 are available. How can I access more then first 10 arguments? -- Best regards, Robert mailto:rmilkowski@task.gda.pl _______________________________________________ DTrace mailing list DTrace@opensolaris.org https://www.opensolaris.org/mailman/listinfo/dtrace