1291344Sgnn#!/usr/sbin/dtrace -s
2291344Sgnn/*-
3291344Sgnn * Copyright (c) 2015 George V. Neville-Neil <gnn@neville-neil.com>
4291344Sgnn * All rights reserved.
5291344Sgnn *
6291344Sgnn * Redistribution and use in source and binary forms, with or without
7291344Sgnn * modification, are permitted provided that the following conditions
8291344Sgnn * are met:
9291344Sgnn * 1. Redistributions of source code must retain the above copyright
10291344Sgnn *    notice, this list of conditions and the following disclaimer.
11291344Sgnn * 2. Redistributions in binary form must reproduce the above copyright
12291344Sgnn *    notice, this list of conditions and the following disclaimer in the
13291344Sgnn *    documentation and/or other materials provided with the distribution.
14291344Sgnn *
15291344Sgnn * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
16291344Sgnn * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17291344Sgnn * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18291344Sgnn * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
19291344Sgnn * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20291344Sgnn * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21291344Sgnn * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22291344Sgnn * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23291344Sgnn * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24291344Sgnn * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25291344Sgnn * SUCH DAMAGE.
26291344Sgnn *
27291344Sgnn * $FreeBSD: releng/11.0/share/dtrace/retval 298386 2016-04-21 03:17:53Z gnn $
28291344Sgnn *
29291344Sgnn * retval - show the return value of any probe named by the user
30291344Sgnn *
31291344Sgnn * USAGE:	retval name
32291344Sgnn *
33291344Sgnn * The name can be a full function name or a wild card name.  The
34291344Sgnn * caller is responsible for handling the escaping of wild cards.
35291344Sgnn */
36291344Sgnn
37291344Sgnn#pragma D option quiet
38291344Sgnn
39291344Sgnnfbt::$1:return {
40298386Sgnn	printf("%s+0x%x returned %d\n", probefunc, arg0, arg1);
41291344Sgnn}
42291344Sgnn
43