This file is indexed.

/usr/share/systemtap/tapset/linux/syscalls2.stp is in systemtap-common 2.6-0.2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
// syscalls tapset part 2 [N-Z]
// Copyright (C) 2005 IBM Corp.
// Copyright (C) 2005-2014 Red Hat Inc.
// Copyright (C) 2007 Quentin Barnes.
//
// This file is part of systemtap, and is free software.  You can
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.

/* Each syscall returns the calls parameters. In addition, the following
* variables are set:
*
* name - generally the syscall name minus the "sys_".
*
* argstr - a string containing the decoded args in an easy-to-read format.
*          It doesn't need to contain everything, but should have all the
*          important args. Set in entry probes only.
*
* retstr - a string containing the return value in an easy-to-read format.
*          Set in return probes only.
*/

# nanosleep __________________________________________________
#
# long sys_nanosleep(struct timespec __user *rqtp,
#		struct timespec __user *rmtp)
# long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
#		struct compat_timespec __user *rmtp)
#
probe syscall.nanosleep = kernel.function("sys_nanosleep").call
{
	name = "nanosleep"
	req_uaddr = $rqtp
	rem_uaddr = $rmtp
	argstr = sprintf("%s, %p", _struct_timespec_u($rqtp, 1), $rmtp)
}
probe syscall.nanosleep.return = kernel.function("sys_nanosleep").return
{
	name = "nanosleep"
	retstr = return_str(1, $return)
}
probe syscall.compat_nanosleep = kernel.function("compat_sys_nanosleep").call ?
{
	name = "nanosleep"
	req_uaddr = $rqtp
	rem_uaddr = $rmtp
	argstr = sprintf("%s, %p", _struct_compat_timespec_u($rqtp, 1), $rmtp)
}
probe syscall.compat_nanosleep.return = kernel.function("compat_sys_nanosleep").return ?
{
	name = "nanosleep"
	retstr = return_str(1, $return)
}

# nfsservctl _________________________________________________
#
# long sys_nfsservctl(int cmd, struct nfsctl_arg __user *arg, void __user *res)
# long compat_sys_nfsservctl(int cmd, struct compat_nfsctl_arg __user *arg,
#					union compat_nfsctl_res __user *res)
#
# nfsservctl was removed in kernel 3.0/2.6.40.
%( kernel_v < "2.6.40" && CONFIG_NFSD == "[ym]" %?
probe syscall.nfsservctl = kernel.function("sys_nfsservctl").call ?,
                           kernel.function("compat_sys_nfsservctl").call ?
{
	name = "nfsservctl"
	cmd = $cmd
	if (@defined($arg) && @defined($res)) {
		argp_uaddr = $arg
		resp_uaddr = $res
		argstr = sprintf("%s, %p, %p", _nfsctl_cmd_str($cmd),
				 $arg, $res)
	} else {
		argp_uaddr = $notused
		resp_uaddr = $notused2
		argstr = sprintf("/* NI_SYSCALL */ %s, %p, %p",
				 _nfsctl_cmd_str($cmd), $notused, $notused2)
	}
}
probe syscall.nfsservctl.return = kernel.function("sys_nfsservctl").return ?,
                                  kernel.function("compat_sys_nfsservctl").return ?
{
	name = "nfsservctl"
	retstr = return_str(1, $return)
}
%)

# nice _______________________________________________________
# long sys_nice(int increment)
#
probe syscall.nice = kernel.function("sys_nice").call ?
{
	name = "nice"
	inc = $increment
	argstr = sprintf("%d", $increment)
}
probe syscall.nice.return = kernel.function("sys_nice").return ?
{
	name = "nice"
	retstr = return_str(1, $return)
}

# ni_syscall _________________________________________________
#
# long sys_ni_syscall(void)
#
probe syscall.ni_syscall = kernel.function("sys_ni_syscall").call
{
	name = "ni_syscall"
	argstr = ""
}
probe syscall.ni_syscall.return = kernel.function("sys_ni_syscall").return
{
	name = "ni_syscall"
	retstr = return_str(1, $return)
}

# open _______________________________________________________
# long sys_open(const char __user * filename, int flags, int mode)
# (obsolete) long sys32_open(const char * filename, int flags, int mode)
#
probe syscall.open = __syscall.compat_open ?, __syscall.open
{
	@__syscall_compat_gate(%{ __NR_open %}, %{ __NR_compat_open %})
	name = "open"
	flags = __int32($flags)
	if ($flags & %{ O_CREAT %})
		argstr = sprintf("%s, %s, %#o", filename,
				 _sys_open_flag_str(__int32($flags)), mode)
	else
		argstr = sprintf("%s, %s", filename,
				 _sys_open_flag_str(__int32($flags)))
}
probe __syscall.compat_open = kernel.function("compat_sys_open").call ?,
			      kernel.function("sys32_open").call ?
{
	// On some platforms, $filename and $mode are longs on the
	// kernel side. Truncate these down to 32 bits.
	filename = user_string_quoted(__uint32($filename))
	mode = __uint32($mode)
}
probe __syscall.open = kernel.function("sys_open").call
{
	filename = user_string_quoted($filename)
	mode = __uint32($mode)
}
probe syscall.open.return = kernel.function("compat_sys_open").return ?,
                            kernel.function("sys32_open").return ?,
                            kernel.function("sys_open").return ?
{
	@__syscall_compat_gate(%{ __NR_open %}, %{ __NR_compat_open %})
	name = "open"
	retstr = return_str(1, $return)
}

# openat _______________________________________________________
# long sys_openat(int dfd, const char __user *filename, int flags, int mode)
# long compat_sys_openat(unsigned int dfd, const char __user *filename, int flags, int mode)
#
probe syscall.openat = kernel.function("compat_sys_openat").call ?,
                       kernel.function("sys_openat").call ?
{
	name = "openat"
	dfd = __int32($dfd)
	dfd_str = _dfd_str(__int32($dfd))
	filename = user_string_quoted($filename)
	flags = $flags
	mode = __uint32($mode)
	if ($flags & %{ O_CREAT %})
		argstr = sprintf("%s, %s, %s, %#o", _dfd_str(__int32($dfd)),
				 user_string_quoted($filename),
				 _sys_open_flag_str($flags), __uint32($mode))
	else
		argstr = sprintf("%s, %s, %s", _dfd_str(__int32($dfd)),
				 user_string_quoted($filename),
				 _sys_open_flag_str(__int32($flags)))
}
probe syscall.openat.return = kernel.function("compat_sys_openat").return ?,
                              kernel.function("sys_openat").return ?
{
	name = "openat"
	retstr = return_str(1, $return)
}

# pause ______________________________________________________
#
# sys_pause(void)
#
probe syscall.pause = kernel.function("sys_pause").call ?,
                      kernel.function("sys32_pause").call ?,
                      kernel.function("compat_sys_pause").call ?
{
	name = "pause"
	argstr = ""
}
probe syscall.pause.return = kernel.function("sys_pause").return ?,
                             kernel.function("sys32_pause").return ?,
                             kernel.function("compat_sys_pause").return ?
{
	name = "pause"
	retstr = return_str(1, $return)
}

# pciconfig_iobase ___________________________________________
#
# asmlinkage long
# sys_pciconfig_iobase(long which,
#			    unsigned long bus,
#			    unsigned long dfn)
#
#
#probe syscall.pciconfig_iobase = kernel.function("sys_pciconfig_iobase").call
#{
#	name = "pciconfig_iobase"
#	which = $which
#	bus = $bus
#	dfn = $dfn
#	argstr = sprintf("%p, %p, %p", which, bus, dfn)
#}
#probe syscall.pciconfig_iobase.return = kernel.function("sys_pciconfig_iobase").return
#{
#	name = "pciconfig_iobase"
#	retstr = return_str(1, $return)
#}
# pciconfig_read _____________________________________________
#
# asmlinkage int
# sys_pciconfig_read(unsigned long bus,
#			  unsigned long dfn,
#			  unsigned long off,
#			  unsigned long len,
#			  unsigned char *buf)
#			  { return 0; }
#
#
#probe syscall.pciconfig_read = kernel.function("sys_pciconfig_read").call
#{
#	name = "pciconfig_read"
#	bus = $bus
#	dfn = $dfn
#	off = $off
#	len = $len
#	buf_uaddr = $buf
#	argstr = sprintf("%p, %p, %p, %d, %p", bus, dfn, off,
#				len, buf_uaddr)
#}
#probe syscall.pciconfig_read.return = kernel.function("sys_pciconfig_read").return
#{
#	name = "pciconfig_read"
#	retstr = return_str(1, $return)
#}
# pciconfig_write ____________________________________________
#
# asmlinkage int
# sys_pciconfig_write(unsigned long bus,
#			   unsigned long dfn,
#			   unsigned long off,
#			   unsigned long len,
#			   unsigned char *buf)
#
#
#probe syscall.pciconfig_write = kernel.function("sys_pciconfig_write").call
#{
#	name = "pciconfig_write"
#	bus = $bus
#	dfn = $dfn
#	off = $off
#	len = $len
#	buf_uaddr = $buf
#	argstr = sprintf("%p, %p, %p, %d, %p", bus, dfn, off,
#				len, buf_uaddr)
#}
#probe syscall.pciconfig_write.return = kernel.function("sys_pciconfig_write").return
#{
#	name = "pciconfig_write"
#	retstr = return_str(1, $return)
#}
# personality ________________________________________________
#
# asmlinkage long
# sys_personality(u_long personality)
#
probe syscall.personality = kernel.function("sys_personality").call
{
	name = "personality"
	persona = $personality
	argstr = sprintf("%p", persona);
}
probe syscall.personality.return = kernel.function("sys_personality").return
{
	name = "personality"
	retstr = return_str(1, $return)
}

# ia64 returns the results from the pipe call through (user) registers.
%( arch == "ia64" %?
function _ia64_pipe0:long() %{
	STAP_RETVALUE = CONTEXT->kregs ? CONTEXT->kregs->r8 : 0;
%}
function _ia64_pipe1:long() %{
	STAP_RETVALUE = _stp_current_pt_regs()->r9;
%}
%)
# pipe _______________________________________________________
#
# asmlinkage int sys_pipe(unsigned long __user * fildes)
# asmlinkage long sys_ia64_pipe (void)
# SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
# pipe2() was added to Linux in version 2.6.27.
probe syscall.pipe = __syscall.pipe2 ?, __syscall.ia64_pipe ?, __syscall.pipe
{
}
probe __syscall.pipe2 = kernel.function("sys_pipe2").call
{
	@__syscall_compat_gate(%{ __NR_pipe2 %}, %{ __NR_compat_pipe2 %})
	name = "pipe2"
	flags = $flags
	flag_str = _sys_pipe2_flag_str(flags);
	fildes_uaddr = $fildes
	if (fildes_uaddr == 0) {
		pipe0 = 0;
		pipe1 = 0;
		argstr = "NULL"
	} else {
		/* 
		 * Why use @cast here?  Why not just:
		 *
		 *   pipe0 = user_int(&$fildes[0]);
		 *   pipe1 = user_int(&$fildes[1]);
		 *
		 * The answer is syscall wrappers
		 * (CONFIG_SYSCALL_WRAPPERS).  On ppc (for example),
		 * SyS_foo has all "long" arguments, and then the
		 * inline SYSC_foo has the real argument types.  The
		 * @cast makes sure we're dealing with the "final"
		 * type.
		 */
		pipe0 = user_int(&@cast($fildes, "int")[0])
		pipe1 = user_int(&@cast($fildes, "int")[1])
		argstr = sprintf("[%d, %d], %s", pipe0, pipe1, flag_str);
	}
}
probe __syscall.ia64_pipe = kernel.function("sys_ia64_pipe").call
{
	name = "pipe"
	flags = 0
	flag_str = ""
	fildes_uaddr = 0
	pipe0 = 0;
	pipe1 = 0;
	argstr = "[0, 0]";
}
probe __syscall.pipe = kernel.function("sys_pipe").call
{
	name = "pipe"
	flags = 0
	flag_str = ""
	fildes_uaddr = $fildes
	if (fildes_uaddr == 0) {
		pipe0 = 0;
		pipe1 = 0;
		argstr = "NULL"
	} else {
		/* 
		 * Why use @cast here?  Why not just:
		 *
		 *   pipe0 = user_int(&$fildes[0]);
		 *   pipe1 = user_int(&$fildes[1]);
		 *
		 * The answer is syscall wrappers
		 * (CONFIG_SYSCALL_WRAPPERS).  On ppc (for example),
		 * SyS_foo has all "long" arguments, and then the
		 * inline SYSC_foo has the real argument types.  The
		 * @cast makes sure we're dealing with the "final"
		 * type.
		 */
		pipe0 = user_int(&@cast($fildes, "int")[0])
		pipe1 = user_int(&@cast($fildes, "int")[1])
		argstr = sprintf("[%d, %d]", pipe0, pipe1);
	}
}
probe syscall.pipe.return = __syscall.pipe2.return ?,
			    __syscall.ia64_pipe.return ?,
			    __syscall.pipe.return
{
}
probe __syscall.pipe2.return = kernel.function("sys_pipe2").return
{
	@__syscall_compat_gate(%{ __NR_pipe2 %}, %{ __NR_compat_pipe2 %})
	name = "pipe2"
	fildes_uaddr = $fildes
	if (fildes_uaddr == 0) {
		pipe0 = 0;
		pipe1 = 0;
	} else {
		/* 
		 * See comment in syscall.pipe about why @cast is used
		 * here.
		 */
		pipe0 = user_int(&@cast($fildes, "int")[0])
		pipe1 = user_int(&@cast($fildes, "int")[1])
	}
	retstr = return_str(1, $return)
}
probe __syscall.ia64_pipe.return = kernel.function("sys_ia64_pipe").return
{
	name = "pipe"
	fildes_uaddr = 0;
	pipe0 = _ia64_pipe0();
	pipe1 = _ia64_pipe1();
	retstr = (pipe0 < 0) ? return_str(1, $return) : "0";
}
probe __syscall.pipe.return = kernel.function("sys_pipe").return
{
	name = "pipe"
	fildes_uaddr = $fildes
	if (fildes_uaddr == 0) {
		pipe0 = 0;
		pipe1 = 0;
	} else {
		/* 
		 * See comment in syscall.pipe about why @cast is used
		 * here.
		 */
		pipe0 = user_int(&@cast($fildes, "int")[0])
		pipe1 = user_int(&@cast($fildes, "int")[1])
	}
	retstr = return_str(1, $return)
}

# pivot_root _________________________________________________
#
# long sys_pivot_root(const char __user *new_root, const char __user *put_old)
#
probe syscall.pivot_root = kernel.function("sys_pivot_root").call
{
	name = "pivot_root"
	new_root_str = user_string_quoted($new_root)
	old_root_str = user_string_quoted($put_old)
	argstr = sprintf("%s, %s", user_string_quoted($new_root),
		user_string_quoted($put_old))
}
probe syscall.pivot_root.return = kernel.function("sys_pivot_root").return
{
	name = "pivot_root"
	retstr = return_str(1, $return)
}

# poll _______________________________________________________
#
# long sys_poll(struct pollfd __user * ufds, unsigned int nfds, int timeout)
#
probe syscall.poll = kernel.function("sys_poll").call
{
	name = "poll"
	ufds_uaddr = $ufds
	nfds = __uint32($nfds)
	timeout = __int32(@choose_defined($timeout_msecs, $timeout))
	argstr = sprintf("%p, %u, %d", $ufds, __uint32($nfds),
			 __int32(@choose_defined($timeout_msecs, $timeout)))
}
probe syscall.poll.return = kernel.function("sys_poll").return
{
	name = "poll"
	retstr = return_str(1, $return)
}

# ppoll _______________________________________________________
#
# long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds,
#	struct timespec __user *tsp, const sigset_t __user *sigmask,
#	size_t sigsetsize)
#
probe syscall.ppoll = kernel.function("sys_ppoll").call ?
{
	name = "ppoll"
	argstr = sprintf("%p, %u, %s, %p, %d", $ufds, __uint32($nfds),
			 _struct_timespec_u($tsp, 1), $sigmask, $sigsetsize)
}
probe syscall.ppoll.return = kernel.function("sys_ppoll").return ?
{
	name = "ppoll"
	retstr = return_str(1, $return)
}
# long compat_sys_ppoll(struct pollfd __user *ufds,
#	unsigned int nfds, struct compat_timespec __user *tsp,
#	const compat_sigset_t __user *sigmask, compat_size_t sigsetsize)
#
probe syscall.compat_ppoll = kernel.function("compat_sys_ppoll").call ?
{
	name = "ppoll"
	argstr = sprintf("%p, %u, %s, %p, %d", $ufds, __uint32($nfds),
			 _struct_compat_timespec_u($tsp, 1), $sigmask,
			 $sigsetsize)
}
probe syscall.compat_ppoll.return = kernel.function("compat_sys_ppoll").return ?
{
	name = "ppoll"
	retstr = return_str(1, $return)
}

# prctl ______________________________________________________
#
# asmlinkage long
# sys_prctl(int option,
#	     unsigned long arg2,
#	     unsigned long arg3,
#	     unsigned long arg4,
#	     unsigned long arg5)
#
probe syscall.prctl = kernel.function("sys_prctl").call
{
	name = "prctl"
	option = $option
	arg2 = $arg2
	arg3 = $arg3
	arg4 = $arg4
	arg5 = $arg5
	argstr = sprintf("%p, %p, %p, %p, %p", option, arg2, arg3,
		arg4, arg5)
}
probe syscall.prctl.return = kernel.function("sys_prctl").return
{
	name = "prctl"
	retstr = return_str(1, $return)
}
# pread64 ____________________________________________________
#
# ssize_t sys_pread64(unsigned int fd,
#		 char __user *buf,
#		 size_t count,
#		 loff_t pos)
#
probe syscall.pread = kernel.function("sys_pread64").call
{
	name = "pread"
	fd = $fd
	buf_uaddr = $buf
	count = $count
	offset = $pos
	argstr = sprintf("%d, %p, %d, %d", $fd, $buf, $count, $pos)
}
probe syscall.pread.return = kernel.function("sys_pread64").return
{
	name = "pread"
	retstr = return_str(1, $return)
}

