• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: DTrace probe problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DTrace probe problem


  • Subject: Re: DTrace probe problem
  • From: "Michael Ash" <email@hidden>
  • Date: Fri, 6 Jun 2008 11:13:29 +0800

On Fri, Jun 6, 2008 at 10:28 AM, radj <email@hidden> wrote:
> Hello again.
>
> I have another problem now and it is how to set off DTrace from within the
> application. This is my code:
>
> // SNIPPET START
>
> int pid = [[NSProcessInfo processInfo] processIdentifier];
>
> NSArray *arguments = [NSArray arrayWithObjects: @"-w", // permit destructive
> actions
>                                                    @"-o /tmp/DTraceLog", //
> output file
>                                                    @"-s /tmp/DTrace.d", //
> D script

These are not your immediate problem, but they will break next. These
arguments are incorrect. You're passing the flag plus the value as a
*single* argument. This is equivalent to quoting it in the shell. You
don't want that. Pass them as separate arguments. See:

http://www.cocoadev.com/index.pl?NSTaskArguments

>                                                    [NSNumber
> numberWithInt:pid], // feed in PID for macro $1
>                                                    nil];
>
> NSTask *task;
> task = [[NSTask alloc] init];
> [task setLaunchPath: @"/dev/dtrace"];

This won't work. /dev is for "devices", not "developer". /dev/dtrace
is a dtrace kernel device, *not* the dtrace binary. Use "which dtrace"
in the shell to find out the path to the dtrace executable.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: DTrace probe problem
      • From: radj <email@hidden>
References: 
 >Re: DTrace probe problem (From: radj <email@hidden>)
 >Re: DTrace probe problem (From: Bill Bumgarner <email@hidden>)
 >Re: DTrace probe problem (From: Ken Thomases <email@hidden>)
 >Re: DTrace probe problem (From: radj <email@hidden>)
 >Re: DTrace probe problem (From: Ken Thomases <email@hidden>)
 >Re: DTrace probe problem (From: radj <email@hidden>)
 >Re: DTrace probe problem (From: radj <email@hidden>)
 >Re: DTrace probe problem (From: radj <email@hidden>)

  • Prev by Date: Re: NSBundle getting location of file in bundle
  • Next by Date: Re: App hangs when displaying any sheet in 10.5 [SOLVED]
  • Previous by thread: Re: DTrace probe problem
  • Next by thread: Re: DTrace probe problem
  • Index(es):
    • Date
    • Thread