Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 May 2017 09:23:14 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r317732 - head/usr.bin/truss
Message-ID:  <201705030923.v439NEWv072629@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Wed May  3 09:23:13 2017
New Revision: 317732
URL: https://svnweb.freebsd.org/changeset/base/317732

Log:
  Decode the third argument of socket().

Modified:
  head/usr.bin/truss/syscall.h
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/syscall.h
==============================================================================
--- head/usr.bin/truss/syscall.h	Wed May  3 09:20:36 2017	(r317731)
+++ head/usr.bin/truss/syscall.h	Wed May  3 09:23:13 2017	(r317732)
@@ -46,7 +46,7 @@ enum Argtype { None = 1, Hex, Octal, Int
 	LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode, Long,
 	Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex, Utrace, IntArray, Pipe2,
 	CapFcntlRights, Fadvice, FileFlags, Flockop, Getfsstatmode, Kldsymcmd,
-	Kldunloadflags, Sizet, Madvice, Socklent,
+	Kldunloadflags, Sizet, Madvice, Socklent, Sockprotocol,
 
 	CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags,
 	CloudABIFDStat, CloudABIFileStat, CloudABIFileType,

Modified: head/usr.bin/truss/syscalls.c
==============================================================================
--- head/usr.bin/truss/syscalls.c	Wed May  3 09:20:36 2017	(r317731)
+++ head/usr.bin/truss/syscalls.c	Wed May  3 09:23:13 2017	(r317732)
@@ -317,7 +317,7 @@ static struct syscall decoded_syscalls[]
 	{ .name = "sigwaitinfo", .ret_type = 1, .nargs = 2,
 	  .args = { { Sigset | IN, 0 }, { Ptr, 1 } } },
 	{ .name = "socket", .ret_type = 1, .nargs = 3,
-	  .args = { { Sockdomain, 0 }, { Socktype, 1 }, { Int, 2 } } },
+	  .args = { { Sockdomain, 0 }, { Socktype, 1 }, { Sockprotocol, 2 } } },
 	{ .name = "stat", .ret_type = 1, .nargs = 2,
 	  .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } },
 	{ .name = "statfs", .ret_type = 1, .nargs = 2,
@@ -1917,6 +1917,17 @@ print_arg(struct syscall_args *sc, unsig
 	case Socklent:
 		fprintf(fp, "%u", (socklen_t)args[sc->offset]);
 		break;
+	case Sockprotocol: {
+		int protocol;
+
+		protocol = args[sc->offset];
+		if (protocol == 0) {
+			fputs("0", fp);
+		} else {
+			print_integer_arg(sysdecode_ipproto, fp, protocol);
+		}
+		break;
+	}
 
 	case CloudABIAdvice:
 		fputs(xlookup(cloudabi_advice, args[sc->offset]), fp);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705030923.v439NEWv072629>