# preadv ____________________________________________________
#
# SYSCALL_DEFINE5(preadv, unsigned long, fd,
#		  const struct iovec __user *, vec,
#		  unsigned long, vlen, unsigned long, pos_l,
#		  unsigned long, pos_h)
# COMPAT_SYSCALL_DEFINE5(preadv, unsigned long, fd,
#		const struct compat_iovec __user *,vec,
#		unsigned long, vlen, u32, pos_low, u32, pos_high)
#
probe syscall.preadv = __syscall.preadv ?, __syscall.compat_preadv ?
{
	name = "preadv"
}
probe __syscall.preadv = kernel.function("sys_preadv")
{
	fd = __int32($fd)
	vector_uaddr = $vec
	count = __int32($vlen)
	offset = ($pos_h << %{ BITS_PER_LONG %}) + $pos_l
	argstr = sprintf("%d, %p, %d, 0x%x", __int32($fd), $vec,
			 __int32($vlen),
			 ($pos_h << %{ BITS_PER_LONG %}) + $pos_l)
}
probe __syscall.compat_preadv = kernel.function("compat_sys_preadv")
{
	fd = __int32($fd)
	vector_uaddr = $vec
	count = __int32($vlen)
	offset = ($pos_high << 32) + $pos_low
	argstr = sprintf("%d, %p, %d, 0x%x", __int32($fd), $vec,
			 __int32($vlen), ($pos_high << 32) + $pos_low)
}
probe syscall.preadv.return = kernel.function("sys_preadv").return ?,
			      kernel.function("compat_sys_preadv").return ?
{
	name = "preadv"
	retstr = return_str(1, $return)
}

# pselect6 _____________________________________________________
#
# long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp,
#	fd_set __user *exp, struct timespec __user *tsp, void __user *sig)
#
probe syscall.pselect6 = kernel.function("sys_pselect6").call ?
{
	name = "pselect6"
	argstr = sprintf("%d, %p, %p, %p, %s, %p", $n, $inp, $outp, $exp,
		_struct_timespec_u($tsp, 1), $sig)
}
probe syscall.pselect6.return = kernel.function("sys_pselect6").return ?
{
	name = "pselect6"
	retstr = return_str(1, $return)
}
probe syscall.compat_pselect6 = kernel.function("compat_sys_pselect6").call ?
{
	name = "pselect6"
	argstr = sprintf("%d, %p, %p, %p, %s, %p", $n, $inp, $outp, $exp,
		_struct_compat_timespec_u($tsp, 1), $sig)
}
probe syscall.compat_pselect6.return = kernel.function("compat_sys_pselect6").return ?
{
	name = "pselect6"
	retstr = return_str(1, $return)
}

# pselect7 _____________________________________________________
#
# long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp,
#	fd_set __user *exp, struct timespec __user *tsp,
#	const sigset_t __user *sigmask, size_t sigsetsize)
#
probe syscall.pselect7 = kernel.function("sys_pselect7").call ?
{
	name = "pselect7"
	argstr = sprintf("%d, %p, %p, %p, %s, %p, %d", $n, $inp, $outp, $exp,
		_struct_timespec_u($tsp, 1), $sigmask, $sigsetsize)
}
probe syscall.pselect7.return = kernel.function("sys_pselect7").return ?
{
	name = "pselect7"
	retstr = return_str(1, $return)
}

# Through a typo, 'compat_pselect7' was misnamed as
# 'compat_pselect7a' (notice the trailing 'a').  The old name is
# deprecated.  To use the old name without changing your script, use
# the '--compatible 1.3' stap option.
probe
%( systemtap_v <= "1.3"
	%? syscall.compat_pselect7a %: syscall.compat_pselect7
%) =
		kernel.function("compat_sys_pselect7").call ?
{
	name = "pselect7"
	argstr = sprintf("%d, %p, %p, %p, %s, %p, %d", $n, $inp, $outp, $exp,
		_struct_compat_timespec_u($tsp, 1), $sigmask, $sigsetsize)
}
probe syscall.compat_pselect7.return = kernel.function("compat_sys_pselect7").return ?
{
	name = "pselect7"
	retstr = return_str(1, $return)
}

# ptrace _____________________________________________________
#
# int sys_ptrace(long request,
#		long pid,
#		long addr,
#		long data)
#
probe syscall.ptrace = kernel.function("sys_ptrace").call ?
{
	name = "ptrace"
	request = $request
	pid = $pid
	addr = $addr
	data = $data

	argstr = _ptrace_argstr($request, $pid, $addr, $data)
}
probe syscall.ptrace.return = kernel.function("sys_ptrace").return ?
{
	name = "ptrace"
	retstr = return_str(1, $return)

	geteventmsg_data = _ptrace_return_geteventmsg_data($request, $data)
	arch_prctl_addr = _ptrace_return_arch_prctl_addr($request, $addr, $data)
}

# pwrite64 ___________________________________________________
#
# ssize_t sys_pwrite64(unsigned int fd,
#		  const char __user *buf,
#		  size_t count,
#		  loff_t pos)
#
probe syscall.pwrite = kernel.function("sys_pwrite64").call
{
	name = "pwrite"
	fd = $fd
	buf_uaddr = $buf
	count = $count
	offset = $pos
	argstr = sprintf("%d, %s, %d, %d", $fd,
		user_string_n2_quoted($buf, $count, syscall_string_trunc),
		$count, $pos)
}
probe syscall.pwrite.return = kernel.function("sys_pwrite64").return
{
	name = "pwrite"
	retstr = return_str(1, $return)
}
# long sys32_pwrite64(unsigned int fd, const char __user *ubuf,
#				size_t count, u32 poshi, u32 poslo)
probe syscall.pwrite32 = kernel.function("sys32_pwrite64").call ?
{
	name = "pwrite"
	fd = $fd
	count = $count
	offset = ($poshi << 32) + $poslo
%( arch == "s390" %?
	buf_uaddr = $ubuf
	argstr = sprintf("%d, %s, %d, %d", $fd,
		user_string_n2_quoted($ubuf, $count, syscall_string_trunc),
		$count, ($poshi << 32) + $poslo)
%:
	buf_uaddr = $buf
	argstr = sprintf("%d, %s, %d, %d", $fd,
		user_string_n2_quoted($buf, $count, syscall_string_trunc),
		$count, ($poshi << 32) + $poslo)
%)
}
probe syscall.pwrite32.return = kernel.function("sys32_pwrite64").return ?
{
	name = "pwrite"
	retstr = return_str(1, $return)
}

# pwritev ___________________________________________________
#
# sys_pwritev(unsigned long fd, const struct iovec __user * vec,
#             unsigned long vlen, unsigned long pos_l, unsigned long pos_h)
# compat_sys_pwritev(unsigned long fd, const struct compat_iovec __user *vec,
#                    unsigned long vlen, u32 pos_low, u32 pos_high)
#
probe syscall.pwritev = __syscall.pwritev ?, __syscall.compat_pwritev ?
{
	name = "pwritev"
}
probe __syscall.pwritev = kernel.function("sys_pwritev").call
{
	fd = __int32($fd)
	vector_uaddr = $vec
	count = __int32($vlen)
	offset = ($pos_h << %{ BITS_PER_LONG %}) + $pos_l
	argstr = sprintf("%d, %p, %d, 0x%x", __int32($fd), $vec,
			 __int32($vlen),
			 ($pos_h << %{ BITS_PER_LONG %}) + $pos_l)
}
probe __syscall.compat_pwritev = kernel.function("compat_sys_pwritev").call
{
	fd = __int32($fd)
	vector_uaddr = $vec
	count = __int32($vlen)
	offset = ($pos_high << 32) + $pos_low
	argstr = sprintf("%d, %p, %d, 0x%x", __int32($fd), $vec,
			 __int32($vlen),
			 ($pos_high << 32) + $pos_low)
}
probe syscall.pwritev.return = kernel.function("sys_pwritev").return ?,
			       kernel.function("compat_sys_pwritev").return ?
{
	name = "pwritev"
	retstr = return_str(1, $return)
}

# quotactl ___________________________________________________
#
# long sys_quotactl(unsigned int cmd,
#		  const char __user *special,
#		  qid_t id,
#		  void __user *addr)
#
probe syscall.quotactl = kernel.function("sys_quotactl").call ?
{
	name = "quotactl"
	cmd = $cmd
	cmd_str = _quotactl_cmd_str($cmd)
	special = $special
	special_str = user_string_quoted($special)
	id = $id
	addr_uaddr = $addr
	argstr = sprintf("%s, %s, %d, %p", cmd_str, special_str, $id, $addr)
}
probe syscall.quotactl.return = kernel.function("sys_quotactl").return ?
{
	name = "quotactl"
	retstr = return_str(1, $return)
}


# read _______________________________________________________
# ssize_t sys_read(unsigned int fd, char __user * buf, size_t count)
probe syscall.read = kernel.function("sys_read").call
{
	name = "read"
	fd = $fd
	buf_uaddr = $buf
	count = $count
	argstr = sprintf("%d, %p, %d", $fd, $buf, $count)
}
probe syscall.read.return = kernel.function("sys_read").return
{
	name = "read"
	retstr = return_str(1, $return)
}

# readahead __________________________________________________
#
# asmlinkage ssize_t
# sys_readahead(int fd,
#		   loff_t offset,
#		   size_t count)
#
probe syscall.readahead = kernel.function("sys_readahead").call
{
	name = "readahead"
	fd = $fd
	offset = $offset
	count = $count
	argstr = sprintf("%d, %p, %p", fd, offset, count)
}
probe syscall.readahead.return = kernel.function("sys_readahead").return
{
	name = "readahead"
	retstr = return_str(1, $return)
}

# readdir ___________________________________________________
#
# long compat_sys_old_readdir(unsigned int fd, struct compat_old_linux_dirent __user *dirent, unsigned int count)
# int old32_readdir(unsigned int fd, struct old_linux_dirent32 *dirent, unsigned int count)
#
probe syscall.readdir = kernel.function("compat_sys_old_readdir").call ?,
                        kernel.function("old32_readdir").call ?
{
	name = "readdir"
	argstr = sprintf("%d, %p, %d", $fd, $dirent, $count)
}
probe syscall.readdir.return = kernel.function("compat_sys_old_readdir").return ?,
                               kernel.function("old32_readdir").return ?
{
	name = "readdir"
	retstr = return_str(1, $return)
}

# readlink ___________________________________________________
#
# long sys_readlink(const char __user * path,
#		  char __user * buf,
#		  int bufsiz)
#
probe syscall.readlink = kernel.function("sys_readlink").call
{
	name = "readlink"
	path = user_string_quoted($path)
	buf_uaddr = $buf
	bufsiz = __int32($bufsiz)
	argstr = sprintf("%s, %p, %d", user_string_quoted($path),
		$buf, __int32($bufsiz))
}
probe syscall.readlink.return = kernel.function("sys_readlink").return
{
	name = "readlink"
	retstr = return_str(1, $return)
}

# readlinkat ___________________________________________________
#
# long sys_readlinkat(int dfd, const char __user * path,
#		  char __user * buf,
#		  int bufsiz)
#
probe syscall.readlinkat = kernel.function("sys_readlinkat").call ?
{
	@__syscall_compat_gate(%{ __NR_readlinkat %},
			       %{ __NR_compat_readlinkat %})
	name = "readlinkat"
	dfd = __int32($dfd)
	dfd_str = _dfd_str(__int32($dfd))
	buf_uaddr = $buf
	bufsiz = __int32($bufsiz)
	path = user_string_quoted(@choose_defined($pathname, $path))
	argstr = sprintf("%s, %s, %p, %d", _dfd_str(__int32($dfd)),
		user_string_quoted(@choose_defined($pathname, $path)),
		$buf, __int32($bufsiz))
}

probe syscall.readlinkat.return = kernel.function("sys_readlinkat").return ?
{
	@__syscall_compat_gate(%{ __NR_readlinkat %},
			       %{ __NR_compat_readlinkat %})
	name = "readlinkat"
	retstr = return_str(1, $return)
}

# readv ______________________________________________________
#
# ssize_t sys_readv(unsigned long fd,
#		const struct iovec __user *vec,
#		unsigned long vlen)
# ssize_t compat_sys_readv(unsigned long fd,
#		const struct compat_iovec __user *vec,
#		unsigned long vlen)
#
probe syscall.readv = kernel.function("compat_sys_readv").call ?,
                      kernel.function("sys_readv").call
{
	name = "readv"
	vector_uaddr = $vec
	count = __int32($vlen)
	# Although the kernel gets an unsigned long fd, on the
	# user-side it is a signed int.  Fix this.
	fd = __int32($fd)
	argstr = sprintf("%d, %p, %d", __int32($fd), $vec, __int32($vlen))
}
probe syscall.readv.return = kernel.function("compat_sys_readv").return ?,
                             kernel.function("sys_readv").return
{
	name = "readv"
	retstr = return_str(1, $return)
}

# reboot _____________________________________________________
#
# long sys_reboot(int magic1,
#		int magic2,
#		unsigned int cmd,
#		void __user * arg)
#
probe syscall.reboot = kernel.function("sys_reboot").call
{
	name = "reboot"
	magic = __int32($magic1)
	magic_str = _reboot_magic_str(__int32($magic1))
	magic2 = __int32($magic2)
	magic2_str =_reboot_magic_str(__int32($magic2))
	flag = __uint32($cmd)
	flag_str =  _reboot_flag_str(__uint32($cmd))
	arg_uaddr = $arg
	argstr = sprintf("%s, %s, %s, %p", magic_str, magic2_str,
		flag_str, $arg)
}
probe syscall.reboot.return = kernel.function("sys_reboot").return
{
	name = "reboot"
	retstr = return_str(1, $return)
}

# recv _______________________________________________________
#
# long sys_recv(int fd, void __user *ubuf, size_t size, unsigned flags)
#
# On some kernels, the recv() syscall goes through
# sys_socketcall(), which then calls an inlined version of
# sys_recv(). So, we need to probe sys_socketcall() also.
#
probe syscall.recv = __syscall.socketcall.recv ?,
	__syscall.compat_socketcall.recv ?,
	__syscall.recv ?
{
	name = "recv"
	flags_str = _msg_flags_str(flags)
	argstr = sprintf("%d, %p, %u, %s", s, buf_uaddr, len,
			 _msg_flags_str(flags))
}
probe __syscall.socketcall.recv = kernel.function("sys_socketcall").call ?
{
	if ($call != %{ SYS_RECV %}) next;
	s = __int32(user_ulong(&@cast($args, "ulong")[0]))
	buf_uaddr = user_ulong(&@cast($args, "ulong")[1])
	len = user_ulong(&@cast($args, "ulong")[2])
	flags = __uint32(user_ulong(&@cast($args, "ulong")[3]))
}
probe __syscall.compat_socketcall.recv =
	kernel.function("compat_sys_socketcall").call ?
{
	if ($call != %{ SYS_RECV %}) next;
	s = user_int(&@cast($args, "unsigned int")[0])
	buf_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
	len = user_uint32(&@cast($args, "unsigned int")[2])
	flags = user_uint32(&@cast($args, "unsigned int")[3])
}
probe __syscall.recv = kernel.function("sys_recv").call ?
{
	@__syscall_gate(%{ __NR_recv %})
	s = __int32($fd)
	buf_uaddr = $ubuf
	len = $size
	flags = __uint32($flags)
}
probe syscall.recv.return = __syscall.socketcall.recv.return ?,
	__syscall.recv.return ?
{
	name = "recv"
	retstr = return_str(1, $return)
}
probe __syscall.socketcall.recv.return = 
	kernel.function("sys_socketcall").return ?, 
	kernel.function("compat_sys_socketcall").return ?
{
	if ($call != %{ SYS_RECV %}) next;
}
probe __syscall.recv.return = kernel.function("sys_recv").return ?
{
	@__syscall_gate(%{ __NR_recv %})
}

# recvfrom ___________________________________________________
#
# long sys_recvfrom(int fd,
#		  void __user * ubuf,
#		  size_t size,
#		  unsigned flags,
#		  struct sockaddr __user *addr,
#		  int __user *addr_len)
#
# On some kernels, sys_recv() is just a wrapper for sys_recvfrom(). We
# check the syscall value (and the 'call' value in the case of
# sys_socketcall) to make sure we're really in a recvfrom() call.
#
probe syscall.recvfrom = __syscall.socketcall.recvfrom ?,
	__syscall.compat_socketcall.recvfrom ?, __syscall.recvfrom ?
{
	name = "recvfrom"
	flags_str = _msg_flags_str(flags)
	argstr = sprintf("%d, %p, %u, %s, %p, %p", s, buf_uaddr, len,
			 _msg_flags_str(flags), addr_uaddr, addrlen_uaddr)
}
probe __syscall.socketcall.recvfrom = kernel.function("sys_socketcall").call ?
{
	if ($call != %{ SYS_RECVFROM %}) next
	s = __int32(user_ulong(&@cast($args, "ulong")[0]))
	buf_uaddr = user_ulong(&@cast($args, "ulong")[1])
	len = user_ulong(&@cast($args, "ulong")[2])
	flags = __uint32(user_ulong(&@cast($args, "ulong")[3]))
	addr_uaddr = user_ulong(&@cast($args, "ulong")[4])
	addrlen_uaddr = __uint32(user_ulong(&@cast($args, "ulong")[5]))
}
probe __syscall.compat_socketcall.recvfrom =
	kernel.function("compat_sys_socketcall").call ?
{
	if ($call != %{ SYS_RECVFROM %}) next
	s = user_int(&@cast($args, "unsigned int")[0])
	buf_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
	len = user_uint32(&@cast($args, "unsigned int")[2])
	flags = user_uint32(&@cast($args, "unsigned int")[3])
	addr_uaddr = user_uint32(&@cast($args, "unsigned int")[4])
	addrlen_uaddr = user_uint32(&@cast($args, "unsigned int")[5])
}
probe __syscall.recvfrom = kernel.function("sys_recvfrom").call ?
{
	@__syscall_gate(%{ __NR_recvfrom %})
	s = __int32($fd)
	buf_uaddr = $ubuf
	len = $size
	flags = __uint32($flags)
	addr_uaddr = $addr
	addrlen_uaddr = $addr_len
}
probe syscall.recvfrom.return = __syscall.socketcall.return ?,
	__syscall.recvfrom.return ?
{
	name = "recvfrom"
	retstr = return_str(1, $return)
}
probe __syscall.socketcall.return = kernel.function("sys_socketcall").return ?,
	kernel.function("compat_sys_socketcall").return ?
{
	if ($call != %{ SYS_RECVFROM %}) next
}
probe __syscall.recvfrom.return = kernel.function("sys_recvfrom").return ?
{
	@__syscall_gate(%{ __NR_recvfrom %})
}

