eb6e DTrace in 7.1-p2 - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > General

General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Reply
 
Thread Tools Display Modes
  #1  
Old January 28th, 2009, 17:41
alp alp is offline
Junior Member
 
Join Date: Jan 2009
Posts: 29
Thanks: 1
Thanked 3 Times in 3 Posts
Default DTrace in 7.1-p2

Hello.
I've updated to FreeBSD-7.1-p2 and I'm going to look at DTrace. But I have the following error after compiling new kernel according the instructions in Handbook:
Code:
# ./hotkernel
Sampling... Hit Ctrl-C to end.
dtrace: invalid probe specifier 
	#pragma D option quiet
	profile:::profile-1001hz
	/arg0/
	{
		@pc[arg0] = count();
	}
	dtrace:::END
	{
		printa("%a %@d\n", @pc);
	}
: "/usr/lib/dtrace/psinfo.d", line 37: syntax error near "uid_t"
I have compiled kernel with the following options:

Code:
options         KDTRACE_FRAME   # Ensure frames are compiled in - need it on amd64
options         KDTRACE_HOOKS           # Kernel DTrace hooks
options         DDB_CTF # DTrace CTF.
and made make WITH_CTF=1 kernel KERNCONF=MyConf

ctfdump on /boot/kernel/kernel gives a long listing, begining with:

Code:
- CTF Header -----------------------------------------------------------------

  cth_magic    = 0xcff1
  cth_version  = 2
  cth_flags    = 0x01
  cth_parlabel = (anon)
  cth_parname  = (anon)
  cth_lbloff   = 0
  cth_objtoff  = 8
  cth_funcoff  = 19910
  cth_typeoff  = 41348
  cth_stroff   = 41348
  cth_strlen   = 37

- Label Table ----------------------------------------------------------------

      0 FreeBSD 7.1-RELEASE-p2 amd64 701000

- Data Objects ---------------------------------------------------------------

  [0] 0        __set_sysctl_set_sym_sysctl___kern_cam (3)

Last edited by DutchDaemon; December 7th, 2010 at 19:25.
Reply With Quote
  #2  
Old January 28th, 2009, 22:43
Maledictus Maledictus is offline
Junior Member
 
Join Date: Nov 2008
Posts: 53
Thanks: 14
Thanked 7 Times in 6 Posts
Default

Hmm, I had the same error but I forgot WITH_CTF=1 at that time. The first thing I tried was renaming psinfo.d which kinda helped too. Maybe just try that too?
Reply With Quote
  #3  
Old January 29th, 2009, 07:23
alp alp is offline
Junior Member
 
Join Date: Jan 2009
Posts: 29
Thanks: 1
Thanked 3 Times in 3 Posts
Default

It shouldn't help, cause as I understand this will make the psinfo struct unknown to DTrace. It seems, DTrace doesn't understand uid_t type...
Reply With Quote
  #4  
Old January 31st, 2009, 11:50
nox@ nox@ is offline
FreeBSD Developer
 
Join Date: Feb 2008
Posts: 66
Thanks: 1
Thanked 38 Times in 14 Posts
Default

Quote:
Originally Posted by alp View Post
Hello.
I've updated to FreeBSD-7.1-p2 and I'm going to look at DTrace. But I have the following error after compiling new kernel according the instructions in Handbook:
# ./hotkernel
Sampling... Hit Ctrl-C to end.
[...]
: "/usr/lib/dtrace/psinfo.d", line 37: syntax error near "uid_t"

I have compiled kernel with the following options:
[...]
I don't see a problem with your kernel options, the same script 'works' here (works in quotes because using too many fbt probes like this does can cause panics which is a known problem mentioned in an early DTrace for FreeBSD - sources available via cvsup announcement) - maybe you forgot to # kldload dtraceall or something went wrong with the way you did the installkernel?
Reply With Quote
  #5  
Old January 31st, 2009, 19:01
f-andrey f-andrey is offline
Junior Member
 
Join Date: Jan 2009
Location: Russia, S-Petersburg
Posts: 33
Thanks: 11
Thanked 8 Times in 3 Posts
Default

My sistem dtrace not working to
Code:
test# uname -a
FreeBSD test.local 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Sat Jan 31 18:35:34 MSK 2009     andrey@test.local:/usr/obj/usr/src/sys/MY_USB2  amd64
test# kldstat 
Id Refs Address            Size     Name
...
 8    1 0xffffffff80cff000 1588     dtraceall.ko
 9    4 0xffffffff80d01000 51e8     cyclic.ko
10    9 0xffffffff80d07000 3678     opensolaris.ko
11    7 0xffffffff80d0b000 14fab0   dtrace.ko
12    2 0xffffffff80e5b000 1e40     dtmalloc.ko
13    2 0xffffffff80e5d000 4b30     fbt.ko
...
test# dtrace -l
   ID   PROVIDER  MODULE         FUNCTION NAME
    1     dtrace                 BEGIN
    2     dtrace                 END
    3     dtrace                 ERROR
    4    syscall                 syscall entry
...
test# dtrace -l | wc -l
   30546
test# dtrace -n "syscall::::"
dtrace: invalid probe specifier syscall::::: "/usr/lib/dtrace/psinfo.d", line 37: syntax error near "uid_t"

test# grep KDTRACE /usr/src/sys/amd64/conf/MY_USB2
options         KDTRACE_FRAME           # Ensure frames are compiled in
options         KDTRACE_HOOKS           # Kernel DTrace hooks
test# grep CTF /usr/src/sys/amd64/conf/MY_USB2 /etc/make.conf
/usr/src/sys/amd64/conf/MY_USB2:options         DDB_CTF
/etc/make.conf:WITH_CTF=1
Mayby this is because of amd64?
Reply With Quote
  #6  
Old July 20th, 2010, 21:51
trasz@ trasz@ is offline
FreeBSD Developer
 
Join Date: Feb 2008
Location: Warszawa, Poland
Posts: 178
Thanks: 7
Thanked 37 Times in 29 Posts
Default

The '/usr/lib/dtrace/psinfo.d", line 37: syntax error near "uid_t"' error means you have to recompile your kernel and world with "WITH_CTF=1" in /etc/src.conf.
Reply With Quote
  #7  
Old December 7th, 2010, 13:07
mjb mjb is offline
Junior Member
 
Join Date: Oct 2009
Location: Stoke, UK
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I know it's an old thread, but this is one of the top google results for psinfo.d so may help someone else with the same problem

Quote:
Originally Posted by trasz@ View Post
The '/usr/lib/dtrace/psinfo.d", line 37: syntax error near "uid_t"' error means you have to recompile your kernel and world with "WITH_CTF=1" in /etc/src.conf.
This may have been the case previously or for 7.x, but the wiki page says:

Quote:
Note: WITH_CTF=1 in the kernel config file works only on 9-CURRENT (or later) but not for stable/8. For stable/8 specify WITH_CTF on the make command line. In either case WITH_CTF=1 will not be picked up from make.conf or src.conf for the kernel build.
After failing to RTFM properly the first time around, I can confirm you do need it on the 'make kernel' command line (at least on 8.2-PRERELEASE), not just in src.conf
Reply With Quote
Reply

Tags
dtrace 7.1

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Current status of dtrace? Maledictus FreeBSD Development 11 May 13th, 2009 00:26


All times are GMT +1. The time now is 05:56.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0