1235368Sgnn#!/usr/sbin/dtrace -Zs
2/*
3 * js_execs.d - JavaScript execute snoop using DTrace.
4 *              Written for the JavaScript DTrace provider.
5 *
6 * $Id: js_execs.d 63 2007-10-04 04:34:38Z brendan $
7 *
8 * This traces activity from all browsers on the system that are
9 * running with JavaScript provider support.
10 *
11 * USAGE: js_execs.d 		# hit Ctrl-C to end
12 *
13 * FIELDS:
14 *		TIME		Time of event
15 *		FILE		Filename of the JavaScript program
16 *		LINENO		Line number in filename
17 *
18 * Filename and function names are printed if available.
19 *
20 * COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
21 *
22 * CDDL HEADER START
23 *
24 *  The contents of this file are subject to the terms of the
25 *  Common Development and Distribution License, Version 1.0 only
26 *  (the "License").  You may not use this file except in compliance
27 *  with the License.
28 *
29 *  You can obtain a copy of the license at Docs/cddl1.txt
30 *  or http://www.opensolaris.org/os/licensing.
31 *  See the License for the specific language governing permissions
32 *  and limitations under the License.
33 *
34 * CDDL HEADER END
35 *
36 * 09-Sep-2007	Brendan Gregg	Created this.
37 */
38
39#pragma D option quiet
40#pragma D option switchrate=10
41
42dtrace:::BEGIN
43{
44	printf("%-20s  %32s:%s\n", "TIME", "FILE", "LINENO");
45}
46
47javascript*:::execute-start
48{
49	printf("%-20Y  %32s:%d\n", walltimestamp, basename(copyinstr(arg0)),
50	    arg1);
51}
52