# recvmmsg ___________________________________________________
#
# long sys_recvmmsg(int fd, struct mmsghdr __user *mmsg,
#		    unsigned int vlen, unsigned int flags,
#		    struct timespec __user *timeout)
#
probe syscall.recvmmsg = kernel.function("sys_recvmmsg").call ?
{
	name = "recvmmsg"
	s = __int32($fd)
	mmsg_uaddr = $mmsg
	vlen = __uint32($vlen)
	flags = __uint32($flags)
	flags_str = _msg_flags_str(flags)
	timeout_uaddr = $timeout
	argstr = sprintf("%d, %p, %u, %s, %s", s, $mmsg, vlen,
			 _msg_flags_str(flags),
			 _struct_timespec_u($timeout, 1))
}
probe syscall.recvmmsg.return = kernel.function("sys_recvmmsg").return ?
{
	name = "recvmmsg"
	retstr = return_str(1, $return)
}

# compat_recvmmsg ___________________________________________________
#
# long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
#			   unsigned vlen, unsigned int flags,
#			   struct compat_timespec __user *timeout)
#
probe syscall.compat_recvmmsg = kernel.function("compat_sys_recvmmsg").call ?
{
	name = "recvmmsg"
	s = __int32($fd)
	mmsg_uaddr = $mmsg
	vlen = __uint32($vlen)
	flags = __uint32($flags)
	flags_str = _msg_flags_str(flags)
	timeout_uaddr = $timeout
	argstr = sprintf("%d, %p, %u, %s, %s", s, $mmsg, vlen,
			 _msg_flags_str(flags),
			 _struct_compat_timespec_u($timeout, 1))
}
probe syscall.compat_recvmmsg.return =
	kernel.function("compat_sys_recvmmsg").return ?
{
	name = "recvmmsg"
	retstr = return_str(1, $return)
}

# recvmsg ____________________________________________________
#
# long sys_recvmsg(int fd,
#		 struct msghdr __user *msg,
#		 unsigned int flags)
#
probe syscall.recvmsg = kernel.function("sys_recvmsg").call ?
{
%( CONFIG_COMPAT == "y" %?
	# Avoid probe hits from compat_sys_socketcall() calling
	# compat_sys_recvmsg(), which sometimes calls
	# sys_recvmsg(). We could call __syscall_gate2() here with
	# NR_recvmsg and NR_socketcall, but all we really need to
	# check is that we're not in a compat task.
	if (%{ _stp_is_compat_task() %}) next
%)
	name = "recvmsg"
	s = __int32($fd)
	msg_uaddr = $msg
	flags = __uint32($flags)
	flags_str = _msg_flags_str(flags)
	argstr = sprintf("%d, %p, %s", s, $msg, _msg_flags_str(flags))
}
probe syscall.recvmsg.return = kernel.function("sys_recvmsg").return ?
{
%( CONFIG_COMPAT == "y" %?
	if (%{ _stp_is_compat_task() %}) next
%)
	name = "recvmsg"
	retstr = return_str(1, $return)
}
# compat_sys_recvmsg ________________________________________
#
# long compat_sys_recvmsg(int fd,
#				struct compat_msghdr __user *msg,
#				unsigned int flags)
#
# On all tested kernels/architectures, the compat recvmsg() syscall
# goes through compat_sys_socketcall(). compat_sys_socketcall() then
# calls an inlined version of compat_sys_recvmsg() on some
# architectures (like ppc64). So, the only reliable thing to do here
# is just probe compat_sys_socketcall().
#
# Note that this probe should have been either called
# 'syscall.compat_recvmsg' or just merged with 'syscall.recvmsg'.
#
probe syscall.compat_sys_recvmsg =
	kernel.function("compat_sys_socketcall").call ?
{
	if ($call != %{ SYS_RECVMSG %}) next;
	name = "recvmsg"
	s = user_int(&@cast($args, "unsigned int")[0])
	msg_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
	flags = user_uint32(&@cast($args, "unsigned int")[2])
	flags_str = _msg_flags_str(flags)
	argstr = sprintf("%d, %p, %s", s, msg_uaddr, _msg_flags_str(flags))
}
probe syscall.compat_sys_recvmsg.return =
 	kernel.function("compat_sys_socketcall").return ?
{
	if ($call != %{ SYS_RECVMSG %}) next;
	name = "recvmsg"
	retstr = return_str(1, $return)
}

# remap_file_pages ___________________________________________
#
# long sys_remap_file_pages(unsigned long start,
#			    unsigned long size,
#			    unsigned long __prot,
#			    unsigned long pgoff,
#			    unsigned long flags)
#
probe syscall.remap_file_pages = kernel.function("sys_remap_file_pages").call ?
{
	name = "remap_file_pages"
	start = $start
	size = $size
	prot = @choose_defined($prot, $__prot)
	pgoff = $pgoff
	flags = $flags
	argstr = sprintf("%p, %p, %p, %p, %p", start, size, prot,
		pgoff, flags)
}
probe syscall.remap_file_pages.return = kernel.function("sys_remap_file_pages").return ?
{
	name = "remap_file_pages"
	retstr = return_str(1, $return)
}

# removexattr ________________________________________________
#
# asmlinkage long
# sys_removexattr(char __user *path,
#		     char __user *name)
#
probe syscall.removexattr = kernel.function("sys_removexattr").call
{
	name = "removexattr"
	name_str = user_string_quoted($name)

	path = user_string_quoted(@choose_defined($pathname, $path))
	argstr = sprintf("%s, %s",
		user_string_quoted(@choose_defined($pathname, $path)),
		user_string_quoted($name))
}
probe syscall.removexattr.return = kernel.function("sys_removexattr").return
{
	name = "removexattr"
	retstr = return_str(1, $return)
}
# rename _____________________________________________________
#
# asmlinkage long
# sys_rename(const char __user * oldname,
#		const char __user * newname)
#
probe syscall.rename = kernel.function("sys_rename").call
{
	name = "rename"
	oldpath = user_string_quoted($oldname)
	newpath = user_string_quoted($newname)
	argstr = sprintf("%s, %s", user_string_quoted($oldname),
		user_string_quoted($newname))
}
probe syscall.rename.return = kernel.function("sys_rename").return
{
	name = "rename"
	retstr = return_str(1, $return)
}

# renameat ___________________________________________________
# new function with 2.6.16
# long sys_renameat(int olddfd, const char __user *oldname,
#	int newdfd, const char __user *newname)
probe syscall.renameat = kernel.function("sys_renameat").call ?
{
	@__syscall_compat_gate(%{ __NR_renameat %}, %{ __NR_compat_renameat %})
	name = "renameat"
	olddfd = __int32($olddfd)
	olddfd_str = _dfd_str(__int32($olddfd))
	oldname = $oldname
	oldname_str = user_string_quoted($oldname)
	newdfd = __int32($newdfd)
	newdfd_str = _dfd_str(__int32($newdfd))
	newname = $newname
	newname_str = user_string_quoted($newname)
	argstr = sprintf("%s, %s, %s, %s", olddfd_str,
			 user_string_quoted($oldname),
			 newdfd_str, user_string_quoted($newname))
}
probe syscall.renameat.return = kernel.function("sys_renameat").return ?
{
	@__syscall_compat_gate(%{ __NR_renameat %}, %{ __NR_compat_renameat %})
	name = "renameat"
	retstr = return_str(1, $return)
}

# request_key ________________________________________________
#
# long sys_request_key(const char __user *_type,
#		     const char __user *_description,
#		     const char __user *_callout_info,
#		     key_serial_t destringid)
# compat_sys_request_key() calls sys_request_key, so don't need probe there.
#
probe syscall.request_key = kernel.function("sys_request_key").call ?
{
	name = "request_key"
	type_uaddr = $_type
	description_uaddr = $_description
	callout_info_uaddr = $_callout_info
	destringid = $destringid
	argstr = sprintf("%p, %p, %p, %p", $_type, $_description, $_callout_info, $destringid)
}
probe syscall.request_key.return = kernel.function("sys_request_key").return ?
{
	name = "request_key"
	retstr = return_str(1, $return)
}

# restart_syscall ____________________________________________
#
# asmlinkage long
# sys_restart_syscall(void)
#
probe syscall.restart_syscall = kernel.function("sys_restart_syscall").call
{
	name = "restart_syscall"
	argstr = ""
}
probe syscall.restart_syscall.return = kernel.function("sys_restart_syscall").return
{
	name = "restart_syscall"
	retstr = return_str(1, $return)
}
# rmdir ______________________________________________________
#
# asmlinkage long
# sys_rmdir(const char __user * pathname)
#
probe syscall.rmdir = kernel.function("sys_rmdir").call
{
	name = "rmdir"
	pathname = user_string_quoted($pathname)
	argstr = user_string_quoted($pathname)
}
probe syscall.rmdir.return = kernel.function("sys_rmdir").return
{
	name = "rmdir"
	retstr = return_str(1, $return)
}

# rt_sigaction _______________________________________________
#
# sys_rt_sigaction(int sig,
#			const struct sigaction __user *act,
#			struct sigaction __user *oact,
#			size_t sigsetsize)
#
probe syscall.rt_sigaction = kernel.function("sys_rt_sigaction").call ?
{
	name = "rt_sigaction"
	sig = $sig
	act_uaddr = $act
	oact_uaddr = $oact
	sigsetsize = $sigsetsize
	argstr = sprintf("%s, {%s}, %p, %d", _signal_name($sig),
		_struct_sigaction_u($act), $oact, $sigsetsize)
}
probe syscall.rt_sigaction.return = kernel.function("sys_rt_sigaction").return ?
{
	name = "rt_sigaction"
	retstr = return_str(1, $return)
}

#
# long sys32_rt_sigaction(int sig,
#		struct sigaction32 __user *act,
#		struct sigaction32 __user *oact,
#		unsigned int sigsetsize)
# ppc only
# compat_sys_rt_sigaction(int sig,
#			const struct sigaction32 __user *act,
#			struct sigaction32 __user *oact,
#			size_t sigsetsize)

probe syscall.rt_sigaction32 = kernel.function("sys32_rt_sigaction").call ?,
                               kernel.function("compat_sys_rt_sigaction").call ?
{
	name = "rt_sigaction"
	sig = $sig
	act_uaddr = $act
	oact_uaddr = $oact
	sigsetsize = $sigsetsize
	argstr = sprintf("%s, {%s}, %p, %d", _signal_name($sig),
		_struct_sigaction32_u($act), $oact, $sigsetsize)
}
probe syscall.rt_sigaction32.return = kernel.function("sys32_rt_sigaction").return ?,
                                      kernel.function("compat_sys_rt_sigaction").return ?
{
	name = "rt_sigaction"
	retstr = return_str(1, $return)
}

# rt_sigpending ______________________________________________
#
# long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize)
# COMPAT_SYSCALL_DEFINE2(rt_sigpending, compat_sigset_t __user *, uset,
#		compat_size_t, sigsetsize)
# asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set,
#				    compat_size_t sigsetsize)
#
probe syscall.rt_sigpending = __syscall.rt_sigpending ?,
			      __syscall.compat_rt_sigpending ?
{
	name = "rt_sigpending"
	set_uaddr = @choose_defined($uset, $set)
	sigsetsize = $sigsetsize
	argstr = sprintf("%p, %d", set_uaddr, $sigsetsize)
}
probe __syscall.rt_sigpending = kernel.function("sys_rt_sigpending").call ?
{
	@__syscall_gate(%{ __NR_rt_sigpending %})
}
probe __syscall.compat_rt_sigpending =
	kernel.function("compat_sys_rt_sigpending").call !,
	kernel.function("sys32_rt_sigpending").call ?
{
}
probe syscall.rt_sigpending.return = __syscall.rt_sigpending.return ?,
				     __syscall.compat_rt_sigpending.return ?
{
	name = "rt_sigpending"
	retstr = return_str(1, $return)
}
probe __syscall.rt_sigpending.return =
	kernel.function("sys_rt_sigpending").return ?
{
	@__syscall_gate(%{ __NR_rt_sigpending %})
}
probe __syscall.compat_rt_sigpending.return =
	kernel.function("compat_sys_rt_sigpending").return !,
	kernel.function("sys32_rt_sigpending").return ?
{
}

# rt_sigprocmask _____________________________________________
# long sys_rt_sigprocmask(int how, sigset_t __user *set, sigset_t __user *oset,
#			  size_t sigsetsize)
# long sys32_rt_sigprocmask(u32 how, compat_sigset_t __user *set,
#			    compat_sigset_t __user *oset, size_t sigsetsize)
# long compat_sys_rt_sigprocmask(int how, compat_sigset_t __user *set,
#				 compat_sigset_t __user *oset,
#				 compat_size_t sigsetsize)
#
probe syscall.rt_sigprocmask = kernel.function("sys_rt_sigprocmask").call ?
{
%( arch != "x86_64" || kernel_v < "3.4" || CONFIG_COMPAT != "y" %?
	// In kernels < 3.4, a 32-bit rt_sigprocmask call goes through
	// sys32_rt_sigprocmask().
	@__syscall_gate(%{ __NR_rt_sigprocmask %})
%)
	name = "rt_sigprocmask"
	how = $how
	how_str = _sigprocmask_how_str($how)
	set_uaddr = @choose_defined($set, $nset)

	// In kernels 3.4+, the following kernel commit changed the
	// way rt_sigprocmask is handled on x86:
	//
	//    commit 2c73ce734653f96542a070f3c3b3e3d1cd0fba02
	//    Author: H. Peter Anvin <hpa@zytor.com>
	//    Date:   Sun Feb 19 09:48:01 2012 -0800
	//
	//    x86-64, ia32: Drop sys32_rt_sigprocmask
 	//
	// On those kernels, a call to the 32-bit rt_sigprocmask goes
	// straight to the 64-bit rt_sigprocmask function.
%( arch == "x86_64" && kernel_v >= "3.4" && CONFIG_COMPAT == "y" %?
	if (%{ _stp_is_compat_task() %}
	    && _stp_syscall_nr() == %{ __NR_compat_rt_sigprocmask %}) {
		oldset_uaddr = __uint32($oset)
		argstr = sprintf("%s, [%s], %p, %d", how_str,
				 _stp_compat_sigset_u(set_uaddr), oldset_uaddr,
				 __int32($sigsetsize))
	}
	else
%)
	{
		oldset_uaddr = $oset
		argstr = sprintf("%s, [%s], %p, %d", how_str,
				 _stp_sigset_u(set_uaddr), $oset, $sigsetsize)
	}
}
probe syscall.rt_sigprocmask.return =
	kernel.function("sys_rt_sigprocmask").return ?
{
%( arch != "x86_64" || kernel_v < "3.4" || CONFIG_COMPAT != "y" %?
	@__syscall_gate(%{ __NR_rt_sigprocmask %})
%)
	name = "rt_sigprocmask"
	retstr = return_str(1, $return)
}
probe syscall.compat_rt_sigprocmask =
	kernel.function("compat_sys_rt_sigprocmask").call ?,
	kernel.function("sys32_rt_sigprocmask").call ?
{
	name = "rt_sigprocmask"
	how = $how
	how_str = _sigprocmask_how_str($how)
	set_uaddr = @choose_defined($set, $nset)
	oldset_uaddr = __uint32($oset)
	argstr = sprintf("%s, [%s], %p, %d", how_str,
			 _stp_compat_sigset_u(set_uaddr), __uint32($oset),
			 __uint32($sigsetsize))
}
probe syscall.compat_rt_sigprocmask.return =
	kernel.function("compat_sys_rt_sigprocmask").return ?,
	kernel.function("sys32_rt_sigprocmask").return ?
{
	name = "rt_sigprocmask"
	retstr = return_str(1, $return)
}

# rt_sigqueueinfo ____________________________________________
#
# long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo)
#
probe syscall.rt_sigqueueinfo = kernel.function("sys_rt_sigqueueinfo").call
{
	name = "rt_sigqueueinfo"
	pid = $pid
	sig = $sig
	uinfo_uaddr = $uinfo
	argstr = sprintf("%d, %s, %p", $pid, _signal_name($sig), $uinfo)
}
probe syscall.rt_sigqueueinfo.return = kernel.function("sys_rt_sigqueueinfo").return
{
	name = "rt_sigqueueinfo"
	retstr = return_str(1, $return)
}

# rt_sigreturn _______________________________________________
# int sys_rt_sigreturn(unsigned long __unused)
#
probe syscall.rt_sigreturn = kernel.function("ia64_rt_sigreturn").call !,
			     kernel.function("sys_rt_sigreturn").call ?,
                             kernel.function("sys32_rt_sigreturn").call ?
{
	name = "rt_sigreturn"
	argstr = ""
}
probe syscall.rt_sigreturn.return =
	kernel.function("ia64_rt_sigreturn").return !,
	kernel.function("sys_rt_sigreturn").return ?,
	kernel.function("sys32_rt_sigreturn").return ?
{
	name = "rt_sigreturn"
	retstr = return_str(1, $return)
}

# rt_sigsuspend ______________________________________________
#
# sys_rt_sigsuspend(struct pt_regs regs)
#
probe syscall.rt_sigsuspend = kernel.function("compat_sys_rt_sigsuspend").call ?,
                              kernel.function("ia64_rt_sigsuspend").call ?,
                              kernel.function("sys_rt_sigsuspend").call ?
{
	name = "rt_sigsuspend"
	argstr = ""
}
probe syscall.rt_sigsuspend.return = kernel.function("compat_sys_rt_sigsuspend").return ?,
                                     kernel.function("ia64_rt_sigsuspend").return ?,
                                     kernel.function("sys_rt_sigsuspend").return ?
{
	name = "rt_sigsuspend"
	retstr = return_str(1, $return)
}

