e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# CDDL HEADER START
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# This file and its contents are supplied under the terms of the
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# Common Development and Distribution License ("CDDL"), version 1.0.
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# You may only use this file in accordance with the terms of version
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# 1.0 of the CDDL.
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# A full copy of the text of the CDDL should have accompanied this
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# source. A copy of the CDDL is also available via the Internet at
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# CDDL HEADER END
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# Copyright (c) 2012 by Delphix. All rights reserved.
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal############################################################################
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# temporal option causes output to be sorted
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# SECTION: Pragma
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# NOTES: The temporal option has no effect on a single-CPU system, so
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# this needs to be run on a multi-CPU system to effectively test the
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# temporal option.
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal############################################################################
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhalif [ $# != 1 ]; then
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal echo expected one argument: '<'dtrace-path'>'
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal$dtrace -o $file -c 'sleep 3' -s /dev/stdin <<EOF
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal #pragma D option quiet
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal #pragma D option temporal
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal @lines = count();
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal printf("0 begin\n");
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal /* Bump @lines every time we print a line. */
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal @lines = count();
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal printf("%u end\n", timestamp);
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal @lines = count();
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal printa("99999999999999999 lines %@u\n", @lines);
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal @lines = count();
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal printf("%u\n", timestamp);
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# dtrace outputs a blank line at the end, which will sort to the beginning,
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal# so use head to remove the blank line.
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhalif [ $(tail -n 1 $file.2 | cut -f3 -d ' ') -ne \
e5803b76927480e8f9b67b22201c484ccf4c2bcfAdam H. Leventhal $(wc -l $file.2) ]; then