# rt_sigtimedwait ____________________________________________
#
# long sys_rt_sigtimedwait(const sigset_t __user *uthese,
#		   siginfo_t __user *uinfo,
#		   const struct timespec __user *uts,
#		   size_t sigsetsize)
# long compat_sys_rt_sigtimedwait (compat_sigset_t __user *uthese,
#		struct compat_siginfo __user *uinfo,
#		struct compat_timespec __user *uts, compat_size_t sigsetsize)
#
probe syscall.rt_sigtimedwait = kernel.function("compat_sys_rt_sigtimedwait").call ?,
                                kernel.function("sys_rt_sigtimedwait").call
{
	name = "rt_sigtimedwait"
	uthese_uaddr = $uthese
	uinfo_uaddr = $uinfo
	uts_uaddr = $uts
	sigsetsize = $sigsetsize
	argstr = sprintf("%p, %p, %p, %d", $uthese, $uinfo, $uts, $sigsetsize)
}
probe syscall.rt_sigtimedwait.return = kernel.function("compat_sys_rt_sigtimedwait").return ?,
                                       kernel.function("sys_rt_sigtimedwait").return
{
	name = "rt_sigtimedwait"
	retstr = return_str(1, $return)
}

# sched_getaffinity __________________________________________
#
# asmlinkage long
# sys_sched_getaffinity(pid_t pid,
#			     unsigned int len,
#			     unsigned long __user *user_mask_ptr)
#
probe syscall.sched_getaffinity = kernel.function("sys_sched_getaffinity").call
{
	name = "sched_getaffinity"
	pid = $pid
	len = $len
	mask_uaddr = $user_mask_ptr
	argstr = sprintf("%d, %p, %p", pid, len, mask_uaddr)
}
probe syscall.sched_getaffinity.return = kernel.function("sys_sched_getaffinity").return
{
	name = "sched_getaffinity"
	retstr = return_str(1, $return)
}
# sched_getparam _____________________________________________
#
# asmlinkage long
# sys_sched_getparam(pid_t pid,
#			  struct sched_param __user *param)
#
probe syscall.sched_getparam = kernel.function("sys_sched_getparam").call
{
	name = "sched_getparam"
	pid = $pid
	p_uaddr = $param
	argstr = sprintf("%d, %p", pid, p_uaddr)
}
probe syscall.sched_getparam.return = kernel.function("sys_sched_getparam").return
{
	name = "sched_getparam"
	retstr = return_str(1, $return)
}
# sched_get_priority_max _____________________________________
#
# asmlinkage long
# sys_sched_get_priority_max(int policy)
#
probe syscall.sched_get_priority_max = kernel.function("sys_sched_get_priority_max").call
{
	name = "sched_get_priority_max"
	policy = $policy
	argstr = sprint(policy)
}
probe syscall.sched_get_priority_max.return = kernel.function("sys_sched_get_priority_max").return
{
	name = "sched_get_priority_max"
	retstr = return_str(1, $return)
}
# sched_get_priority_min _____________________________________
#
# asmlinkage long
# sys_sched_get_priority_min(int policy)
#
probe syscall.sched_get_priority_min = kernel.function("sys_sched_get_priority_min").call
{
	name = "sched_get_priority_min"
	policy = $policy
	argstr = sprint(policy)
}
probe syscall.sched_get_priority_min.return = kernel.function("sys_sched_get_priority_min").return
{
	name = "sched_get_priority_min"
	retstr = return_str(1, $return)
}
# sched_getscheduler _________________________________________
#
# long sys_sched_getscheduler(pid_t pid)
#
probe syscall.sched_getscheduler = kernel.function("sys_sched_getscheduler").call
{
	name = "sched_getscheduler"
	pid = __int32($pid)
	argstr = sprint(pid)
}
probe syscall.sched_getscheduler.return = kernel.function("sys_sched_getscheduler").return
{
	name = "sched_getscheduler"
	retstr = return_str(1, $return)
}

# sched_rr_get_interval ______________________________________
#
# long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval)
#
probe syscall.sched_rr_get_interval = __syscall.sched_rr_get_interval, 
	kernel.function("compat_sys_sched_rr_get_interval").call ?,
	kernel.function("sys32_sched_rr_get_interval").call ?
{
	name = "sched_rr_get_interval"
	pid = __int32($pid)
	tp_uaddr = $interval
	argstr = sprintf("%d, %p", pid, $interval)
}
probe __syscall.sched_rr_get_interval =
	kernel.function("sys_sched_rr_get_interval").call
{
	@__syscall_gate(%{ __NR_sched_rr_get_interval %})
}
probe syscall.sched_rr_get_interval.return =
	__syscall.sched_rr_get_interval.return,
	kernel.function("compat_sys_sched_rr_get_interval").return ?,
	kernel.function("sys32_sched_rr_get_interval").return ?
{
	name = "sched_rr_get_interval"
	retstr = return_str(1, $return)
}
probe __syscall.sched_rr_get_interval.return =
	kernel.function("sys_sched_rr_get_interval").return
{
	@__syscall_gate(%{ __NR_sched_rr_get_interval %})
}

# sched_setaffinity __________________________________________
# long sys_sched_setaffinity(pid_t pid,
#	unsigned int len,
#	unsigned long __user *user_mask_ptr)
#
probe syscall.sched_setaffinity = kernel.function("sys_sched_setaffinity").call
{
	name = "sched_setaffinity"
	pid = $pid
	len = @choose_defined($len, 0)
	mask_uaddr = $user_mask_ptr
	argstr = sprintf("%d, %d, %p", $pid, $len, $user_mask_ptr)
}
probe syscall.sched_setaffinity.return = kernel.function("sys_sched_setaffinity").return
{
	name = "sched_setaffinity"
	retstr = return_str(1, $return)
}

# sched_setparam _____________________________________________
#
# long sys_sched_setparam(pid_t pid, struct sched_param __user *param)
#
probe syscall.sched_setparam = kernel.function("sys_sched_setparam").call ?
{
	name = "sched_setparam"
	pid = $pid
	p_uaddr = $param
	argstr = sprintf("%d, %p", $pid, $param)
}
probe syscall.sched_setparam.return = kernel.function("sys_sched_setparam").return ?
{
	name = "sched_setparam"
	retstr = return_str(1, $return)
}

# sched_setscheduler _________________________________________
#
# long sys_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param)
#
probe syscall.sched_setscheduler = kernel.function("sys_sched_setscheduler").call ?
{
	name = "sched_setscheduler"
	pid = __int32($pid)
	policy = __int32($policy)
	policy_str = _sched_policy_str(policy)
	p_uaddr = $param
	argstr = sprintf("%d, %s, %p", pid, policy_str, $param)
}
probe syscall.sched_setscheduler.return = kernel.function("sys_sched_setscheduler").return ?
{
	name = "sched_setscheduler"
	retstr = return_str(1, $return)
}

# sched_yield ________________________________________________
# long sys_sched_yield(void)
#
probe syscall.sched_yield = kernel.function("sys_sched_yield").call
{
	name = "sched_yield"
	argstr = ""
}
probe syscall.sched_yield.return = kernel.function("sys_sched_yield").return
{
	name = "sched_yield"
	retstr = return_str(1, $return)
}

# select _____________________________________________________
# long sys_select(int n,
#		fd_set __user *inp,
#		fd_set __user *outp,
#		fd_set __user *exp,
#		struct timeval __user *tvp)
#
probe syscall.select = kernel.function("sys_select").call
{
	name = "select"
	n = __int32($n)
	readfds_uaddr = $inp
	writefds_uaddr = $outp
	exceptfds_uaddr = $exp
	timeout_uaddr = $tvp
	argstr = sprintf("%d, %p, %p, %p, %s", n, $inp, $outp, $exp,
		_struct_timeval_u($tvp, 1))
}
probe syscall.select.return = kernel.function("sys_select").return
{
	name = "select"
	retstr = return_str(1, $return)
}
# long compat_sys_select(int n,
#		compat_ulong_t __user *inp,
#		compat_ulong_t __user *outp,
#		compat_ulong_t __user *exp,
#		struct compat_timeval __user *tvp)
#
probe syscall.compat_select = kernel.function("compat_sys_select").call ?
{
	name = "select"
	n = __int32($n)
	readfds_uaddr = $inp
	writefds_uaddr = $outp
	exceptfds_uaddr = $exp
	timeout_uaddr = $tvp
	argstr = sprintf("%d, %p, %p, %p, %s", n, $inp, $outp, $exp,
		_struct_compat_timeval_u($tvp, 1))
}
probe syscall.compat_select.return = kernel.function("compat_sys_select").return ?
{
	name = "select"
	retstr = return_str(1, $return)
}

# semctl _____________________________________________________
# long sys_semctl (int semid,
#		 int semnum,
#		 int cmd,
#		 union semun arg)
#
probe syscall.semctl = kernel.function("sys_semctl").call ?
{
	name = "semctl"
	semid = $semid
	semnum = $semnum
	cmd = $cmd
	/*
	 * unsupported type tag identifier '$arg'
	 * arg = $arg
	 */
	argstr = sprintf("%d, %d, %s", $semid, $semnum, _semctl_cmd($cmd))
}
probe syscall.semctl.return = kernel.function("sys_semctl").return ?
{
	name = "semctl"
	retstr = return_str(1, $return)
}
# compat_sys_semctl ________________________________________
#
# long compat_sys_semctl(int first, int second, int third, void __user *uptr)
# COMPAT_SYSCALL_DEFINE4(semctl, int, semid, int, semnum, int, cmd, int, arg)
#
probe syscall.compat_sys_semctl = kernel.function("compat_sys_semctl").call ?
{
	name = "compat_sys_semctl"
	semid = @choose_defined($semid, $first)
	semnum = @choose_defined($semnum, $second)
	cmd = @choose_defined($cmd, $third)
	argstr = sprintf("%d, %d, %s", semid, semnum, _semctl_cmd(cmd))
}
probe syscall.compat_sys_semctl.return = kernel.function("compat_sys_semctl").return ?
{
	name = "compat_sys_semctl"
	retstr = return_str(1, $return)
}

# semget _____________________________________________________
# long sys_semget (key_t key, int nsems, int semflg)
#
probe syscall.semget = kernel.function("sys_semget").call ?
{
	name = "semget"
	key = $key
	nsems = $nsems
	semflg = $semflg
	argstr = sprintf("%d, %d, %s", $key, $nsems, __sem_flags($semflg))
}
probe syscall.semget.return = kernel.function("sys_semget").return ?
{
	name = "semget"
	retstr = return_str(1, $return)
}

# semop ______________________________________________________
#
# long sys_semop (int semid,
#		struct sembuf __user *tsops,
#		unsigned nsops)
#
probe syscall.semop = kernel.function("sys_semtimedop").call ?
{
	name = "semop"
	semid = $semid
%( systemtap_v < "2.3" %?
	tsops_uaddr = $tsops
%:
	sops_uaddr = $tsops
%)
	nsops = $nsops
	argstr = sprintf("%d, %p, %d", $semid, $tsops, $nsops)
}
probe syscall.semop.return = kernel.function("sys_semtimedop").return ?
{
	name = "semop"
	retstr = return_str(1, $return)
}

# semtimedop _________________________________________________
#
# long sys_semtimedop(int semid,
#		    struct sembuf __user *tsops,
#		    unsigned nsops,
#		    const struct timespec __user *timeout)
#
probe syscall.semtimedop = kernel.function("sys_semtimedop").call ?
{
	name = "semtimedop"
	semid = $semid
	sops_uaddr = $tsops
	nsops = $nsops
	timeout_uaddr = $timeout
	argstr = sprintf("%d, %p, %d, %s", $semid, $tsops, $nsops,
		_struct_timespec_u($timeout, 1))
}
probe syscall.semtimedop.return = kernel.function("sys_semtimedop").return ?
{
	name = "semtimedop"
	retstr = return_str(1, $return)
}
# compat_sys_semtimedop ________________________________________
#
# long compat_sys_semtimedop(int semid, struct sembuf __user *tsems,
#		unsigned nsops, const struct compat_timespec __user *timeout)
#
probe syscall.compat_sys_semtimedop = kernel.function("compat_sys_semtimedop").call ?
{
	name = "compat_sys_semtimedop"
	semid = $semid
	sops_uaddr = $tsems
	nsops = $nsops
	timeout_uaddr = $timeout
	argstr = sprintf("%d, %p, %d, %s", $semid, $tsems, $nsops,
		_struct_compat_timespec_u($timeout, 1))
}
probe syscall.compat_sys_semtimedop.return = kernel.function("compat_sys_semtimedop").return ?
{
	name = "compat_sys_semtimedop"
	retstr = return_str(1, $return)
}

# send _______________________________________________________
#
# long sys_send(int fd,
#		void __user * buff,
#		size_t len,
#		unsigned flags)
#
probe syscall.send = kernel.function("sys_send").call ?
{
	name = "send"
	s = __int32($fd)
	buf_uaddr = $buff
	len = $len
	flags = __uint32($flags)
	flags_str = _msg_flags_str(flags)
	argstr = sprintf("%d, %p, %u, %s", s, $buff, $len, flags_str)
}
probe syscall.send.return = kernel.function("sys_send").return ?
{
	name = "send"
	retstr = return_str(1, $return)
}

# sendfile ___________________________________________________
#
# ssize_t sys_sendfile[64](int out_fd,
#		  int in_fd,
#		  off_t __user *offset,
#		  size_t count)
# SYSCALL_DEFINE4(sendfile64, int, out_fd, int, in_fd, loff_t __user *, offset,
#		 size_t, count)
# COMPAT_SYSCALL_DEFINE4(sendfile, int, out_fd, int, in_fd,
#		compat_off_t __user *, offset, compat_size_t, count)
# COMPAT_SYSCALL_DEFINE4(sendfile64, int, out_fd, int, in_fd,
#		compat_loff_t __user *, offset, compat_size_t, count)
#
probe syscall.sendfile = __syscall.sendfile ?, __syscall.compat_sendfile ?
{
	name = "sendfile"
	out_fd = __int32($out_fd)
	in_fd = __int32($in_fd)
	offset_uaddr = $offset
	argstr = sprintf("%d, %d, %p, %u", out_fd, in_fd, $offset, count)
}
probe __syscall.sendfile = kernel.function("sys_sendfile").call ?,
	kernel.function("sys_sendfile64").call ?
{
	@__syscall_gate2(%{ __NR_sendfile %}, %{ __NR_sendfile64 %})
	count = $count
}
probe __syscall.compat_sendfile =
	kernel.function("compat_sys_sendfile").call ?,
	kernel.function("compat_sys_sendfile64").call ?,
	kernel.function("sys32_sendfile").call ?
{
	count = __uint32($count)
}
probe syscall.sendfile.return = __syscall.sendfile.return ?,
	kernel.function("compat_sys_sendfile").return ?,
	kernel.function("compat_sys_sendfile64").return ?,
	kernel.function("sys32_sendfile").return ?
{
	name = "sendfile"
	retstr = return_str(1, $return)
}
probe __syscall.sendfile.return = kernel.function("sys_sendfile").return ?,
	kernel.function("sys_sendfile64").return ?
{
	@__syscall_gate2(%{ __NR_sendfile %}, %{ __NR_sendfile64 %})
}

# sendmsg ____________________________________________________
#
# long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags)
#
probe syscall.sendmsg = kernel.function("sys_sendmsg").call ?
{
%( CONFIG_COMPAT == "y" %?
	# Avoid probe hits from compat_sys_socketcall() calling
	# compat_sys_sendmsg(), which sometimes calls
	# sys_sendmsg(). We could call __syscall_gate2() here with
	# NR_sendmsg and NR_socketcall, but all we really need to
	# check is that we're not in a compat task.
	if (%{ _stp_is_compat_task() %}) next
%)
	name = "sendmsg"
	s = __int32($fd)
	msg_uaddr = $msg
	flags = __uint32($flags)
	flags_str = _msg_flags_str($flags)
	argstr = sprintf("%d, %p, %s", s, $msg, _msg_flags_str(flags))
}
probe syscall.sendmsg.return = kernel.function("sys_sendmsg").return ?
{
%( CONFIG_COMPAT == "y" %?
	# Avoid probe hits from compat_sys_socketcall() calling
	# compat_sys_sendmsg(), which sometimes calls
	# sys_sendmsg(). We could call __syscall_gate2() here with
	# NR_sendmsg and NR_socketcall, but all we really need to
	# check is that we're not in a compat task.
	if (%{ _stp_is_compat_task() %}) next
%)
	name = "sendmsg"
	retstr = return_str(1, $return)
}
# compat_sys_sendmsg ________________________________________
#
# long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned flags)
#
# On all tested kernels/architectures, the compat sendmsg() syscall
# goes through compat_sys_socketcall(). compat_sys_socketcall() then
# calls an inlined version of compat_sys_sendmsg() on some
# architectures (like x86_64 and ppc64). So, the only reliable thing
# to do here is just probe compat_sys_socketcall().
#
# Note that this probe should have been either called
# 'syscall.compat_sendmsg' or just merged with 'syscall.sendmsg'.
#
probe syscall.compat_sys_sendmsg =
	kernel.function("compat_sys_socketcall").call ?
{
	if ($call != %{ SYS_SENDMSG %}) next;
	name = "sendmsg"
	s = user_int(&@cast($args, "unsigned int")[0])
	msg_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
	flags = user_uint32(&@cast($args, "unsigned int")[2])
	flags_str = _msg_flags_str(flags)
	argstr = sprintf("%d, %p, %s", s, msg_uaddr, _msg_flags_str(flags))
}
probe syscall.compat_sys_sendmsg.return =
 	kernel.function("compat_sys_socketcall").return ?
{
	if ($call != %{ SYS_SENDMSG %}) next;
	name = "sendmsg"
	retstr = return_str(1, $return)
}

# sendmmsg ____________________________________________________
#
# int sys_sendmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
#                  unsigned int flags)
#
probe syscall.sendmmsg = __syscall.sendmmsg ?,
	__syscall.compat_socketcall.sendmmsg ?, __syscall.compat_sendmmsg ?
{
	name = "sendmmsg"
	flags_str = _msg_flags_str(flags)
	argstr = sprintf("%d, %p, %d, %s", s, mmsg_uaddr, vlen,
			 _msg_flags_str(flags))
}
probe __syscall.sendmmsg = kernel.function("sys_sendmmsg").call ?
{
%( CONFIG_COMPAT == "y" %?
	# Avoid probe hits from compat_sys_socketcall() calling
	# compat_sys_sendmmsg(), which sometimes calls
	# sys_sendmmsg(). We could call __syscall_gate2() here with
	# NR_sendmmsg and NR_socketcall, but all we really need to
	# check is that we're not in a compat task.
	if (%{ _stp_is_compat_task() %}) next
%)
	s = __int32($fd)
	mmsg_uaddr = $mmsg
	vlen = __uint32($vlen)
	flags = __uint32($flags)
}
probe __syscall.compat_socketcall.sendmmsg =
	kernel.function("compat_sys_socketcall").call ?
{
	if ($call != %{ SYS_SENDMMSG %}) next
	s = user_int(&@cast($args, "unsigned int")[0])
	mmsg_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
	vlen = user_uint32(&@cast($args, "unsigned int")[2])
	flags = user_uint32(&@cast($args, "unsigned int")[3])
}
probe __syscall.compat_sendmmsg =
	kernel.function("compat_sys_sendmmsg").call ?
{
	@__compat_syscall_gate(%{ __NR_compat_sendmmsg %})
	s = __int32($fd)
	mmsg_uaddr = $mmsg
	vlen = __uint32($vlen)
	flags = __uint32($flags)
}
probe syscall.sendmmsg.return = __syscall.sendmmsg.return ?,
	__syscall.compat_socketcall.sendmmsg.return ?,
	__syscall.compat_sendmmsg.return ?
{
	name = "sendmmsg"
	retstr = return_str(1, $return)
}
probe __syscall.sendmmsg.return = kernel.function("sys_sendmmsg").return ?
{
%( CONFIG_COMPAT == "y" %?
	# Avoid probe hits from compat_sys_socketcall() calling
	# compat_sys_sendmmsg(), which sometimes calls
	# sys_sendmmsg(). We could call __syscall_gate2() here with
	# NR_sendmmsg and NR_socketcall, but all we really need to
	# check is that we're not in a compat task.
	if (%{ _stp_is_compat_task() %}) next
%)
}
probe __syscall.compat_socketcall.sendmmsg.return =
	kernel.function("compat_sys_socketcall").return ?
{
	if ($call != %{ SYS_SENDMMSG %}) next
}
probe __syscall.compat_sendmmsg.return =
	kernel.function("compat_sys_sendmmsg").return ?
{
	@__compat_syscall_gate(%{ __NR_compat_sendmmsg %})
}

# sendto _____________________________________________________
#
# long sys_sendto(int fd,
#		void __user * buff,
#		size_t len,
#		unsigned flags,
#		struct sockaddr __user *addr,
#		int addr_len)
#
probe syscall.sendto = __syscall.sendto ?, __syscall.socketcall.sendto ?,
	__syscall.compat_socketcall.sendto ?
{
	name = "sendto"
	flags_str = _msg_flags_str(flags)
	argstr = sprintf("%d, %p, %u, %s, %s, %u", s, buf_uaddr,
			 len, flags_str,
			 _struct_sockaddr_u(to_uaddr, tolen), tolen)
}
probe __syscall.sendto = kernel.function("sys_sendto").call ?
{
	@__syscall_gate(%{ __NR_sendto %})
	s = __int32($fd)
	buf_uaddr = $buff
	len = $len
	flags = __uint32($flags)
	to_uaddr = $addr
	tolen = __uint32($addr_len)
}
probe __syscall.socketcall.sendto = kernel.function("sys_socketcall").call ?
{
	if ($call != %{ SYS_SENDTO %}) next;
	s = __int32(user_ulong(&@cast($args, "ulong")[0]))
	buf_uaddr = user_ulong(&@cast($args, "ulong")[1])
	len = user_ulong(&@cast($args, "ulong")[2])
	flags = __uint32(user_ulong(&@cast($args, "ulong")[3]))
	to_uaddr = user_ulong(&@cast($args, "ulong")[4])
	tolen = __uint32(user_ulong(&@cast($args, "ulong")[5]))
}
probe __syscall.compat_socketcall.sendto = 
	kernel.function("compat_sys_socketcall").call ?
{
	if ($call != %{ SYS_SENDTO %}) next;
	s = user_int(&@cast($args, "unsigned int")[0])
	buf_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
	len = user_uint32(&@cast($args, "unsigned int")[2])
	flags = user_uint32(&@cast($args, "unsigned int")[3])
	to_uaddr = user_uint32(&@cast($args, "unsigned int")[4])
	tolen = user_uint32(&@cast($args, "unsigned int")[5])
}
probe syscall.sendto.return = kernel.function("sys_sendto").return ?,
	kernel.function("sys_socketcall").return ?,
	kernel.function("compat_sys_socketcall").return ?
{
	if (@defined($call)) {
		if ($call != %{ SYS_SENDTO %}) next;
	}
	else {
		@__syscall_gate(%{ __NR_sendto %})
	}
	name = "sendto"
	retstr = return_str(1, $return)
}

# setdomainname ______________________________________________
#
# asmlinkage long
# sys_setdomainname(char __user *name,
#			 int len)
#
probe syscall.setdomainname = kernel.function("sys_setdomainname").call
{
	name = "setdomainname"
	hostname_uaddr = $name
	len = $len
	argstr = sprintf("%p, %d", $name, $len)
}
probe syscall.setdomainname.return = kernel.function("sys_setdomainname").return
{
	name = "setdomainname"
	retstr = return_str(1, $return)
}

# setfsgid ___________________________________________________
# long sys_setfsgid(gid_t gid)
# long sys_setfsgid16(old_gid_t gid)
#
probe syscall.setfsgid = kernel.function("sys_setfsgid16").call ?,
                         kernel.function("sys_setfsgid").call ?
{
	name = "setfsgid"
	fsgid = $gid
	argstr = sprint($gid)
}
probe syscall.setfsgid.return = kernel.function("sys_setfsgid16").return ?,
                                kernel.function("sys_setfsgid").return ?
{
	name = "setfsgid"
	retstr = return_str(1, $return)
}

# setfsuid ___________________________________________________
# long sys_setfsuid(uid_t uid)
# long sys_setfsuid16(old_uid_t uid)
#
probe syscall.setfsuid = kernel.function("sys_setfsuid16").call ?,
                         kernel.function("sys_setfsuid").call ?
{
	name = "setfsuid"
	fsuid = $uid
	argstr = sprint($uid)
}
probe syscall.setfsuid.return = kernel.function("sys_setfsuid16").return ?,
                                kernel.function("sys_setfsuid").return ?
{
	name = "setfsuid"
	retstr = return_str(1, $return)
}

# setgid _____________________________________________________
#
# long sys_setgid(gid_t gid)
# long sys_setgid16(old_gid_t gid)
#
probe syscall.setgid = kernel.function("sys_setgid16").call ?,
                       kernel.function("sys_setgid").call ?
{
	name = "setgid"
	gid = $gid
	argstr = sprint($gid)
}
probe syscall.setgid.return = kernel.function("sys_setgid16").return ?,
                              kernel.function("sys_setgid").return ?
{
	name = "setgid"
	retstr = return_str(1, $return)
}

# setgroups __________________________________________________
#
# long sys_setgroups(int gidsetsize, gid_t __user *grouplist)
# long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist)
# long sys32_setgroups16(int gidsetsize, u16 __user *grouplist)
#
probe syscall.setgroups = kernel.function("sys_setgroups16").call ?,
                          kernel.function("sys32_setgroups16").call ?,
                          kernel.function("sys_setgroups").call ?
{
	name = "setgroups"
	size = $gidsetsize
	list_uaddr = $grouplist
	argstr = sprintf("%d, %p", $gidsetsize, $grouplist)
}
probe syscall.setgroups.return = kernel.function("sys_setgroups16").return ?,
                                 kernel.function("sys32_setgroups16").return ?,
                                 kernel.function("sys_setgroups").return ?
{
	name = "setgroups"
	retstr = return_str(1, $return)
}

# sethostname ________________________________________________
#
# asmlinkage long
# sys_sethostname(char __user *name,
#		     int len)
#
probe syscall.sethostname = kernel.function("sys_sethostname").call
{
	name = "sethostname"
	hostname_uaddr = $name
	name_str = user_string_quoted($name)
	len = $len
	argstr = sprintf("%s, %d", user_string_quoted($name), $len)
}
probe syscall.sethostname.return = kernel.function("sys_sethostname").return
{
	name = "sethostname"
	retstr = return_str(1, $return)
}
# setitimer __________________________________________________
#
# long sys_setitimer(int which,
#		   struct itimerval __user *value,
#		   struct itimerval __user *ovalue)
#
probe syscall.setitimer = kernel.function("sys_setitimer").call
{
	name = "setitimer"
	which = __int32($which)
	value_uaddr = $value
	ovalue_uaddr = $ovalue
	argstr = sprintf("%s, %s, %p", _itimer_which_str(which),
			 _struct_itimerval_u($value), $ovalue)
}
probe syscall.setitimer.return = kernel.function("sys_setitimer").return
{
	name = "setitimer"
	retstr = return_str(1, $return)
}
#
# long compat_sys_setitimer(int which,
#		struct compat_itimerval __user *in,
#		struct compat_itimerval __user *out)
#
probe syscall.compat_setitimer = kernel.function("compat_sys_setitimer").call ?
{
	name = "setitimer"
	which = __int32($which)
	value_uaddr = $in
	ovalue_uaddr = @__pointer($out)
	argstr = sprintf("%s, %s, %p", _itimer_which_str(which),
			 _struct_compat_itimerval_u($in), @__pointer($out))
}
probe syscall.compat_setitimer.return = kernel.function("compat_sys_setitimer").return ?
{
	name = "setitimer"
	retstr = return_str(1, $return)
}

# set_mempolicy ______________________________________________
# long sys_set_mempolicy(int mode,
#	unsigned long __user *nmask,
#	unsigned long maxnode)
#
probe syscall.set_mempolicy = kernel.function("compat_sys_set_mempolicy").call ?,
                              kernel.function("sys_set_mempolicy").call ?
{
	name = "set_mempolicy"
	mode = $mode
	nmask_uaddr = $nmask
	maxnode = $maxnode
	argstr = sprintf("%d, %p, %d", $mode, $nmask, $maxnode)
}
probe syscall.set_mempolicy.return = kernel.function("compat_sys_set_mempolicy").return ?,
                                     kernel.function("sys_set_mempolicy").return ?
{
	name = "set_mempolicy"
	retstr = return_str(1, $return)
}

# setpgid ____________________________________________________
#
# asmlinkage long
# sys_setpgid(pid_t pid,
#		 pid_t pgid)
#
probe syscall.setpgid = kernel.function("sys_setpgid").call
{
	name = "setpgid"
	pid = __int32($pid)
	pgid = __int32($pgid)
	argstr = sprintf("%d, %d", __int32($pid), __int32($pgid))
}
probe syscall.setpgid.return = kernel.function("sys_setpgid").return
{
	name = "setpgid"
	retstr = return_str(1, $return)
}
# setpriority ________________________________________________
#
# asmlinkage long
# sys_setpriority(int which,
#		     int who,
#		     int niceval)
#
probe syscall.setpriority = kernel.function("sys_setpriority").call
{
	name = "setpriority"
	which = __int32($which)
	which_str = _priority_which_str(__int32($which))
	who = __int32($who)
	prio = __int32($niceval)
	argstr = sprintf("%s, %d, %d", which_str, __int32($who),
			 __int32($niceval))
}
probe syscall.setpriority.return = kernel.function("sys_setpriority").return
{
	name = "setpriority"
	retstr = return_str(1, $return)
}

# setregid ___________________________________________________
# long sys_setregid(gid_t rgid, gid_t egid)
#
probe syscall.setregid = kernel.function("sys_setregid").call
{
	name = "setregid"
	rgid = __int32($rgid)
	egid = __int32($egid)
	argstr = sprintf("%d, %d", rgid, egid)
}
probe syscall.setregid.return = kernel.function("sys_setregid").return
{
	name = "setregid"
	retstr = return_str(1, $return)
}
# setregid16 _________________________________________________
# long sys_setregid16(old_gid_t rgid, old_gid_t egid)
#
probe syscall.setregid16 = kernel.function("sys_setregid16").call ?
{
	name = "setregid"
	rgid = __short($rgid)
	egid = __short($egid)
	argstr = sprintf("%d, %d", rgid, egid)
}
probe syscall.setregid16.return = kernel.function("sys_setregid16").return ?
{
	name = "setregid"
	retstr = return_str(1, $return)
}
# setresgid __________________________________________________
# long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid)
#
probe syscall.setresgid = kernel.function("sys_setresgid").call
{
	name = "setresgid"
	rgid = __int32($rgid)
	egid = __int32($egid)
	sgid = __int32($sgid)
	argstr = sprintf("%d, %d, %d", rgid, egid, sgid)
}
probe syscall.setresgid.return = kernel.function("sys_setresgid").return
{
	name = "setresgid"
	retstr = return_str(1, $return)
}
# setresgid16 ________________________________________________
#
# long sys_setresgid16(old_gid_t rgid,
#		     old_gid_t egid,
#		     old_gid_t sgid)
#
probe syscall.setresgid16 = kernel.function("sys_setresgid16").call ?
{
	name = "setresgid"
	rgid = __short($rgid)
	egid = __short($egid)
	sgid = __short($sgid)
	argstr = sprintf("%d, %d, %d", rgid, egid, sgid)
}
probe syscall.setresgid16.return = kernel.function("sys_setresgid16").return ?
{
	name = "setresgid16"
	retstr = return_str(1, $return)
}

# setresuid __________________________________________________
#
# long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid)
#
probe syscall.setresuid = kernel.function("sys_setresuid").call
{
	name = "setresuid"
	ruid = __int32($ruid)
	euid = __int32($euid)
	suid = __int32($suid)
	argstr = sprintf("%d, %d, %d", ruid, euid, suid)
}
probe syscall.setresuid.return = kernel.function("sys_setresuid").return
{
	name = "setresuid"
	retstr = return_str(1, $return)
}

# setresuid16 ________________________________________________
#
# long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid)
#
probe syscall.setresuid16 = kernel.function("sys_setresuid16").call ?
{
	name = "setresuid"
	ruid = __short($ruid)
	euid = __short($euid)
	suid = __short($suid)
	argstr = sprintf("%d, %d, %d", ruid, euid, suid)
}
probe syscall.setresuid16.return = kernel.function("sys_setresuid16").return ?
{
	name = "setresuid"
	retstr = return_str(1, $return)
}

# setreuid ___________________________________________________
# long sys_setreuid(uid_t ruid, uid_t euid)
#
probe syscall.setreuid = kernel.function("sys_setreuid").call
{
	name = "setreuid"
	ruid = __int32($ruid)
	euid = __int32($euid)
	argstr = sprintf("%d, %d", ruid, euid)
}
probe syscall.setreuid.return = kernel.function("sys_setreuid").return
{
	name = "setreuid"
	retstr = return_str(1, $return)
}
# setreuid16 _________________________________________________
# long sys_setreuid16(old_uid_t ruid, old_uid_t euid)
#
probe syscall.setreuid16 = kernel.function("sys_setreuid16").call ?
{
	name = "setreuid"
	ruid = __short($ruid)
	euid = __short($euid)
	argstr = sprintf("%d, %d", ruid, euid)
}
probe syscall.setreuid16.return = kernel.function("sys_setreuid16").return ?
{
	name = "setreuid"
	retstr = return_str(1, $return)
}
# setrlimit __________________________________________________
#
# asmlinkage long
# sys_setrlimit(unsigned int resource,
#		   struct rlimit __user *rlim)
#
probe syscall.setrlimit = kernel.function("sys_setrlimit").call
{
	name = "setrlimit"
	resource = $resource
	rlim_uaddr = $rlim
	argstr = sprintf("%s, %s", _rlimit_resource_str($resource),
		_struct_rlimit_u($rlim))
}
probe syscall.setrlimit.return = kernel.function("sys_setrlimit").return
{
	name = "setrlimit"
	retstr = return_str(1, $return)
}
# setsid _____________________________________________________
#
# long sys_setsid(void)
#
probe syscall.setsid = kernel.function("sys_setsid").call
{
	name = "setsid"
	argstr = ""
}
probe syscall.setsid.return = kernel.function("sys_setsid").return
{
	name = "setsid"
	retstr = return_str(1, $return)
}

# setsockopt _________________________________________________
#
# long sys_setsockopt(int fd,
#		    int level,
#		    int optname,
#		    char __user *optval,
#		    int optlen)
#
probe syscall.setsockopt = __syscall.setsockopt ?,
	__syscall.socketcall.setsockopt ?,
	__syscall.compat_socketcall.setsockopt ?
{
	name = "setsockopt"
	level_str = _sockopt_level_str(level)
	optname_str = _sockopt_optname_str(optname)
	argstr = sprintf("%d, %s, %s, %p, %u", fd, level_str,
			 optname_str, optval_uaddr, optlen)
}
probe __syscall.setsockopt = kernel.function("sys_setsockopt").call ?
{
	@__syscall_gate(%{ __NR_setsockopt %})
	fd = __int32($fd)
	level = __int32($level)
	optname = __int32($optname)
	optval_uaddr = $optval
	optlen = __uint32($optlen)
}
probe __syscall.socketcall.setsockopt = kernel.function("sys_socketcall").call ?
{
	if ($call != %{ SYS_SETSOCKOPT %}) next;
	fd = __int32(user_ulong(&@cast($args, "ulong")[0]))
	level = __int32(user_ulong(&@cast($args, "ulong")[1]))
	optname = __int32(user_ulong(&@cast($args, "ulong")[2]))
	optval_uaddr = user_ulong(&@cast($args, "ulong")[3])
	optlen = __uint32(user_ulong(&@cast($args, "ulong")[4]))
}
probe __syscall.compat_socketcall.setsockopt =
	kernel.function("compat_sys_socketcall").call ?
{
	if ($call != %{ SYS_SETSOCKOPT %}) next;
	fd = user_int(&@cast($args, "unsigned int")[0])
	level = user_int(&@cast($args, "unsigned int")[1])
	optname = user_int(&@cast($args, "unsigned int")[2])
	optval_uaddr = user_uint32(&@cast($args, "unsigned int")[3])
	optlen = user_uint32(&@cast($args, "unsigned int")[4])
}
probe syscall.setsockopt.return = __syscall.setsockopt.return ?,
      __syscall.socketcall.setsockopt.return ?
{
	name = "setsockopt"
	retstr = return_str(1, $return)
}
probe __syscall.setsockopt.return =
	kernel.function("sys_setsockopt").return ?
{
	@__syscall_gate(%{ __NR_setsockopt %})
}
probe __syscall.socketcall.setsockopt.return =
	kernel.function("sys_socketcall").return ?,
	kernel.function("compat_sys_socketcall").return ?
{
	if ($call != %{ SYS_SETSOCKOPT %}) next;
}

# set_tid_address ____________________________________________
#
# asmlinkage long
# sys_set_tid_address(int __user *tidptr)
#
probe syscall.set_tid_address = kernel.function("sys_set_tid_address").call
{
	name = "set_tid_address"
	tidptr_uaddr = $tidptr
	argstr = sprintf("%p", tidptr_uaddr)
}
probe syscall.set_tid_address.return = kernel.function("sys_set_tid_address").return
{
	name = "set_tid_address"
	retstr = return_str(1, $return)
}
# settimeofday _______________________________________________
#
# long sys_settimeofday(struct timeval __user *tv,
#			struct timezone __user *tz)
#
probe syscall.settimeofday = kernel.function("sys_settimeofday").call
{
	name = "settimeofday"
	tv_uaddr = $tv
	tz_uaddr = $tz
	argstr = sprintf("%s, %s", _struct_timeval_u($tv, 1), _struct_timezone_u($tz))
}
probe syscall.settimeofday.return = kernel.function("sys_settimeofday").return
{
	name = "settimeofday"
	retstr = return_str(1, $return)
}
#
# long sys32_settimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
# long compat_sys_settimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
#
probe syscall.settimeofday32 = kernel.function("sys32_settimeofday").call ?,
                               kernel.function("compat_sys_settimeofday").call ?
{
	name = "settimeofday"
	tv_uaddr = $tv
	tz_uaddr = $tz
	argstr = sprintf("%s, %s", _struct_compat_timeval_u($tv, 1), _struct_timezone_u($tz))
}
probe syscall.settimeofday32.return = kernel.function("sys32_settimeofday").return ?,
                                      kernel.function("compat_sys_settimeofday").return ?
{
	name = "settimeofday"
	retstr = return_str(1, $return)
}

# setuid _____________________________________________________
#
# long sys_setuid(uid_t uid)
# long sys_setuid16(old_uid_t uid)
#
probe syscall.setuid = kernel.function("sys_setuid16").call ?,
                       kernel.function("sys_setuid").call
{
	name = "setuid"
	uid = $uid
	argstr = sprint($uid)
}
probe syscall.setuid.return = kernel.function("sys_setuid16").return ?,
                              kernel.function("sys_setuid").return
{
	name = "setuid"
	retstr = return_str(1, $return)
}

# setxattr ___________________________________________________
# long sys_setxattr(char __user *path,
#		  char __user *name,
#		  void __user *value,
#		  size_t size,
#		  int flags)
#
probe syscall.setxattr = kernel.function("sys_setxattr").call
{
	name = "setxattr"
	path_uaddr = @choose_defined($pathname, $path)
	path = user_string_quoted(@choose_defined($pathname, $path))
	name_uaddr = $name
	name_str = user_string_quoted($name)
	value_uaddr = $value
	size = $size
	flags = $flags
	argstr = sprintf("%s, %s, %p, %d, %d",
			user_string_quoted(@choose_defined($pathname, $path)),
			user_string_quoted($name),
			value_uaddr, $size, $flags)
}
probe syscall.setxattr.return = kernel.function("sys_setxattr").return
{
	name = "setxattr"
	retstr = return_str(1, $return)
}
# sgetmask ___________________________________________________
#
# sys_sgetmask(void)
#
probe syscall.sgetmask = kernel.function("sys_sgetmask").call ?
{
	name = "sgetmask"
	argstr = ""
}
probe syscall.sgetmask.return = kernel.function("sys_sgetmask").return ?
{
	name = "sgetmask"
	retstr = return_str(1, $return)
}

# shmat ______________________________________________________
#
# long sys_shmat(int shmid, char __user *shmaddr, int shmflg)
#
probe syscall.shmat = kernel.function("sys_shmat").call ?
{
	name = "shmat"
	shmid = $shmid
	shmaddr_uaddr = $shmaddr
	shmflg = $shmflg
	argstr = sprintf("%d, %p, %s", $shmid, $shmaddr, _shmat_flags_str($shmflg))
}
probe syscall.shmat.return = kernel.function("sys_shmat").return ?
{
	name = "shmat"
	retstr = return_str(1, $return)
}
# compat_sys_shmat ________________________________________
#
# long compat_sys_shmat(int first, int second, compat_uptr_t third,
#			int version, void __user *uptr)
# COMPAT_SYSCALL_DEFINE3(shmat, int, shmid, compat_uptr_t, shmaddr,
#			 int, shmflg)
#
probe syscall.compat_sys_shmat = kernel.function("compat_sys_shmat").call ?
{
	name = "compat_sys_shmat"
%( systemtap_v < "2.3" %?
	first = @choose_defined($shmid, $first)
	second = @choose_defined($shmflg, $second)
	third = @choose_defined($third, 0)
	uptr_uaddr = @choose_defined($shmaddr, $uptr)
%)
	shmid = @choose_defined($shmid, $first)
	shmaddr_uaddr = @choose_defined($shmaddr, $uptr)
	shmflg = @choose_defined($shmflg, $second)
	argstr = sprintf("%d, %p, %s", shmid, shmaddr_uaddr,
			 _shmat_flags_str(shmflg))
}
probe syscall.compat_sys_shmat.return =	kernel.function("compat_sys_shmat").return ?
{
	name = "compat_sys_shmat"
	retstr = return_str(1, $return)
}

# shmctl _____________________________________________________
#
# long sys_shmctl (int shmid,
#		 int cmd,
#		 struct shmid_ds __user *buf)
#
probe syscall.shmctl = kernel.function("sys_shmctl").call ?
{
	name = "shmctl"
	shmid = $shmid
	cmd = $cmd
	buf_uaddr = $buf
	argstr = sprintf("%d, %s, %p", $shmid, _semctl_cmd($cmd), $buf)
}
probe syscall.shmctl.return = kernel.function("sys_shmctl").return ?
{
	name = "shmctl"
	retstr = return_str(1, $return)
}
# compat_sys_shmctl ________________________________________
#
# long compat_sys_shmctl(int first, int second, void __user *uptr)
#
probe syscall.compat_sys_shmctl = kernel.function("compat_sys_shmctl").call ?
{
	name = "compat_sys_shmctl"
%( systemtap_v <= "2.5" %?
	first = $first
	second = $second
	uptr_uaddr = $uptr
%)
	shmid = $first
	cmd = $second
	buf_uaddr = $uptr
	argstr = sprintf("%d, %d, %p", $first, $second, $uptr)
}
probe syscall.compat_sys_shmctl.return = kernel.function("compat_sys_shmctl").return ?
{
	name = "compat_sys_shmctl"
	retstr = return_str(1, $return)
}

# shmdt ______________________________________________________
#
# long sys_shmdt(char __user *shmaddr)
#
probe syscall.shmdt = kernel.function("sys_shmdt").call ?
{
	name = "shmdt"
	shmaddr_uaddr = $shmaddr
	argstr = sprintf("%p", $shmaddr)
}
probe syscall.shmdt.return = kernel.function("sys_shmdt").return ?
{
	name = "shmdt"
	retstr = return_str(1, $return)
}

# shmget _____________________________________________________
#
# long sys_shmget (key_t key,
#		 size_t size,
#		 int shmflg)
#
probe syscall.shmget = kernel.function("sys_shmget").call ?
{
	name = "shmget"
	key = $key
	size = $size
	shmflg = $shmflg
	argstr = sprintf("%d, %d, %d", $key, $size, $shmflg)
}
probe syscall.shmget.return = kernel.function("sys_shmget").return ?
{
	name = "shmget"
	retstr = return_str(1, $return)
}

# shutdown ___________________________________________________
#
# long sys_shutdown(int fd, int how)
#
probe syscall.shutdown = kernel.function("sys_shutdown").call ?
{
	name = "shutdown"
	s = __int32($fd)
	how = __int32($how)
	how_str = _shutdown_how_str(how)
	argstr = sprintf("%d, %s", s, how_str)
}
probe syscall.shutdown.return = kernel.function("sys_shutdown").return ?
{
	name = "shutdown"
	retstr = return_str(1, $return)
}

# sigaction __________________________________________________
# sys_sigaction(int sig, const struct old_sigaction __user *act, struct old_sigaction __user *oact)
# sys32_sigaction(int sig, struct old_sigaction32 __user *act, struct old_sigaction32 __user *oact)
#
probe syscall.sigaction = kernel.function("sys_sigaction").call ?
{
	name = "sigaction"
	sig = $sig
	act_uaddr = $act
	oact_uaddr = $oact
	argstr = sprintf("%s, {%s}, %p", _signal_name($sig), _struct_sigaction_u($act), $oact)
}
probe syscall.sigaction.return = kernel.function("sys_sigaction").return ?
{
	name = "sigaction"
	retstr = return_str(1, $return)
}
probe syscall.sigaction32 = kernel.function("sys32_sigaction").call ?,
			    kernel.function("compat_sys_sigaction").call ?
{
	name = "sigaction"
	sig = $sig
	act_uaddr = $act
	oact_uaddr = $oact
	argstr = sprintf("%s, {%s}, %p", _signal_name($sig), _struct_old_sigaction32_u($act), $oact)
}
probe syscall.sigaction32.return = kernel.function("sys32_sigaction").return ?,
				   kernel.function("compat_sys_sigaction").return ?
{
	name = "sigaction"
	retstr = return_str(1, $return)
}

# In kernel 3.8, CONFIG_GENERIC_SIGALTSTACK was added by 
# kernel commit 6bf9adfc90370b695cb111116e15fdc0e1906270.
#
# Then, in kernel 3.9, all architectures were switched to using the
# generic sigaltstack by kernel commit
# d64008a8f30e0b381b292788ec6f3ee509b3bb40, which also removed the
# CONFIG_GENERIC_SIGALTSTACK config variable.
#
# Thus the following preprocessor test.
%( CONFIG_GENERIC_SIGALTSTACK == "y" || kernel_v >= "3.9" %?

# sigaltstack ________________________________________________
# SYSCALL_DEFINE2(sigaltstack,const stack_t __user *,uss, stack_t __user *,uoss)
#
probe syscall.sigaltstack = kernel.function("sys_sigaltstack").call
{
	name = "sigaltstack"
	uss_uaddr = $uss
	uoss_uaddr = $uoss
	argstr = sprintf("%p, %p", $uss, $uoss)
}
probe syscall.sigaltstack.return = kernel.function("sys_sigaltstack").return
{
	name = "sigaltstack"
	retstr = return_str(1, $return)
}
%)

# signal _____________________________________________________
# unsigned long sys_signal(int sig, __sighandler_t handler)
#
probe syscall.signal = kernel.function("sys_signal").call ?
{
	name = "signal"
	sig = $sig
	handler = $handler
	argstr = sprintf("%s, %s", _signal_name($sig), _sighandler_str($handler))
}
probe syscall.signal.return = kernel.function("sys_signal").return ?
{
	name = "signal"
	retstr = return_str(1, $return)
}

# signalfd _____________________________________________________
#
# long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask)
# long sys_signalfd4(int ufd, sigset_t __user *user_mask, size_t sizemask,
#		 int flags)
# long compat_sys_signalfd(int ufd, const compat_sigset_t __user *sigmask,
# 		 compat_size_t sigsetsize)
# long compat_sys_signalfd4(int ufd, const compat_sigset_t __user *sigmask,
#		 compat_size_t sigsetsize, int flags)
#
probe syscall.signalfd = __syscall.signalfd4 !, __syscall.signalfd ?
{
	flags = @choose_defined($flags, 0);
	if (flags == 0) {
		name = "signalfd"
		argstr = sprintf("%d, %p, %d", $ufd, $user_mask, $sizemask)
	} else {
		name = "signalfd4"
		argstr = sprintf("%d, %p, %d, %s", $ufd, $user_mask,
		       	 	 $sizemask, _signalfd4_flags_str($flags))
	}
}
probe __syscall.signalfd4 = kernel.function("sys_signalfd4").call
{
	@__syscall_gate(%{ __NR_signalfd4 %})
}
probe __syscall.signalfd = kernel.function("sys_signalfd").call
{
	@__syscall_gate(%{ __NR_signalfd %})
}
probe syscall.signalfd.return = __syscall.signalfd4.return !,
				__syscall.signalfd.return ?
{
	retstr = return_str(1, $return)
}
probe __syscall.signalfd4.return = kernel.function("sys_signalfd4").return
{
	@__syscall_gate(%{ __NR_signalfd4 %})
	flags = $flags
	name = (flags == 0) ? "signalfd" : "signalfd4"
}
probe __syscall.signalfd.return = kernel.function("sys_signalfd").return
{
	@__syscall_gate(%{ __NR_signalfd %})
	flags = 0
	name = "signalfd"
}
probe syscall.compat_signalfd = kernel.function("compat_sys_signalfd4").call !,
                                kernel.function("compat_sys_signalfd").call ?
{
	flags = __int32(@choose_defined($flags, 0))
	if (flags == 0) {
		name = "signalfd"
		argstr = sprintf("%d, %p, %d", __int32($ufd), $sigmask,
				 $sigsetsize)
	} else {
		name = "signalfd4"
		argstr = sprintf("%d, %p, %d, %s", __int32($ufd), $sigmask,
				 $sigsetsize, _signalfd4_flags_str($flags))
	}
}
probe syscall.compat_signalfd.return =
		kernel.function("compat_sys_signalfd4").return !,
		kernel.function("compat_sys_signalfd").return ?
{
	flags = __int32(@choose_defined($flags, 0))
	name = (flags == 0) ? "signalfd" : "signalfd4"
	retstr = return_str(1, $return)
}

# sigpending _________________________________________________
# long sys_sigpending(old_sigset_t __user *set)
#
probe syscall.sigpending = kernel.function("sys_sigpending").call ?
{
	name = "sigpending"
	argstr = sprintf("%p", $set)
}
probe syscall.sigpending.return = kernel.function("sys_sigpending").return ?
{
	name = "sigpending"
	retstr = return_str(1, $return)
}

# sigprocmask ________________________________________________
# long sys_sigprocmask(int how, old_sigset_t __user *set, old_sigset_t __user *oset)
# asmlinkage long compat_sys_sigprocmask(int how,
# 				         compat_old_sigset_t __user *nset,
#				         compat_old_sigset_t __user *oset)
#
probe syscall.sigprocmask = __syscall.sigprocmask ?,
			    __syscall.compat_sigprocmask ?
{
	name = "sigprocmask"
	how = $how
	how_str = _sigprocmask_how_str($how)
	set_uaddr = @choose_defined($set, $nset)
	argstr = sprintf("%s, %p, %p", how_str, set_uaddr, oldset_uaddr)
}
probe __syscall.sigprocmask = kernel.function("sys_sigprocmask").call ?
{
	oldset_uaddr = $oset
}
probe __syscall.compat_sigprocmask =
	kernel.function("compat_sys_sigprocmask").call ?
{
	oldset_uaddr = __uint32($oset)
}
probe syscall.sigprocmask.return = kernel.function("sys_sigprocmask").return ?,
	kernel.function("compat_sys_sigprocmask").return ?
{
	name = "sigprocmask"
	retstr = return_str(1, $return)
}

# sigreturn __________________________________________________
# int sys_sigreturn(unsigned long __unused)
#
probe syscall.sigreturn = kernel.function("sys_sigreturn").call ?,
                          kernel.function("sys32_sigreturn").call ?
{
	name = "sigreturn"
	argstr = ""
}
probe syscall.sigreturn.return = kernel.function("sys_sigreturn").return ?,
                                 kernel.function("sys32_sigreturn").return ?
{
	name = "sigreturn"
	retstr = return_str(1, $return)
}

# sigsuspend _________________________________________________
#
probe syscall.sigsuspend = kernel.function("sys_sigsuspend").call ?,
                           kernel.function("sys32_sigsuspend").call ?
{
	name = "sigsuspend"
	argstr = ""
}
probe syscall.sigsuspend.return = kernel.function("sys_sigsuspend").return ?,
                                  kernel.function("sys32_sigsuspend").return ?
{
	name = "sigsuspend"
	retstr = return_str(1, $return)
}

# socket _____________________________________________________
# long sys_socket(int family, int type, int protocol)
#
probe syscall.socket = kernel.function("sys_socket").call ?
{
	name = "socket"
	family = __int32($family)
	type = __int32($type)
	protocol = __int32($protocol)
	argstr = sprintf("%s, %s, %s", _sock_family_str(family),
			 _sock_type_str(type),
			 _sock_protocol_str(family, protocol))
}
probe syscall.socket.return = kernel.function("sys_socket").return ?
{
	name = "socket"
	retstr = return_str(1, $return)
}

# commented out because this seems redundant
# socketcall _________________________________________________
#
# long sys_socketcall(int call, unsigned long __user *args)
#
#probe syscall.socketcall = kernel.function("sys_socketcall").call ?
#{
#	name = "socketcall"
#	call = $call
#	args_uaddr = $args
#	argstr = sprintf("%d, %p", $call, args_uaddr)
#}
#probe syscall.socketcall.return = kernel.function("sys_socketcall").return ?
#{
#	name = "socketcall"
#	retstr = return_str(1, $return)
#}

# socketpair _________________________________________________
# long sys_socketpair(int family,
#		    int type,
#		    int protocol,
#		    int __user *usockvec)
#
probe syscall.socketpair = kernel.function("sys_socketpair").call ?
{
	name = "socketpair"
	family = __int32($family)
	type = __int32($type)
	protocol = __int32($protocol)
	sv_uaddr = $usockvec
	argstr = sprintf("%s, %s, %s, %p",
		_sock_family_str(family),
		_sock_type_str(type),
		_sock_protocol_str(family, protocol), sv_uaddr)
}
probe syscall.socketpair.return = kernel.function("sys_socketpair").return ?
{
	name = "socketpair"
	retstr = return_str(1, $return)
}

# splice ___________________________________________________
#
# long sys_splice(int fd_in, loff_t __user *off_in,
#		   int fd_out, loff_t __user *off_out,
#		   size_t len, unsigned int flags)
#
probe syscall.splice = kernel.function("sys_splice").call ?
{
	name = "splice"
	argstr = sprintf("%d, %p, %d, %p, %d, 0x%x",
		$fd_in, $off_in, $fd_out, $off_out, $len, $flags)
}
probe syscall.splice.return = kernel.function("sys_splice").return ?
{
	name = "splice"
	retstr = return_str(1, $return)
}

# ssetmask ___________________________________________________
#
# long sys_ssetmask(int newmask)
#
probe syscall.ssetmask = kernel.function("sys_ssetmask").call ?
{
	name = "ssetmask"
	newmask = $newmask
	argstr = sprint($newmask)
}
probe syscall.ssetmask.return = kernel.function("sys_ssetmask").return ?
{
	name = "ssetmask"
	retstr = return_str(1, $return)
}

# stat _______________________________________________________
# long sys_stat(char __user * filename, struct __old_stat __user * statbuf)
# long sys32_stat64(char __user * filename, struct stat64 __user *statbuf)
# long sys_stat64(char __user * filename, struct stat64 __user * statbuf)
# long sys_oabi_stat64(char __user * filename, struct oldabi_stat64 __user * statbuf)
# long compat_sys_newstat(char __user * filename, struct compat_stat __user *statbuf)
probe syscall.stat = kernel.function("sys_stat").call ?,
                     kernel.function("sys_newstat").call ?,
                     kernel.function("sys32_stat64").call ?,
                     kernel.function("sys_stat64").call ?,
                     kernel.function("sys_oabi_stat64").call ?,
                     kernel.function("compat_sys_newstat").call ?
{
	name = "stat"
	filename_uaddr = $filename
	filename = user_string_quoted($filename)
	buf_uaddr = $statbuf
	argstr = sprintf("%s, %p", user_string_quoted($filename), buf_uaddr)
}
probe syscall.stat.return = kernel.function("sys_stat").return ?,
                            kernel.function("sys_newstat").return ?,
                            kernel.function("sys32_stat64").return ?,
                            kernel.function("sys_stat64").return ?,
                            kernel.function("sys_oabi_stat64").return ?,
                            kernel.function("compat_sys_newstat").return ?
{
	name = "stat"
	retstr = return_str(1, $return)
}

# statfs _____________________________________________________
# long sys_statfs(const char __user * path, struct statfs __user * buf)
# long compat_sys_statfs(const char __user *path, struct compat_statfs __user *buf)
#
probe syscall.statfs = kernel.function("compat_sys_statfs").call ?,
                       kernel.function("sys_statfs").call ?
{
	name = "statfs"
	buf_uaddr = $buf
	path = user_string_quoted(@choose_defined($pathname, $path))
	argstr = sprintf("%s, %p",
		user_string_quoted(@choose_defined($pathname, $path)),
		$buf)
}

probe syscall.statfs.return = kernel.function("compat_sys_statfs").return ?,
                              kernel.function("sys_statfs").return ?
{
	name = "statfs"
	retstr = return_str(1, $return)
}

# statfs64 ___________________________________________________
#
# long sys_statfs64(const char __user *path, size_t sz, struct statfs64 __user *buf)
# long compat_sys_statfs64(const char __user *path, compat_size_t sz, struct compat_statfs64 __user *buf)
#
probe syscall.statfs64 = kernel.function("compat_sys_statfs64").call ?,
                         kernel.function("sys_statfs64").call ?
{
	name = "statfs"
	sz = $sz
	buf_uaddr = $buf

	path = user_string_quoted(@choose_defined($pathname, $path))
	argstr = sprintf("%s, %d, %p",
		user_string_quoted(@choose_defined($pathname, $path)),
		$sz, $buf)
}

probe syscall.statfs64.return = kernel.function("compat_sys_statfs64").return ?,
                                kernel.function("sys_statfs64").return ?
{
	name = "statfs"
	retstr = return_str(1, $return)
}

# stime ______________________________________________________
#
# long sys_stime(time_t __user *tptr)
# long compat_sys_stime(compat_time_t __user *tptr)
#
probe syscall.stime = kernel.function("compat_sys_stime").call ?,
                      kernel.function("sys_stime").call ?
{
	name = "stime"
	t_uaddr = $tptr
	/* FIXME. Decode time */
	argstr = sprintf("%p", $tptr)
}
probe syscall.stime.return = kernel.function("compat_sys_stime").return ?,
                             kernel.function("sys_stime").return ?
{
	name = "stime"
	retstr = return_str(1, $return)
}

# swapoff ____________________________________________________
#
# asmlinkage long
# sys_swapoff(const char __user * specialfile)
#
probe syscall.swapoff = kernel.function("sys_swapoff").call ?
{
	name = "swapoff"
	path = user_string_quoted($specialfile)
	argstr = user_string_quoted($specialfile)
}
probe syscall.swapoff.return = kernel.function("sys_swapoff").return ?
{
	name = "swapoff"
	retstr = return_str(1, $return)
}
# swapon _____________________________________________________
#
# asmlinkage long
# sys_swapon(const char __user * specialfile,
#		int swap_flags)
#
probe syscall.swapon = kernel.function("sys_swapon").call ?
{
	name = "swapon"
	path = user_string_quoted($specialfile)
	swapflags = __int32($swap_flags)
	swapflags_str = _swapon_flags_str(__int32($swap_flags))
	argstr = sprintf("%s, %s", user_string_quoted($specialfile),
			 swapflags_str)
}
probe syscall.swapon.return = kernel.function("sys_swapon").return ?
{
	name = "swapon"
	retstr = return_str(1, $return)
}

# symlink ____________________________________________________
# long sys_symlink(const char __user * oldname,
#		 const char __user * newname)
probe syscall.symlink = kernel.function("sys_symlink").call
{
	name = "symlink"
	oldpath = user_string_quoted($oldname)
	newpath = user_string_quoted($newname)
	argstr = sprintf("%s, %s", user_string_quoted($oldname),
		user_string_quoted($newname))
}
probe syscall.symlink.return = kernel.function("sys_symlink").return
{
	name = "symlink"
	retstr = return_str(1, $return)
}

# symlinkat __________________________________________________
# new function with 2.6.16
# long sys_symlinkat(const char __user *oldname, int newdfd,
#	const char __user *newname)
probe syscall.symlinkat = kernel.function("sys_symlinkat").call ?
{
	@__syscall_compat_gate(%{ __NR_symlinkat %},
			       %{ __NR_compat_symlinkat %})
	name = "symlinkat"
	oldname = $oldname
	oldname_str = user_string_quoted($oldname)
	newdfd = __int32($newdfd)
	newdfd_str = _dfd_str(__int32($newdfd))
	newname = $newname
	newname_str = user_string_quoted($newname)
	argstr = sprintf("%s, %s, %s", user_string_quoted($oldname),
		newdfd_str, user_string_quoted($newname))
}
probe syscall.symlinkat.return = kernel.function("sys_symlinkat").return ?
{
	@__syscall_compat_gate(%{ __NR_symlinkat %},
			       %{ __NR_compat_symlinkat %})
	name = "symlinkat"
	retstr = return_str(1, $return)
}

# sync _______________________________________________________
#
# sys_sync(void)
#
probe syscall.sync = kernel.function("sys_sync").call
{
	name = "sync"
	argstr = ""
}
probe syscall.sync.return = kernel.function("sys_sync").return
{
	name = "sync"
	retstr = return_str(1, $return)
}

# sysctl _____________________________________________________
#
# long sys_sysctl(struct __sysctl_args __user *args)
#
probe syscall.sysctl = kernel.function("compat_sys_sysctl").call ?,
                       kernel.function("sys_sysctl").call ?
{
	name = "sysctl"
	argstr = sprintf("%p", $args)
}
probe syscall.sysctl.return = kernel.function("compat_sys_sysctl").return ?,
                              kernel.function("sys_sysctl").return ?
{
	name = "sysctl"
	retstr = return_str(1, $return)
}

# sysfs ______________________________________________________
#
# asmlinkage long
# sys_sysfs(int option,
#	     unsigned long arg1,
#	     unsigned long arg2)
#
probe syscall.sysfs = kernel.function("sys_sysfs").call
{
	name = "sysfs"
	option = __int32($option)
	arg1 = $arg1
	arg2 = $arg2
	if (option == 1)
		argstr = sprintf("%d, %s", __int32($option),
				 user_string_quoted($arg1))
	else if (option == 2)
		argstr = sprintf("%d, %d, %p", __int32($option), $arg1, $arg2)
	else if (option == 3)
		argstr = sprintf("%d", __int32($option))
	else
		argstr = sprintf("%d, 0x%x, 0x%x", __int32($option), $arg1,
				 $arg2)
}
probe syscall.sysfs.return = kernel.function("sys_sysfs").return
{
	name = "sysfs"
	retstr = return_str(1, $return)
}

# sysinfo ____________________________________________________
#
# long sys_sysinfo(struct sysinfo __user *info)
# long compat_sys_sysinfo(struct compat_sysinfo __user *info)
probe syscall.sysinfo = kernel.function("compat_sys_sysinfo").call ?,
                        kernel.function("sys_sysinfo").call
{
	name = "sysinfo"
	info_uaddr = $info
	argstr = sprintf("%p", $info)
}
probe syscall.sysinfo.return = kernel.function("compat_sys_sysinfo").return ?,
                               kernel.function("sys_sysinfo").return
{
	name = "sysinfo"
	retstr = return_str(1, $return)
}

# syslog _____________________________________________________
#
# long sys_syslog(int type, char __user * buf, int len)
#
probe syscall.syslog = kernel.function("sys_syslog").call
{
	name = "syslog"
	type = __int32($type)
	bufp_uaddr = $buf
	len = __int32($len)
	argstr = sprintf("%d, %p, %d", __int32($type), $buf, __int32($len))
}
probe syscall.syslog.return = kernel.function("sys_syslog").return
{
	name = "syslog"
	retstr = return_str(1, $return)
}

# tee _____________________________________________________
#
# long sys_tee(int fdin, int fdout, size_t len, unsigned int flags)
#
probe syscall.tee = kernel.function("sys_tee").call ?
{
	name = "tee"
	argstr = sprintf("%d, %d, %d, 0x%x", $fdin, $fdout, $len, $flags)
}
probe syscall.tee.return = kernel.function("sys_tee").return ?
{
	name = "tee"
	retstr = return_str(1, $return)
}

# tgkill _____________________________________________________
#
# asmlinkage long
# sys_tgkill(int tgid,
#		int pid,
#		int sig)
#
probe syscall.tgkill = kernel.function("sys_tgkill").call
{
	name = "tgkill"
	tgid = $tgid
	pid = $pid
	sig = $sig
	argstr = sprintf("%d, %d, %s", $tgid, $pid, _signal_name($sig))
}
probe syscall.tgkill.return = kernel.function("sys_tgkill").return
{
	name = "tgkill"
	retstr = return_str(1, $return)
}
# time _______________________________________________________
#
# long sys_time(time_t __user * tloc)
# long sys_time64(long __user * tloc)
# long sys32_time(compat_time_t __user * tloc)
# long compat_sys_time(compat_time_t __user * tloc)
#
probe syscall.time = kernel.function("sys32_time").call ?,
                     kernel.function("sys_time64").call ?,
                     kernel.function("compat_sys_time").call ?,
                     kernel.function("sys_time").call ?
{
	name = "time"
	t_uaddr = $tloc
	argstr = sprintf("%p", $tloc)
}
probe syscall.time.return = kernel.function("sys32_time").return ?,
                            kernel.function("sys_time64").return ?,
                            kernel.function("compat_sys_time").return ?,
                            kernel.function("sys_time").return ?
{
	name = "time"
	retstr = return_str(1, $return)
}

# timer_create _______________________________________________
#
# long sys_timer_create(clockid_t which_clock,
#			struct sigevent __user *timer_event_spec,
#			timer_t __user * created_timer_id)
#
probe syscall.timer_create = kernel.function("sys_timer_create").call
{
	name = "timer_create"
	clockid = $which_clock
	clockid_str = _get_wc_str($which_clock)
	evp_uaddr = $timer_event_spec
	timerid_uaddr = $created_timer_id
	argstr = sprintf("%s, %p, %p", clockid_str, $timer_event_spec, $created_timer_id)
}
probe syscall.timer_create.return = kernel.function("sys_timer_create").return
{
	name = "timer_create"
	retstr = return_str(1, $return)
}

# timer_delete _______________________________________________
#
# long sys_timer_delete(timer_t timer_id)
#
probe syscall.timer_delete = kernel.function("sys_timer_delete").call
{
	name = "timer_delete"
	timerid = $timer_id
	argstr = sprint($timer_id)
}
probe syscall.timer_delete.return = kernel.function("sys_timer_delete").return
{
	name = "timer_delete"
	retstr = return_str(1, $return)
}

# timer_getoverrun ___________________________________________
#
# long sys_timer_getoverrun(timer_t timer_id)
#
probe syscall.timer_getoverrun = kernel.function("sys_timer_getoverrun").call
{
	name = "timer_getoverrun"
	timerid = $timer_id
	argstr = sprint($timer_id)
}
probe syscall.timer_getoverrun.return = kernel.function("sys_timer_getoverrun").return
{
	name = "timer_getoverrun"
	retstr = return_str(1, $return)
}

# timer_gettime ______________________________________________
#
# long sys_timer_gettime(timer_t timer_id,
#			 struct itimerspec __user *setting)
#
probe syscall.timer_gettime = kernel.function("sys_timer_gettime").call
{
	name = "timer_gettime"
	timerid = $timer_id
	value_uaddr = $setting
	argstr = sprintf("%d, %p", $timer_id, $setting)
}
probe syscall.timer_gettime.return = kernel.function("sys_timer_gettime").return
{
	name = "timer_gettime"
	retstr = return_str(1, $return)
}

# timer_settime ______________________________________________
#
# long sys_timer_settime(timer_t timer_id,
#			 int flags,
#			 const struct itimerspec __user *new_setting,
#			 struct itimerspec __user *old_setting)
# long compat_sys_timer_settime(timer_t timer_id, int flags,
#			  struct compat_itimerspec __user *new,
#			  struct compat_itimerspec __user *old)
#
probe syscall.timer_settime = __syscall.timer_settime,
			      __syscall.compat_timer_settime ?
{
	name = "timer_settime"
}
probe __syscall.timer_settime = kernel.function("sys_timer_settime").call
{
	@__syscall_gate(%{ __NR_timer_settime %})
	timerid = $timer_id
	flags = $flags
	value_uaddr  = $new_setting
	ovalue_uaddr = $old_setting
	argstr = sprintf("%d, %d, %s, %p", $timer_id, $flags,
			 _struct_itimerspec_u($new_setting), $old_setting)
}
probe __syscall.compat_timer_settime =
	kernel.function("compat_sys_timer_settime").call ?
{
	timerid = $timer_id
	flags = $flags
	value_uaddr  = $new
	ovalue_uaddr = $old
	argstr = sprintf("%d, %d, %s, %p", $timer_id, $flags,
			 _struct_compat_itimerspec_u($new), $old)
}
probe syscall.timer_settime.return =
	__syscall.timer_settime.return,
	kernel.function("compat_sys_timer_settime").return ?
{
	name = "timer_settime"
	retstr = return_str(1, $return)
}
probe __syscall.timer_settime.return =
	kernel.function("sys_timer_settime").return
{
	@__syscall_gate(%{ __NR_timer_settime %})
}

# timerfd ______________________________________________
#
# long sys_timerfd(int ufd, int clockid, int flags,
#	    const struct itimerspec __user *utmr)
# long compat_sys_timerfd(int ufd, int clockid, int flags,
#  	   const struct compat_itimerspec __user *utmr)
#
probe syscall.timerfd = kernel.function("sys_timerfd").call ?,
                        kernel.function("compat_sys_timerfd").call ?
{
	name = "timerfd"
	argstr = sprintf("%d, %d, 0x%x", $ufd, $clockid, $flags)
}
probe syscall.timerfd.return = kernel.function("sys_timerfd").return ?,
                               kernel.function("compat_sys_timerfd").return ?
{
	name = "timerfd"
	retstr = return_str(1, $return)
}

# times ______________________________________________________
#
# long sys_times(struct tms __user * tbuf)
# long compat_sys_times(struct compat_tms __user *tbuf)
probe syscall.times = kernel.function("compat_sys_times").call ?,
                      kernel.function("sys_times").call ?
{
	name = "times"
	argstr = sprintf("%p", $tbuf)
}
probe syscall.times.return = kernel.function("compat_sys_times").return ?,
                             kernel.function("sys_times").return ?
{
	name = "times"
	retstr = return_str(1, $return)
}

# tkill ______________________________________________________
#
# asmlinkage long
# sys_tkill(int pid,
#	     int sig)
#
probe syscall.tkill = kernel.function("sys_tkill").call
{
	name = "tkill"
	pid = $pid
	sig = $sig
	argstr = sprintf("%d, %s", $pid, _signal_name($sig))
}
probe syscall.tkill.return = kernel.function("sys_tkill").return
{
	name = "tkill"
	retstr = return_str(1, $return)
}

# truncate ___________________________________________________
#
# sys_truncate(const char __user * path, unsigned long length)
# sys_truncate64(const char __user * path, loff_t length)
# COMPAT_SYSCALL_DEFINE2(truncate, const char __user *, path,
#			 compat_off_t, length)
#
probe syscall.truncate = __syscall.truncate ?, __syscall.compat_truncate ?
{
	name = "truncate"
%( arch == "s390" %?
	# Sigh. The syscall wrappers on s390x do odd things.
	if (%{ _stp_is_compat_task() %})
		path_uaddr = __uint32($path)
	else
		path_uaddr = $path
%:
	path_uaddr = $path
%)
	path = user_string_quoted(path_uaddr)
	argstr = sprintf("%s, %u", user_string_quoted(path_uaddr), length)
}
probe __syscall.truncate = kernel.function("sys_truncate").call ?,
			   kernel.function("sys_truncate64").call ?
{
%( arch == "powerpc" && CONFIG_COMPAT == "y" && kernel_v < "3.9.0" %?
	# Avoid probe hits from compat_sys_truncate() calling
	# compat_sys_truncate().  The following kernel commit
	# switched to a generic compat_sys_truncate() which doesn't
	# go through sys_truncate():
	#
	#   commit 3f6d078d4accfff8b114f968259a060bfdc7c682
	#   Author: Al Viro <viro@zeniv.linux.org.uk>
	#   Date:   Sun Feb 24 13:49:08 2013 -0500
	#
	#       fix compat truncate/ftruncate
	#
	#       Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
	#
	# We could call one of the syscall_gate macros here, but the
	# syscall number is the same number on ppc64 for the 64-bit
	# and 32-bit syscall. So, just check that we're not in a
	# compat task.
	if (%{ _stp_is_compat_task() %}) next
%)
%( arch == "s390" %?
	# Sigh. The syscall wrappers on s390x do odd things.
	if (%{ _stp_is_compat_task() %})
		length = __uint32($length)
	else
		length = __ulong($length)
%:
	length = __ulong($length)
%)
}
probe __syscall.compat_truncate = kernel.function("compat_sys_truncate").call ?
{
	length = __uint32($length)
}
probe syscall.truncate.return = __syscall.truncate.return,
                                kernel.function("sys_truncate64").return ?,
				kernel.function("compat_sys_truncate").return ?
{
	name = "truncate"
	retstr = return_str(1, $return)
}
probe __syscall.truncate.return = kernel.function("sys_truncate").return
{
%( arch == "powerpc" && CONFIG_COMPAT == "y" && kernel_v < "3.9.0" %?
	if (%{ _stp_is_compat_task() %}) next
%)
}

# tux ________________________________________________________
# long sys_tux (unsigned int action, user_req_t *u_info)
#
probe syscall.tux = kernel.function("sys_tux").call ?
{
	name = "tux"
	action = $action
	u_info_uaddr = $u_info
	argstr = sprintf("%d, %p", $action, $u_info)
}
probe syscall.tux.return = kernel.function("sys_tux").return ?
{
	name = "tux"
	retstr = return_str(1, $return)
}

# umask ______________________________________________________
# long sys_umask(int mask)
#
probe syscall.umask = kernel.function("sys_umask").call
{
	name = "umask"
	mask = $mask
	argstr = sprintf("%#o", $mask)
}
probe syscall.umask.return = kernel.function("sys_umask").return
{
	name = "umask"
	retstr = return_str(3, $return)
}

# umount _____________________________________________________
# long sys_umount(char __user * name, int flags)
# SYSCALL_DEFINE1(oldumount, char __user *, name)
#
probe syscall.umount = __syscall.umount, __syscall.oldumount ?
{
	name = "umount"
}
probe __syscall.umount = kernel.function("sys_umount").call
{
	@__syscall_compat_gate(%{ __NR_umount2 %}, %{ __NR_compat_umount2 %})
	target = user_string_quoted($name)
	flags = $flags
	flags_str = _umountflags_str($flags)
	argstr = sprintf("%s, %s", user_string_quoted($name), flags_str)
}
probe __syscall.oldumount = kernel.function("sys_oldumount").call ?
{
	target = user_string_quoted($name)
	flags = 0
	flags_str = "0"
	argstr = sprintf("%s, 0", user_string_quoted($name))
}
probe syscall.umount.return = __syscall.umount.return,
			      kernel.function("sys_oldumount").return ?
{
	name = "umount"
	retstr = return_str(1, $return)
}
probe __syscall.umount.return = kernel.function("sys_umount").return
{
	@__syscall_compat_gate(%{ __NR_umount2 %}, %{ __NR_compat_umount2 %})
}

# uname ______________________________________________________
#
# int sys_uname(struct old_utsname __user *name)
# long sys_newuname(struct new_utsname __user * name)
# int sys_olduname(struct oldold_utsname __user * name)
# int sys32_olduname(struct oldold_utsname __user * name)
# long sys32_uname(struct old_utsname __user * name)
#
probe syscall.uname = kernel.function("sys_uname").call ?,
                      kernel.function("sys_olduname").call ?,
                      kernel.function("sys32_olduname").call ?,
                      kernel.function("sys32_uname").call ?,
                      kernel.function("sys_newuname").call ?
{
	name = "uname"
	argstr = sprintf("%p", $name)
}

probe syscall.uname.return = kernel.function("sys_uname").return ?,
                             kernel.function("sys_olduname").return ?,
                             kernel.function("sys32_olduname").return ?,
                             kernel.function("sys32_uname").return ?,
                             kernel.function("sys_newuname").return ?
{
	name = "uname"
	retstr = return_str(1, $return)
}

# unlink _____________________________________________________
# long sys_unlink(const char __user * pathname)
#
probe syscall.unlink = kernel.function("sys_unlink").call
{
	name = "unlink"
	pathname_uaddr = $pathname
	pathname = user_string_quoted($pathname)
	argstr = user_string_quoted($pathname)
}
probe syscall.unlink.return = kernel.function("sys_unlink").return
{
	name = "unlink"
	retstr = return_str(1, $return)
}

# unlinkat ___________________________________________________
# new function with 2.6.16
# long sys_unlinkat(int dfd, const char __user *pathname,
#	int flag)
probe syscall.unlinkat = kernel.function("sys_unlinkat").call ?
{
	name = "unlinkat"
	dfd = __int32($dfd)
	dfd_str = _dfd_str(__int32($dfd))
	pathname = $pathname
	pathname_str = user_string_quoted($pathname)
	flag = __uint32($flag)
	flag_str = _at_flag_str(__uint32($flag))
	argstr = sprintf("%s, %s, %s", dfd_str, user_string_quoted($pathname),
			 flag_str)
}
probe syscall.unlinkat.return = kernel.function("sys_unlinkat").return ?
{
	name = "unlinkat"
	retstr = return_str(1, $return)
}

# unshare ____________________________________________________
# new function with 2.6.16
# long sys_unshare(unsigned long unshare_flags)
probe syscall.unshare = kernel.function("sys_unshare").call ?
{
	name = "unshare"
	unshare_flags = $unshare_flags
	argstr = __fork_flags(unshare_flags)
}
probe syscall.unshare.return = kernel.function("sys_unshare").return ?
{
	name = "unshare"
	retstr = return_str(1, $return)
}

# uselib _____________________________________________________
#
# asmlinkage long
# sys_uselib(const char __user * library)
#
probe syscall.uselib = kernel.function("sys_uselib").call ?
{
	name = "uselib"
	library_uaddr = $library
	library = user_string_quoted($library)
	argstr = user_string_quoted($library)
}
probe syscall.uselib.return = kernel.function("sys_uselib").return ?
{
	name = "uselib"
	retstr = return_str(1, $return)
}
# ustat ______________________________________________________
# long sys_ustat(unsigned dev, struct ustat __user * ubuf)
#
probe syscall.ustat = kernel.function("sys_ustat").call
{
	name = "ustat"
	dev = $dev
	ubuf_uaddr = $ubuf
	argstr = sprintf("%d, %p", $dev, $ubuf)
}

# long sys32_ustat(unsigned dev, struct ustat32 __user *u32p)
# long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u)
#
probe syscall.ustat32 = kernel.function("compat_sys_ustat").call ?,
      		        kernel.function("sys32_ustat").call ?
{
	name = "ustat"
	dev = $dev
	ubuf_uaddr = @choose_defined($u, $u32p)
	argstr = sprintf("%d, %p", $dev, @choose_defined($u, $u32p))
}

probe syscall.ustat.return = kernel.function("sys_ustat").return ?
{
	name = "ustat"
	retstr = return_str(1, $return)
}

probe syscall.ustat32.return = kernel.function("sys32_ustat").return ?,
                               kernel.function("compat_sys_ustat").return ?
{
	name = "ustat"
	retstr = return_str(1, $return)
}

# utime ______________________________________________________
# long sys_utime(char __user * filename, struct utimbuf __user * times)
probe syscall.utime = kernel.function("sys_utime").call ?
{
	name = "utime"
	filename_uaddr = $filename
	filename = user_string_quoted($filename)
	buf_uaddr = $times
	# On s390, '$times' is a long, so the @cast() is needed.
	actime = user_long(&@cast($times, "utimbuf")->actime)
	modtime = user_long(&@cast($times, "utimbuf")->modtime)
	argstr = sprintf("%s, [%s, %s]", user_string_quoted($filename),
		ctime(actime), ctime(modtime))
}
probe syscall.utime.return = kernel.function("sys_utime").return ?
{
	name = "utime"
	retstr = return_str(1, $return)
}

# long compat_sys_utime(char __user *filename, struct compat_utimbuf __user *t)
probe syscall.compat_utime = kernel.function("compat_sys_utime").call ?
{
	name = "utime"
	filename_uaddr = $filename
	filename = user_string_quoted($filename)
	buf_uaddr = $t
	actime = _struct_compat_utimbuf_actime(buf_uaddr)
	modtime = _struct_compat_utimbuf_modtime(buf_uaddr)
	argstr = sprintf("%s, [%s, %s]", user_string_quoted($filename),
		ctime(actime), ctime(modtime))
}
probe syscall.compat_utime.return = kernel.function("compat_sys_utime").return ?
{
	name = "utime"
	retstr = return_str(1, $return)
}

# utimes _____________________________________________________
#
# long sys_utimes(char __user * filename, struct timeval __user * utimes)
#
probe syscall.utimes = kernel.function("sys_utimes").call
{
	name = "utimes"
	filename_uaddr = $filename
	filename = user_string_quoted($filename)
	tvp_uaddr = $utimes
	argstr = sprintf("%s, %s", user_string_quoted($filename),
		_struct_timeval_u($utimes, 2))
}
probe syscall.utimes.return = kernel.function("sys_utimes").return
{
	name = "utimes"
	retstr = return_str(1, $return)
}
# compat_sys_utimes ________________________________________
#
# long compat_sys_utimes(char __user *filename, struct compat_timeval __user *t)
#
probe syscall.compat_sys_utimes = kernel.function("compat_sys_utimes").call ?
{
	name = "utimes"
	filename = user_string_quoted($filename)
	argstr = sprintf("%s, %s", user_string_quoted($filename),
		_struct_compat_timeval_u($t, 2))
}
probe syscall.compat_sys_utimes.return = kernel.function("compat_sys_utimes").return ?
{
	name = "utimes"
	retstr = return_str(1, $return)
}

# utimensat ____________________________________________________
# long sys_utimensat(int dfd, char __user *filename, struct timespec __user *utimes, int flags)
# long compat_sys_utimensat(unsigned int dfd, char __user *filename, struct compat_timespec __user *t, int flags)
#
probe syscall.utimensat = kernel.function("sys_utimensat").call ?
{
	name = "utimensat"
	dfd = __int32($dfd)
	dfd_str = _dfd_str(__int32($dfd))
	filename_uaddr = $filename
	filename = user_string_quoted($filename)
	tsp_uaddr = $utimes
	flags = __int32($flags)
	flags_str = _at_flag_str(__int32($flags))
	argstr = sprintf("%s, %s, %s, %s", _dfd_str(__int32($dfd)),
			 user_string_quoted($filename),
			 _struct_timespec_u($utimes, 2),
			 _at_flag_str(__int32($flags)))
}
probe syscall.compat_utimensat = kernel.function("compat_sys_utimensat").call ?
{
	name = "utimensat"
	dfd = __int32($dfd)
	dfd_str = _dfd_str(__int32($dfd))
	filename_uaddr = $filename
	filename = user_string_quoted($filename)
	tsp_uaddr = $t
	flags = __int32($flags)
	flags_str = _at_flag_str(__int32($flags))
	argstr = sprintf("%s, %s, %s, %s", _dfd_str(__int32($dfd)),
			 user_string_quoted($filename),
			 _struct_compat_timespec_u($t, 2),
			 _at_flag_str(__int32($flags)))
}
probe syscall.utimensat.return = kernel.function("sys_utimensat").return ?
{
	name = "utimensat"
	retstr = return_str(1, $return)
}
probe syscall.compat_utimensat.return =  kernel.function("compat_sys_utimensat").return ?
{
	name = "utimensat"
	retstr = return_str(1, $return)
}

# vfork _______________________________________________________
#
# SYSCALL_DEFINE0(vfork)
#
probe syscall.vfork = kernel.function("sys_vfork").call ?
{
	name = "vfork"
	argstr = ""
}
probe syscall.vfork.return = kernel.function("sys_vfork").return ?
{
	name = "vfork"
	retstr = return_str(1, $return)
}

# vhangup ____________________________________________________
#
# asmlinkage long
# sys_vhangup(void)
#
probe syscall.vhangup = kernel.function("sys_vhangup").call
{
	name = "vhangup"
	argstr = ""
}
probe syscall.vhangup.return = kernel.function("sys_vhangup").return
{
	name = "vhangup"
	retstr = return_str(1, $return)
}

# vmsplice ___________________________________________________
#
# long sys_vmsplice(int fd, const struct iovec __user *iov,
#	    unsigned long nr_segs, unsigned int flags)
# long compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32,
#	    unsigned int nr_segs, unsigned int flags)
#
probe syscall.vmsplice = kernel.function("sys_vmsplice").call ?
{
	name = "vmsplice"
	argstr = sprintf("%d, %p, %d, 0x%x", $fd, $iov, $nr_segs, $flags)
}
probe syscall.compat_vmsplice = kernel.function("compat_sys_vmsplice").call ?
{
	name = "vmsplice"
	argstr = sprintf("%d, %p, %d, 0x%x", $fd, $iov32, $nr_segs, $flags)
}
probe syscall.vmsplice.return = kernel.function("sys_vmsplice").return ?
{
	name = "vmsplice"
	retstr = return_str(1, $return)
}
probe syscall.compat_vmsplice.return = kernel.function("compat_sys_vmsplice").return ?
{
	name = "vmsplice"
	retstr = return_str(1, $return)
}

# wait4 ______________________________________________________
#
# long sys_wait4(pid_t pid,
#	     int __user *stat_addr,
#	     int options,
#	     struct rusage __user *ru)
# COMPAT_SYSCALL_DEFINE4(wait4,
#	compat_pid_t, pid,
#	compat_uint_t __user *, stat_addr,
#	int, options,
#	struct compat_rusage __user *, ru)
#
probe syscall.wait4 = __syscall.wait4,
	kernel.function("compat_sys_wait4").call ?
{
	name = "wait4"
	pid = __int32(@choose_defined($upid, $pid))
	status_uaddr = @__pointer($stat_addr)
	options = $options & 0xffffffff
	options_str = _wait4_opt_str(options)
	rusage_uaddr = @__pointer($ru)
	argstr = sprintf("%d, %p, %s, %p", pid, status_uaddr, options_str,
			 rusage_uaddr)
}
probe __syscall.wait4 = kernel.function("sys_wait4").call
{
	@__syscall_gate(%{ __NR_wait4 %})
}
probe syscall.wait4.return = __syscall.wait4.return,
	kernel.function("compat_sys_wait4").return ?
{
	name = "wait4"

	if (returnval () <= 0)
		status_str = "N/A"
	else if ($stat_addr == 0)
		status_str = "NULL"
	else
		status_str = _wait_status_str(user_int($stat_addr))

	retstr = return_str(1, $return)
}
probe __syscall.wait4.return = kernel.function("sys_wait4").return
{
	@__syscall_gate(%{ __NR_wait4 %})
}

# waitid _____________________________________________________
#
# long sys_waitid(int which,
#		pid_t pid,
#		struct siginfo __user *infop,
#		int options,
#		struct rusage __user *ru)
#
probe syscall.waitid = kernel.function("sys_waitid").call
{
	name = "waitid"
	pid = @choose_defined($upid, $pid)
	which = $which
	which_str = _waitid_which_str($which)
	infop_uaddr = $infop
	options = $options
	options_str = _waitid_opt_str($options)
	rusage_uaddr = $ru
	argstr = sprintf("%d, %d, %p, %s, %p", $which,
		@choose_defined($upid, $pid), $infop,
		_waitid_opt_str($options), $ru)
}
probe syscall.waitid.return = kernel.function("sys_waitid").return
{
	name = "waitid"
	retstr = return_str(1, $return)
}
/* FIXME:
# waitpid ____________________________________________________
#
# long sys_wait4(pid_t pid,
#	     int __user *stat_addr,
#	     int options,
#	     struct rusage __user *ru)
#
probe syscall.waitpid = kernel.function("sys_wait4").call
{
	name = "waitpid"
	pid = $pid
	status_uaddr = $stat_addr
	options = $options & 0xffffffff
	options_str = _wait4_opt_str(options)
	rusage_uaddr = $ru
	argstr = sprintf("%d, %p, %s, %p", $pid, $stat_addr,
		options_str, $ru)
}
probe syscall.waitpid.return = kernel.function("sys_wait4").return
{
	name = "waitpid"
	retstr = return_str(1, $return)
}
*/

# write ______________________________________________________
#
# ssize_t sys_write(unsigned int fd,
#	     const char __user * buf,
#	     size_t count)
#
probe syscall.write = kernel.function("sys_write").call
{
	name = "write"
	fd = $fd
	buf_uaddr = $buf
	count = $count
	argstr = sprintf("%d, %s, %d", $fd,
		user_string_n2_quoted($buf, $count, syscall_string_trunc),
		$count)
}
probe syscall.write.return = kernel.function("sys_write").return
{
	name = "write"
	retstr = return_str(1, $return)
}

# writev _____________________________________________________
#
# ssize_t sys_writev(unsigned long fd,
#		const struct iovec __user *vec,
#		unsigned long vlen)
# ssize_t compat_sys_writev(unsigned long fd,
#		const struct compat_iovec __user *vec,
#		unsigned long vlen)
#
probe syscall.writev = kernel.function("compat_sys_writev").call ?,
                       kernel.function("sys_writev").call
{
	name = "writev"
	vector_uaddr = $vec
	count = __int32($vlen)
	# Although the kernel gets an unsigned long fd, on the
	# user-side it is a signed int.  Fix this.
	fd = __int32($fd)
	argstr = sprintf("%d, %p, %d", __int32($fd), $vec, __int32($vlen))
}
probe syscall.writev.return = kernel.function("compat_sys_writev").return ?,
                              kernel.function("sys_writev").return
{
	name = "writev"
	retstr = return_str(1, $return)
}