File: ChangeLog

package info (click to toggle)
strace 5.10-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 49,332 kB
  • sloc: ansic: 113,177; sh: 8,831; makefile: 3,108; awk: 364; perl: 267; sed: 9
file content (68472 lines) | stat: -rw-r--r-- 2,660,150 bytes parent folder | download
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
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
21002
21003
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073
21074
21075
21076
21077
21078
21079
21080
21081
21082
21083
21084
21085
21086
21087
21088
21089
21090
21091
21092
21093
21094
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
21122
21123
21124
21125
21126
21127
21128
21129
21130
21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166
21167
21168
21169
21170
21171
21172
21173
21174
21175
21176
21177
21178
21179
21180
21181
21182
21183
21184
21185
21186
21187
21188
21189
21190
21191
21192
21193
21194
21195
21196
21197
21198
21199
21200
21201
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229
21230
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242
21243
21244
21245
21246
21247
21248
21249
21250
21251
21252
21253
21254
21255
21256
21257
21258
21259
21260
21261
21262
21263
21264
21265
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292
21293
21294
21295
21296
21297
21298
21299
21300
21301
21302
21303
21304
21305
21306
21307
21308
21309
21310
21311
21312
21313
21314
21315
21316
21317
21318
21319
21320
21321
21322
21323
21324
21325
21326
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354
21355
21356
21357
21358
21359
21360
21361
21362
21363
21364
21365
21366
21367
21368
21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418
21419
21420
21421
21422
21423
21424
21425
21426
21427
21428
21429
21430
21431
21432
21433
21434
21435
21436
21437
21438
21439
21440
21441
21442
21443
21444
21445
21446
21447
21448
21449
21450
21451
21452
21453
21454
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484
21485
21486
21487
21488
21489
21490
21491
21492
21493
21494
21495
21496
21497
21498
21499
21500
21501
21502
21503
21504
21505
21506
21507
21508
21509
21510
21511
21512
21513
21514
21515
21516
21517
21518
21519
21520
21521
21522
21523
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550
21551
21552
21553
21554
21555
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
21571
21572
21573
21574
21575
21576
21577
21578
21579
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590
21591
21592
21593
21594
21595
21596
21597
21598
21599
21600
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625
21626
21627
21628
21629
21630
21631
21632
21633
21634
21635
21636
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
21652
21653
21654
21655
21656
21657
21658
21659
21660
21661
21662
21663
21664
21665
21666
21667
21668
21669
21670
21671
21672
21673
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683
21684
21685
21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705
21706
21707
21708
21709
21710
21711
21712
21713
21714
21715
21716
21717
21718
21719
21720
21721
21722
21723
21724
21725
21726
21727
21728
21729
21730
21731
21732
21733
21734
21735
21736
21737
21738
21739
21740
21741
21742
21743
21744
21745
21746
21747
21748
21749
21750
21751
21752
21753
21754
21755
21756
21757
21758
21759
21760
21761
21762
21763
21764
21765
21766
21767
21768
21769
21770
21771
21772
21773
21774
21775
21776
21777
21778
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814
21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
21863
21864
21865
21866
21867
21868
21869
21870
21871
21872
21873
21874
21875
21876
21877
21878
21879
21880
21881
21882
21883
21884
21885
21886
21887
21888
21889
21890
21891
21892
21893
21894
21895
21896
21897
21898
21899
21900
21901
21902
21903
21904
21905
21906
21907
21908
21909
21910
21911
21912
21913
21914
21915
21916
21917
21918
21919
21920
21921
21922
21923
21924
21925
21926
21927
21928
21929
21930
21931
21932
21933
21934
21935
21936
21937
21938
21939
21940
21941
21942
21943
21944
21945
21946
21947
21948
21949
21950
21951
21952
21953
21954
21955
21956
21957
21958
21959
21960
21961
21962
21963
21964
21965
21966
21967
21968
21969
21970
21971
21972
21973
21974
21975
21976
21977
21978
21979
21980
21981
21982
21983
21984
21985
21986
21987
21988
21989
21990
21991
21992
21993
21994
21995
21996
21997
21998
21999
22000
22001
22002
22003
22004
22005
22006
22007
22008
22009
22010
22011
22012
22013
22014
22015
22016
22017
22018
22019
22020
22021
22022
22023
22024
22025
22026
22027
22028
22029
22030
22031
22032
22033
22034
22035
22036
22037
22038
22039
22040
22041
22042
22043
22044
22045
22046
22047
22048
22049
22050
22051
22052
22053
22054
22055
22056
22057
22058
22059
22060
22061
22062
22063
22064
22065
22066
22067
22068
22069
22070
22071
22072
22073
22074
22075
22076
22077
22078
22079
22080
22081
22082
22083
22084
22085
22086
22087
22088
22089
22090
22091
22092
22093
22094
22095
22096
22097
22098
22099
22100
22101
22102
22103
22104
22105
22106
22107
22108
22109
22110
22111
22112
22113
22114
22115
22116
22117
22118
22119
22120
22121
22122
22123
22124
22125
22126
22127
22128
22129
22130
22131
22132
22133
22134
22135
22136
22137
22138
22139
22140
22141
22142
22143
22144
22145
22146
22147
22148
22149
22150
22151
22152
22153
22154
22155
22156
22157
22158
22159
22160
22161
22162
22163
22164
22165
22166
22167
22168
22169
22170
22171
22172
22173
22174
22175
22176
22177
22178
22179
22180
22181
22182
22183
22184
22185
22186
22187
22188
22189
22190
22191
22192
22193
22194
22195
22196
22197
22198
22199
22200
22201
22202
22203
22204
22205
22206
22207
22208
22209
22210
22211
22212
22213
22214
22215
22216
22217
22218
22219
22220
22221
22222
22223
22224
22225
22226
22227
22228
22229
22230
22231
22232
22233
22234
22235
22236
22237
22238
22239
22240
22241
22242
22243
22244
22245
22246
22247
22248
22249
22250
22251
22252
22253
22254
22255
22256
22257
22258
22259
22260
22261
22262
22263
22264
22265
22266
22267
22268
22269
22270
22271
22272
22273
22274
22275
22276
22277
22278
22279
22280
22281
22282
22283
22284
22285
22286
22287
22288
22289
22290
22291
22292
22293
22294
22295
22296
22297
22298
22299
22300
22301
22302
22303
22304
22305
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316
22317
22318
22319
22320
22321
22322
22323
22324
22325
22326
22327
22328
22329
22330
22331
22332
22333
22334
22335
22336
22337
22338
22339
22340
22341
22342
22343
22344
22345
22346
22347
22348
22349
22350
22351
22352
22353
22354
22355
22356
22357
22358
22359
22360
22361
22362
22363
22364
22365
22366
22367
22368
22369
22370
22371
22372
22373
22374
22375
22376
22377
22378
22379
22380
22381
22382
22383
22384
22385
22386
22387
22388
22389
22390
22391
22392
22393
22394
22395
22396
22397
22398
22399
22400
22401
22402
22403
22404
22405
22406
22407
22408
22409
22410
22411
22412
22413
22414
22415
22416
22417
22418
22419
22420
22421
22422
22423
22424
22425
22426
22427
22428
22429
22430
22431
22432
22433
22434
22435
22436
22437
22438
22439
22440
22441
22442
22443
22444
22445
22446
22447
22448
22449
22450
22451
22452
22453
22454
22455
22456
22457
22458
22459
22460
22461
22462
22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479
22480
22481
22482
22483
22484
22485
22486
22487
22488
22489
22490
22491
22492
22493
22494
22495
22496
22497
22498
22499
22500
22501
22502
22503
22504
22505
22506
22507
22508
22509
22510
22511
22512
22513
22514
22515
22516
22517
22518
22519
22520
22521
22522
22523
22524
22525
22526
22527
22528
22529
22530
22531
22532
22533
22534
22535
22536
22537
22538
22539
22540
22541
22542
22543
22544
22545
22546
22547
22548
22549
22550
22551
22552
22553
22554
22555
22556
22557
22558
22559
22560
22561
22562
22563
22564
22565
22566
22567
22568
22569
22570
22571
22572
22573
22574
22575
22576
22577
22578
22579
22580
22581
22582
22583
22584
22585
22586
22587
22588
22589
22590
22591
22592
22593
22594
22595
22596
22597
22598
22599
22600
22601
22602
22603
22604
22605
22606
22607
22608
22609
22610
22611
22612
22613
22614
22615
22616
22617
22618
22619
22620
22621
22622
22623
22624
22625
22626
22627
22628
22629
22630
22631
22632
22633
22634
22635
22636
22637
22638
22639
22640
22641
22642
22643
22644
22645
22646
22647
22648
22649
22650
22651
22652
22653
22654
22655
22656
22657
22658
22659
22660
22661
22662
22663
22664
22665
22666
22667
22668
22669
22670
22671
22672
22673
22674
22675
22676
22677
22678
22679
22680
22681
22682
22683
22684
22685
22686
22687
22688
22689
22690
22691
22692
22693
22694
22695
22696
22697
22698
22699
22700
22701
22702
22703
22704
22705
22706
22707
22708
22709
22710
22711
22712
22713
22714
22715
22716
22717
22718
22719
22720
22721
22722
22723
22724
22725
22726
22727
22728
22729
22730
22731
22732
22733
22734
22735
22736
22737
22738
22739
22740
22741
22742
22743
22744
22745
22746
22747
22748
22749
22750
22751
22752
22753
22754
22755
22756
22757
22758
22759
22760
22761
22762
22763
22764
22765
22766
22767
22768
22769
22770
22771
22772
22773
22774
22775
22776
22777
22778
22779
22780
22781
22782
22783
22784
22785
22786
22787
22788
22789
22790
22791
22792
22793
22794
22795
22796
22797
22798
22799
22800
22801
22802
22803
22804
22805
22806
22807
22808
22809
22810
22811
22812
22813
22814
22815
22816
22817
22818
22819
22820
22821
22822
22823
22824
22825
22826
22827
22828
22829
22830
22831
22832
22833
22834
22835
22836
22837
22838
22839
22840
22841
22842
22843
22844
22845
22846
22847
22848
22849
22850
22851
22852
22853
22854
22855
22856
22857
22858
22859
22860
22861
22862
22863
22864
22865
22866
22867
22868
22869
22870
22871
22872
22873
22874
22875
22876
22877
22878
22879
22880
22881
22882
22883
22884
22885
22886
22887
22888
22889
22890
22891
22892
22893
22894
22895
22896
22897
22898
22899
22900
22901
22902
22903
22904
22905
22906
22907
22908
22909
22910
22911
22912
22913
22914
22915
22916
22917
22918
22919
22920
22921
22922
22923
22924
22925
22926
22927
22928
22929
22930
22931
22932
22933
22934
22935
22936
22937
22938
22939
22940
22941
22942
22943
22944
22945
22946
22947
22948
22949
22950
22951
22952
22953
22954
22955
22956
22957
22958
22959
22960
22961
22962
22963
22964
22965
22966
22967
22968
22969
22970
22971
22972
22973
22974
22975
22976
22977
22978
22979
22980
22981
22982
22983
22984
22985
22986
22987
22988
22989
22990
22991
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011
23012
23013
23014
23015
23016
23017
23018
23019
23020
23021
23022
23023
23024
23025
23026
23027
23028
23029
23030
23031
23032
23033
23034
23035
23036
23037
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048
23049
23050
23051
23052
23053
23054
23055
23056
23057
23058
23059
23060
23061
23062
23063
23064
23065
23066
23067
23068
23069
23070
23071
23072
23073
23074
23075
23076
23077
23078
23079
23080
23081
23082
23083
23084
23085
23086
23087
23088
23089
23090
23091
23092
23093
23094
23095
23096
23097
23098
23099
23100
23101
23102
23103
23104
23105
23106
23107
23108
23109
23110
23111
23112
23113
23114
23115
23116
23117
23118
23119
23120
23121
23122
23123
23124
23125
23126
23127
23128
23129
23130
23131
23132
23133
23134
23135
23136
23137
23138
23139
23140
23141
23142
23143
23144
23145
23146
23147
23148
23149
23150
23151
23152
23153
23154
23155
23156
23157
23158
23159
23160
23161
23162
23163
23164
23165
23166
23167
23168
23169
23170
23171
23172
23173
23174
23175
23176
23177
23178
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226
23227
23228
23229
23230
23231
23232
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
23254
23255
23256
23257
23258
23259
23260
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
23276
23277
23278
23279
23280
23281
23282
23283
23284
23285
23286
23287
23288
23289
23290
23291
23292
23293
23294
23295
23296
23297
23298
23299
23300
23301
23302
23303
23304
23305
23306
23307
23308
23309
23310
23311
23312
23313
23314
23315
23316
23317
23318
23319
23320
23321
23322
23323
23324
23325
23326
23327
23328
23329
23330
23331
23332
23333
23334
23335
23336
23337
23338
23339
23340
23341
23342
23343
23344
23345
23346
23347
23348
23349
23350
23351
23352
23353
23354
23355
23356
23357
23358
23359
23360
23361
23362
23363
23364
23365
23366
23367
23368
23369
23370
23371
23372
23373
23374
23375
23376
23377
23378
23379
23380
23381
23382
23383
23384
23385
23386
23387
23388
23389
23390
23391
23392
23393
23394
23395
23396
23397
23398
23399
23400
23401
23402
23403
23404
23405
23406
23407
23408
23409
23410
23411
23412
23413
23414
23415
23416
23417
23418
23419
23420
23421
23422
23423
23424
23425
23426
23427
23428
23429
23430
23431
23432
23433
23434
23435
23436
23437
23438
23439
23440
23441
23442
23443
23444
23445
23446
23447
23448
23449
23450
23451
23452
23453
23454
23455
23456
23457
23458
23459
23460
23461
23462
23463
23464
23465
23466
23467
23468
23469
23470
23471
23472
23473
23474
23475
23476
23477
23478
23479
23480
23481
23482
23483
23484
23485
23486
23487
23488
23489
23490
23491
23492
23493
23494
23495
23496
23497
23498
23499
23500
23501
23502
23503
23504
23505
23506
23507
23508
23509
23510
23511
23512
23513
23514
23515
23516
23517
23518
23519
23520
23521
23522
23523
23524
23525
23526
23527
23528
23529
23530
23531
23532
23533
23534
23535
23536
23537
23538
23539
23540
23541
23542
23543
23544
23545
23546
23547
23548
23549
23550
23551
23552
23553
23554
23555
23556
23557
23558
23559
23560
23561
23562
23563
23564
23565
23566
23567
23568
23569
23570
23571
23572
23573
23574
23575
23576
23577
23578
23579
23580
23581
23582
23583
23584
23585
23586
23587
23588
23589
23590
23591
23592
23593
23594
23595
23596
23597
23598
23599
23600
23601
23602
23603
23604
23605
23606
23607
23608
23609
23610
23611
23612
23613
23614
23615
23616
23617
23618
23619
23620
23621
23622
23623
23624
23625
23626
23627
23628
23629
23630
23631
23632
23633
23634
23635
23636
23637
23638
23639
23640
23641
23642
23643
23644
23645
23646
23647
23648
23649
23650
23651
23652
23653
23654
23655
23656
23657
23658
23659
23660
23661
23662
23663
23664
23665
23666
23667
23668
23669
23670
23671
23672
23673
23674
23675
23676
23677
23678
23679
23680
23681
23682
23683
23684
23685
23686
23687
23688
23689
23690
23691
23692
23693
23694
23695
23696
23697
23698
23699
23700
23701
23702
23703
23704
23705
23706
23707
23708
23709
23710
23711
23712
23713
23714
23715
23716
23717
23718
23719
23720
23721
23722
23723
23724
23725
23726
23727
23728
23729
23730
23731
23732
23733
23734
23735
23736
23737
23738
23739
23740
23741
23742
23743
23744
23745
23746
23747
23748
23749
23750
23751
23752
23753
23754
23755
23756
23757
23758
23759
23760
23761
23762
23763
23764
23765
23766
23767
23768
23769
23770
23771
23772
23773
23774
23775
23776
23777
23778
23779
23780
23781
23782
23783
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
23798
23799
23800
23801
23802
23803
23804
23805
23806
23807
23808
23809
23810
23811
23812
23813
23814
23815
23816
23817
23818
23819
23820
23821
23822
23823
23824
23825
23826
23827
23828
23829
23830
23831
23832
23833
23834
23835
23836
23837
23838
23839
23840
23841
23842
23843
23844
23845
23846
23847
23848
23849
23850
23851
23852
23853
23854
23855
23856
23857
23858
23859
23860
23861
23862
23863
23864
23865
23866
23867
23868
23869
23870
23871
23872
23873
23874
23875
23876
23877
23878
23879
23880
23881
23882
23883
23884
23885
23886
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927
23928
23929
23930
23931
23932
23933
23934
23935
23936
23937
23938
23939
23940
23941
23942
23943
23944
23945
23946
23947
23948
23949
23950
23951
23952
23953
23954
23955
23956
23957
23958
23959
23960
23961
23962
23963
23964
23965
23966
23967
23968
23969
23970
23971
23972
23973
23974
23975
23976
23977
23978
23979
23980
23981
23982
23983
23984
23985
23986
23987
23988
23989
23990
23991
23992
23993
23994
23995
23996
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011
24012
24013
24014
24015
24016
24017
24018
24019
24020
24021
24022
24023
24024
24025
24026
24027
24028
24029
24030
24031
24032
24033
24034
24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066
24067
24068
24069
24070
24071
24072
24073
24074
24075
24076
24077
24078
24079
24080
24081
24082
24083
24084
24085
24086
24087
24088
24089
24090
24091
24092
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109
24110
24111
24112
24113
24114
24115
24116
24117
24118
24119
24120
24121
24122
24123
24124
24125
24126
24127
24128
24129
24130
24131
24132
24133
24134
24135
24136
24137
24138
24139
24140
24141
24142
24143
24144
24145
24146
24147
24148
24149
24150
24151
24152
24153
24154
24155
24156
24157
24158
24159
24160
24161
24162
24163
24164
24165
24166
24167
24168
24169
24170
24171
24172
24173
24174
24175
24176
24177
24178
24179
24180
24181
24182
24183
24184
24185
24186
24187
24188
24189
24190
24191
24192
24193
24194
24195
24196
24197
24198
24199
24200
24201
24202
24203
24204
24205
24206
24207
24208
24209
24210
24211
24212
24213
24214
24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246
24247
24248
24249
24250
24251
24252
24253
24254
24255
24256
24257
24258
24259
24260
24261
24262
24263
24264
24265
24266
24267
24268
24269
24270
24271
24272
24273
24274
24275
24276
24277
24278
24279
24280
24281
24282
24283
24284
24285
24286
24287
24288
24289
24290
24291
24292
24293
24294
24295
24296
24297
24298
24299
24300
24301
24302
24303
24304
24305
24306
24307
24308
24309
24310
24311
24312
24313
24314
24315
24316
24317
24318
24319
24320
24321
24322
24323
24324
24325
24326
24327
24328
24329
24330
24331
24332
24333
24334
24335
24336
24337
24338
24339
24340
24341
24342
24343
24344
24345
24346
24347
24348
24349
24350
24351
24352
24353
24354
24355
24356
24357
24358
24359
24360
24361
24362
24363
24364
24365
24366
24367
24368
24369
24370
24371
24372
24373
24374
24375
24376
24377
24378
24379
24380
24381
24382
24383
24384
24385
24386
24387
24388
24389
24390
24391
24392
24393
24394
24395
24396
24397
24398
24399
24400
24401
24402
24403
24404
24405
24406
24407
24408
24409
24410
24411
24412
24413
24414
24415
24416
24417
24418
24419
24420
24421
24422
24423
24424
24425
24426
24427
24428
24429
24430
24431
24432
24433
24434
24435
24436
24437
24438
24439
24440
24441
24442
24443
24444
24445
24446
24447
24448
24449
24450
24451
24452
24453
24454
24455
24456
24457
24458
24459
24460
24461
24462
24463
24464
24465
24466
24467
24468
24469
24470
24471
24472
24473
24474
24475
24476
24477
24478
24479
24480
24481
24482
24483
24484
24485
24486
24487
24488
24489
24490
24491
24492
24493
24494
24495
24496
24497
24498
24499
24500
24501
24502
24503
24504
24505
24506
24507
24508
24509
24510
24511
24512
24513
24514
24515
24516
24517
24518
24519
24520
24521
24522
24523
24524
24525
24526
24527
24528
24529
24530
24531
24532
24533
24534
24535
24536
24537
24538
24539
24540
24541
24542
24543
24544
24545
24546
24547
24548
24549
24550
24551
24552
24553
24554
24555
24556
24557
24558
24559
24560
24561
24562
24563
24564
24565
24566
24567
24568
24569
24570
24571
24572
24573
24574
24575
24576
24577
24578
24579
24580
24581
24582
24583
24584
24585
24586
24587
24588
24589
24590
24591
24592
24593
24594
24595
24596
24597
24598
24599
24600
24601
24602
24603
24604
24605
24606
24607
24608
24609
24610
24611
24612
24613
24614
24615
24616
24617
24618
24619
24620
24621
24622
24623
24624
24625
24626
24627
24628
24629
24630
24631
24632
24633
24634
24635
24636
24637
24638
24639
24640
24641
24642
24643
24644
24645
24646
24647
24648
24649
24650
24651
24652
24653
24654
24655
24656
24657
24658
24659
24660
24661
24662
24663
24664
24665
24666
24667
24668
24669
24670
24671
24672
24673
24674
24675
24676
24677
24678
24679
24680
24681
24682
24683
24684
24685
24686
24687
24688
24689
24690
24691
24692
24693
24694
24695
24696
24697
24698
24699
24700
24701
24702
24703
24704
24705
24706
24707
24708
24709
24710
24711
24712
24713
24714
24715
24716
24717
24718
24719
24720
24721
24722
24723
24724
24725
24726
24727
24728
24729
24730
24731
24732
24733
24734
24735
24736
24737
24738
24739
24740
24741
24742
24743
24744
24745
24746
24747
24748
24749
24750
24751
24752
24753
24754
24755
24756
24757
24758
24759
24760
24761
24762
24763
24764
24765
24766
24767
24768
24769
24770
24771
24772
24773
24774
24775
24776
24777
24778
24779
24780
24781
24782
24783
24784
24785
24786
24787
24788
24789
24790
24791
24792
24793
24794
24795
24796
24797
24798
24799
24800
24801
24802
24803
24804
24805
24806
24807
24808
24809
24810
24811
24812
24813
24814
24815
24816
24817
24818
24819
24820
24821
24822
24823
24824
24825
24826
24827
24828
24829
24830
24831
24832
24833
24834
24835
24836
24837
24838
24839
24840
24841
24842
24843
24844
24845
24846
24847
24848
24849
24850
24851
24852
24853
24854
24855
24856
24857
24858
24859
24860
24861
24862
24863
24864
24865
24866
24867
24868
24869
24870
24871
24872
24873
24874
24875
24876
24877
24878
24879
24880
24881
24882
24883
24884
24885
24886
24887
24888
24889
24890
24891
24892
24893
24894
24895
24896
24897
24898
24899
24900
24901
24902
24903
24904
24905
24906
24907
24908
24909
24910
24911
24912
24913
24914
24915
24916
24917
24918
24919
24920
24921
24922
24923
24924
24925
24926
24927
24928
24929
24930
24931
24932
24933
24934
24935
24936
24937
24938
24939
24940
24941
24942
24943
24944
24945
24946
24947
24948
24949
24950
24951
24952
24953
24954
24955
24956
24957
24958
24959
24960
24961
24962
24963
24964
24965
24966
24967
24968
24969
24970
24971
24972
24973
24974
24975
24976
24977
24978
24979
24980
24981
24982
24983
24984
24985
24986
24987
24988
24989
24990
24991
24992
24993
24994
24995
24996
24997
24998
24999
25000
25001
25002
25003
25004
25005
25006
25007
25008
25009
25010
25011
25012
25013
25014
25015
25016
25017
25018
25019
25020
25021
25022
25023
25024
25025
25026
25027
25028
25029
25030
25031
25032
25033
25034
25035
25036
25037
25038
25039
25040
25041
25042
25043
25044
25045
25046
25047
25048
25049
25050
25051
25052
25053
25054
25055
25056
25057
25058
25059
25060
25061
25062
25063
25064
25065
25066
25067
25068
25069
25070
25071
25072
25073
25074
25075
25076
25077
25078
25079
25080
25081
25082
25083
25084
25085
25086
25087
25088
25089
25090
25091
25092
25093
25094
25095
25096
25097
25098
25099
25100
25101
25102
25103
25104
25105
25106
25107
25108
25109
25110
25111
25112
25113
25114
25115
25116
25117
25118
25119
25120
25121
25122
25123
25124
25125
25126
25127
25128
25129
25130
25131
25132
25133
25134
25135
25136
25137
25138
25139
25140
25141
25142
25143
25144
25145
25146
25147
25148
25149
25150
25151
25152
25153
25154
25155
25156
25157
25158
25159
25160
25161
25162
25163
25164
25165
25166
25167
25168
25169
25170
25171
25172
25173
25174
25175
25176
25177
25178
25179
25180
25181
25182
25183
25184
25185
25186
25187
25188
25189
25190
25191
25192
25193
25194
25195
25196
25197
25198
25199
25200
25201
25202
25203
25204
25205
25206
25207
25208
25209
25210
25211
25212
25213
25214
25215
25216
25217
25218
25219
25220
25221
25222
25223
25224
25225
25226
25227
25228
25229
25230
25231
25232
25233
25234
25235
25236
25237
25238
25239
25240
25241
25242
25243
25244
25245
25246
25247
25248
25249
25250
25251
25252
25253
25254
25255
25256
25257
25258
25259
25260
25261
25262
25263
25264
25265
25266
25267
25268
25269
25270
25271
25272
25273
25274
25275
25276
25277
25278
25279
25280
25281
25282
25283
25284
25285
25286
25287
25288
25289
25290
25291
25292
25293
25294
25295
25296
25297
25298
25299
25300
25301
25302
25303
25304
25305
25306
25307
25308
25309
25310
25311
25312
25313
25314
25315
25316
25317
25318
25319
25320
25321
25322
25323
25324
25325
25326
25327
25328
25329
25330
25331
25332
25333
25334
25335
25336
25337
25338
25339
25340
25341
25342
25343
25344
25345
25346
25347
25348
25349
25350
25351
25352
25353
25354
25355
25356
25357
25358
25359
25360
25361
25362
25363
25364
25365
25366
25367
25368
25369
25370
25371
25372
25373
25374
25375
25376
25377
25378
25379
25380
25381
25382
25383
25384
25385
25386
25387
25388
25389
25390
25391
25392
25393
25394
25395
25396
25397
25398
25399
25400
25401
25402
25403
25404
25405
25406
25407
25408
25409
25410
25411
25412
25413
25414
25415
25416
25417
25418
25419
25420
25421
25422
25423
25424
25425
25426
25427
25428
25429
25430
25431
25432
25433
25434
25435
25436
25437
25438
25439
25440
25441
25442
25443
25444
25445
25446
25447
25448
25449
25450
25451
25452
25453
25454
25455
25456
25457
25458
25459
25460
25461
25462
25463
25464
25465
25466
25467
25468
25469
25470
25471
25472
25473
25474
25475
25476
25477
25478
25479
25480
25481
25482
25483
25484
25485
25486
25487
25488
25489
25490
25491
25492
25493
25494
25495
25496
25497
25498
25499
25500
25501
25502
25503
25504
25505
25506
25507
25508
25509
25510
25511
25512
25513
25514
25515
25516
25517
25518
25519
25520
25521
25522
25523
25524
25525
25526
25527
25528
25529
25530
25531
25532
25533
25534
25535
25536
25537
25538
25539
25540
25541
25542
25543
25544
25545
25546
25547
25548
25549
25550
25551
25552
25553
25554
25555
25556
25557
25558
25559
25560
25561
25562
25563
25564
25565
25566
25567
25568
25569
25570
25571
25572
25573
25574
25575
25576
25577
25578
25579
25580
25581
25582
25583
25584
25585
25586
25587
25588
25589
25590
25591
25592
25593
25594
25595
25596
25597
25598
25599
25600
25601
25602
25603
25604
25605
25606
25607
25608
25609
25610
25611
25612
25613
25614
25615
25616
25617
25618
25619
25620
25621
25622
25623
25624
25625
25626
25627
25628
25629
25630
25631
25632
25633
25634
25635
25636
25637
25638
25639
25640
25641
25642
25643
25644
25645
25646
25647
25648
25649
25650
25651
25652
25653
25654
25655
25656
25657
25658
25659
25660
25661
25662
25663
25664
25665
25666
25667
25668
25669
25670
25671
25672
25673
25674
25675
25676
25677
25678
25679
25680
25681
25682
25683
25684
25685
25686
25687
25688
25689
25690
25691
25692
25693
25694
25695
25696
25697
25698
25699
25700
25701
25702
25703
25704
25705
25706
25707
25708
25709
25710
25711
25712
25713
25714
25715
25716
25717
25718
25719
25720
25721
25722
25723
25724
25725
25726
25727
25728
25729
25730
25731
25732
25733
25734
25735
25736
25737
25738
25739
25740
25741
25742
25743
25744
25745
25746
25747
25748
25749
25750
25751
25752
25753
25754
25755
25756
25757
25758
25759
25760
25761
25762
25763
25764
25765
25766
25767
25768
25769
25770
25771
25772
25773
25774
25775
25776
25777
25778
25779
25780
25781
25782
25783
25784
25785
25786
25787
25788
25789
25790
25791
25792
25793
25794
25795
25796
25797
25798
25799
25800
25801
25802
25803
25804
25805
25806
25807
25808
25809
25810
25811
25812
25813
25814
25815
25816
25817
25818
25819
25820
25821
25822
25823
25824
25825
25826
25827
25828
25829
25830
25831
25832
25833
25834
25835
25836
25837
25838
25839
25840
25841
25842
25843
25844
25845
25846
25847
25848
25849
25850
25851
25852
25853
25854
25855
25856
25857
25858
25859
25860
25861
25862
25863
25864
25865
25866
25867
25868
25869
25870
25871
25872
25873
25874
25875
25876
25877
25878
25879
25880
25881
25882
25883
25884
25885
25886
25887
25888
25889
25890
25891
25892
25893
25894
25895
25896
25897
25898
25899
25900
25901
25902
25903
25904
25905
25906
25907
25908
25909
25910
25911
25912
25913
25914
25915
25916
25917
25918
25919
25920
25921
25922
25923
25924
25925
25926
25927
25928
25929
25930
25931
25932
25933
25934
25935
25936
25937
25938
25939
25940
25941
25942
25943
25944
25945
25946
25947
25948
25949
25950
25951
25952
25953
25954
25955
25956
25957
25958
25959
25960
25961
25962
25963
25964
25965
25966
25967
25968
25969
25970
25971
25972
25973
25974
25975
25976
25977
25978
25979
25980
25981
25982
25983
25984
25985
25986
25987
25988
25989
25990
25991
25992
25993
25994
25995
25996
25997
25998
25999
26000
26001
26002
26003
26004
26005
26006
26007
26008
26009
26010
26011
26012
26013
26014
26015
26016
26017
26018
26019
26020
26021
26022
26023
26024
26025
26026
26027
26028
26029
26030
26031
26032
26033
26034
26035
26036
26037
26038
26039
26040
26041
26042
26043
26044
26045
26046
26047
26048
26049
26050
26051
26052
26053
26054
26055
26056
26057
26058
26059
26060
26061
26062
26063
26064
26065
26066
26067
26068
26069
26070
26071
26072
26073
26074
26075
26076
26077
26078
26079
26080
26081
26082
26083
26084
26085
26086
26087
26088
26089
26090
26091
26092
26093
26094
26095
26096
26097
26098
26099
26100
26101
26102
26103
26104
26105
26106
26107
26108
26109
26110
26111
26112
26113
26114
26115
26116
26117
26118
26119
26120
26121
26122
26123
26124
26125
26126
26127
26128
26129
26130
26131
26132
26133
26134
26135
26136
26137
26138
26139
26140
26141
26142
26143
26144
26145
26146
26147
26148
26149
26150
26151
26152
26153
26154
26155
26156
26157
26158
26159
26160
26161
26162
26163
26164
26165
26166
26167
26168
26169
26170
26171
26172
26173
26174
26175
26176
26177
26178
26179
26180
26181
26182
26183
26184
26185
26186
26187
26188
26189
26190
26191
26192
26193
26194
26195
26196
26197
26198
26199
26200
26201
26202
26203
26204
26205
26206
26207
26208
26209
26210
26211
26212
26213
26214
26215
26216
26217
26218
26219
26220
26221
26222
26223
26224
26225
26226
26227
26228
26229
26230
26231
26232
26233
26234
26235
26236
26237
26238
26239
26240
26241
26242
26243
26244
26245
26246
26247
26248
26249
26250
26251
26252
26253
26254
26255
26256
26257
26258
26259
26260
26261
26262
26263
26264
26265
26266
26267
26268
26269
26270
26271
26272
26273
26274
26275
26276
26277
26278
26279
26280
26281
26282
26283
26284
26285
26286
26287
26288
26289
26290
26291
26292
26293
26294
26295
26296
26297
26298
26299
26300
26301
26302
26303
26304
26305
26306
26307
26308
26309
26310
26311
26312
26313
26314
26315
26316
26317
26318
26319
26320
26321
26322
26323
26324
26325
26326
26327
26328
26329
26330
26331
26332
26333
26334
26335
26336
26337
26338
26339
26340
26341
26342
26343
26344
26345
26346
26347
26348
26349
26350
26351
26352
26353
26354
26355
26356
26357
26358
26359
26360
26361
26362
26363
26364
26365
26366
26367
26368
26369
26370
26371
26372
26373
26374
26375
26376
26377
26378
26379
26380
26381
26382
26383
26384
26385
26386
26387
26388
26389
26390
26391
26392
26393
26394
26395
26396
26397
26398
26399
26400
26401
26402
26403
26404
26405
26406
26407
26408
26409
26410
26411
26412
26413
26414
26415
26416
26417
26418
26419
26420
26421
26422
26423
26424
26425
26426
26427
26428
26429
26430
26431
26432
26433
26434
26435
26436
26437
26438
26439
26440
26441
26442
26443
26444
26445
26446
26447
26448
26449
26450
26451
26452
26453
26454
26455
26456
26457
26458
26459
26460
26461
26462
26463
26464
26465
26466
26467
26468
26469
26470
26471
26472
26473
26474
26475
26476
26477
26478
26479
26480
26481
26482
26483
26484
26485
26486
26487
26488
26489
26490
26491
26492
26493
26494
26495
26496
26497
26498
26499
26500
26501
26502
26503
26504
26505
26506
26507
26508
26509
26510
26511
26512
26513
26514
26515
26516
26517
26518
26519
26520
26521
26522
26523
26524
26525
26526
26527
26528
26529
26530
26531
26532
26533
26534
26535
26536
26537
26538
26539
26540
26541
26542
26543
26544
26545
26546
26547
26548
26549
26550
26551
26552
26553
26554
26555
26556
26557
26558
26559
26560
26561
26562
26563
26564
26565
26566
26567
26568
26569
26570
26571
26572
26573
26574
26575
26576
26577
26578
26579
26580
26581
26582
26583
26584
26585
26586
26587
26588
26589
26590
26591
26592
26593
26594
26595
26596
26597
26598
26599
26600
26601
26602
26603
26604
26605
26606
26607
26608
26609
26610
26611
26612
26613
26614
26615
26616
26617
26618
26619
26620
26621
26622
26623
26624
26625
26626
26627
26628
26629
26630
26631
26632
26633
26634
26635
26636
26637
26638
26639
26640
26641
26642
26643
26644
26645
26646
26647
26648
26649
26650
26651
26652
26653
26654
26655
26656
26657
26658
26659
26660
26661
26662
26663
26664
26665
26666
26667
26668
26669
26670
26671
26672
26673
26674
26675
26676
26677
26678
26679
26680
26681
26682
26683
26684
26685
26686
26687
26688
26689
26690
26691
26692
26693
26694
26695
26696
26697
26698
26699
26700
26701
26702
26703
26704
26705
26706
26707
26708
26709
26710
26711
26712
26713
26714
26715
26716
26717
26718
26719
26720
26721
26722
26723
26724
26725
26726
26727
26728
26729
26730
26731
26732
26733
26734
26735
26736
26737
26738
26739
26740
26741
26742
26743
26744
26745
26746
26747
26748
26749
26750
26751
26752
26753
26754
26755
26756
26757
26758
26759
26760
26761
26762
26763
26764
26765
26766
26767
26768
26769
26770
26771
26772
26773
26774
26775
26776
26777
26778
26779
26780
26781
26782
26783
26784
26785
26786
26787
26788
26789
26790
26791
26792
26793
26794
26795
26796
26797
26798
26799
26800
26801
26802
26803
26804
26805
26806
26807
26808
26809
26810
26811
26812
26813
26814
26815
26816
26817
26818
26819
26820
26821
26822
26823
26824
26825
26826
26827
26828
26829
26830
26831
26832
26833
26834
26835
26836
26837
26838
26839
26840
26841
26842
26843
26844
26845
26846
26847
26848
26849
26850
26851
26852
26853
26854
26855
26856
26857
26858
26859
26860
26861
26862
26863
26864
26865
26866
26867
26868
26869
26870
26871
26872
26873
26874
26875
26876
26877
26878
26879
26880
26881
26882
26883
26884
26885
26886
26887
26888
26889
26890
26891
26892
26893
26894
26895
26896
26897
26898
26899
26900
26901
26902
26903
26904
26905
26906
26907
26908
26909
26910
26911
26912
26913
26914
26915
26916
26917
26918
26919
26920
26921
26922
26923
26924
26925
26926
26927
26928
26929
26930
26931
26932
26933
26934
26935
26936
26937
26938
26939
26940
26941
26942
26943
26944
26945
26946
26947
26948
26949
26950
26951
26952
26953
26954
26955
26956
26957
26958
26959
26960
26961
26962
26963
26964
26965
26966
26967
26968
26969
26970
26971
26972
26973
26974
26975
26976
26977
26978
26979
26980
26981
26982
26983
26984
26985
26986
26987
26988
26989
26990
26991
26992
26993
26994
26995
26996
26997
26998
26999
27000
27001
27002
27003
27004
27005
27006
27007
27008
27009
27010
27011
27012
27013
27014
27015
27016
27017
27018
27019
27020
27021
27022
27023
27024
27025
27026
27027
27028
27029
27030
27031
27032
27033
27034
27035
27036
27037
27038
27039
27040
27041
27042
27043
27044
27045
27046
27047
27048
27049
27050
27051
27052
27053
27054
27055
27056
27057
27058
27059
27060
27061
27062
27063
27064
27065
27066
27067
27068
27069
27070
27071
27072
27073
27074
27075
27076
27077
27078
27079
27080
27081
27082
27083
27084
27085
27086
27087
27088
27089
27090
27091
27092
27093
27094
27095
27096
27097
27098
27099
27100
27101
27102
27103
27104
27105
27106
27107
27108
27109
27110
27111
27112
27113
27114
27115
27116
27117
27118
27119
27120
27121
27122
27123
27124
27125
27126
27127
27128
27129
27130
27131
27132
27133
27134
27135
27136
27137
27138
27139
27140
27141
27142
27143
27144
27145
27146
27147
27148
27149
27150
27151
27152
27153
27154
27155
27156
27157
27158
27159
27160
27161
27162
27163
27164
27165
27166
27167
27168
27169
27170
27171
27172
27173
27174
27175
27176
27177
27178
27179
27180
27181
27182
27183
27184
27185
27186
27187
27188
27189
27190
27191
27192
27193
27194
27195
27196
27197
27198
27199
27200
27201
27202
27203
27204
27205
27206
27207
27208
27209
27210
27211
27212
27213
27214
27215
27216
27217
27218
27219
27220
27221
27222
27223
27224
27225
27226
27227
27228
27229
27230
27231
27232
27233
27234
27235
27236
27237
27238
27239
27240
27241
27242
27243
27244
27245
27246
27247
27248
27249
27250
27251
27252
27253
27254
27255
27256
27257
27258
27259
27260
27261
27262
27263
27264
27265
27266
27267
27268
27269
27270
27271
27272
27273
27274
27275
27276
27277
27278
27279
27280
27281
27282
27283
27284
27285
27286
27287
27288
27289
27290
27291
27292
27293
27294
27295
27296
27297
27298
27299
27300
27301
27302
27303
27304
27305
27306
27307
27308
27309
27310
27311
27312
27313
27314
27315
27316
27317
27318
27319
27320
27321
27322
27323
27324
27325
27326
27327
27328
27329
27330
27331
27332
27333
27334
27335
27336
27337
27338
27339
27340
27341
27342
27343
27344
27345
27346
27347
27348
27349
27350
27351
27352
27353
27354
27355
27356
27357
27358
27359
27360
27361
27362
27363
27364
27365
27366
27367
27368
27369
27370
27371
27372
27373
27374
27375
27376
27377
27378
27379
27380
27381
27382
27383
27384
27385
27386
27387
27388
27389
27390
27391
27392
27393
27394
27395
27396
27397
27398
27399
27400
27401
27402
27403
27404
27405
27406
27407
27408
27409
27410
27411
27412
27413
27414
27415
27416
27417
27418
27419
27420
27421
27422
27423
27424
27425
27426
27427
27428
27429
27430
27431
27432
27433
27434
27435
27436
27437
27438
27439
27440
27441
27442
27443
27444
27445
27446
27447
27448
27449
27450
27451
27452
27453
27454
27455
27456
27457
27458
27459
27460
27461
27462
27463
27464
27465
27466
27467
27468
27469
27470
27471
27472
27473
27474
27475
27476
27477
27478
27479
27480
27481
27482
27483
27484
27485
27486
27487
27488
27489
27490
27491
27492
27493
27494
27495
27496
27497
27498
27499
27500
27501
27502
27503
27504
27505
27506
27507
27508
27509
27510
27511
27512
27513
27514
27515
27516
27517
27518
27519
27520
27521
27522
27523
27524
27525
27526
27527
27528
27529
27530
27531
27532
27533
27534
27535
27536
27537
27538
27539
27540
27541
27542
27543
27544
27545
27546
27547
27548
27549
27550
27551
27552
27553
27554
27555
27556
27557
27558
27559
27560
27561
27562
27563
27564
27565
27566
27567
27568
27569
27570
27571
27572
27573
27574
27575
27576
27577
27578
27579
27580
27581
27582
27583
27584
27585
27586
27587
27588
27589
27590
27591
27592
27593
27594
27595
27596
27597
27598
27599
27600
27601
27602
27603
27604
27605
27606
27607
27608
27609
27610
27611
27612
27613
27614
27615
27616
27617
27618
27619
27620
27621
27622
27623
27624
27625
27626
27627
27628
27629
27630
27631
27632
27633
27634
27635
27636
27637
27638
27639
27640
27641
27642
27643
27644
27645
27646
27647
27648
27649
27650
27651
27652
27653
27654
27655
27656
27657
27658
27659
27660
27661
27662
27663
27664
27665
27666
27667
27668
27669
27670
27671
27672
27673
27674
27675
27676
27677
27678
27679
27680
27681
27682
27683
27684
27685
27686
27687
27688
27689
27690
27691
27692
27693
27694
27695
27696
27697
27698
27699
27700
27701
27702
27703
27704
27705
27706
27707
27708
27709
27710
27711
27712
27713
27714
27715
27716
27717
27718
27719
27720
27721
27722
27723
27724
27725
27726
27727
27728
27729
27730
27731
27732
27733
27734
27735
27736
27737
27738
27739
27740
27741
27742
27743
27744
27745
27746
27747
27748
27749
27750
27751
27752
27753
27754
27755
27756
27757
27758
27759
27760
27761
27762
27763
27764
27765
27766
27767
27768
27769
27770
27771
27772
27773
27774
27775
27776
27777
27778
27779
27780
27781
27782
27783
27784
27785
27786
27787
27788
27789
27790
27791
27792
27793
27794
27795
27796
27797
27798
27799
27800
27801
27802
27803
27804
27805
27806
27807
27808
27809
27810
27811
27812
27813
27814
27815
27816
27817
27818
27819
27820
27821
27822
27823
27824
27825
27826
27827
27828
27829
27830
27831
27832
27833
27834
27835
27836
27837
27838
27839
27840
27841
27842
27843
27844
27845
27846
27847
27848
27849
27850
27851
27852
27853
27854
27855
27856
27857
27858
27859
27860
27861
27862
27863
27864
27865
27866
27867
27868
27869
27870
27871
27872
27873
27874
27875
27876
27877
27878
27879
27880
27881
27882
27883
27884
27885
27886
27887
27888
27889
27890
27891
27892
27893
27894
27895
27896
27897
27898
27899
27900
27901
27902
27903
27904
27905
27906
27907
27908
27909
27910
27911
27912
27913
27914
27915
27916
27917
27918
27919
27920
27921
27922
27923
27924
27925
27926
27927
27928
27929
27930
27931
27932
27933
27934
27935
27936
27937
27938
27939
27940
27941
27942
27943
27944
27945
27946
27947
27948
27949
27950
27951
27952
27953
27954
27955
27956
27957
27958
27959
27960
27961
27962
27963
27964
27965
27966
27967
27968
27969
27970
27971
27972
27973
27974
27975
27976
27977
27978
27979
27980
27981
27982
27983
27984
27985
27986
27987
27988
27989
27990
27991
27992
27993
27994
27995
27996
27997
27998
27999
28000
28001
28002
28003
28004
28005
28006
28007
28008
28009
28010
28011
28012
28013
28014
28015
28016
28017
28018
28019
28020
28021
28022
28023
28024
28025
28026
28027
28028
28029
28030
28031
28032
28033
28034
28035
28036
28037
28038
28039
28040
28041
28042
28043
28044
28045
28046
28047
28048
28049
28050
28051
28052
28053
28054
28055
28056
28057
28058
28059
28060
28061
28062
28063
28064
28065
28066
28067
28068
28069
28070
28071
28072
28073
28074
28075
28076
28077
28078
28079
28080
28081
28082
28083
28084
28085
28086
28087
28088
28089
28090
28091
28092
28093
28094
28095
28096
28097
28098
28099
28100
28101
28102
28103
28104
28105
28106
28107
28108
28109
28110
28111
28112
28113
28114
28115
28116
28117
28118
28119
28120
28121
28122
28123
28124
28125
28126
28127
28128
28129
28130
28131
28132
28133
28134
28135
28136
28137
28138
28139
28140
28141
28142
28143
28144
28145
28146
28147
28148
28149
28150
28151
28152
28153
28154
28155
28156
28157
28158
28159
28160
28161
28162
28163
28164
28165
28166
28167
28168
28169
28170
28171
28172
28173
28174
28175
28176
28177
28178
28179
28180
28181
28182
28183
28184
28185
28186
28187
28188
28189
28190
28191
28192
28193
28194
28195
28196
28197
28198
28199
28200
28201
28202
28203
28204
28205
28206
28207
28208
28209
28210
28211
28212
28213
28214
28215
28216
28217
28218
28219
28220
28221
28222
28223
28224
28225
28226
28227
28228
28229
28230
28231
28232
28233
28234
28235
28236
28237
28238
28239
28240
28241
28242
28243
28244
28245
28246
28247
28248
28249
28250
28251
28252
28253
28254
28255
28256
28257
28258
28259
28260
28261
28262
28263
28264
28265
28266
28267
28268
28269
28270
28271
28272
28273
28274
28275
28276
28277
28278
28279
28280
28281
28282
28283
28284
28285
28286
28287
28288
28289
28290
28291
28292
28293
28294
28295
28296
28297
28298
28299
28300
28301
28302
28303
28304
28305
28306
28307
28308
28309
28310
28311
28312
28313
28314
28315
28316
28317
28318
28319
28320
28321
28322
28323
28324
28325
28326
28327
28328
28329
28330
28331
28332
28333
28334
28335
28336
28337
28338
28339
28340
28341
28342
28343
28344
28345
28346
28347
28348
28349
28350
28351
28352
28353
28354
28355
28356
28357
28358
28359
28360
28361
28362
28363
28364
28365
28366
28367
28368
28369
28370
28371
28372
28373
28374
28375
28376
28377
28378
28379
28380
28381
28382
28383
28384
28385
28386
28387
28388
28389
28390
28391
28392
28393
28394
28395
28396
28397
28398
28399
28400
28401
28402
28403
28404
28405
28406
28407
28408
28409
28410
28411
28412
28413
28414
28415
28416
28417
28418
28419
28420
28421
28422
28423
28424
28425
28426
28427
28428
28429
28430
28431
28432
28433
28434
28435
28436
28437
28438
28439
28440
28441
28442
28443
28444
28445
28446
28447
28448
28449
28450
28451
28452
28453
28454
28455
28456
28457
28458
28459
28460
28461
28462
28463
28464
28465
28466
28467
28468
28469
28470
28471
28472
28473
28474
28475
28476
28477
28478
28479
28480
28481
28482
28483
28484
28485
28486
28487
28488
28489
28490
28491
28492
28493
28494
28495
28496
28497
28498
28499
28500
28501
28502
28503
28504
28505
28506
28507
28508
28509
28510
28511
28512
28513
28514
28515
28516
28517
28518
28519
28520
28521
28522
28523
28524
28525
28526
28527
28528
28529
28530
28531
28532
28533
28534
28535
28536
28537
28538
28539
28540
28541
28542
28543
28544
28545
28546
28547
28548
28549
28550
28551
28552
28553
28554
28555
28556
28557
28558
28559
28560
28561
28562
28563
28564
28565
28566
28567
28568
28569
28570
28571
28572
28573
28574
28575
28576
28577
28578
28579
28580
28581
28582
28583
28584
28585
28586
28587
28588
28589
28590
28591
28592
28593
28594
28595
28596
28597
28598
28599
28600
28601
28602
28603
28604
28605
28606
28607
28608
28609
28610
28611
28612
28613
28614
28615
28616
28617
28618
28619
28620
28621
28622
28623
28624
28625
28626
28627
28628
28629
28630
28631
28632
28633
28634
28635
28636
28637
28638
28639
28640
28641
28642
28643
28644
28645
28646
28647
28648
28649
28650
28651
28652
28653
28654
28655
28656
28657
28658
28659
28660
28661
28662
28663
28664
28665
28666
28667
28668
28669
28670
28671
28672
28673
28674
28675
28676
28677
28678
28679
28680
28681
28682
28683
28684
28685
28686
28687
28688
28689
28690
28691
28692
28693
28694
28695
28696
28697
28698
28699
28700
28701
28702
28703
28704
28705
28706
28707
28708
28709
28710
28711
28712
28713
28714
28715
28716
28717
28718
28719
28720
28721
28722
28723
28724
28725
28726
28727
28728
28729
28730
28731
28732
28733
28734
28735
28736
28737
28738
28739
28740
28741
28742
28743
28744
28745
28746
28747
28748
28749
28750
28751
28752
28753
28754
28755
28756
28757
28758
28759
28760
28761
28762
28763
28764
28765
28766
28767
28768
28769
28770
28771
28772
28773
28774
28775
28776
28777
28778
28779
28780
28781
28782
28783
28784
28785
28786
28787
28788
28789
28790
28791
28792
28793
28794
28795
28796
28797
28798
28799
28800
28801
28802
28803
28804
28805
28806
28807
28808
28809
28810
28811
28812
28813
28814
28815
28816
28817
28818
28819
28820
28821
28822
28823
28824
28825
28826
28827
28828
28829
28830
28831
28832
28833
28834
28835
28836
28837
28838
28839
28840
28841
28842
28843
28844
28845
28846
28847
28848
28849
28850
28851
28852
28853
28854
28855
28856
28857
28858
28859
28860
28861
28862
28863
28864
28865
28866
28867
28868
28869
28870
28871
28872
28873
28874
28875
28876
28877
28878
28879
28880
28881
28882
28883
28884
28885
28886
28887
28888
28889
28890
28891
28892
28893
28894
28895
28896
28897
28898
28899
28900
28901
28902
28903
28904
28905
28906
28907
28908
28909
28910
28911
28912
28913
28914
28915
28916
28917
28918
28919
28920
28921
28922
28923
28924
28925
28926
28927
28928
28929
28930
28931
28932
28933
28934
28935
28936
28937
28938
28939
28940
28941
28942
28943
28944
28945
28946
28947
28948
28949
28950
28951
28952
28953
28954
28955
28956
28957
28958
28959
28960
28961
28962
28963
28964
28965
28966
28967
28968
28969
28970
28971
28972
28973
28974
28975
28976
28977
28978
28979
28980
28981
28982
28983
28984
28985
28986
28987
28988
28989
28990
28991
28992
28993
28994
28995
28996
28997
28998
28999
29000
29001
29002
29003
29004
29005
29006
29007
29008
29009
29010
29011
29012
29013
29014
29015
29016
29017
29018
29019
29020
29021
29022
29023
29024
29025
29026
29027
29028
29029
29030
29031
29032
29033
29034
29035
29036
29037
29038
29039
29040
29041
29042
29043
29044
29045
29046
29047
29048
29049
29050
29051
29052
29053
29054
29055
29056
29057
29058
29059
29060
29061
29062
29063
29064
29065
29066
29067
29068
29069
29070
29071
29072
29073
29074
29075
29076
29077
29078
29079
29080
29081
29082
29083
29084
29085
29086
29087
29088
29089
29090
29091
29092
29093
29094
29095
29096
29097
29098
29099
29100
29101
29102
29103
29104
29105
29106
29107
29108
29109
29110
29111
29112
29113
29114
29115
29116
29117
29118
29119
29120
29121
29122
29123
29124
29125
29126
29127
29128
29129
29130
29131
29132
29133
29134
29135
29136
29137
29138
29139
29140
29141
29142
29143
29144
29145
29146
29147
29148
29149
29150
29151
29152
29153
29154
29155
29156
29157
29158
29159
29160
29161
29162
29163
29164
29165
29166
29167
29168
29169
29170
29171
29172
29173
29174
29175
29176
29177
29178
29179
29180
29181
29182
29183
29184
29185
29186
29187
29188
29189
29190
29191
29192
29193
29194
29195
29196
29197
29198
29199
29200
29201
29202
29203
29204
29205
29206
29207
29208
29209
29210
29211
29212
29213
29214
29215
29216
29217
29218
29219
29220
29221
29222
29223
29224
29225
29226
29227
29228
29229
29230
29231
29232
29233
29234
29235
29236
29237
29238
29239
29240
29241
29242
29243
29244
29245
29246
29247
29248
29249
29250
29251
29252
29253
29254
29255
29256
29257
29258
29259
29260
29261
29262
29263
29264
29265
29266
29267
29268
29269
29270
29271
29272
29273
29274
29275
29276
29277
29278
29279
29280
29281
29282
29283
29284
29285
29286
29287
29288
29289
29290
29291
29292
29293
29294
29295
29296
29297
29298
29299
29300
29301
29302
29303
29304
29305
29306
29307
29308
29309
29310
29311
29312
29313
29314
29315
29316
29317
29318
29319
29320
29321
29322
29323
29324
29325
29326
29327
29328
29329
29330
29331
29332
29333
29334
29335
29336
29337
29338
29339
29340
29341
29342
29343
29344
29345
29346
29347
29348
29349
29350
29351
29352
29353
29354
29355
29356
29357
29358
29359
29360
29361
29362
29363
29364
29365
29366
29367
29368
29369
29370
29371
29372
29373
29374
29375
29376
29377
29378
29379
29380
29381
29382
29383
29384
29385
29386
29387
29388
29389
29390
29391
29392
29393
29394
29395
29396
29397
29398
29399
29400
29401
29402
29403
29404
29405
29406
29407
29408
29409
29410
29411
29412
29413
29414
29415
29416
29417
29418
29419
29420
29421
29422
29423
29424
29425
29426
29427
29428
29429
29430
29431
29432
29433
29434
29435
29436
29437
29438
29439
29440
29441
29442
29443
29444
29445
29446
29447
29448
29449
29450
29451
29452
29453
29454
29455
29456
29457
29458
29459
29460
29461
29462
29463
29464
29465
29466
29467
29468
29469
29470
29471
29472
29473
29474
29475
29476
29477
29478
29479
29480
29481
29482
29483
29484
29485
29486
29487
29488
29489
29490
29491
29492
29493
29494
29495
29496
29497
29498
29499
29500
29501
29502
29503
29504
29505
29506
29507
29508
29509
29510
29511
29512
29513
29514
29515
29516
29517
29518
29519
29520
29521
29522
29523
29524
29525
29526
29527
29528
29529
29530
29531
29532
29533
29534
29535
29536
29537
29538
29539
29540
29541
29542
29543
29544
29545
29546
29547
29548
29549
29550
29551
29552
29553
29554
29555
29556
29557
29558
29559
29560
29561
29562
29563
29564
29565
29566
29567
29568
29569
29570
29571
29572
29573
29574
29575
29576
29577
29578
29579
29580
29581
29582
29583
29584
29585
29586
29587
29588
29589
29590
29591
29592
29593
29594
29595
29596
29597
29598
29599
29600
29601
29602
29603
29604
29605
29606
29607
29608
29609
29610
29611
29612
29613
29614
29615
29616
29617
29618
29619
29620
29621
29622
29623
29624
29625
29626
29627
29628
29629
29630
29631
29632
29633
29634
29635
29636
29637
29638
29639
29640
29641
29642
29643
29644
29645
29646
29647
29648
29649
29650
29651
29652
29653
29654
29655
29656
29657
29658
29659
29660
29661
29662
29663
29664
29665
29666
29667
29668
29669
29670
29671
29672
29673
29674
29675
29676
29677
29678
29679
29680
29681
29682
29683
29684
29685
29686
29687
29688
29689
29690
29691
29692
29693
29694
29695
29696
29697
29698
29699
29700
29701
29702
29703
29704
29705
29706
29707
29708
29709
29710
29711
29712
29713
29714
29715
29716
29717
29718
29719
29720
29721
29722
29723
29724
29725
29726
29727
29728
29729
29730
29731
29732
29733
29734
29735
29736
29737
29738
29739
29740
29741
29742
29743
29744
29745
29746
29747
29748
29749
29750
29751
29752
29753
29754
29755
29756
29757
29758
29759
29760
29761
29762
29763
29764
29765
29766
29767
29768
29769
29770
29771
29772
29773
29774
29775
29776
29777
29778
29779
29780
29781
29782
29783
29784
29785
29786
29787
29788
29789
29790
29791
29792
29793
29794
29795
29796
29797
29798
29799
29800
29801
29802
29803
29804
29805
29806
29807
29808
29809
29810
29811
29812
29813
29814
29815
29816
29817
29818
29819
29820
29821
29822
29823
29824
29825
29826
29827
29828
29829
29830
29831
29832
29833
29834
29835
29836
29837
29838
29839
29840
29841
29842
29843
29844
29845
29846
29847
29848
29849
29850
29851
29852
29853
29854
29855
29856
29857
29858
29859
29860
29861
29862
29863
29864
29865
29866
29867
29868
29869
29870
29871
29872
29873
29874
29875
29876
29877
29878
29879
29880
29881
29882
29883
29884
29885
29886
29887
29888
29889
29890
29891
29892
29893
29894
29895
29896
29897
29898
29899
29900
29901
29902
29903
29904
29905
29906
29907
29908
29909
29910
29911
29912
29913
29914
29915
29916
29917
29918
29919
29920
29921
29922
29923
29924
29925
29926
29927
29928
29929
29930
29931
29932
29933
29934
29935
29936
29937
29938
29939
29940
29941
29942
29943
29944
29945
29946
29947
29948
29949
29950
29951
29952
29953
29954
29955
29956
29957
29958
29959
29960
29961
29962
29963
29964
29965
29966
29967
29968
29969
29970
29971
29972
29973
29974
29975
29976
29977
29978
29979
29980
29981
29982
29983
29984
29985
29986
29987
29988
29989
29990
29991
29992
29993
29994
29995
29996
29997
29998
29999
30000
30001
30002
30003
30004
30005
30006
30007
30008
30009
30010
30011
30012
30013
30014
30015
30016
30017
30018
30019
30020
30021
30022
30023
30024
30025
30026
30027
30028
30029
30030
30031
30032
30033
30034
30035
30036
30037
30038
30039
30040
30041
30042
30043
30044
30045
30046
30047
30048
30049
30050
30051
30052
30053
30054
30055
30056
30057
30058
30059
30060
30061
30062
30063
30064
30065
30066
30067
30068
30069
30070
30071
30072
30073
30074
30075
30076
30077
30078
30079
30080
30081
30082
30083
30084
30085
30086
30087
30088
30089
30090
30091
30092
30093
30094
30095
30096
30097
30098
30099
30100
30101
30102
30103
30104
30105
30106
30107
30108
30109
30110
30111
30112
30113
30114
30115
30116
30117
30118
30119
30120
30121
30122
30123
30124
30125
30126
30127
30128
30129
30130
30131
30132
30133
30134
30135
30136
30137
30138
30139
30140
30141
30142
30143
30144
30145
30146
30147
30148
30149
30150
30151
30152
30153
30154
30155
30156
30157
30158
30159
30160
30161
30162
30163
30164
30165
30166
30167
30168
30169
30170
30171
30172
30173
30174
30175
30176
30177
30178
30179
30180
30181
30182
30183
30184
30185
30186
30187
30188
30189
30190
30191
30192
30193
30194
30195
30196
30197
30198
30199
30200
30201
30202
30203
30204
30205
30206
30207
30208
30209
30210
30211
30212
30213
30214
30215
30216
30217
30218
30219
30220
30221
30222
30223
30224
30225
30226
30227
30228
30229
30230
30231
30232
30233
30234
30235
30236
30237
30238
30239
30240
30241
30242
30243
30244
30245
30246
30247
30248
30249
30250
30251
30252
30253
30254
30255
30256
30257
30258
30259
30260
30261
30262
30263
30264
30265
30266
30267
30268
30269
30270
30271
30272
30273
30274
30275
30276
30277
30278
30279
30280
30281
30282
30283
30284
30285
30286
30287
30288
30289
30290
30291
30292
30293
30294
30295
30296
30297
30298
30299
30300
30301
30302
30303
30304
30305
30306
30307
30308
30309
30310
30311
30312
30313
30314
30315
30316
30317
30318
30319
30320
30321
30322
30323
30324
30325
30326
30327
30328
30329
30330
30331
30332
30333
30334
30335
30336
30337
30338
30339
30340
30341
30342
30343
30344
30345
30346
30347
30348
30349
30350
30351
30352
30353
30354
30355
30356
30357
30358
30359
30360
30361
30362
30363
30364
30365
30366
30367
30368
30369
30370
30371
30372
30373
30374
30375
30376
30377
30378
30379
30380
30381
30382
30383
30384
30385
30386
30387
30388
30389
30390
30391
30392
30393
30394
30395
30396
30397
30398
30399
30400
30401
30402
30403
30404
30405
30406
30407
30408
30409
30410
30411
30412
30413
30414
30415
30416
30417
30418
30419
30420
30421
30422
30423
30424
30425
30426
30427
30428
30429
30430
30431
30432
30433
30434
30435
30436
30437
30438
30439
30440
30441
30442
30443
30444
30445
30446
30447
30448
30449
30450
30451
30452
30453
30454
30455
30456
30457
30458
30459
30460
30461
30462
30463
30464
30465
30466
30467
30468
30469
30470
30471
30472
30473
30474
30475
30476
30477
30478
30479
30480
30481
30482
30483
30484
30485
30486
30487
30488
30489
30490
30491
30492
30493
30494
30495
30496
30497
30498
30499
30500
30501
30502
30503
30504
30505
30506
30507
30508
30509
30510
30511
30512
30513
30514
30515
30516
30517
30518
30519
30520
30521
30522
30523
30524
30525
30526
30527
30528
30529
30530
30531
30532
30533
30534
30535
30536
30537
30538
30539
30540
30541
30542
30543
30544
30545
30546
30547
30548
30549
30550
30551
30552
30553
30554
30555
30556
30557
30558
30559
30560
30561
30562
30563
30564
30565
30566
30567
30568
30569
30570
30571
30572
30573
30574
30575
30576
30577
30578
30579
30580
30581
30582
30583
30584
30585
30586
30587
30588
30589
30590
30591
30592
30593
30594
30595
30596
30597
30598
30599
30600
30601
30602
30603
30604
30605
30606
30607
30608
30609
30610
30611
30612
30613
30614
30615
30616
30617
30618
30619
30620
30621
30622
30623
30624
30625
30626
30627
30628
30629
30630
30631
30632
30633
30634
30635
30636
30637
30638
30639
30640
30641
30642
30643
30644
30645
30646
30647
30648
30649
30650
30651
30652
30653
30654
30655
30656
30657
30658
30659
30660
30661
30662
30663
30664
30665
30666
30667
30668
30669
30670
30671
30672
30673
30674
30675
30676
30677
30678
30679
30680
30681
30682
30683
30684
30685
30686
30687
30688
30689
30690
30691
30692
30693
30694
30695
30696
30697
30698
30699
30700
30701
30702
30703
30704
30705
30706
30707
30708
30709
30710
30711
30712
30713
30714
30715
30716
30717
30718
30719
30720
30721
30722
30723
30724
30725
30726
30727
30728
30729
30730
30731
30732
30733
30734
30735
30736
30737
30738
30739
30740
30741
30742
30743
30744
30745
30746
30747
30748
30749
30750
30751
30752
30753
30754
30755
30756
30757
30758
30759
30760
30761
30762
30763
30764
30765
30766
30767
30768
30769
30770
30771
30772
30773
30774
30775
30776
30777
30778
30779
30780
30781
30782
30783
30784
30785
30786
30787
30788
30789
30790
30791
30792
30793
30794
30795
30796
30797
30798
30799
30800
30801
30802
30803
30804
30805
30806
30807
30808
30809
30810
30811
30812
30813
30814
30815
30816
30817
30818
30819
30820
30821
30822
30823
30824
30825
30826
30827
30828
30829
30830
30831
30832
30833
30834
30835
30836
30837
30838
30839
30840
30841
30842
30843
30844
30845
30846
30847
30848
30849
30850
30851
30852
30853
30854
30855
30856
30857
30858
30859
30860
30861
30862
30863
30864
30865
30866
30867
30868
30869
30870
30871
30872
30873
30874
30875
30876
30877
30878
30879
30880
30881
30882
30883
30884
30885
30886
30887
30888
30889
30890
30891
30892
30893
30894
30895
30896
30897
30898
30899
30900
30901
30902
30903
30904
30905
30906
30907
30908
30909
30910
30911
30912
30913
30914
30915
30916
30917
30918
30919
30920
30921
30922
30923
30924
30925
30926
30927
30928
30929
30930
30931
30932
30933
30934
30935
30936
30937
30938
30939
30940
30941
30942
30943
30944
30945
30946
30947
30948
30949
30950
30951
30952
30953
30954
30955
30956
30957
30958
30959
30960
30961
30962
30963
30964
30965
30966
30967
30968
30969
30970
30971
30972
30973
30974
30975
30976
30977
30978
30979
30980
30981
30982
30983
30984
30985
30986
30987
30988
30989
30990
30991
30992
30993
30994
30995
30996
30997
30998
30999
31000
31001
31002
31003
31004
31005
31006
31007
31008
31009
31010
31011
31012
31013
31014
31015
31016
31017
31018
31019
31020
31021
31022
31023
31024
31025
31026
31027
31028
31029
31030
31031
31032
31033
31034
31035
31036
31037
31038
31039
31040
31041
31042
31043
31044
31045
31046
31047
31048
31049
31050
31051
31052
31053
31054
31055
31056
31057
31058
31059
31060
31061
31062
31063
31064
31065
31066
31067
31068
31069
31070
31071
31072
31073
31074
31075
31076
31077
31078
31079
31080
31081
31082
31083
31084
31085
31086
31087
31088
31089
31090
31091
31092
31093
31094
31095
31096
31097
31098
31099
31100
31101
31102
31103
31104
31105
31106
31107
31108
31109
31110
31111
31112
31113
31114
31115
31116
31117
31118
31119
31120
31121
31122
31123
31124
31125
31126
31127
31128
31129
31130
31131
31132
31133
31134
31135
31136
31137
31138
31139
31140
31141
31142
31143
31144
31145
31146
31147
31148
31149
31150
31151
31152
31153
31154
31155
31156
31157
31158
31159
31160
31161
31162
31163
31164
31165
31166
31167
31168
31169
31170
31171
31172
31173
31174
31175
31176
31177
31178
31179
31180
31181
31182
31183
31184
31185
31186
31187
31188
31189
31190
31191
31192
31193
31194
31195
31196
31197
31198
31199
31200
31201
31202
31203
31204
31205
31206
31207
31208
31209
31210
31211
31212
31213
31214
31215
31216
31217
31218
31219
31220
31221
31222
31223
31224
31225
31226
31227
31228
31229
31230
31231
31232
31233
31234
31235
31236
31237
31238
31239
31240
31241
31242
31243
31244
31245
31246
31247
31248
31249
31250
31251
31252
31253
31254
31255
31256
31257
31258
31259
31260
31261
31262
31263
31264
31265
31266
31267
31268
31269
31270
31271
31272
31273
31274
31275
31276
31277
31278
31279
31280
31281
31282
31283
31284
31285
31286
31287
31288
31289
31290
31291
31292
31293
31294
31295
31296
31297
31298
31299
31300
31301
31302
31303
31304
31305
31306
31307
31308
31309
31310
31311
31312
31313
31314
31315
31316
31317
31318
31319
31320
31321
31322
31323
31324
31325
31326
31327
31328
31329
31330
31331
31332
31333
31334
31335
31336
31337
31338
31339
31340
31341
31342
31343
31344
31345
31346
31347
31348
31349
31350
31351
31352
31353
31354
31355
31356
31357
31358
31359
31360
31361
31362
31363
31364
31365
31366
31367
31368
31369
31370
31371
31372
31373
31374
31375
31376
31377
31378
31379
31380
31381
31382
31383
31384
31385
31386
31387
31388
31389
31390
31391
31392
31393
31394
31395
31396
31397
31398
31399
31400
31401
31402
31403
31404
31405
31406
31407
31408
31409
31410
31411
31412
31413
31414
31415
31416
31417
31418
31419
31420
31421
31422
31423
31424
31425
31426
31427
31428
31429
31430
31431
31432
31433
31434
31435
31436
31437
31438
31439
31440
31441
31442
31443
31444
31445
31446
31447
31448
31449
31450
31451
31452
31453
31454
31455
31456
31457
31458
31459
31460
31461
31462
31463
31464
31465
31466
31467
31468
31469
31470
31471
31472
31473
31474
31475
31476
31477
31478
31479
31480
31481
31482
31483
31484
31485
31486
31487
31488
31489
31490
31491
31492
31493
31494
31495
31496
31497
31498
31499
31500
31501
31502
31503
31504
31505
31506
31507
31508
31509
31510
31511
31512
31513
31514
31515
31516
31517
31518
31519
31520
31521
31522
31523
31524
31525
31526
31527
31528
31529
31530
31531
31532
31533
31534
31535
31536
31537
31538
31539
31540
31541
31542
31543
31544
31545
31546
31547
31548
31549
31550
31551
31552
31553
31554
31555
31556
31557
31558
31559
31560
31561
31562
31563
31564
31565
31566
31567
31568
31569
31570
31571
31572
31573
31574
31575
31576
31577
31578
31579
31580
31581
31582
31583
31584
31585
31586
31587
31588
31589
31590
31591
31592
31593
31594
31595
31596
31597
31598
31599
31600
31601
31602
31603
31604
31605
31606
31607
31608
31609
31610
31611
31612
31613
31614
31615
31616
31617
31618
31619
31620
31621
31622
31623
31624
31625
31626
31627
31628
31629
31630
31631
31632
31633
31634
31635
31636
31637
31638
31639
31640
31641
31642
31643
31644
31645
31646
31647
31648
31649
31650
31651
31652
31653
31654
31655
31656
31657
31658
31659
31660
31661
31662
31663
31664
31665
31666
31667
31668
31669
31670
31671
31672
31673
31674
31675
31676
31677
31678
31679
31680
31681
31682
31683
31684
31685
31686
31687
31688
31689
31690
31691
31692
31693
31694
31695
31696
31697
31698
31699
31700
31701
31702
31703
31704
31705
31706
31707
31708
31709
31710
31711
31712
31713
31714
31715
31716
31717
31718
31719
31720
31721
31722
31723
31724
31725
31726
31727
31728
31729
31730
31731
31732
31733
31734
31735
31736
31737
31738
31739
31740
31741
31742
31743
31744
31745
31746
31747
31748
31749
31750
31751
31752
31753
31754
31755
31756
31757
31758
31759
31760
31761
31762
31763
31764
31765
31766
31767
31768
31769
31770
31771
31772
31773
31774
31775
31776
31777
31778
31779
31780
31781
31782
31783
31784
31785
31786
31787
31788
31789
31790
31791
31792
31793
31794
31795
31796
31797
31798
31799
31800
31801
31802
31803
31804
31805
31806
31807
31808
31809
31810
31811
31812
31813
31814
31815
31816
31817
31818
31819
31820
31821
31822
31823
31824
31825
31826
31827
31828
31829
31830
31831
31832
31833
31834
31835
31836
31837
31838
31839
31840
31841
31842
31843
31844
31845
31846
31847
31848
31849
31850
31851
31852
31853
31854
31855
31856
31857
31858
31859
31860
31861
31862
31863
31864
31865
31866
31867
31868
31869
31870
31871
31872
31873
31874
31875
31876
31877
31878
31879
31880
31881
31882
31883
31884
31885
31886
31887
31888
31889
31890
31891
31892
31893
31894
31895
31896
31897
31898
31899
31900
31901
31902
31903
31904
31905
31906
31907
31908
31909
31910
31911
31912
31913
31914
31915
31916
31917
31918
31919
31920
31921
31922
31923
31924
31925
31926
31927
31928
31929
31930
31931
31932
31933
31934
31935
31936
31937
31938
31939
31940
31941
31942
31943
31944
31945
31946
31947
31948
31949
31950
31951
31952
31953
31954
31955
31956
31957
31958
31959
31960
31961
31962
31963
31964
31965
31966
31967
31968
31969
31970
31971
31972
31973
31974
31975
31976
31977
31978
31979
31980
31981
31982
31983
31984
31985
31986
31987
31988
31989
31990
31991
31992
31993
31994
31995
31996
31997
31998
31999
32000
32001
32002
32003
32004
32005
32006
32007
32008
32009
32010
32011
32012
32013
32014
32015
32016
32017
32018
32019
32020
32021
32022
32023
32024
32025
32026
32027
32028
32029
32030
32031
32032
32033
32034
32035
32036
32037
32038
32039
32040
32041
32042
32043
32044
32045
32046
32047
32048
32049
32050
32051
32052
32053
32054
32055
32056
32057
32058
32059
32060
32061
32062
32063
32064
32065
32066
32067
32068
32069
32070
32071
32072
32073
32074
32075
32076
32077
32078
32079
32080
32081
32082
32083
32084
32085
32086
32087
32088
32089
32090
32091
32092
32093
32094
32095
32096
32097
32098
32099
32100
32101
32102
32103
32104
32105
32106
32107
32108
32109
32110
32111
32112
32113
32114
32115
32116
32117
32118
32119
32120
32121
32122
32123
32124
32125
32126
32127
32128
32129
32130
32131
32132
32133
32134
32135
32136
32137
32138
32139
32140
32141
32142
32143
32144
32145
32146
32147
32148
32149
32150
32151
32152
32153
32154
32155
32156
32157
32158
32159
32160
32161
32162
32163
32164
32165
32166
32167
32168
32169
32170
32171
32172
32173
32174
32175
32176
32177
32178
32179
32180
32181
32182
32183
32184
32185
32186
32187
32188
32189
32190
32191
32192
32193
32194
32195
32196
32197
32198
32199
32200
32201
32202
32203
32204
32205
32206
32207
32208
32209
32210
32211
32212
32213
32214
32215
32216
32217
32218
32219
32220
32221
32222
32223
32224
32225
32226
32227
32228
32229
32230
32231
32232
32233
32234
32235
32236
32237
32238
32239
32240
32241
32242
32243
32244
32245
32246
32247
32248
32249
32250
32251
32252
32253
32254
32255
32256
32257
32258
32259
32260
32261
32262
32263
32264
32265
32266
32267
32268
32269
32270
32271
32272
32273
32274
32275
32276
32277
32278
32279
32280
32281
32282
32283
32284
32285
32286
32287
32288
32289
32290
32291
32292
32293
32294
32295
32296
32297
32298
32299
32300
32301
32302
32303
32304
32305
32306
32307
32308
32309
32310
32311
32312
32313
32314
32315
32316
32317
32318
32319
32320
32321
32322
32323
32324
32325
32326
32327
32328
32329
32330
32331
32332
32333
32334
32335
32336
32337
32338
32339
32340
32341
32342
32343
32344
32345
32346
32347
32348
32349
32350
32351
32352
32353
32354
32355
32356
32357
32358
32359
32360
32361
32362
32363
32364
32365
32366
32367
32368
32369
32370
32371
32372
32373
32374
32375
32376
32377
32378
32379
32380
32381
32382
32383
32384
32385
32386
32387
32388
32389
32390
32391
32392
32393
32394
32395
32396
32397
32398
32399
32400
32401
32402
32403
32404
32405
32406
32407
32408
32409
32410
32411
32412
32413
32414
32415
32416
32417
32418
32419
32420
32421
32422
32423
32424
32425
32426
32427
32428
32429
32430
32431
32432
32433
32434
32435
32436
32437
32438
32439
32440
32441
32442
32443
32444
32445
32446
32447
32448
32449
32450
32451
32452
32453
32454
32455
32456
32457
32458
32459
32460
32461
32462
32463
32464
32465
32466
32467
32468
32469
32470
32471
32472
32473
32474
32475
32476
32477
32478
32479
32480
32481
32482
32483
32484
32485
32486
32487
32488
32489
32490
32491
32492
32493
32494
32495
32496
32497
32498
32499
32500
32501
32502
32503
32504
32505
32506
32507
32508
32509
32510
32511
32512
32513
32514
32515
32516
32517
32518
32519
32520
32521
32522
32523
32524
32525
32526
32527
32528
32529
32530
32531
32532
32533
32534
32535
32536
32537
32538
32539
32540
32541
32542
32543
32544
32545
32546
32547
32548
32549
32550
32551
32552
32553
32554
32555
32556
32557
32558
32559
32560
32561
32562
32563
32564
32565
32566
32567
32568
32569
32570
32571
32572
32573
32574
32575
32576
32577
32578
32579
32580
32581
32582
32583
32584
32585
32586
32587
32588
32589
32590
32591
32592
32593
32594
32595
32596
32597
32598
32599
32600
32601
32602
32603
32604
32605
32606
32607
32608
32609
32610
32611
32612
32613
32614
32615
32616
32617
32618
32619
32620
32621
32622
32623
32624
32625
32626
32627
32628
32629
32630
32631
32632
32633
32634
32635
32636
32637
32638
32639
32640
32641
32642
32643
32644
32645
32646
32647
32648
32649
32650
32651
32652
32653
32654
32655
32656
32657
32658
32659
32660
32661
32662
32663
32664
32665
32666
32667
32668
32669
32670
32671
32672
32673
32674
32675
32676
32677
32678
32679
32680
32681
32682
32683
32684
32685
32686
32687
32688
32689
32690
32691
32692
32693
32694
32695
32696
32697
32698
32699
32700
32701
32702
32703
32704
32705
32706
32707
32708
32709
32710
32711
32712
32713
32714
32715
32716
32717
32718
32719
32720
32721
32722
32723
32724
32725
32726
32727
32728
32729
32730
32731
32732
32733
32734
32735
32736
32737
32738
32739
32740
32741
32742
32743
32744
32745
32746
32747
32748
32749
32750
32751
32752
32753
32754
32755
32756
32757
32758
32759
32760
32761
32762
32763
32764
32765
32766
32767
32768
32769
32770
32771
32772
32773
32774
32775
32776
32777
32778
32779
32780
32781
32782
32783
32784
32785
32786
32787
32788
32789
32790
32791
32792
32793
32794
32795
32796
32797
32798
32799
32800
32801
32802
32803
32804
32805
32806
32807
32808
32809
32810
32811
32812
32813
32814
32815
32816
32817
32818
32819
32820
32821
32822
32823
32824
32825
32826
32827
32828
32829
32830
32831
32832
32833
32834
32835
32836
32837
32838
32839
32840
32841
32842
32843
32844
32845
32846
32847
32848
32849
32850
32851
32852
32853
32854
32855
32856
32857
32858
32859
32860
32861
32862
32863
32864
32865
32866
32867
32868
32869
32870
32871
32872
32873
32874
32875
32876
32877
32878
32879
32880
32881
32882
32883
32884
32885
32886
32887
32888
32889
32890
32891
32892
32893
32894
32895
32896
32897
32898
32899
32900
32901
32902
32903
32904
32905
32906
32907
32908
32909
32910
32911
32912
32913
32914
32915
32916
32917
32918
32919
32920
32921
32922
32923
32924
32925
32926
32927
32928
32929
32930
32931
32932
32933
32934
32935
32936
32937
32938
32939
32940
32941
32942
32943
32944
32945
32946
32947
32948
32949
32950
32951
32952
32953
32954
32955
32956
32957
32958
32959
32960
32961
32962
32963
32964
32965
32966
32967
32968
32969
32970
32971
32972
32973
32974
32975
32976
32977
32978
32979
32980
32981
32982
32983
32984
32985
32986
32987
32988
32989
32990
32991
32992
32993
32994
32995
32996
32997
32998
32999
33000
33001
33002
33003
33004
33005
33006
33007
33008
33009
33010
33011
33012
33013
33014
33015
33016
33017
33018
33019
33020
33021
33022
33023
33024
33025
33026
33027
33028
33029
33030
33031
33032
33033
33034
33035
33036
33037
33038
33039
33040
33041
33042
33043
33044
33045
33046
33047
33048
33049
33050
33051
33052
33053
33054
33055
33056
33057
33058
33059
33060
33061
33062
33063
33064
33065
33066
33067
33068
33069
33070
33071
33072
33073
33074
33075
33076
33077
33078
33079
33080
33081
33082
33083
33084
33085
33086
33087
33088
33089
33090
33091
33092
33093
33094
33095
33096
33097
33098
33099
33100
33101
33102
33103
33104
33105
33106
33107
33108
33109
33110
33111
33112
33113
33114
33115
33116
33117
33118
33119
33120
33121
33122
33123
33124
33125
33126
33127
33128
33129
33130
33131
33132
33133
33134
33135
33136
33137
33138
33139
33140
33141
33142
33143
33144
33145
33146
33147
33148
33149
33150
33151
33152
33153
33154
33155
33156
33157
33158
33159
33160
33161
33162
33163
33164
33165
33166
33167
33168
33169
33170
33171
33172
33173
33174
33175
33176
33177
33178
33179
33180
33181
33182
33183
33184
33185
33186
33187
33188
33189
33190
33191
33192
33193
33194
33195
33196
33197
33198
33199
33200
33201
33202
33203
33204
33205
33206
33207
33208
33209
33210
33211
33212
33213
33214
33215
33216
33217
33218
33219
33220
33221
33222
33223
33224
33225
33226
33227
33228
33229
33230
33231
33232
33233
33234
33235
33236
33237
33238
33239
33240
33241
33242
33243
33244
33245
33246
33247
33248
33249
33250
33251
33252
33253
33254
33255
33256
33257
33258
33259
33260
33261
33262
33263
33264
33265
33266
33267
33268
33269
33270
33271
33272
33273
33274
33275
33276
33277
33278
33279
33280
33281
33282
33283
33284
33285
33286
33287
33288
33289
33290
33291
33292
33293
33294
33295
33296
33297
33298
33299
33300
33301
33302
33303
33304
33305
33306
33307
33308
33309
33310
33311
33312
33313
33314
33315
33316
33317
33318
33319
33320
33321
33322
33323
33324
33325
33326
33327
33328
33329
33330
33331
33332
33333
33334
33335
33336
33337
33338
33339
33340
33341
33342
33343
33344
33345
33346
33347
33348
33349
33350
33351
33352
33353
33354
33355
33356
33357
33358
33359
33360
33361
33362
33363
33364
33365
33366
33367
33368
33369
33370
33371
33372
33373
33374
33375
33376
33377
33378
33379
33380
33381
33382
33383
33384
33385
33386
33387
33388
33389
33390
33391
33392
33393
33394
33395
33396
33397
33398
33399
33400
33401
33402
33403
33404
33405
33406
33407
33408
33409
33410
33411
33412
33413
33414
33415
33416
33417
33418
33419
33420
33421
33422
33423
33424
33425
33426
33427
33428
33429
33430
33431
33432
33433
33434
33435
33436
33437
33438
33439
33440
33441
33442
33443
33444
33445
33446
33447
33448
33449
33450
33451
33452
33453
33454
33455
33456
33457
33458
33459
33460
33461
33462
33463
33464
33465
33466
33467
33468
33469
33470
33471
33472
33473
33474
33475
33476
33477
33478
33479
33480
33481
33482
33483
33484
33485
33486
33487
33488
33489
33490
33491
33492
33493
33494
33495
33496
33497
33498
33499
33500
33501
33502
33503
33504
33505
33506
33507
33508
33509
33510
33511
33512
33513
33514
33515
33516
33517
33518
33519
33520
33521
33522
33523
33524
33525
33526
33527
33528
33529
33530
33531
33532
33533
33534
33535
33536
33537
33538
33539
33540
33541
33542
33543
33544
33545
33546
33547
33548
33549
33550
33551
33552
33553
33554
33555
33556
33557
33558
33559
33560
33561
33562
33563
33564
33565
33566
33567
33568
33569
33570
33571
33572
33573
33574
33575
33576
33577
33578
33579
33580
33581
33582
33583
33584
33585
33586
33587
33588
33589
33590
33591
33592
33593
33594
33595
33596
33597
33598
33599
33600
33601
33602
33603
33604
33605
33606
33607
33608
33609
33610
33611
33612
33613
33614
33615
33616
33617
33618
33619
33620
33621
33622
33623
33624
33625
33626
33627
33628
33629
33630
33631
33632
33633
33634
33635
33636
33637
33638
33639
33640
33641
33642
33643
33644
33645
33646
33647
33648
33649
33650
33651
33652
33653
33654
33655
33656
33657
33658
33659
33660
33661
33662
33663
33664
33665
33666
33667
33668
33669
33670
33671
33672
33673
33674
33675
33676
33677
33678
33679
33680
33681
33682
33683
33684
33685
33686
33687
33688
33689
33690
33691
33692
33693
33694
33695
33696
33697
33698
33699
33700
33701
33702
33703
33704
33705
33706
33707
33708
33709
33710
33711
33712
33713
33714
33715
33716
33717
33718
33719
33720
33721
33722
33723
33724
33725
33726
33727
33728
33729
33730
33731
33732
33733
33734
33735
33736
33737
33738
33739
33740
33741
33742
33743
33744
33745
33746
33747
33748
33749
33750
33751
33752
33753
33754
33755
33756
33757
33758
33759
33760
33761
33762
33763
33764
33765
33766
33767
33768
33769
33770
33771
33772
33773
33774
33775
33776
33777
33778
33779
33780
33781
33782
33783
33784
33785
33786
33787
33788
33789
33790
33791
33792
33793
33794
33795
33796
33797
33798
33799
33800
33801
33802
33803
33804
33805
33806
33807
33808
33809
33810
33811
33812
33813
33814
33815
33816
33817
33818
33819
33820
33821
33822
33823
33824
33825
33826
33827
33828
33829
33830
33831
33832
33833
33834
33835
33836
33837
33838
33839
33840
33841
33842
33843
33844
33845
33846
33847
33848
33849
33850
33851
33852
33853
33854
33855
33856
33857
33858
33859
33860
33861
33862
33863
33864
33865
33866
33867
33868
33869
33870
33871
33872
33873
33874
33875
33876
33877
33878
33879
33880
33881
33882
33883
33884
33885
33886
33887
33888
33889
33890
33891
33892
33893
33894
33895
33896
33897
33898
33899
33900
33901
33902
33903
33904
33905
33906
33907
33908
33909
33910
33911
33912
33913
33914
33915
33916
33917
33918
33919
33920
33921
33922
33923
33924
33925
33926
33927
33928
33929
33930
33931
33932
33933
33934
33935
33936
33937
33938
33939
33940
33941
33942
33943
33944
33945
33946
33947
33948
33949
33950
33951
33952
33953
33954
33955
33956
33957
33958
33959
33960
33961
33962
33963
33964
33965
33966
33967
33968
33969
33970
33971
33972
33973
33974
33975
33976
33977
33978
33979
33980
33981
33982
33983
33984
33985
33986
33987
33988
33989
33990
33991
33992
33993
33994
33995
33996
33997
33998
33999
34000
34001
34002
34003
34004
34005
34006
34007
34008
34009
34010
34011
34012
34013
34014
34015
34016
34017
34018
34019
34020
34021
34022
34023
34024
34025
34026
34027
34028
34029
34030
34031
34032
34033
34034
34035
34036
34037
34038
34039
34040
34041
34042
34043
34044
34045
34046
34047
34048
34049
34050
34051
34052
34053
34054
34055
34056
34057
34058
34059
34060
34061
34062
34063
34064
34065
34066
34067
34068
34069
34070
34071
34072
34073
34074
34075
34076
34077
34078
34079
34080
34081
34082
34083
34084
34085
34086
34087
34088
34089
34090
34091
34092
34093
34094
34095
34096
34097
34098
34099
34100
34101
34102
34103
34104
34105
34106
34107
34108
34109
34110
34111
34112
34113
34114
34115
34116
34117
34118
34119
34120
34121
34122
34123
34124
34125
34126
34127
34128
34129
34130
34131
34132
34133
34134
34135
34136
34137
34138
34139
34140
34141
34142
34143
34144
34145
34146
34147
34148
34149
34150
34151
34152
34153
34154
34155
34156
34157
34158
34159
34160
34161
34162
34163
34164
34165
34166
34167
34168
34169
34170
34171
34172
34173
34174
34175
34176
34177
34178
34179
34180
34181
34182
34183
34184
34185
34186
34187
34188
34189
34190
34191
34192
34193
34194
34195
34196
34197
34198
34199
34200
34201
34202
34203
34204
34205
34206
34207
34208
34209
34210
34211
34212
34213
34214
34215
34216
34217
34218
34219
34220
34221
34222
34223
34224
34225
34226
34227
34228
34229
34230
34231
34232
34233
34234
34235
34236
34237
34238
34239
34240
34241
34242
34243
34244
34245
34246
34247
34248
34249
34250
34251
34252
34253
34254
34255
34256
34257
34258
34259
34260
34261
34262
34263
34264
34265
34266
34267
34268
34269
34270
34271
34272
34273
34274
34275
34276
34277
34278
34279
34280
34281
34282
34283
34284
34285
34286
34287
34288
34289
34290
34291
34292
34293
34294
34295
34296
34297
34298
34299
34300
34301
34302
34303
34304
34305
34306
34307
34308
34309
34310
34311
34312
34313
34314
34315
34316
34317
34318
34319
34320
34321
34322
34323
34324
34325
34326
34327
34328
34329
34330
34331
34332
34333
34334
34335
34336
34337
34338
34339
34340
34341
34342
34343
34344
34345
34346
34347
34348
34349
34350
34351
34352
34353
34354
34355
34356
34357
34358
34359
34360
34361
34362
34363
34364
34365
34366
34367
34368
34369
34370
34371
34372
34373
34374
34375
34376
34377
34378
34379
34380
34381
34382
34383
34384
34385
34386
34387
34388
34389
34390
34391
34392
34393
34394
34395
34396
34397
34398
34399
34400
34401
34402
34403
34404
34405
34406
34407
34408
34409
34410
34411
34412
34413
34414
34415
34416
34417
34418
34419
34420
34421
34422
34423
34424
34425
34426
34427
34428
34429
34430
34431
34432
34433
34434
34435
34436
34437
34438
34439
34440
34441
34442
34443
34444
34445
34446
34447
34448
34449
34450
34451
34452
34453
34454
34455
34456
34457
34458
34459
34460
34461
34462
34463
34464
34465
34466
34467
34468
34469
34470
34471
34472
34473
34474
34475
34476
34477
34478
34479
34480
34481
34482
34483
34484
34485
34486
34487
34488
34489
34490
34491
34492
34493
34494
34495
34496
34497
34498
34499
34500
34501
34502
34503
34504
34505
34506
34507
34508
34509
34510
34511
34512
34513
34514
34515
34516
34517
34518
34519
34520
34521
34522
34523
34524
34525
34526
34527
34528
34529
34530
34531
34532
34533
34534
34535
34536
34537
34538
34539
34540
34541
34542
34543
34544
34545
34546
34547
34548
34549
34550
34551
34552
34553
34554
34555
34556
34557
34558
34559
34560
34561
34562
34563
34564
34565
34566
34567
34568
34569
34570
34571
34572
34573
34574
34575
34576
34577
34578
34579
34580
34581
34582
34583
34584
34585
34586
34587
34588
34589
34590
34591
34592
34593
34594
34595
34596
34597
34598
34599
34600
34601
34602
34603
34604
34605
34606
34607
34608
34609
34610
34611
34612
34613
34614
34615
34616
34617
34618
34619
34620
34621
34622
34623
34624
34625
34626
34627
34628
34629
34630
34631
34632
34633
34634
34635
34636
34637
34638
34639
34640
34641
34642
34643
34644
34645
34646
34647
34648
34649
34650
34651
34652
34653
34654
34655
34656
34657
34658
34659
34660
34661
34662
34663
34664
34665
34666
34667
34668
34669
34670
34671
34672
34673
34674
34675
34676
34677
34678
34679
34680
34681
34682
34683
34684
34685
34686
34687
34688
34689
34690
34691
34692
34693
34694
34695
34696
34697
34698
34699
34700
34701
34702
34703
34704
34705
34706
34707
34708
34709
34710
34711
34712
34713
34714
34715
34716
34717
34718
34719
34720
34721
34722
34723
34724
34725
34726
34727
34728
34729
34730
34731
34732
34733
34734
34735
34736
34737
34738
34739
34740
34741
34742
34743
34744
34745
34746
34747
34748
34749
34750
34751
34752
34753
34754
34755
34756
34757
34758
34759
34760
34761
34762
34763
34764
34765
34766
34767
34768
34769
34770
34771
34772
34773
34774
34775
34776
34777
34778
34779
34780
34781
34782
34783
34784
34785
34786
34787
34788
34789
34790
34791
34792
34793
34794
34795
34796
34797
34798
34799
34800
34801
34802
34803
34804
34805
34806
34807
34808
34809
34810
34811
34812
34813
34814
34815
34816
34817
34818
34819
34820
34821
34822
34823
34824
34825
34826
34827
34828
34829
34830
34831
34832
34833
34834
34835
34836
34837
34838
34839
34840
34841
34842
34843
34844
34845
34846
34847
34848
34849
34850
34851
34852
34853
34854
34855
34856
34857
34858
34859
34860
34861
34862
34863
34864
34865
34866
34867
34868
34869
34870
34871
34872
34873
34874
34875
34876
34877
34878
34879
34880
34881
34882
34883
34884
34885
34886
34887
34888
34889
34890
34891
34892
34893
34894
34895
34896
34897
34898
34899
34900
34901
34902
34903
34904
34905
34906
34907
34908
34909
34910
34911
34912
34913
34914
34915
34916
34917
34918
34919
34920
34921
34922
34923
34924
34925
34926
34927
34928
34929
34930
34931
34932
34933
34934
34935
34936
34937
34938
34939
34940
34941
34942
34943
34944
34945
34946
34947
34948
34949
34950
34951
34952
34953
34954
34955
34956
34957
34958
34959
34960
34961
34962
34963
34964
34965
34966
34967
34968
34969
34970
34971
34972
34973
34974
34975
34976
34977
34978
34979
34980
34981
34982
34983
34984
34985
34986
34987
34988
34989
34990
34991
34992
34993
34994
34995
34996
34997
34998
34999
35000
35001
35002
35003
35004
35005
35006
35007
35008
35009
35010
35011
35012
35013
35014
35015
35016
35017
35018
35019
35020
35021
35022
35023
35024
35025
35026
35027
35028
35029
35030
35031
35032
35033
35034
35035
35036
35037
35038
35039
35040
35041
35042
35043
35044
35045
35046
35047
35048
35049
35050
35051
35052
35053
35054
35055
35056
35057
35058
35059
35060
35061
35062
35063
35064
35065
35066
35067
35068
35069
35070
35071
35072
35073
35074
35075
35076
35077
35078
35079
35080
35081
35082
35083
35084
35085
35086
35087
35088
35089
35090
35091
35092
35093
35094
35095
35096
35097
35098
35099
35100
35101
35102
35103
35104
35105
35106
35107
35108
35109
35110
35111
35112
35113
35114
35115
35116
35117
35118
35119
35120
35121
35122
35123
35124
35125
35126
35127
35128
35129
35130
35131
35132
35133
35134
35135
35136
35137
35138
35139
35140
35141
35142
35143
35144
35145
35146
35147
35148
35149
35150
35151
35152
35153
35154
35155
35156
35157
35158
35159
35160
35161
35162
35163
35164
35165
35166
35167
35168
35169
35170
35171
35172
35173
35174
35175
35176
35177
35178
35179
35180
35181
35182
35183
35184
35185
35186
35187
35188
35189
35190
35191
35192
35193
35194
35195
35196
35197
35198
35199
35200
35201
35202
35203
35204
35205
35206
35207
35208
35209
35210
35211
35212
35213
35214
35215
35216
35217
35218
35219
35220
35221
35222
35223
35224
35225
35226
35227
35228
35229
35230
35231
35232
35233
35234
35235
35236
35237
35238
35239
35240
35241
35242
35243
35244
35245
35246
35247
35248
35249
35250
35251
35252
35253
35254
35255
35256
35257
35258
35259
35260
35261
35262
35263
35264
35265
35266
35267
35268
35269
35270
35271
35272
35273
35274
35275
35276
35277
35278
35279
35280
35281
35282
35283
35284
35285
35286
35287
35288
35289
35290
35291
35292
35293
35294
35295
35296
35297
35298
35299
35300
35301
35302
35303
35304
35305
35306
35307
35308
35309
35310
35311
35312
35313
35314
35315
35316
35317
35318
35319
35320
35321
35322
35323
35324
35325
35326
35327
35328
35329
35330
35331
35332
35333
35334
35335
35336
35337
35338
35339
35340
35341
35342
35343
35344
35345
35346
35347
35348
35349
35350
35351
35352
35353
35354
35355
35356
35357
35358
35359
35360
35361
35362
35363
35364
35365
35366
35367
35368
35369
35370
35371
35372
35373
35374
35375
35376
35377
35378
35379
35380
35381
35382
35383
35384
35385
35386
35387
35388
35389
35390
35391
35392
35393
35394
35395
35396
35397
35398
35399
35400
35401
35402
35403
35404
35405
35406
35407
35408
35409
35410
35411
35412
35413
35414
35415
35416
35417
35418
35419
35420
35421
35422
35423
35424
35425
35426
35427
35428
35429
35430
35431
35432
35433
35434
35435
35436
35437
35438
35439
35440
35441
35442
35443
35444
35445
35446
35447
35448
35449
35450
35451
35452
35453
35454
35455
35456
35457
35458
35459
35460
35461
35462
35463
35464
35465
35466
35467
35468
35469
35470
35471
35472
35473
35474
35475
35476
35477
35478
35479
35480
35481
35482
35483
35484
35485
35486
35487
35488
35489
35490
35491
35492
35493
35494
35495
35496
35497
35498
35499
35500
35501
35502
35503
35504
35505
35506
35507
35508
35509
35510
35511
35512
35513
35514
35515
35516
35517
35518
35519
35520
35521
35522
35523
35524
35525
35526
35527
35528
35529
35530
35531
35532
35533
35534
35535
35536
35537
35538
35539
35540
35541
35542
35543
35544
35545
35546
35547
35548
35549
35550
35551
35552
35553
35554
35555
35556
35557
35558
35559
35560
35561
35562
35563
35564
35565
35566
35567
35568
35569
35570
35571
35572
35573
35574
35575
35576
35577
35578
35579
35580
35581
35582
35583
35584
35585
35586
35587
35588
35589
35590
35591
35592
35593
35594
35595
35596
35597
35598
35599
35600
35601
35602
35603
35604
35605
35606
35607
35608
35609
35610
35611
35612
35613
35614
35615
35616
35617
35618
35619
35620
35621
35622
35623
35624
35625
35626
35627
35628
35629
35630
35631
35632
35633
35634
35635
35636
35637
35638
35639
35640
35641
35642
35643
35644
35645
35646
35647
35648
35649
35650
35651
35652
35653
35654
35655
35656
35657
35658
35659
35660
35661
35662
35663
35664
35665
35666
35667
35668
35669
35670
35671
35672
35673
35674
35675
35676
35677
35678
35679
35680
35681
35682
35683
35684
35685
35686
35687
35688
35689
35690
35691
35692
35693
35694
35695
35696
35697
35698
35699
35700
35701
35702
35703
35704
35705
35706
35707
35708
35709
35710
35711
35712
35713
35714
35715
35716
35717
35718
35719
35720
35721
35722
35723
35724
35725
35726
35727
35728
35729
35730
35731
35732
35733
35734
35735
35736
35737
35738
35739
35740
35741
35742
35743
35744
35745
35746
35747
35748
35749
35750
35751
35752
35753
35754
35755
35756
35757
35758
35759
35760
35761
35762
35763
35764
35765
35766
35767
35768
35769
35770
35771
35772
35773
35774
35775
35776
35777
35778
35779
35780
35781
35782
35783
35784
35785
35786
35787
35788
35789
35790
35791
35792
35793
35794
35795
35796
35797
35798
35799
35800
35801
35802
35803
35804
35805
35806
35807
35808
35809
35810
35811
35812
35813
35814
35815
35816
35817
35818
35819
35820
35821
35822
35823
35824
35825
35826
35827
35828
35829
35830
35831
35832
35833
35834
35835
35836
35837
35838
35839
35840
35841
35842
35843
35844
35845
35846
35847
35848
35849
35850
35851
35852
35853
35854
35855
35856
35857
35858
35859
35860
35861
35862
35863
35864
35865
35866
35867
35868
35869
35870
35871
35872
35873
35874
35875
35876
35877
35878
35879
35880
35881
35882
35883
35884
35885
35886
35887
35888
35889
35890
35891
35892
35893
35894
35895
35896
35897
35898
35899
35900
35901
35902
35903
35904
35905
35906
35907
35908
35909
35910
35911
35912
35913
35914
35915
35916
35917
35918
35919
35920
35921
35922
35923
35924
35925
35926
35927
35928
35929
35930
35931
35932
35933
35934
35935
35936
35937
35938
35939
35940
35941
35942
35943
35944
35945
35946
35947
35948
35949
35950
35951
35952
35953
35954
35955
35956
35957
35958
35959
35960
35961
35962
35963
35964
35965
35966
35967
35968
35969
35970
35971
35972
35973
35974
35975
35976
35977
35978
35979
35980
35981
35982
35983
35984
35985
35986
35987
35988
35989
35990
35991
35992
35993
35994
35995
35996
35997
35998
35999
36000
36001
36002
36003
36004
36005
36006
36007
36008
36009
36010
36011
36012
36013
36014
36015
36016
36017
36018
36019
36020
36021
36022
36023
36024
36025
36026
36027
36028
36029
36030
36031
36032
36033
36034
36035
36036
36037
36038
36039
36040
36041
36042
36043
36044
36045
36046
36047
36048
36049
36050
36051
36052
36053
36054
36055
36056
36057
36058
36059
36060
36061
36062
36063
36064
36065
36066
36067
36068
36069
36070
36071
36072
36073
36074
36075
36076
36077
36078
36079
36080
36081
36082
36083
36084
36085
36086
36087
36088
36089
36090
36091
36092
36093
36094
36095
36096
36097
36098
36099
36100
36101
36102
36103
36104
36105
36106
36107
36108
36109
36110
36111
36112
36113
36114
36115
36116
36117
36118
36119
36120
36121
36122
36123
36124
36125
36126
36127
36128
36129
36130
36131
36132
36133
36134
36135
36136
36137
36138
36139
36140
36141
36142
36143
36144
36145
36146
36147
36148
36149
36150
36151
36152
36153
36154
36155
36156
36157
36158
36159
36160
36161
36162
36163
36164
36165
36166
36167
36168
36169
36170
36171
36172
36173
36174
36175
36176
36177
36178
36179
36180
36181
36182
36183
36184
36185
36186
36187
36188
36189
36190
36191
36192
36193
36194
36195
36196
36197
36198
36199
36200
36201
36202
36203
36204
36205
36206
36207
36208
36209
36210
36211
36212
36213
36214
36215
36216
36217
36218
36219
36220
36221
36222
36223
36224
36225
36226
36227
36228
36229
36230
36231
36232
36233
36234
36235
36236
36237
36238
36239
36240
36241
36242
36243
36244
36245
36246
36247
36248
36249
36250
36251
36252
36253
36254
36255
36256
36257
36258
36259
36260
36261
36262
36263
36264
36265
36266
36267
36268
36269
36270
36271
36272
36273
36274
36275
36276
36277
36278
36279
36280
36281
36282
36283
36284
36285
36286
36287
36288
36289
36290
36291
36292
36293
36294
36295
36296
36297
36298
36299
36300
36301
36302
36303
36304
36305
36306
36307
36308
36309
36310
36311
36312
36313
36314
36315
36316
36317
36318
36319
36320
36321
36322
36323
36324
36325
36326
36327
36328
36329
36330
36331
36332
36333
36334
36335
36336
36337
36338
36339
36340
36341
36342
36343
36344
36345
36346
36347
36348
36349
36350
36351
36352
36353
36354
36355
36356
36357
36358
36359
36360
36361
36362
36363
36364
36365
36366
36367
36368
36369
36370
36371
36372
36373
36374
36375
36376
36377
36378
36379
36380
36381
36382
36383
36384
36385
36386
36387
36388
36389
36390
36391
36392
36393
36394
36395
36396
36397
36398
36399
36400
36401
36402
36403
36404
36405
36406
36407
36408
36409
36410
36411
36412
36413
36414
36415
36416
36417
36418
36419
36420
36421
36422
36423
36424
36425
36426
36427
36428
36429
36430
36431
36432
36433
36434
36435
36436
36437
36438
36439
36440
36441
36442
36443
36444
36445
36446
36447
36448
36449
36450
36451
36452
36453
36454
36455
36456
36457
36458
36459
36460
36461
36462
36463
36464
36465
36466
36467
36468
36469
36470
36471
36472
36473
36474
36475
36476
36477
36478
36479
36480
36481
36482
36483
36484
36485
36486
36487
36488
36489
36490
36491
36492
36493
36494
36495
36496
36497
36498
36499
36500
36501
36502
36503
36504
36505
36506
36507
36508
36509
36510
36511
36512
36513
36514
36515
36516
36517
36518
36519
36520
36521
36522
36523
36524
36525
36526
36527
36528
36529
36530
36531
36532
36533
36534
36535
36536
36537
36538
36539
36540
36541
36542
36543
36544
36545
36546
36547
36548
36549
36550
36551
36552
36553
36554
36555
36556
36557
36558
36559
36560
36561
36562
36563
36564
36565
36566
36567
36568
36569
36570
36571
36572
36573
36574
36575
36576
36577
36578
36579
36580
36581
36582
36583
36584
36585
36586
36587
36588
36589
36590
36591
36592
36593
36594
36595
36596
36597
36598
36599
36600
36601
36602
36603
36604
36605
36606
36607
36608
36609
36610
36611
36612
36613
36614
36615
36616
36617
36618
36619
36620
36621
36622
36623
36624
36625
36626
36627
36628
36629
36630
36631
36632
36633
36634
36635
36636
36637
36638
36639
36640
36641
36642
36643
36644
36645
36646
36647
36648
36649
36650
36651
36652
36653
36654
36655
36656
36657
36658
36659
36660
36661
36662
36663
36664
36665
36666
36667
36668
36669
36670
36671
36672
36673
36674
36675
36676
36677
36678
36679
36680
36681
36682
36683
36684
36685
36686
36687
36688
36689
36690
36691
36692
36693
36694
36695
36696
36697
36698
36699
36700
36701
36702
36703
36704
36705
36706
36707
36708
36709
36710
36711
36712
36713
36714
36715
36716
36717
36718
36719
36720
36721
36722
36723
36724
36725
36726
36727
36728
36729
36730
36731
36732
36733
36734
36735
36736
36737
36738
36739
36740
36741
36742
36743
36744
36745
36746
36747
36748
36749
36750
36751
36752
36753
36754
36755
36756
36757
36758
36759
36760
36761
36762
36763
36764
36765
36766
36767
36768
36769
36770
36771
36772
36773
36774
36775
36776
36777
36778
36779
36780
36781
36782
36783
36784
36785
36786
36787
36788
36789
36790
36791
36792
36793
36794
36795
36796
36797
36798
36799
36800
36801
36802
36803
36804
36805
36806
36807
36808
36809
36810
36811
36812
36813
36814
36815
36816
36817
36818
36819
36820
36821
36822
36823
36824
36825
36826
36827
36828
36829
36830
36831
36832
36833
36834
36835
36836
36837
36838
36839
36840
36841
36842
36843
36844
36845
36846
36847
36848
36849
36850
36851
36852
36853
36854
36855
36856
36857
36858
36859
36860
36861
36862
36863
36864
36865
36866
36867
36868
36869
36870
36871
36872
36873
36874
36875
36876
36877
36878
36879
36880
36881
36882
36883
36884
36885
36886
36887
36888
36889
36890
36891
36892
36893
36894
36895
36896
36897
36898
36899
36900
36901
36902
36903
36904
36905
36906
36907
36908
36909
36910
36911
36912
36913
36914
36915
36916
36917
36918
36919
36920
36921
36922
36923
36924
36925
36926
36927
36928
36929
36930
36931
36932
36933
36934
36935
36936
36937
36938
36939
36940
36941
36942
36943
36944
36945
36946
36947
36948
36949
36950
36951
36952
36953
36954
36955
36956
36957
36958
36959
36960
36961
36962
36963
36964
36965
36966
36967
36968
36969
36970
36971
36972
36973
36974
36975
36976
36977
36978
36979
36980
36981
36982
36983
36984
36985
36986
36987
36988
36989
36990
36991
36992
36993
36994
36995
36996
36997
36998
36999
37000
37001
37002
37003
37004
37005
37006
37007
37008
37009
37010
37011
37012
37013
37014
37015
37016
37017
37018
37019
37020
37021
37022
37023
37024
37025
37026
37027
37028
37029
37030
37031
37032
37033
37034
37035
37036
37037
37038
37039
37040
37041
37042
37043
37044
37045
37046
37047
37048
37049
37050
37051
37052
37053
37054
37055
37056
37057
37058
37059
37060
37061
37062
37063
37064
37065
37066
37067
37068
37069
37070
37071
37072
37073
37074
37075
37076
37077
37078
37079
37080
37081
37082
37083
37084
37085
37086
37087
37088
37089
37090
37091
37092
37093
37094
37095
37096
37097
37098
37099
37100
37101
37102
37103
37104
37105
37106
37107
37108
37109
37110
37111
37112
37113
37114
37115
37116
37117
37118
37119
37120
37121
37122
37123
37124
37125
37126
37127
37128
37129
37130
37131
37132
37133
37134
37135
37136
37137
37138
37139
37140
37141
37142
37143
37144
37145
37146
37147
37148
37149
37150
37151
37152
37153
37154
37155
37156
37157
37158
37159
37160
37161
37162
37163
37164
37165
37166
37167
37168
37169
37170
37171
37172
37173
37174
37175
37176
37177
37178
37179
37180
37181
37182
37183
37184
37185
37186
37187
37188
37189
37190
37191
37192
37193
37194
37195
37196
37197
37198
37199
37200
37201
37202
37203
37204
37205
37206
37207
37208
37209
37210
37211
37212
37213
37214
37215
37216
37217
37218
37219
37220
37221
37222
37223
37224
37225
37226
37227
37228
37229
37230
37231
37232
37233
37234
37235
37236
37237
37238
37239
37240
37241
37242
37243
37244
37245
37246
37247
37248
37249
37250
37251
37252
37253
37254
37255
37256
37257
37258
37259
37260
37261
37262
37263
37264
37265
37266
37267
37268
37269
37270
37271
37272
37273
37274
37275
37276
37277
37278
37279
37280
37281
37282
37283
37284
37285
37286
37287
37288
37289
37290
37291
37292
37293
37294
37295
37296
37297
37298
37299
37300
37301
37302
37303
37304
37305
37306
37307
37308
37309
37310
37311
37312
37313
37314
37315
37316
37317
37318
37319
37320
37321
37322
37323
37324
37325
37326
37327
37328
37329
37330
37331
37332
37333
37334
37335
37336
37337
37338
37339
37340
37341
37342
37343
37344
37345
37346
37347
37348
37349
37350
37351
37352
37353
37354
37355
37356
37357
37358
37359
37360
37361
37362
37363
37364
37365
37366
37367
37368
37369
37370
37371
37372
37373
37374
37375
37376
37377
37378
37379
37380
37381
37382
37383
37384
37385
37386
37387
37388
37389
37390
37391
37392
37393
37394
37395
37396
37397
37398
37399
37400
37401
37402
37403
37404
37405
37406
37407
37408
37409
37410
37411
37412
37413
37414
37415
37416
37417
37418
37419
37420
37421
37422
37423
37424
37425
37426
37427
37428
37429
37430
37431
37432
37433
37434
37435
37436
37437
37438
37439
37440
37441
37442
37443
37444
37445
37446
37447
37448
37449
37450
37451
37452
37453
37454
37455
37456
37457
37458
37459
37460
37461
37462
37463
37464
37465
37466
37467
37468
37469
37470
37471
37472
37473
37474
37475
37476
37477
37478
37479
37480
37481
37482
37483
37484
37485
37486
37487
37488
37489
37490
37491
37492
37493
37494
37495
37496
37497
37498
37499
37500
37501
37502
37503
37504
37505
37506
37507
37508
37509
37510
37511
37512
37513
37514
37515
37516
37517
37518
37519
37520
37521
37522
37523
37524
37525
37526
37527
37528
37529
37530
37531
37532
37533
37534
37535
37536
37537
37538
37539
37540
37541
37542
37543
37544
37545
37546
37547
37548
37549
37550
37551
37552
37553
37554
37555
37556
37557
37558
37559
37560
37561
37562
37563
37564
37565
37566
37567
37568
37569
37570
37571
37572
37573
37574
37575
37576
37577
37578
37579
37580
37581
37582
37583
37584
37585
37586
37587
37588
37589
37590
37591
37592
37593
37594
37595
37596
37597
37598
37599
37600
37601
37602
37603
37604
37605
37606
37607
37608
37609
37610
37611
37612
37613
37614
37615
37616
37617
37618
37619
37620
37621
37622
37623
37624
37625
37626
37627
37628
37629
37630
37631
37632
37633
37634
37635
37636
37637
37638
37639
37640
37641
37642
37643
37644
37645
37646
37647
37648
37649
37650
37651
37652
37653
37654
37655
37656
37657
37658
37659
37660
37661
37662
37663
37664
37665
37666
37667
37668
37669
37670
37671
37672
37673
37674
37675
37676
37677
37678
37679
37680
37681
37682
37683
37684
37685
37686
37687
37688
37689
37690
37691
37692
37693
37694
37695
37696
37697
37698
37699
37700
37701
37702
37703
37704
37705
37706
37707
37708
37709
37710
37711
37712
37713
37714
37715
37716
37717
37718
37719
37720
37721
37722
37723
37724
37725
37726
37727
37728
37729
37730
37731
37732
37733
37734
37735
37736
37737
37738
37739
37740
37741
37742
37743
37744
37745
37746
37747
37748
37749
37750
37751
37752
37753
37754
37755
37756
37757
37758
37759
37760
37761
37762
37763
37764
37765
37766
37767
37768
37769
37770
37771
37772
37773
37774
37775
37776
37777
37778
37779
37780
37781
37782
37783
37784
37785
37786
37787
37788
37789
37790
37791
37792
37793
37794
37795
37796
37797
37798
37799
37800
37801
37802
37803
37804
37805
37806
37807
37808
37809
37810
37811
37812
37813
37814
37815
37816
37817
37818
37819
37820
37821
37822
37823
37824
37825
37826
37827
37828
37829
37830
37831
37832
37833
37834
37835
37836
37837
37838
37839
37840
37841
37842
37843
37844
37845
37846
37847
37848
37849
37850
37851
37852
37853
37854
37855
37856
37857
37858
37859
37860
37861
37862
37863
37864
37865
37866
37867
37868
37869
37870
37871
37872
37873
37874
37875
37876
37877
37878
37879
37880
37881
37882
37883
37884
37885
37886
37887
37888
37889
37890
37891
37892
37893
37894
37895
37896
37897
37898
37899
37900
37901
37902
37903
37904
37905
37906
37907
37908
37909
37910
37911
37912
37913
37914
37915
37916
37917
37918
37919
37920
37921
37922
37923
37924
37925
37926
37927
37928
37929
37930
37931
37932
37933
37934
37935
37936
37937
37938
37939
37940
37941
37942
37943
37944
37945
37946
37947
37948
37949
37950
37951
37952
37953
37954
37955
37956
37957
37958
37959
37960
37961
37962
37963
37964
37965
37966
37967
37968
37969
37970
37971
37972
37973
37974
37975
37976
37977
37978
37979
37980
37981
37982
37983
37984
37985
37986
37987
37988
37989
37990
37991
37992
37993
37994
37995
37996
37997
37998
37999
38000
38001
38002
38003
38004
38005
38006
38007
38008
38009
38010
38011
38012
38013
38014
38015
38016
38017
38018
38019
38020
38021
38022
38023
38024
38025
38026
38027
38028
38029
38030
38031
38032
38033
38034
38035
38036
38037
38038
38039
38040
38041
38042
38043
38044
38045
38046
38047
38048
38049
38050
38051
38052
38053
38054
38055
38056
38057
38058
38059
38060
38061
38062
38063
38064
38065
38066
38067
38068
38069
38070
38071
38072
38073
38074
38075
38076
38077
38078
38079
38080
38081
38082
38083
38084
38085
38086
38087
38088
38089
38090
38091
38092
38093
38094
38095
38096
38097
38098
38099
38100
38101
38102
38103
38104
38105
38106
38107
38108
38109
38110
38111
38112
38113
38114
38115
38116
38117
38118
38119
38120
38121
38122
38123
38124
38125
38126
38127
38128
38129
38130
38131
38132
38133
38134
38135
38136
38137
38138
38139
38140
38141
38142
38143
38144
38145
38146
38147
38148
38149
38150
38151
38152
38153
38154
38155
38156
38157
38158
38159
38160
38161
38162
38163
38164
38165
38166
38167
38168
38169
38170
38171
38172
38173
38174
38175
38176
38177
38178
38179
38180
38181
38182
38183
38184
38185
38186
38187
38188
38189
38190
38191
38192
38193
38194
38195
38196
38197
38198
38199
38200
38201
38202
38203
38204
38205
38206
38207
38208
38209
38210
38211
38212
38213
38214
38215
38216
38217
38218
38219
38220
38221
38222
38223
38224
38225
38226
38227
38228
38229
38230
38231
38232
38233
38234
38235
38236
38237
38238
38239
38240
38241
38242
38243
38244
38245
38246
38247
38248
38249
38250
38251
38252
38253
38254
38255
38256
38257
38258
38259
38260
38261
38262
38263
38264
38265
38266
38267
38268
38269
38270
38271
38272
38273
38274
38275
38276
38277
38278
38279
38280
38281
38282
38283
38284
38285
38286
38287
38288
38289
38290
38291
38292
38293
38294
38295
38296
38297
38298
38299
38300
38301
38302
38303
38304
38305
38306
38307
38308
38309
38310
38311
38312
38313
38314
38315
38316
38317
38318
38319
38320
38321
38322
38323
38324
38325
38326
38327
38328
38329
38330
38331
38332
38333
38334
38335
38336
38337
38338
38339
38340
38341
38342
38343
38344
38345
38346
38347
38348
38349
38350
38351
38352
38353
38354
38355
38356
38357
38358
38359
38360
38361
38362
38363
38364
38365
38366
38367
38368
38369
38370
38371
38372
38373
38374
38375
38376
38377
38378
38379
38380
38381
38382
38383
38384
38385
38386
38387
38388
38389
38390
38391
38392
38393
38394
38395
38396
38397
38398
38399
38400
38401
38402
38403
38404
38405
38406
38407
38408
38409
38410
38411
38412
38413
38414
38415
38416
38417
38418
38419
38420
38421
38422
38423
38424
38425
38426
38427
38428
38429
38430
38431
38432
38433
38434
38435
38436
38437
38438
38439
38440
38441
38442
38443
38444
38445
38446
38447
38448
38449
38450
38451
38452
38453
38454
38455
38456
38457
38458
38459
38460
38461
38462
38463
38464
38465
38466
38467
38468
38469
38470
38471
38472
38473
38474
38475
38476
38477
38478
38479
38480
38481
38482
38483
38484
38485
38486
38487
38488
38489
38490
38491
38492
38493
38494
38495
38496
38497
38498
38499
38500
38501
38502
38503
38504
38505
38506
38507
38508
38509
38510
38511
38512
38513
38514
38515
38516
38517
38518
38519
38520
38521
38522
38523
38524
38525
38526
38527
38528
38529
38530
38531
38532
38533
38534
38535
38536
38537
38538
38539
38540
38541
38542
38543
38544
38545
38546
38547
38548
38549
38550
38551
38552
38553
38554
38555
38556
38557
38558
38559
38560
38561
38562
38563
38564
38565
38566
38567
38568
38569
38570
38571
38572
38573
38574
38575
38576
38577
38578
38579
38580
38581
38582
38583
38584
38585
38586
38587
38588
38589
38590
38591
38592
38593
38594
38595
38596
38597
38598
38599
38600
38601
38602
38603
38604
38605
38606
38607
38608
38609
38610
38611
38612
38613
38614
38615
38616
38617
38618
38619
38620
38621
38622
38623
38624
38625
38626
38627
38628
38629
38630
38631
38632
38633
38634
38635
38636
38637
38638
38639
38640
38641
38642
38643
38644
38645
38646
38647
38648
38649
38650
38651
38652
38653
38654
38655
38656
38657
38658
38659
38660
38661
38662
38663
38664
38665
38666
38667
38668
38669
38670
38671
38672
38673
38674
38675
38676
38677
38678
38679
38680
38681
38682
38683
38684
38685
38686
38687
38688
38689
38690
38691
38692
38693
38694
38695
38696
38697
38698
38699
38700
38701
38702
38703
38704
38705
38706
38707
38708
38709
38710
38711
38712
38713
38714
38715
38716
38717
38718
38719
38720
38721
38722
38723
38724
38725
38726
38727
38728
38729
38730
38731
38732
38733
38734
38735
38736
38737
38738
38739
38740
38741
38742
38743
38744
38745
38746
38747
38748
38749
38750
38751
38752
38753
38754
38755
38756
38757
38758
38759
38760
38761
38762
38763
38764
38765
38766
38767
38768
38769
38770
38771
38772
38773
38774
38775
38776
38777
38778
38779
38780
38781
38782
38783
38784
38785
38786
38787
38788
38789
38790
38791
38792
38793
38794
38795
38796
38797
38798
38799
38800
38801
38802
38803
38804
38805
38806
38807
38808
38809
38810
38811
38812
38813
38814
38815
38816
38817
38818
38819
38820
38821
38822
38823
38824
38825
38826
38827
38828
38829
38830
38831
38832
38833
38834
38835
38836
38837
38838
38839
38840
38841
38842
38843
38844
38845
38846
38847
38848
38849
38850
38851
38852
38853
38854
38855
38856
38857
38858
38859
38860
38861
38862
38863
38864
38865
38866
38867
38868
38869
38870
38871
38872
38873
38874
38875
38876
38877
38878
38879
38880
38881
38882
38883
38884
38885
38886
38887
38888
38889
38890
38891
38892
38893
38894
38895
38896
38897
38898
38899
38900
38901
38902
38903
38904
38905
38906
38907
38908
38909
38910
38911
38912
38913
38914
38915
38916
38917
38918
38919
38920
38921
38922
38923
38924
38925
38926
38927
38928
38929
38930
38931
38932
38933
38934
38935
38936
38937
38938
38939
38940
38941
38942
38943
38944
38945
38946
38947
38948
38949
38950
38951
38952
38953
38954
38955
38956
38957
38958
38959
38960
38961
38962
38963
38964
38965
38966
38967
38968
38969
38970
38971
38972
38973
38974
38975
38976
38977
38978
38979
38980
38981
38982
38983
38984
38985
38986
38987
38988
38989
38990
38991
38992
38993
38994
38995
38996
38997
38998
38999
39000
39001
39002
39003
39004
39005
39006
39007
39008
39009
39010
39011
39012
39013
39014
39015
39016
39017
39018
39019
39020
39021
39022
39023
39024
39025
39026
39027
39028
39029
39030
39031
39032
39033
39034
39035
39036
39037
39038
39039
39040
39041
39042
39043
39044
39045
39046
39047
39048
39049
39050
39051
39052
39053
39054
39055
39056
39057
39058
39059
39060
39061
39062
39063
39064
39065
39066
39067
39068
39069
39070
39071
39072
39073
39074
39075
39076
39077
39078
39079
39080
39081
39082
39083
39084
39085
39086
39087
39088
39089
39090
39091
39092
39093
39094
39095
39096
39097
39098
39099
39100
39101
39102
39103
39104
39105
39106
39107
39108
39109
39110
39111
39112
39113
39114
39115
39116
39117
39118
39119
39120
39121
39122
39123
39124
39125
39126
39127
39128
39129
39130
39131
39132
39133
39134
39135
39136
39137
39138
39139
39140
39141
39142
39143
39144
39145
39146
39147
39148
39149
39150
39151
39152
39153
39154
39155
39156
39157
39158
39159
39160
39161
39162
39163
39164
39165
39166
39167
39168
39169
39170
39171
39172
39173
39174
39175
39176
39177
39178
39179
39180
39181
39182
39183
39184
39185
39186
39187
39188
39189
39190
39191
39192
39193
39194
39195
39196
39197
39198
39199
39200
39201
39202
39203
39204
39205
39206
39207
39208
39209
39210
39211
39212
39213
39214
39215
39216
39217
39218
39219
39220
39221
39222
39223
39224
39225
39226
39227
39228
39229
39230
39231
39232
39233
39234
39235
39236
39237
39238
39239
39240
39241
39242
39243
39244
39245
39246
39247
39248
39249
39250
39251
39252
39253
39254
39255
39256
39257
39258
39259
39260
39261
39262
39263
39264
39265
39266
39267
39268
39269
39270
39271
39272
39273
39274
39275
39276
39277
39278
39279
39280
39281
39282
39283
39284
39285
39286
39287
39288
39289
39290
39291
39292
39293
39294
39295
39296
39297
39298
39299
39300
39301
39302
39303
39304
39305
39306
39307
39308
39309
39310
39311
39312
39313
39314
39315
39316
39317
39318
39319
39320
39321
39322
39323
39324
39325
39326
39327
39328
39329
39330
39331
39332
39333
39334
39335
39336
39337
39338
39339
39340
39341
39342
39343
39344
39345
39346
39347
39348
39349
39350
39351
39352
39353
39354
39355
39356
39357
39358
39359
39360
39361
39362
39363
39364
39365
39366
39367
39368
39369
39370
39371
39372
39373
39374
39375
39376
39377
39378
39379
39380
39381
39382
39383
39384
39385
39386
39387
39388
39389
39390
39391
39392
39393
39394
39395
39396
39397
39398
39399
39400
39401
39402
39403
39404
39405
39406
39407
39408
39409
39410
39411
39412
39413
39414
39415
39416
39417
39418
39419
39420
39421
39422
39423
39424
39425
39426
39427
39428
39429
39430
39431
39432
39433
39434
39435
39436
39437
39438
39439
39440
39441
39442
39443
39444
39445
39446
39447
39448
39449
39450
39451
39452
39453
39454
39455
39456
39457
39458
39459
39460
39461
39462
39463
39464
39465
39466
39467
39468
39469
39470
39471
39472
39473
39474
39475
39476
39477
39478
39479
39480
39481
39482
39483
39484
39485
39486
39487
39488
39489
39490
39491
39492
39493
39494
39495
39496
39497
39498
39499
39500
39501
39502
39503
39504
39505
39506
39507
39508
39509
39510
39511
39512
39513
39514
39515
39516
39517
39518
39519
39520
39521
39522
39523
39524
39525
39526
39527
39528
39529
39530
39531
39532
39533
39534
39535
39536
39537
39538
39539
39540
39541
39542
39543
39544
39545
39546
39547
39548
39549
39550
39551
39552
39553
39554
39555
39556
39557
39558
39559
39560
39561
39562
39563
39564
39565
39566
39567
39568
39569
39570
39571
39572
39573
39574
39575
39576
39577
39578
39579
39580
39581
39582
39583
39584
39585
39586
39587
39588
39589
39590
39591
39592
39593
39594
39595
39596
39597
39598
39599
39600
39601
39602
39603
39604
39605
39606
39607
39608
39609
39610
39611
39612
39613
39614
39615
39616
39617
39618
39619
39620
39621
39622
39623
39624
39625
39626
39627
39628
39629
39630
39631
39632
39633
39634
39635
39636
39637
39638
39639
39640
39641
39642
39643
39644
39645
39646
39647
39648
39649
39650
39651
39652
39653
39654
39655
39656
39657
39658
39659
39660
39661
39662
39663
39664
39665
39666
39667
39668
39669
39670
39671
39672
39673
39674
39675
39676
39677
39678
39679
39680
39681
39682
39683
39684
39685
39686
39687
39688
39689
39690
39691
39692
39693
39694
39695
39696
39697
39698
39699
39700
39701
39702
39703
39704
39705
39706
39707
39708
39709
39710
39711
39712
39713
39714
39715
39716
39717
39718
39719
39720
39721
39722
39723
39724
39725
39726
39727
39728
39729
39730
39731
39732
39733
39734
39735
39736
39737
39738
39739
39740
39741
39742
39743
39744
39745
39746
39747
39748
39749
39750
39751
39752
39753
39754
39755
39756
39757
39758
39759
39760
39761
39762
39763
39764
39765
39766
39767
39768
39769
39770
39771
39772
39773
39774
39775
39776
39777
39778
39779
39780
39781
39782
39783
39784
39785
39786
39787
39788
39789
39790
39791
39792
39793
39794
39795
39796
39797
39798
39799
39800
39801
39802
39803
39804
39805
39806
39807
39808
39809
39810
39811
39812
39813
39814
39815
39816
39817
39818
39819
39820
39821
39822
39823
39824
39825
39826
39827
39828
39829
39830
39831
39832
39833
39834
39835
39836
39837
39838
39839
39840
39841
39842
39843
39844
39845
39846
39847
39848
39849
39850
39851
39852
39853
39854
39855
39856
39857
39858
39859
39860
39861
39862
39863
39864
39865
39866
39867
39868
39869
39870
39871
39872
39873
39874
39875
39876
39877
39878
39879
39880
39881
39882
39883
39884
39885
39886
39887
39888
39889
39890
39891
39892
39893
39894
39895
39896
39897
39898
39899
39900
39901
39902
39903
39904
39905
39906
39907
39908
39909
39910
39911
39912
39913
39914
39915
39916
39917
39918
39919
39920
39921
39922
39923
39924
39925
39926
39927
39928
39929
39930
39931
39932
39933
39934
39935
39936
39937
39938
39939
39940
39941
39942
39943
39944
39945
39946
39947
39948
39949
39950
39951
39952
39953
39954
39955
39956
39957
39958
39959
39960
39961
39962
39963
39964
39965
39966
39967
39968
39969
39970
39971
39972
39973
39974
39975
39976
39977
39978
39979
39980
39981
39982
39983
39984
39985
39986
39987
39988
39989
39990
39991
39992
39993
39994
39995
39996
39997
39998
39999
40000
40001
40002
40003
40004
40005
40006
40007
40008
40009
40010
40011
40012
40013
40014
40015
40016
40017
40018
40019
40020
40021
40022
40023
40024
40025
40026
40027
40028
40029
40030
40031
40032
40033
40034
40035
40036
40037
40038
40039
40040
40041
40042
40043
40044
40045
40046
40047
40048
40049
40050
40051
40052
40053
40054
40055
40056
40057
40058
40059
40060
40061
40062
40063
40064
40065
40066
40067
40068
40069
40070
40071
40072
40073
40074
40075
40076
40077
40078
40079
40080
40081
40082
40083
40084
40085
40086
40087
40088
40089
40090
40091
40092
40093
40094
40095
40096
40097
40098
40099
40100
40101
40102
40103
40104
40105
40106
40107
40108
40109
40110
40111
40112
40113
40114
40115
40116
40117
40118
40119
40120
40121
40122
40123
40124
40125
40126
40127
40128
40129
40130
40131
40132
40133
40134
40135
40136
40137
40138
40139
40140
40141
40142
40143
40144
40145
40146
40147
40148
40149
40150
40151
40152
40153
40154
40155
40156
40157
40158
40159
40160
40161
40162
40163
40164
40165
40166
40167
40168
40169
40170
40171
40172
40173
40174
40175
40176
40177
40178
40179
40180
40181
40182
40183
40184
40185
40186
40187
40188
40189
40190
40191
40192
40193
40194
40195
40196
40197
40198
40199
40200
40201
40202
40203
40204
40205
40206
40207
40208
40209
40210
40211
40212
40213
40214
40215
40216
40217
40218
40219
40220
40221
40222
40223
40224
40225
40226
40227
40228
40229
40230
40231
40232
40233
40234
40235
40236
40237
40238
40239
40240
40241
40242
40243
40244
40245
40246
40247
40248
40249
40250
40251
40252
40253
40254
40255
40256
40257
40258
40259
40260
40261
40262
40263
40264
40265
40266
40267
40268
40269
40270
40271
40272
40273
40274
40275
40276
40277
40278
40279
40280
40281
40282
40283
40284
40285
40286
40287
40288
40289
40290
40291
40292
40293
40294
40295
40296
40297
40298
40299
40300
40301
40302
40303
40304
40305
40306
40307
40308
40309
40310
40311
40312
40313
40314
40315
40316
40317
40318
40319
40320
40321
40322
40323
40324
40325
40326
40327
40328
40329
40330
40331
40332
40333
40334
40335
40336
40337
40338
40339
40340
40341
40342
40343
40344
40345
40346
40347
40348
40349
40350
40351
40352
40353
40354
40355
40356
40357
40358
40359
40360
40361
40362
40363
40364
40365
40366
40367
40368
40369
40370
40371
40372
40373
40374
40375
40376
40377
40378
40379
40380
40381
40382
40383
40384
40385
40386
40387
40388
40389
40390
40391
40392
40393
40394
40395
40396
40397
40398
40399
40400
40401
40402
40403
40404
40405
40406
40407
40408
40409
40410
40411
40412
40413
40414
40415
40416
40417
40418
40419
40420
40421
40422
40423
40424
40425
40426
40427
40428
40429
40430
40431
40432
40433
40434
40435
40436
40437
40438
40439
40440
40441
40442
40443
40444
40445
40446
40447
40448
40449
40450
40451
40452
40453
40454
40455
40456
40457
40458
40459
40460
40461
40462
40463
40464
40465
40466
40467
40468
40469
40470
40471
40472
40473
40474
40475
40476
40477
40478
40479
40480
40481
40482
40483
40484
40485
40486
40487
40488
40489
40490
40491
40492
40493
40494
40495
40496
40497
40498
40499
40500
40501
40502
40503
40504
40505
40506
40507
40508
40509
40510
40511
40512
40513
40514
40515
40516
40517
40518
40519
40520
40521
40522
40523
40524
40525
40526
40527
40528
40529
40530
40531
40532
40533
40534
40535
40536
40537
40538
40539
40540
40541
40542
40543
40544
40545
40546
40547
40548
40549
40550
40551
40552
40553
40554
40555
40556
40557
40558
40559
40560
40561
40562
40563
40564
40565
40566
40567
40568
40569
40570
40571
40572
40573
40574
40575
40576
40577
40578
40579
40580
40581
40582
40583
40584
40585
40586
40587
40588
40589
40590
40591
40592
40593
40594
40595
40596
40597
40598
40599
40600
40601
40602
40603
40604
40605
40606
40607
40608
40609
40610
40611
40612
40613
40614
40615
40616
40617
40618
40619
40620
40621
40622
40623
40624
40625
40626
40627
40628
40629
40630
40631
40632
40633
40634
40635
40636
40637
40638
40639
40640
40641
40642
40643
40644
40645
40646
40647
40648
40649
40650
40651
40652
40653
40654
40655
40656
40657
40658
40659
40660
40661
40662
40663
40664
40665
40666
40667
40668
40669
40670
40671
40672
40673
40674
40675
40676
40677
40678
40679
40680
40681
40682
40683
40684
40685
40686
40687
40688
40689
40690
40691
40692
40693
40694
40695
40696
40697
40698
40699
40700
40701
40702
40703
40704
40705
40706
40707
40708
40709
40710
40711
40712
40713
40714
40715
40716
40717
40718
40719
40720
40721
40722
40723
40724
40725
40726
40727
40728
40729
40730
40731
40732
40733
40734
40735
40736
40737
40738
40739
40740
40741
40742
40743
40744
40745
40746
40747
40748
40749
40750
40751
40752
40753
40754
40755
40756
40757
40758
40759
40760
40761
40762
40763
40764
40765
40766
40767
40768
40769
40770
40771
40772
40773
40774
40775
40776
40777
40778
40779
40780
40781
40782
40783
40784
40785
40786
40787
40788
40789
40790
40791
40792
40793
40794
40795
40796
40797
40798
40799
40800
40801
40802
40803
40804
40805
40806
40807
40808
40809
40810
40811
40812
40813
40814
40815
40816
40817
40818
40819
40820
40821
40822
40823
40824
40825
40826
40827
40828
40829
40830
40831
40832
40833
40834
40835
40836
40837
40838
40839
40840
40841
40842
40843
40844
40845
40846
40847
40848
40849
40850
40851
40852
40853
40854
40855
40856
40857
40858
40859
40860
40861
40862
40863
40864
40865
40866
40867
40868
40869
40870
40871
40872
40873
40874
40875
40876
40877
40878
40879
40880
40881
40882
40883
40884
40885
40886
40887
40888
40889
40890
40891
40892
40893
40894
40895
40896
40897
40898
40899
40900
40901
40902
40903
40904
40905
40906
40907
40908
40909
40910
40911
40912
40913
40914
40915
40916
40917
40918
40919
40920
40921
40922
40923
40924
40925
40926
40927
40928
40929
40930
40931
40932
40933
40934
40935
40936
40937
40938
40939
40940
40941
40942
40943
40944
40945
40946
40947
40948
40949
40950
40951
40952
40953
40954
40955
40956
40957
40958
40959
40960
40961
40962
40963
40964
40965
40966
40967
40968
40969
40970
40971
40972
40973
40974
40975
40976
40977
40978
40979
40980
40981
40982
40983
40984
40985
40986
40987
40988
40989
40990
40991
40992
40993
40994
40995
40996
40997
40998
40999
41000
41001
41002
41003
41004
41005
41006
41007
41008
41009
41010
41011
41012
41013
41014
41015
41016
41017
41018
41019
41020
41021
41022
41023
41024
41025
41026
41027
41028
41029
41030
41031
41032
41033
41034
41035
41036
41037
41038
41039
41040
41041
41042
41043
41044
41045
41046
41047
41048
41049
41050
41051
41052
41053
41054
41055
41056
41057
41058
41059
41060
41061
41062
41063
41064
41065
41066
41067
41068
41069
41070
41071
41072
41073
41074
41075
41076
41077
41078
41079
41080
41081
41082
41083
41084
41085
41086
41087
41088
41089
41090
41091
41092
41093
41094
41095
41096
41097
41098
41099
41100
41101
41102
41103
41104
41105
41106
41107
41108
41109
41110
41111
41112
41113
41114
41115
41116
41117
41118
41119
41120
41121
41122
41123
41124
41125
41126
41127
41128
41129
41130
41131
41132
41133
41134
41135
41136
41137
41138
41139
41140
41141
41142
41143
41144
41145
41146
41147
41148
41149
41150
41151
41152
41153
41154
41155
41156
41157
41158
41159
41160
41161
41162
41163
41164
41165
41166
41167
41168
41169
41170
41171
41172
41173
41174
41175
41176
41177
41178
41179
41180
41181
41182
41183
41184
41185
41186
41187
41188
41189
41190
41191
41192
41193
41194
41195
41196
41197
41198
41199
41200
41201
41202
41203
41204
41205
41206
41207
41208
41209
41210
41211
41212
41213
41214
41215
41216
41217
41218
41219
41220
41221
41222
41223
41224
41225
41226
41227
41228
41229
41230
41231
41232
41233
41234
41235
41236
41237
41238
41239
41240
41241
41242
41243
41244
41245
41246
41247
41248
41249
41250
41251
41252
41253
41254
41255
41256
41257
41258
41259
41260
41261
41262
41263
41264
41265
41266
41267
41268
41269
41270
41271
41272
41273
41274
41275
41276
41277
41278
41279
41280
41281
41282
41283
41284
41285
41286
41287
41288
41289
41290
41291
41292
41293
41294
41295
41296
41297
41298
41299
41300
41301
41302
41303
41304
41305
41306
41307
41308
41309
41310
41311
41312
41313
41314
41315
41316
41317
41318
41319
41320
41321
41322
41323
41324
41325
41326
41327
41328
41329
41330
41331
41332
41333
41334
41335
41336
41337
41338
41339
41340
41341
41342
41343
41344
41345
41346
41347
41348
41349
41350
41351
41352
41353
41354
41355
41356
41357
41358
41359
41360
41361
41362
41363
41364
41365
41366
41367
41368
41369
41370
41371
41372
41373
41374
41375
41376
41377
41378
41379
41380
41381
41382
41383
41384
41385
41386
41387
41388
41389
41390
41391
41392
41393
41394
41395
41396
41397
41398
41399
41400
41401
41402
41403
41404
41405
41406
41407
41408
41409
41410
41411
41412
41413
41414
41415
41416
41417
41418
41419
41420
41421
41422
41423
41424
41425
41426
41427
41428
41429
41430
41431
41432
41433
41434
41435
41436
41437
41438
41439
41440
41441
41442
41443
41444
41445
41446
41447
41448
41449
41450
41451
41452
41453
41454
41455
41456
41457
41458
41459
41460
41461
41462
41463
41464
41465
41466
41467
41468
41469
41470
41471
41472
41473
41474
41475
41476
41477
41478
41479
41480
41481
41482
41483
41484
41485
41486
41487
41488
41489
41490
41491
41492
41493
41494
41495
41496
41497
41498
41499
41500
41501
41502
41503
41504
41505
41506
41507
41508
41509
41510
41511
41512
41513
41514
41515
41516
41517
41518
41519
41520
41521
41522
41523
41524
41525
41526
41527
41528
41529
41530
41531
41532
41533
41534
41535
41536
41537
41538
41539
41540
41541
41542
41543
41544
41545
41546
41547
41548
41549
41550
41551
41552
41553
41554
41555
41556
41557
41558
41559
41560
41561
41562
41563
41564
41565
41566
41567
41568
41569
41570
41571
41572
41573
41574
41575
41576
41577
41578
41579
41580
41581
41582
41583
41584
41585
41586
41587
41588
41589
41590
41591
41592
41593
41594
41595
41596
41597
41598
41599
41600
41601
41602
41603
41604
41605
41606
41607
41608
41609
41610
41611
41612
41613
41614
41615
41616
41617
41618
41619
41620
41621
41622
41623
41624
41625
41626
41627
41628
41629
41630
41631
41632
41633
41634
41635
41636
41637
41638
41639
41640
41641
41642
41643
41644
41645
41646
41647
41648
41649
41650
41651
41652
41653
41654
41655
41656
41657
41658
41659
41660
41661
41662
41663
41664
41665
41666
41667
41668
41669
41670
41671
41672
41673
41674
41675
41676
41677
41678
41679
41680
41681
41682
41683
41684
41685
41686
41687
41688
41689
41690
41691
41692
41693
41694
41695
41696
41697
41698
41699
41700
41701
41702
41703
41704
41705
41706
41707
41708
41709
41710
41711
41712
41713
41714
41715
41716
41717
41718
41719
41720
41721
41722
41723
41724
41725
41726
41727
41728
41729
41730
41731
41732
41733
41734
41735
41736
41737
41738
41739
41740
41741
41742
41743
41744
41745
41746
41747
41748
41749
41750
41751
41752
41753
41754
41755
41756
41757
41758
41759
41760
41761
41762
41763
41764
41765
41766
41767
41768
41769
41770
41771
41772
41773
41774
41775
41776
41777
41778
41779
41780
41781
41782
41783
41784
41785
41786
41787
41788
41789
41790
41791
41792
41793
41794
41795
41796
41797
41798
41799
41800
41801
41802
41803
41804
41805
41806
41807
41808
41809
41810
41811
41812
41813
41814
41815
41816
41817
41818
41819
41820
41821
41822
41823
41824
41825
41826
41827
41828
41829
41830
41831
41832
41833
41834
41835
41836
41837
41838
41839
41840
41841
41842
41843
41844
41845
41846
41847
41848
41849
41850
41851
41852
41853
41854
41855
41856
41857
41858
41859
41860
41861
41862
41863
41864
41865
41866
41867
41868
41869
41870
41871
41872
41873
41874
41875
41876
41877
41878
41879
41880
41881
41882
41883
41884
41885
41886
41887
41888
41889
41890
41891
41892
41893
41894
41895
41896
41897
41898
41899
41900
41901
41902
41903
41904
41905
41906
41907
41908
41909
41910
41911
41912
41913
41914
41915
41916
41917
41918
41919
41920
41921
41922
41923
41924
41925
41926
41927
41928
41929
41930
41931
41932
41933
41934
41935
41936
41937
41938
41939
41940
41941
41942
41943
41944
41945
41946
41947
41948
41949
41950
41951
41952
41953
41954
41955
41956
41957
41958
41959
41960
41961
41962
41963
41964
41965
41966
41967
41968
41969
41970
41971
41972
41973
41974
41975
41976
41977
41978
41979
41980
41981
41982
41983
41984
41985
41986
41987
41988
41989
41990
41991
41992
41993
41994
41995
41996
41997
41998
41999
42000
42001
42002
42003
42004
42005
42006
42007
42008
42009
42010
42011
42012
42013
42014
42015
42016
42017
42018
42019
42020
42021
42022
42023
42024
42025
42026
42027
42028
42029
42030
42031
42032
42033
42034
42035
42036
42037
42038
42039
42040
42041
42042
42043
42044
42045
42046
42047
42048
42049
42050
42051
42052
42053
42054
42055
42056
42057
42058
42059
42060
42061
42062
42063
42064
42065
42066
42067
42068
42069
42070
42071
42072
42073
42074
42075
42076
42077
42078
42079
42080
42081
42082
42083
42084
42085
42086
42087
42088
42089
42090
42091
42092
42093
42094
42095
42096
42097
42098
42099
42100
42101
42102
42103
42104
42105
42106
42107
42108
42109
42110
42111
42112
42113
42114
42115
42116
42117
42118
42119
42120
42121
42122
42123
42124
42125
42126
42127
42128
42129
42130
42131
42132
42133
42134
42135
42136
42137
42138
42139
42140
42141
42142
42143
42144
42145
42146
42147
42148
42149
42150
42151
42152
42153
42154
42155
42156
42157
42158
42159
42160
42161
42162
42163
42164
42165
42166
42167
42168
42169
42170
42171
42172
42173
42174
42175
42176
42177
42178
42179
42180
42181
42182
42183
42184
42185
42186
42187
42188
42189
42190
42191
42192
42193
42194
42195
42196
42197
42198
42199
42200
42201
42202
42203
42204
42205
42206
42207
42208
42209
42210
42211
42212
42213
42214
42215
42216
42217
42218
42219
42220
42221
42222
42223
42224
42225
42226
42227
42228
42229
42230
42231
42232
42233
42234
42235
42236
42237
42238
42239
42240
42241
42242
42243
42244
42245
42246
42247
42248
42249
42250
42251
42252
42253
42254
42255
42256
42257
42258
42259
42260
42261
42262
42263
42264
42265
42266
42267
42268
42269
42270
42271
42272
42273
42274
42275
42276
42277
42278
42279
42280
42281
42282
42283
42284
42285
42286
42287
42288
42289
42290
42291
42292
42293
42294
42295
42296
42297
42298
42299
42300
42301
42302
42303
42304
42305
42306
42307
42308
42309
42310
42311
42312
42313
42314
42315
42316
42317
42318
42319
42320
42321
42322
42323
42324
42325
42326
42327
42328
42329
42330
42331
42332
42333
42334
42335
42336
42337
42338
42339
42340
42341
42342
42343
42344
42345
42346
42347
42348
42349
42350
42351
42352
42353
42354
42355
42356
42357
42358
42359
42360
42361
42362
42363
42364
42365
42366
42367
42368
42369
42370
42371
42372
42373
42374
42375
42376
42377
42378
42379
42380
42381
42382
42383
42384
42385
42386
42387
42388
42389
42390
42391
42392
42393
42394
42395
42396
42397
42398
42399
42400
42401
42402
42403
42404
42405
42406
42407
42408
42409
42410
42411
42412
42413
42414
42415
42416
42417
42418
42419
42420
42421
42422
42423
42424
42425
42426
42427
42428
42429
42430
42431
42432
42433
42434
42435
42436
42437
42438
42439
42440
42441
42442
42443
42444
42445
42446
42447
42448
42449
42450
42451
42452
42453
42454
42455
42456
42457
42458
42459
42460
42461
42462
42463
42464
42465
42466
42467
42468
42469
42470
42471
42472
42473
42474
42475
42476
42477
42478
42479
42480
42481
42482
42483
42484
42485
42486
42487
42488
42489
42490
42491
42492
42493
42494
42495
42496
42497
42498
42499
42500
42501
42502
42503
42504
42505
42506
42507
42508
42509
42510
42511
42512
42513
42514
42515
42516
42517
42518
42519
42520
42521
42522
42523
42524
42525
42526
42527
42528
42529
42530
42531
42532
42533
42534
42535
42536
42537
42538
42539
42540
42541
42542
42543
42544
42545
42546
42547
42548
42549
42550
42551
42552
42553
42554
42555
42556
42557
42558
42559
42560
42561
42562
42563
42564
42565
42566
42567
42568
42569
42570
42571
42572
42573
42574
42575
42576
42577
42578
42579
42580
42581
42582
42583
42584
42585
42586
42587
42588
42589
42590
42591
42592
42593
42594
42595
42596
42597
42598
42599
42600
42601
42602
42603
42604
42605
42606
42607
42608
42609
42610
42611
42612
42613
42614
42615
42616
42617
42618
42619
42620
42621
42622
42623
42624
42625
42626
42627
42628
42629
42630
42631
42632
42633
42634
42635
42636
42637
42638
42639
42640
42641
42642
42643
42644
42645
42646
42647
42648
42649
42650
42651
42652
42653
42654
42655
42656
42657
42658
42659
42660
42661
42662
42663
42664
42665
42666
42667
42668
42669
42670
42671
42672
42673
42674
42675
42676
42677
42678
42679
42680
42681
42682
42683
42684
42685
42686
42687
42688
42689
42690
42691
42692
42693
42694
42695
42696
42697
42698
42699
42700
42701
42702
42703
42704
42705
42706
42707
42708
42709
42710
42711
42712
42713
42714
42715
42716
42717
42718
42719
42720
42721
42722
42723
42724
42725
42726
42727
42728
42729
42730
42731
42732
42733
42734
42735
42736
42737
42738
42739
42740
42741
42742
42743
42744
42745
42746
42747
42748
42749
42750
42751
42752
42753
42754
42755
42756
42757
42758
42759
42760
42761
42762
42763
42764
42765
42766
42767
42768
42769
42770
42771
42772
42773
42774
42775
42776
42777
42778
42779
42780
42781
42782
42783
42784
42785
42786
42787
42788
42789
42790
42791
42792
42793
42794
42795
42796
42797
42798
42799
42800
42801
42802
42803
42804
42805
42806
42807
42808
42809
42810
42811
42812
42813
42814
42815
42816
42817
42818
42819
42820
42821
42822
42823
42824
42825
42826
42827
42828
42829
42830
42831
42832
42833
42834
42835
42836
42837
42838
42839
42840
42841
42842
42843
42844
42845
42846
42847
42848
42849
42850
42851
42852
42853
42854
42855
42856
42857
42858
42859
42860
42861
42862
42863
42864
42865
42866
42867
42868
42869
42870
42871
42872
42873
42874
42875
42876
42877
42878
42879
42880
42881
42882
42883
42884
42885
42886
42887
42888
42889
42890
42891
42892
42893
42894
42895
42896
42897
42898
42899
42900
42901
42902
42903
42904
42905
42906
42907
42908
42909
42910
42911
42912
42913
42914
42915
42916
42917
42918
42919
42920
42921
42922
42923
42924
42925
42926
42927
42928
42929
42930
42931
42932
42933
42934
42935
42936
42937
42938
42939
42940
42941
42942
42943
42944
42945
42946
42947
42948
42949
42950
42951
42952
42953
42954
42955
42956
42957
42958
42959
42960
42961
42962
42963
42964
42965
42966
42967
42968
42969
42970
42971
42972
42973
42974
42975
42976
42977
42978
42979
42980
42981
42982
42983
42984
42985
42986
42987
42988
42989
42990
42991
42992
42993
42994
42995
42996
42997
42998
42999
43000
43001
43002
43003
43004
43005
43006
43007
43008
43009
43010
43011
43012
43013
43014
43015
43016
43017
43018
43019
43020
43021
43022
43023
43024
43025
43026
43027
43028
43029
43030
43031
43032
43033
43034
43035
43036
43037
43038
43039
43040
43041
43042
43043
43044
43045
43046
43047
43048
43049
43050
43051
43052
43053
43054
43055
43056
43057
43058
43059
43060
43061
43062
43063
43064
43065
43066
43067
43068
43069
43070
43071
43072
43073
43074
43075
43076
43077
43078
43079
43080
43081
43082
43083
43084
43085
43086
43087
43088
43089
43090
43091
43092
43093
43094
43095
43096
43097
43098
43099
43100
43101
43102
43103
43104
43105
43106
43107
43108
43109
43110
43111
43112
43113
43114
43115
43116
43117
43118
43119
43120
43121
43122
43123
43124
43125
43126
43127
43128
43129
43130
43131
43132
43133
43134
43135
43136
43137
43138
43139
43140
43141
43142
43143
43144
43145
43146
43147
43148
43149
43150
43151
43152
43153
43154
43155
43156
43157
43158
43159
43160
43161
43162
43163
43164
43165
43166
43167
43168
43169
43170
43171
43172
43173
43174
43175
43176
43177
43178
43179
43180
43181
43182
43183
43184
43185
43186
43187
43188
43189
43190
43191
43192
43193
43194
43195
43196
43197
43198
43199
43200
43201
43202
43203
43204
43205
43206
43207
43208
43209
43210
43211
43212
43213
43214
43215
43216
43217
43218
43219
43220
43221
43222
43223
43224
43225
43226
43227
43228
43229
43230
43231
43232
43233
43234
43235
43236
43237
43238
43239
43240
43241
43242
43243
43244
43245
43246
43247
43248
43249
43250
43251
43252
43253
43254
43255
43256
43257
43258
43259
43260
43261
43262
43263
43264
43265
43266
43267
43268
43269
43270
43271
43272
43273
43274
43275
43276
43277
43278
43279
43280
43281
43282
43283
43284
43285
43286
43287
43288
43289
43290
43291
43292
43293
43294
43295
43296
43297
43298
43299
43300
43301
43302
43303
43304
43305
43306
43307
43308
43309
43310
43311
43312
43313
43314
43315
43316
43317
43318
43319
43320
43321
43322
43323
43324
43325
43326
43327
43328
43329
43330
43331
43332
43333
43334
43335
43336
43337
43338
43339
43340
43341
43342
43343
43344
43345
43346
43347
43348
43349
43350
43351
43352
43353
43354
43355
43356
43357
43358
43359
43360
43361
43362
43363
43364
43365
43366
43367
43368
43369
43370
43371
43372
43373
43374
43375
43376
43377
43378
43379
43380
43381
43382
43383
43384
43385
43386
43387
43388
43389
43390
43391
43392
43393
43394
43395
43396
43397
43398
43399
43400
43401
43402
43403
43404
43405
43406
43407
43408
43409
43410
43411
43412
43413
43414
43415
43416
43417
43418
43419
43420
43421
43422
43423
43424
43425
43426
43427
43428
43429
43430
43431
43432
43433
43434
43435
43436
43437
43438
43439
43440
43441
43442
43443
43444
43445
43446
43447
43448
43449
43450
43451
43452
43453
43454
43455
43456
43457
43458
43459
43460
43461
43462
43463
43464
43465
43466
43467
43468
43469
43470
43471
43472
43473
43474
43475
43476
43477
43478
43479
43480
43481
43482
43483
43484
43485
43486
43487
43488
43489
43490
43491
43492
43493
43494
43495
43496
43497
43498
43499
43500
43501
43502
43503
43504
43505
43506
43507
43508
43509
43510
43511
43512
43513
43514
43515
43516
43517
43518
43519
43520
43521
43522
43523
43524
43525
43526
43527
43528
43529
43530
43531
43532
43533
43534
43535
43536
43537
43538
43539
43540
43541
43542
43543
43544
43545
43546
43547
43548
43549
43550
43551
43552
43553
43554
43555
43556
43557
43558
43559
43560
43561
43562
43563
43564
43565
43566
43567
43568
43569
43570
43571
43572
43573
43574
43575
43576
43577
43578
43579
43580
43581
43582
43583
43584
43585
43586
43587
43588
43589
43590
43591
43592
43593
43594
43595
43596
43597
43598
43599
43600
43601
43602
43603
43604
43605
43606
43607
43608
43609
43610
43611
43612
43613
43614
43615
43616
43617
43618
43619
43620
43621
43622
43623
43624
43625
43626
43627
43628
43629
43630
43631
43632
43633
43634
43635
43636
43637
43638
43639
43640
43641
43642
43643
43644
43645
43646
43647
43648
43649
43650
43651
43652
43653
43654
43655
43656
43657
43658
43659
43660
43661
43662
43663
43664
43665
43666
43667
43668
43669
43670
43671
43672
43673
43674
43675
43676
43677
43678
43679
43680
43681
43682
43683
43684
43685
43686
43687
43688
43689
43690
43691
43692
43693
43694
43695
43696
43697
43698
43699
43700
43701
43702
43703
43704
43705
43706
43707
43708
43709
43710
43711
43712
43713
43714
43715
43716
43717
43718
43719
43720
43721
43722
43723
43724
43725
43726
43727
43728
43729
43730
43731
43732
43733
43734
43735
43736
43737
43738
43739
43740
43741
43742
43743
43744
43745
43746
43747
43748
43749
43750
43751
43752
43753
43754
43755
43756
43757
43758
43759
43760
43761
43762
43763
43764
43765
43766
43767
43768
43769
43770
43771
43772
43773
43774
43775
43776
43777
43778
43779
43780
43781
43782
43783
43784
43785
43786
43787
43788
43789
43790
43791
43792
43793
43794
43795
43796
43797
43798
43799
43800
43801
43802
43803
43804
43805
43806
43807
43808
43809
43810
43811
43812
43813
43814
43815
43816
43817
43818
43819
43820
43821
43822
43823
43824
43825
43826
43827
43828
43829
43830
43831
43832
43833
43834
43835
43836
43837
43838
43839
43840
43841
43842
43843
43844
43845
43846
43847
43848
43849
43850
43851
43852
43853
43854
43855
43856
43857
43858
43859
43860
43861
43862
43863
43864
43865
43866
43867
43868
43869
43870
43871
43872
43873
43874
43875
43876
43877
43878
43879
43880
43881
43882
43883
43884
43885
43886
43887
43888
43889
43890
43891
43892
43893
43894
43895
43896
43897
43898
43899
43900
43901
43902
43903
43904
43905
43906
43907
43908
43909
43910
43911
43912
43913
43914
43915
43916
43917
43918
43919
43920
43921
43922
43923
43924
43925
43926
43927
43928
43929
43930
43931
43932
43933
43934
43935
43936
43937
43938
43939
43940
43941
43942
43943
43944
43945
43946
43947
43948
43949
43950
43951
43952
43953
43954
43955
43956
43957
43958
43959
43960
43961
43962
43963
43964
43965
43966
43967
43968
43969
43970
43971
43972
43973
43974
43975
43976
43977
43978
43979
43980
43981
43982
43983
43984
43985
43986
43987
43988
43989
43990
43991
43992
43993
43994
43995
43996
43997
43998
43999
44000
44001
44002
44003
44004
44005
44006
44007
44008
44009
44010
44011
44012
44013
44014
44015
44016
44017
44018
44019
44020
44021
44022
44023
44024
44025
44026
44027
44028
44029
44030
44031
44032
44033
44034
44035
44036
44037
44038
44039
44040
44041
44042
44043
44044
44045
44046
44047
44048
44049
44050
44051
44052
44053
44054
44055
44056
44057
44058
44059
44060
44061
44062
44063
44064
44065
44066
44067
44068
44069
44070
44071
44072
44073
44074
44075
44076
44077
44078
44079
44080
44081
44082
44083
44084
44085
44086
44087
44088
44089
44090
44091
44092
44093
44094
44095
44096
44097
44098
44099
44100
44101
44102
44103
44104
44105
44106
44107
44108
44109
44110
44111
44112
44113
44114
44115
44116
44117
44118
44119
44120
44121
44122
44123
44124
44125
44126
44127
44128
44129
44130
44131
44132
44133
44134
44135
44136
44137
44138
44139
44140
44141
44142
44143
44144
44145
44146
44147
44148
44149
44150
44151
44152
44153
44154
44155
44156
44157
44158
44159
44160
44161
44162
44163
44164
44165
44166
44167
44168
44169
44170
44171
44172
44173
44174
44175
44176
44177
44178
44179
44180
44181
44182
44183
44184
44185
44186
44187
44188
44189
44190
44191
44192
44193
44194
44195
44196
44197
44198
44199
44200
44201
44202
44203
44204
44205
44206
44207
44208
44209
44210
44211
44212
44213
44214
44215
44216
44217
44218
44219
44220
44221
44222
44223
44224
44225
44226
44227
44228
44229
44230
44231
44232
44233
44234
44235
44236
44237
44238
44239
44240
44241
44242
44243
44244
44245
44246
44247
44248
44249
44250
44251
44252
44253
44254
44255
44256
44257
44258
44259
44260
44261
44262
44263
44264
44265
44266
44267
44268
44269
44270
44271
44272
44273
44274
44275
44276
44277
44278
44279
44280
44281
44282
44283
44284
44285
44286
44287
44288
44289
44290
44291
44292
44293
44294
44295
44296
44297
44298
44299
44300
44301
44302
44303
44304
44305
44306
44307
44308
44309
44310
44311
44312
44313
44314
44315
44316
44317
44318
44319
44320
44321
44322
44323
44324
44325
44326
44327
44328
44329
44330
44331
44332
44333
44334
44335
44336
44337
44338
44339
44340
44341
44342
44343
44344
44345
44346
44347
44348
44349
44350
44351
44352
44353
44354
44355
44356
44357
44358
44359
44360
44361
44362
44363
44364
44365
44366
44367
44368
44369
44370
44371
44372
44373
44374
44375
44376
44377
44378
44379
44380
44381
44382
44383
44384
44385
44386
44387
44388
44389
44390
44391
44392
44393
44394
44395
44396
44397
44398
44399
44400
44401
44402
44403
44404
44405
44406
44407
44408
44409
44410
44411
44412
44413
44414
44415
44416
44417
44418
44419
44420
44421
44422
44423
44424
44425
44426
44427
44428
44429
44430
44431
44432
44433
44434
44435
44436
44437
44438
44439
44440
44441
44442
44443
44444
44445
44446
44447
44448
44449
44450
44451
44452
44453
44454
44455
44456
44457
44458
44459
44460
44461
44462
44463
44464
44465
44466
44467
44468
44469
44470
44471
44472
44473
44474
44475
44476
44477
44478
44479
44480
44481
44482
44483
44484
44485
44486
44487
44488
44489
44490
44491
44492
44493
44494
44495
44496
44497
44498
44499
44500
44501
44502
44503
44504
44505
44506
44507
44508
44509
44510
44511
44512
44513
44514
44515
44516
44517
44518
44519
44520
44521
44522
44523
44524
44525
44526
44527
44528
44529
44530
44531
44532
44533
44534
44535
44536
44537
44538
44539
44540
44541
44542
44543
44544
44545
44546
44547
44548
44549
44550
44551
44552
44553
44554
44555
44556
44557
44558
44559
44560
44561
44562
44563
44564
44565
44566
44567
44568
44569
44570
44571
44572
44573
44574
44575
44576
44577
44578
44579
44580
44581
44582
44583
44584
44585
44586
44587
44588
44589
44590
44591
44592
44593
44594
44595
44596
44597
44598
44599
44600
44601
44602
44603
44604
44605
44606
44607
44608
44609
44610
44611
44612
44613
44614
44615
44616
44617
44618
44619
44620
44621
44622
44623
44624
44625
44626
44627
44628
44629
44630
44631
44632
44633
44634
44635
44636
44637
44638
44639
44640
44641
44642
44643
44644
44645
44646
44647
44648
44649
44650
44651
44652
44653
44654
44655
44656
44657
44658
44659
44660
44661
44662
44663
44664
44665
44666
44667
44668
44669
44670
44671
44672
44673
44674
44675
44676
44677
44678
44679
44680
44681
44682
44683
44684
44685
44686
44687
44688
44689
44690
44691
44692
44693
44694
44695
44696
44697
44698
44699
44700
44701
44702
44703
44704
44705
44706
44707
44708
44709
44710
44711
44712
44713
44714
44715
44716
44717
44718
44719
44720
44721
44722
44723
44724
44725
44726
44727
44728
44729
44730
44731
44732
44733
44734
44735
44736
44737
44738
44739
44740
44741
44742
44743
44744
44745
44746
44747
44748
44749
44750
44751
44752
44753
44754
44755
44756
44757
44758
44759
44760
44761
44762
44763
44764
44765
44766
44767
44768
44769
44770
44771
44772
44773
44774
44775
44776
44777
44778
44779
44780
44781
44782
44783
44784
44785
44786
44787
44788
44789
44790
44791
44792
44793
44794
44795
44796
44797
44798
44799
44800
44801
44802
44803
44804
44805
44806
44807
44808
44809
44810
44811
44812
44813
44814
44815
44816
44817
44818
44819
44820
44821
44822
44823
44824
44825
44826
44827
44828
44829
44830
44831
44832
44833
44834
44835
44836
44837
44838
44839
44840
44841
44842
44843
44844
44845
44846
44847
44848
44849
44850
44851
44852
44853
44854
44855
44856
44857
44858
44859
44860
44861
44862
44863
44864
44865
44866
44867
44868
44869
44870
44871
44872
44873
44874
44875
44876
44877
44878
44879
44880
44881
44882
44883
44884
44885
44886
44887
44888
44889
44890
44891
44892
44893
44894
44895
44896
44897
44898
44899
44900
44901
44902
44903
44904
44905
44906
44907
44908
44909
44910
44911
44912
44913
44914
44915
44916
44917
44918
44919
44920
44921
44922
44923
44924
44925
44926
44927
44928
44929
44930
44931
44932
44933
44934
44935
44936
44937
44938
44939
44940
44941
44942
44943
44944
44945
44946
44947
44948
44949
44950
44951
44952
44953
44954
44955
44956
44957
44958
44959
44960
44961
44962
44963
44964
44965
44966
44967
44968
44969
44970
44971
44972
44973
44974
44975
44976
44977
44978
44979
44980
44981
44982
44983
44984
44985
44986
44987
44988
44989
44990
44991
44992
44993
44994
44995
44996
44997
44998
44999
45000
45001
45002
45003
45004
45005
45006
45007
45008
45009
45010
45011
45012
45013
45014
45015
45016
45017
45018
45019
45020
45021
45022
45023
45024
45025
45026
45027
45028
45029
45030
45031
45032
45033
45034
45035
45036
45037
45038
45039
45040
45041
45042
45043
45044
45045
45046
45047
45048
45049
45050
45051
45052
45053
45054
45055
45056
45057
45058
45059
45060
45061
45062
45063
45064
45065
45066
45067
45068
45069
45070
45071
45072
45073
45074
45075
45076
45077
45078
45079
45080
45081
45082
45083
45084
45085
45086
45087
45088
45089
45090
45091
45092
45093
45094
45095
45096
45097
45098
45099
45100
45101
45102
45103
45104
45105
45106
45107
45108
45109
45110
45111
45112
45113
45114
45115
45116
45117
45118
45119
45120
45121
45122
45123
45124
45125
45126
45127
45128
45129
45130
45131
45132
45133
45134
45135
45136
45137
45138
45139
45140
45141
45142
45143
45144
45145
45146
45147
45148
45149
45150
45151
45152
45153
45154
45155
45156
45157
45158
45159
45160
45161
45162
45163
45164
45165
45166
45167
45168
45169
45170
45171
45172
45173
45174
45175
45176
45177
45178
45179
45180
45181
45182
45183
45184
45185
45186
45187
45188
45189
45190
45191
45192
45193
45194
45195
45196
45197
45198
45199
45200
45201
45202
45203
45204
45205
45206
45207
45208
45209
45210
45211
45212
45213
45214
45215
45216
45217
45218
45219
45220
45221
45222
45223
45224
45225
45226
45227
45228
45229
45230
45231
45232
45233
45234
45235
45236
45237
45238
45239
45240
45241
45242
45243
45244
45245
45246
45247
45248
45249
45250
45251
45252
45253
45254
45255
45256
45257
45258
45259
45260
45261
45262
45263
45264
45265
45266
45267
45268
45269
45270
45271
45272
45273
45274
45275
45276
45277
45278
45279
45280
45281
45282
45283
45284
45285
45286
45287
45288
45289
45290
45291
45292
45293
45294
45295
45296
45297
45298
45299
45300
45301
45302
45303
45304
45305
45306
45307
45308
45309
45310
45311
45312
45313
45314
45315
45316
45317
45318
45319
45320
45321
45322
45323
45324
45325
45326
45327
45328
45329
45330
45331
45332
45333
45334
45335
45336
45337
45338
45339
45340
45341
45342
45343
45344
45345
45346
45347
45348
45349
45350
45351
45352
45353
45354
45355
45356
45357
45358
45359
45360
45361
45362
45363
45364
45365
45366
45367
45368
45369
45370
45371
45372
45373
45374
45375
45376
45377
45378
45379
45380
45381
45382
45383
45384
45385
45386
45387
45388
45389
45390
45391
45392
45393
45394
45395
45396
45397
45398
45399
45400
45401
45402
45403
45404
45405
45406
45407
45408
45409
45410
45411
45412
45413
45414
45415
45416
45417
45418
45419
45420
45421
45422
45423
45424
45425
45426
45427
45428
45429
45430
45431
45432
45433
45434
45435
45436
45437
45438
45439
45440
45441
45442
45443
45444
45445
45446
45447
45448
45449
45450
45451
45452
45453
45454
45455
45456
45457
45458
45459
45460
45461
45462
45463
45464
45465
45466
45467
45468
45469
45470
45471
45472
45473
45474
45475
45476
45477
45478
45479
45480
45481
45482
45483
45484
45485
45486
45487
45488
45489
45490
45491
45492
45493
45494
45495
45496
45497
45498
45499
45500
45501
45502
45503
45504
45505
45506
45507
45508
45509
45510
45511
45512
45513
45514
45515
45516
45517
45518
45519
45520
45521
45522
45523
45524
45525
45526
45527
45528
45529
45530
45531
45532
45533
45534
45535
45536
45537
45538
45539
45540
45541
45542
45543
45544
45545
45546
45547
45548
45549
45550
45551
45552
45553
45554
45555
45556
45557
45558
45559
45560
45561
45562
45563
45564
45565
45566
45567
45568
45569
45570
45571
45572
45573
45574
45575
45576
45577
45578
45579
45580
45581
45582
45583
45584
45585
45586
45587
45588
45589
45590
45591
45592
45593
45594
45595
45596
45597
45598
45599
45600
45601
45602
45603
45604
45605
45606
45607
45608
45609
45610
45611
45612
45613
45614
45615
45616
45617
45618
45619
45620
45621
45622
45623
45624
45625
45626
45627
45628
45629
45630
45631
45632
45633
45634
45635
45636
45637
45638
45639
45640
45641
45642
45643
45644
45645
45646
45647
45648
45649
45650
45651
45652
45653
45654
45655
45656
45657
45658
45659
45660
45661
45662
45663
45664
45665
45666
45667
45668
45669
45670
45671
45672
45673
45674
45675
45676
45677
45678
45679
45680
45681
45682
45683
45684
45685
45686
45687
45688
45689
45690
45691
45692
45693
45694
45695
45696
45697
45698
45699
45700
45701
45702
45703
45704
45705
45706
45707
45708
45709
45710
45711
45712
45713
45714
45715
45716
45717
45718
45719
45720
45721
45722
45723
45724
45725
45726
45727
45728
45729
45730
45731
45732
45733
45734
45735
45736
45737
45738
45739
45740
45741
45742
45743
45744
45745
45746
45747
45748
45749
45750
45751
45752
45753
45754
45755
45756
45757
45758
45759
45760
45761
45762
45763
45764
45765
45766
45767
45768
45769
45770
45771
45772
45773
45774
45775
45776
45777
45778
45779
45780
45781
45782
45783
45784
45785
45786
45787
45788
45789
45790
45791
45792
45793
45794
45795
45796
45797
45798
45799
45800
45801
45802
45803
45804
45805
45806
45807
45808
45809
45810
45811
45812
45813
45814
45815
45816
45817
45818
45819
45820
45821
45822
45823
45824
45825
45826
45827
45828
45829
45830
45831
45832
45833
45834
45835
45836
45837
45838
45839
45840
45841
45842
45843
45844
45845
45846
45847
45848
45849
45850
45851
45852
45853
45854
45855
45856
45857
45858
45859
45860
45861
45862
45863
45864
45865
45866
45867
45868
45869
45870
45871
45872
45873
45874
45875
45876
45877
45878
45879
45880
45881
45882
45883
45884
45885
45886
45887
45888
45889
45890
45891
45892
45893
45894
45895
45896
45897
45898
45899
45900
45901
45902
45903
45904
45905
45906
45907
45908
45909
45910
45911
45912
45913
45914
45915
45916
45917
45918
45919
45920
45921
45922
45923
45924
45925
45926
45927
45928
45929
45930
45931
45932
45933
45934
45935
45936
45937
45938
45939
45940
45941
45942
45943
45944
45945
45946
45947
45948
45949
45950
45951
45952
45953
45954
45955
45956
45957
45958
45959
45960
45961
45962
45963
45964
45965
45966
45967
45968
45969
45970
45971
45972
45973
45974
45975
45976
45977
45978
45979
45980
45981
45982
45983
45984
45985
45986
45987
45988
45989
45990
45991
45992
45993
45994
45995
45996
45997
45998
45999
46000
46001
46002
46003
46004
46005
46006
46007
46008
46009
46010
46011
46012
46013
46014
46015
46016
46017
46018
46019
46020
46021
46022
46023
46024
46025
46026
46027
46028
46029
46030
46031
46032
46033
46034
46035
46036
46037
46038
46039
46040
46041
46042
46043
46044
46045
46046
46047
46048
46049
46050
46051
46052
46053
46054
46055
46056
46057
46058
46059
46060
46061
46062
46063
46064
46065
46066
46067
46068
46069
46070
46071
46072
46073
46074
46075
46076
46077
46078
46079
46080
46081
46082
46083
46084
46085
46086
46087
46088
46089
46090
46091
46092
46093
46094
46095
46096
46097
46098
46099
46100
46101
46102
46103
46104
46105
46106
46107
46108
46109
46110
46111
46112
46113
46114
46115
46116
46117
46118
46119
46120
46121
46122
46123
46124
46125
46126
46127
46128
46129
46130
46131
46132
46133
46134
46135
46136
46137
46138
46139
46140
46141
46142
46143
46144
46145
46146
46147
46148
46149
46150
46151
46152
46153
46154
46155
46156
46157
46158
46159
46160
46161
46162
46163
46164
46165
46166
46167
46168
46169
46170
46171
46172
46173
46174
46175
46176
46177
46178
46179
46180
46181
46182
46183
46184
46185
46186
46187
46188
46189
46190
46191
46192
46193
46194
46195
46196
46197
46198
46199
46200
46201
46202
46203
46204
46205
46206
46207
46208
46209
46210
46211
46212
46213
46214
46215
46216
46217
46218
46219
46220
46221
46222
46223
46224
46225
46226
46227
46228
46229
46230
46231
46232
46233
46234
46235
46236
46237
46238
46239
46240
46241
46242
46243
46244
46245
46246
46247
46248
46249
46250
46251
46252
46253
46254
46255
46256
46257
46258
46259
46260
46261
46262
46263
46264
46265
46266
46267
46268
46269
46270
46271
46272
46273
46274
46275
46276
46277
46278
46279
46280
46281
46282
46283
46284
46285
46286
46287
46288
46289
46290
46291
46292
46293
46294
46295
46296
46297
46298
46299
46300
46301
46302
46303
46304
46305
46306
46307
46308
46309
46310
46311
46312
46313
46314
46315
46316
46317
46318
46319
46320
46321
46322
46323
46324
46325
46326
46327
46328
46329
46330
46331
46332
46333
46334
46335
46336
46337
46338
46339
46340
46341
46342
46343
46344
46345
46346
46347
46348
46349
46350
46351
46352
46353
46354
46355
46356
46357
46358
46359
46360
46361
46362
46363
46364
46365
46366
46367
46368
46369
46370
46371
46372
46373
46374
46375
46376
46377
46378
46379
46380
46381
46382
46383
46384
46385
46386
46387
46388
46389
46390
46391
46392
46393
46394
46395
46396
46397
46398
46399
46400
46401
46402
46403
46404
46405
46406
46407
46408
46409
46410
46411
46412
46413
46414
46415
46416
46417
46418
46419
46420
46421
46422
46423
46424
46425
46426
46427
46428
46429
46430
46431
46432
46433
46434
46435
46436
46437
46438
46439
46440
46441
46442
46443
46444
46445
46446
46447
46448
46449
46450
46451
46452
46453
46454
46455
46456
46457
46458
46459
46460
46461
46462
46463
46464
46465
46466
46467
46468
46469
46470
46471
46472
46473
46474
46475
46476
46477
46478
46479
46480
46481
46482
46483
46484
46485
46486
46487
46488
46489
46490
46491
46492
46493
46494
46495
46496
46497
46498
46499
46500
46501
46502
46503
46504
46505
46506
46507
46508
46509
46510
46511
46512
46513
46514
46515
46516
46517
46518
46519
46520
46521
46522
46523
46524
46525
46526
46527
46528
46529
46530
46531
46532
46533
46534
46535
46536
46537
46538
46539
46540
46541
46542
46543
46544
46545
46546
46547
46548
46549
46550
46551
46552
46553
46554
46555
46556
46557
46558
46559
46560
46561
46562
46563
46564
46565
46566
46567
46568
46569
46570
46571
46572
46573
46574
46575
46576
46577
46578
46579
46580
46581
46582
46583
46584
46585
46586
46587
46588
46589
46590
46591
46592
46593
46594
46595
46596
46597
46598
46599
46600
46601
46602
46603
46604
46605
46606
46607
46608
46609
46610
46611
46612
46613
46614
46615
46616
46617
46618
46619
46620
46621
46622
46623
46624
46625
46626
46627
46628
46629
46630
46631
46632
46633
46634
46635
46636
46637
46638
46639
46640
46641
46642
46643
46644
46645
46646
46647
46648
46649
46650
46651
46652
46653
46654
46655
46656
46657
46658
46659
46660
46661
46662
46663
46664
46665
46666
46667
46668
46669
46670
46671
46672
46673
46674
46675
46676
46677
46678
46679
46680
46681
46682
46683
46684
46685
46686
46687
46688
46689
46690
46691
46692
46693
46694
46695
46696
46697
46698
46699
46700
46701
46702
46703
46704
46705
46706
46707
46708
46709
46710
46711
46712
46713
46714
46715
46716
46717
46718
46719
46720
46721
46722
46723
46724
46725
46726
46727
46728
46729
46730
46731
46732
46733
46734
46735
46736
46737
46738
46739
46740
46741
46742
46743
46744
46745
46746
46747
46748
46749
46750
46751
46752
46753
46754
46755
46756
46757
46758
46759
46760
46761
46762
46763
46764
46765
46766
46767
46768
46769
46770
46771
46772
46773
46774
46775
46776
46777
46778
46779
46780
46781
46782
46783
46784
46785
46786
46787
46788
46789
46790
46791
46792
46793
46794
46795
46796
46797
46798
46799
46800
46801
46802
46803
46804
46805
46806
46807
46808
46809
46810
46811
46812
46813
46814
46815
46816
46817
46818
46819
46820
46821
46822
46823
46824
46825
46826
46827
46828
46829
46830
46831
46832
46833
46834
46835
46836
46837
46838
46839
46840
46841
46842
46843
46844
46845
46846
46847
46848
46849
46850
46851
46852
46853
46854
46855
46856
46857
46858
46859
46860
46861
46862
46863
46864
46865
46866
46867
46868
46869
46870
46871
46872
46873
46874
46875
46876
46877
46878
46879
46880
46881
46882
46883
46884
46885
46886
46887
46888
46889
46890
46891
46892
46893
46894
46895
46896
46897
46898
46899
46900
46901
46902
46903
46904
46905
46906
46907
46908
46909
46910
46911
46912
46913
46914
46915
46916
46917
46918
46919
46920
46921
46922
46923
46924
46925
46926
46927
46928
46929
46930
46931
46932
46933
46934
46935
46936
46937
46938
46939
46940
46941
46942
46943
46944
46945
46946
46947
46948
46949
46950
46951
46952
46953
46954
46955
46956
46957
46958
46959
46960
46961
46962
46963
46964
46965
46966
46967
46968
46969
46970
46971
46972
46973
46974
46975
46976
46977
46978
46979
46980
46981
46982
46983
46984
46985
46986
46987
46988
46989
46990
46991
46992
46993
46994
46995
46996
46997
46998
46999
47000
47001
47002
47003
47004
47005
47006
47007
47008
47009
47010
47011
47012
47013
47014
47015
47016
47017
47018
47019
47020
47021
47022
47023
47024
47025
47026
47027
47028
47029
47030
47031
47032
47033
47034
47035
47036
47037
47038
47039
47040
47041
47042
47043
47044
47045
47046
47047
47048
47049
47050
47051
47052
47053
47054
47055
47056
47057
47058
47059
47060
47061
47062
47063
47064
47065
47066
47067
47068
47069
47070
47071
47072
47073
47074
47075
47076
47077
47078
47079
47080
47081
47082
47083
47084
47085
47086
47087
47088
47089
47090
47091
47092
47093
47094
47095
47096
47097
47098
47099
47100
47101
47102
47103
47104
47105
47106
47107
47108
47109
47110
47111
47112
47113
47114
47115
47116
47117
47118
47119
47120
47121
47122
47123
47124
47125
47126
47127
47128
47129
47130
47131
47132
47133
47134
47135
47136
47137
47138
47139
47140
47141
47142
47143
47144
47145
47146
47147
47148
47149
47150
47151
47152
47153
47154
47155
47156
47157
47158
47159
47160
47161
47162
47163
47164
47165
47166
47167
47168
47169
47170
47171
47172
47173
47174
47175
47176
47177
47178
47179
47180
47181
47182
47183
47184
47185
47186
47187
47188
47189
47190
47191
47192
47193
47194
47195
47196
47197
47198
47199
47200
47201
47202
47203
47204
47205
47206
47207
47208
47209
47210
47211
47212
47213
47214
47215
47216
47217
47218
47219
47220
47221
47222
47223
47224
47225
47226
47227
47228
47229
47230
47231
47232
47233
47234
47235
47236
47237
47238
47239
47240
47241
47242
47243
47244
47245
47246
47247
47248
47249
47250
47251
47252
47253
47254
47255
47256
47257
47258
47259
47260
47261
47262
47263
47264
47265
47266
47267
47268
47269
47270
47271
47272
47273
47274
47275
47276
47277
47278
47279
47280
47281
47282
47283
47284
47285
47286
47287
47288
47289
47290
47291
47292
47293
47294
47295
47296
47297
47298
47299
47300
47301
47302
47303
47304
47305
47306
47307
47308
47309
47310
47311
47312
47313
47314
47315
47316
47317
47318
47319
47320
47321
47322
47323
47324
47325
47326
47327
47328
47329
47330
47331
47332
47333
47334
47335
47336
47337
47338
47339
47340
47341
47342
47343
47344
47345
47346
47347
47348
47349
47350
47351
47352
47353
47354
47355
47356
47357
47358
47359
47360
47361
47362
47363
47364
47365
47366
47367
47368
47369
47370
47371
47372
47373
47374
47375
47376
47377
47378
47379
47380
47381
47382
47383
47384
47385
47386
47387
47388
47389
47390
47391
47392
47393
47394
47395
47396
47397
47398
47399
47400
47401
47402
47403
47404
47405
47406
47407
47408
47409
47410
47411
47412
47413
47414
47415
47416
47417
47418
47419
47420
47421
47422
47423
47424
47425
47426
47427
47428
47429
47430
47431
47432
47433
47434
47435
47436
47437
47438
47439
47440
47441
47442
47443
47444
47445
47446
47447
47448
47449
47450
47451
47452
47453
47454
47455
47456
47457
47458
47459
47460
47461
47462
47463
47464
47465
47466
47467
47468
47469
47470
47471
47472
47473
47474
47475
47476
47477
47478
47479
47480
47481
47482
47483
47484
47485
47486
47487
47488
47489
47490
47491
47492
47493
47494
47495
47496
47497
47498
47499
47500
47501
47502
47503
47504
47505
47506
47507
47508
47509
47510
47511
47512
47513
47514
47515
47516
47517
47518
47519
47520
47521
47522
47523
47524
47525
47526
47527
47528
47529
47530
47531
47532
47533
47534
47535
47536
47537
47538
47539
47540
47541
47542
47543
47544
47545
47546
47547
47548
47549
47550
47551
47552
47553
47554
47555
47556
47557
47558
47559
47560
47561
47562
47563
47564
47565
47566
47567
47568
47569
47570
47571
47572
47573
47574
47575
47576
47577
47578
47579
47580
47581
47582
47583
47584
47585
47586
47587
47588
47589
47590
47591
47592
47593
47594
47595
47596
47597
47598
47599
47600
47601
47602
47603
47604
47605
47606
47607
47608
47609
47610
47611
47612
47613
47614
47615
47616
47617
47618
47619
47620
47621
47622
47623
47624
47625
47626
47627
47628
47629
47630
47631
47632
47633
47634
47635
47636
47637
47638
47639
47640
47641
47642
47643
47644
47645
47646
47647
47648
47649
47650
47651
47652
47653
47654
47655
47656
47657
47658
47659
47660
47661
47662
47663
47664
47665
47666
47667
47668
47669
47670
47671
47672
47673
47674
47675
47676
47677
47678
47679
47680
47681
47682
47683
47684
47685
47686
47687
47688
47689
47690
47691
47692
47693
47694
47695
47696
47697
47698
47699
47700
47701
47702
47703
47704
47705
47706
47707
47708
47709
47710
47711
47712
47713
47714
47715
47716
47717
47718
47719
47720
47721
47722
47723
47724
47725
47726
47727
47728
47729
47730
47731
47732
47733
47734
47735
47736
47737
47738
47739
47740
47741
47742
47743
47744
47745
47746
47747
47748
47749
47750
47751
47752
47753
47754
47755
47756
47757
47758
47759
47760
47761
47762
47763
47764
47765
47766
47767
47768
47769
47770
47771
47772
47773
47774
47775
47776
47777
47778
47779
47780
47781
47782
47783
47784
47785
47786
47787
47788
47789
47790
47791
47792
47793
47794
47795
47796
47797
47798
47799
47800
47801
47802
47803
47804
47805
47806
47807
47808
47809
47810
47811
47812
47813
47814
47815
47816
47817
47818
47819
47820
47821
47822
47823
47824
47825
47826
47827
47828
47829
47830
47831
47832
47833
47834
47835
47836
47837
47838
47839
47840
47841
47842
47843
47844
47845
47846
47847
47848
47849
47850
47851
47852
47853
47854
47855
47856
47857
47858
47859
47860
47861
47862
47863
47864
47865
47866
47867
47868
47869
47870
47871
47872
47873
47874
47875
47876
47877
47878
47879
47880
47881
47882
47883
47884
47885
47886
47887
47888
47889
47890
47891
47892
47893
47894
47895
47896
47897
47898
47899
47900
47901
47902
47903
47904
47905
47906
47907
47908
47909
47910
47911
47912
47913
47914
47915
47916
47917
47918
47919
47920
47921
47922
47923
47924
47925
47926
47927
47928
47929
47930
47931
47932
47933
47934
47935
47936
47937
47938
47939
47940
47941
47942
47943
47944
47945
47946
47947
47948
47949
47950
47951
47952
47953
47954
47955
47956
47957
47958
47959
47960
47961
47962
47963
47964
47965
47966
47967
47968
47969
47970
47971
47972
47973
47974
47975
47976
47977
47978
47979
47980
47981
47982
47983
47984
47985
47986
47987
47988
47989
47990
47991
47992
47993
47994
47995
47996
47997
47998
47999
48000
48001
48002
48003
48004
48005
48006
48007
48008
48009
48010
48011
48012
48013
48014
48015
48016
48017
48018
48019
48020
48021
48022
48023
48024
48025
48026
48027
48028
48029
48030
48031
48032
48033
48034
48035
48036
48037
48038
48039
48040
48041
48042
48043
48044
48045
48046
48047
48048
48049
48050
48051
48052
48053
48054
48055
48056
48057
48058
48059
48060
48061
48062
48063
48064
48065
48066
48067
48068
48069
48070
48071
48072
48073
48074
48075
48076
48077
48078
48079
48080
48081
48082
48083
48084
48085
48086
48087
48088
48089
48090
48091
48092
48093
48094
48095
48096
48097
48098
48099
48100
48101
48102
48103
48104
48105
48106
48107
48108
48109
48110
48111
48112
48113
48114
48115
48116
48117
48118
48119
48120
48121
48122
48123
48124
48125
48126
48127
48128
48129
48130
48131
48132
48133
48134
48135
48136
48137
48138
48139
48140
48141
48142
48143
48144
48145
48146
48147
48148
48149
48150
48151
48152
48153
48154
48155
48156
48157
48158
48159
48160
48161
48162
48163
48164
48165
48166
48167
48168
48169
48170
48171
48172
48173
48174
48175
48176
48177
48178
48179
48180
48181
48182
48183
48184
48185
48186
48187
48188
48189
48190
48191
48192
48193
48194
48195
48196
48197
48198
48199
48200
48201
48202
48203
48204
48205
48206
48207
48208
48209
48210
48211
48212
48213
48214
48215
48216
48217
48218
48219
48220
48221
48222
48223
48224
48225
48226
48227
48228
48229
48230
48231
48232
48233
48234
48235
48236
48237
48238
48239
48240
48241
48242
48243
48244
48245
48246
48247
48248
48249
48250
48251
48252
48253
48254
48255
48256
48257
48258
48259
48260
48261
48262
48263
48264
48265
48266
48267
48268
48269
48270
48271
48272
48273
48274
48275
48276
48277
48278
48279
48280
48281
48282
48283
48284
48285
48286
48287
48288
48289
48290
48291
48292
48293
48294
48295
48296
48297
48298
48299
48300
48301
48302
48303
48304
48305
48306
48307
48308
48309
48310
48311
48312
48313
48314
48315
48316
48317
48318
48319
48320
48321
48322
48323
48324
48325
48326
48327
48328
48329
48330
48331
48332
48333
48334
48335
48336
48337
48338
48339
48340
48341
48342
48343
48344
48345
48346
48347
48348
48349
48350
48351
48352
48353
48354
48355
48356
48357
48358
48359
48360
48361
48362
48363
48364
48365
48366
48367
48368
48369
48370
48371
48372
48373
48374
48375
48376
48377
48378
48379
48380
48381
48382
48383
48384
48385
48386
48387
48388
48389
48390
48391
48392
48393
48394
48395
48396
48397
48398
48399
48400
48401
48402
48403
48404
48405
48406
48407
48408
48409
48410
48411
48412
48413
48414
48415
48416
48417
48418
48419
48420
48421
48422
48423
48424
48425
48426
48427
48428
48429
48430
48431
48432
48433
48434
48435
48436
48437
48438
48439
48440
48441
48442
48443
48444
48445
48446
48447
48448
48449
48450
48451
48452
48453
48454
48455
48456
48457
48458
48459
48460
48461
48462
48463
48464
48465
48466
48467
48468
48469
48470
48471
48472
48473
48474
48475
48476
48477
48478
48479
48480
48481
48482
48483
48484
48485
48486
48487
48488
48489
48490
48491
48492
48493
48494
48495
48496
48497
48498
48499
48500
48501
48502
48503
48504
48505
48506
48507
48508
48509
48510
48511
48512
48513
48514
48515
48516
48517
48518
48519
48520
48521
48522
48523
48524
48525
48526
48527
48528
48529
48530
48531
48532
48533
48534
48535
48536
48537
48538
48539
48540
48541
48542
48543
48544
48545
48546
48547
48548
48549
48550
48551
48552
48553
48554
48555
48556
48557
48558
48559
48560
48561
48562
48563
48564
48565
48566
48567
48568
48569
48570
48571
48572
48573
48574
48575
48576
48577
48578
48579
48580
48581
48582
48583
48584
48585
48586
48587
48588
48589
48590
48591
48592
48593
48594
48595
48596
48597
48598
48599
48600
48601
48602
48603
48604
48605
48606
48607
48608
48609
48610
48611
48612
48613
48614
48615
48616
48617
48618
48619
48620
48621
48622
48623
48624
48625
48626
48627
48628
48629
48630
48631
48632
48633
48634
48635
48636
48637
48638
48639
48640
48641
48642
48643
48644
48645
48646
48647
48648
48649
48650
48651
48652
48653
48654
48655
48656
48657
48658
48659
48660
48661
48662
48663
48664
48665
48666
48667
48668
48669
48670
48671
48672
48673
48674
48675
48676
48677
48678
48679
48680
48681
48682
48683
48684
48685
48686
48687
48688
48689
48690
48691
48692
48693
48694
48695
48696
48697
48698
48699
48700
48701
48702
48703
48704
48705
48706
48707
48708
48709
48710
48711
48712
48713
48714
48715
48716
48717
48718
48719
48720
48721
48722
48723
48724
48725
48726
48727
48728
48729
48730
48731
48732
48733
48734
48735
48736
48737
48738
48739
48740
48741
48742
48743
48744
48745
48746
48747
48748
48749
48750
48751
48752
48753
48754
48755
48756
48757
48758
48759
48760
48761
48762
48763
48764
48765
48766
48767
48768
48769
48770
48771
48772
48773
48774
48775
48776
48777
48778
48779
48780
48781
48782
48783
48784
48785
48786
48787
48788
48789
48790
48791
48792
48793
48794
48795
48796
48797
48798
48799
48800
48801
48802
48803
48804
48805
48806
48807
48808
48809
48810
48811
48812
48813
48814
48815
48816
48817
48818
48819
48820
48821
48822
48823
48824
48825
48826
48827
48828
48829
48830
48831
48832
48833
48834
48835
48836
48837
48838
48839
48840
48841
48842
48843
48844
48845
48846
48847
48848
48849
48850
48851
48852
48853
48854
48855
48856
48857
48858
48859
48860
48861
48862
48863
48864
48865
48866
48867
48868
48869
48870
48871
48872
48873
48874
48875
48876
48877
48878
48879
48880
48881
48882
48883
48884
48885
48886
48887
48888
48889
48890
48891
48892
48893
48894
48895
48896
48897
48898
48899
48900
48901
48902
48903
48904
48905
48906
48907
48908
48909
48910
48911
48912
48913
48914
48915
48916
48917
48918
48919
48920
48921
48922
48923
48924
48925
48926
48927
48928
48929
48930
48931
48932
48933
48934
48935
48936
48937
48938
48939
48940
48941
48942
48943
48944
48945
48946
48947
48948
48949
48950
48951
48952
48953
48954
48955
48956
48957
48958
48959
48960
48961
48962
48963
48964
48965
48966
48967
48968
48969
48970
48971
48972
48973
48974
48975
48976
48977
48978
48979
48980
48981
48982
48983
48984
48985
48986
48987
48988
48989
48990
48991
48992
48993
48994
48995
48996
48997
48998
48999
49000
49001
49002
49003
49004
49005
49006
49007
49008
49009
49010
49011
49012
49013
49014
49015
49016
49017
49018
49019
49020
49021
49022
49023
49024
49025
49026
49027
49028
49029
49030
49031
49032
49033
49034
49035
49036
49037
49038
49039
49040
49041
49042
49043
49044
49045
49046
49047
49048
49049
49050
49051
49052
49053
49054
49055
49056
49057
49058
49059
49060
49061
49062
49063
49064
49065
49066
49067
49068
49069
49070
49071
49072
49073
49074
49075
49076
49077
49078
49079
49080
49081
49082
49083
49084
49085
49086
49087
49088
49089
49090
49091
49092
49093
49094
49095
49096
49097
49098
49099
49100
49101
49102
49103
49104
49105
49106
49107
49108
49109
49110
49111
49112
49113
49114
49115
49116
49117
49118
49119
49120
49121
49122
49123
49124
49125
49126
49127
49128
49129
49130
49131
49132
49133
49134
49135
49136
49137
49138
49139
49140
49141
49142
49143
49144
49145
49146
49147
49148
49149
49150
49151
49152
49153
49154
49155
49156
49157
49158
49159
49160
49161
49162
49163
49164
49165
49166
49167
49168
49169
49170
49171
49172
49173
49174
49175
49176
49177
49178
49179
49180
49181
49182
49183
49184
49185
49186
49187
49188
49189
49190
49191
49192
49193
49194
49195
49196
49197
49198
49199
49200
49201
49202
49203
49204
49205
49206
49207
49208
49209
49210
49211
49212
49213
49214
49215
49216
49217
49218
49219
49220
49221
49222
49223
49224
49225
49226
49227
49228
49229
49230
49231
49232
49233
49234
49235
49236
49237
49238
49239
49240
49241
49242
49243
49244
49245
49246
49247
49248
49249
49250
49251
49252
49253
49254
49255
49256
49257
49258
49259
49260
49261
49262
49263
49264
49265
49266
49267
49268
49269
49270
49271
49272
49273
49274
49275
49276
49277
49278
49279
49280
49281
49282
49283
49284
49285
49286
49287
49288
49289
49290
49291
49292
49293
49294
49295
49296
49297
49298
49299
49300
49301
49302
49303
49304
49305
49306
49307
49308
49309
49310
49311
49312
49313
49314
49315
49316
49317
49318
49319
49320
49321
49322
49323
49324
49325
49326
49327
49328
49329
49330
49331
49332
49333
49334
49335
49336
49337
49338
49339
49340
49341
49342
49343
49344
49345
49346
49347
49348
49349
49350
49351
49352
49353
49354
49355
49356
49357
49358
49359
49360
49361
49362
49363
49364
49365
49366
49367
49368
49369
49370
49371
49372
49373
49374
49375
49376
49377
49378
49379
49380
49381
49382
49383
49384
49385
49386
49387
49388
49389
49390
49391
49392
49393
49394
49395
49396
49397
49398
49399
49400
49401
49402
49403
49404
49405
49406
49407
49408
49409
49410
49411
49412
49413
49414
49415
49416
49417
49418
49419
49420
49421
49422
49423
49424
49425
49426
49427
49428
49429
49430
49431
49432
49433
49434
49435
49436
49437
49438
49439
49440
49441
49442
49443
49444
49445
49446
49447
49448
49449
49450
49451
49452
49453
49454
49455
49456
49457
49458
49459
49460
49461
49462
49463
49464
49465
49466
49467
49468
49469
49470
49471
49472
49473
49474
49475
49476
49477
49478
49479
49480
49481
49482
49483
49484
49485
49486
49487
49488
49489
49490
49491
49492
49493
49494
49495
49496
49497
49498
49499
49500
49501
49502
49503
49504
49505
49506
49507
49508
49509
49510
49511
49512
49513
49514
49515
49516
49517
49518
49519
49520
49521
49522
49523
49524
49525
49526
49527
49528
49529
49530
49531
49532
49533
49534
49535
49536
49537
49538
49539
49540
49541
49542
49543
49544
49545
49546
49547
49548
49549
49550
49551
49552
49553
49554
49555
49556
49557
49558
49559
49560
49561
49562
49563
49564
49565
49566
49567
49568
49569
49570
49571
49572
49573
49574
49575
49576
49577
49578
49579
49580
49581
49582
49583
49584
49585
49586
49587
49588
49589
49590
49591
49592
49593
49594
49595
49596
49597
49598
49599
49600
49601
49602
49603
49604
49605
49606
49607
49608
49609
49610
49611
49612
49613
49614
49615
49616
49617
49618
49619
49620
49621
49622
49623
49624
49625
49626
49627
49628
49629
49630
49631
49632
49633
49634
49635
49636
49637
49638
49639
49640
49641
49642
49643
49644
49645
49646
49647
49648
49649
49650
49651
49652
49653
49654
49655
49656
49657
49658
49659
49660
49661
49662
49663
49664
49665
49666
49667
49668
49669
49670
49671
49672
49673
49674
49675
49676
49677
49678
49679
49680
49681
49682
49683
49684
49685
49686
49687
49688
49689
49690
49691
49692
49693
49694
49695
49696
49697
49698
49699
49700
49701
49702
49703
49704
49705
49706
49707
49708
49709
49710
49711
49712
49713
49714
49715
49716
49717
49718
49719
49720
49721
49722
49723
49724
49725
49726
49727
49728
49729
49730
49731
49732
49733
49734
49735
49736
49737
49738
49739
49740
49741
49742
49743
49744
49745
49746
49747
49748
49749
49750
49751
49752
49753
49754
49755
49756
49757
49758
49759
49760
49761
49762
49763
49764
49765
49766
49767
49768
49769
49770
49771
49772
49773
49774
49775
49776
49777
49778
49779
49780
49781
49782
49783
49784
49785
49786
49787
49788
49789
49790
49791
49792
49793
49794
49795
49796
49797
49798
49799
49800
49801
49802
49803
49804
49805
49806
49807
49808
49809
49810
49811
49812
49813
49814
49815
49816
49817
49818
49819
49820
49821
49822
49823
49824
49825
49826
49827
49828
49829
49830
49831
49832
49833
49834
49835
49836
49837
49838
49839
49840
49841
49842
49843
49844
49845
49846
49847
49848
49849
49850
49851
49852
49853
49854
49855
49856
49857
49858
49859
49860
49861
49862
49863
49864
49865
49866
49867
49868
49869
49870
49871
49872
49873
49874
49875
49876
49877
49878
49879
49880
49881
49882
49883
49884
49885
49886
49887
49888
49889
49890
49891
49892
49893
49894
49895
49896
49897
49898
49899
49900
49901
49902
49903
49904
49905
49906
49907
49908
49909
49910
49911
49912
49913
49914
49915
49916
49917
49918
49919
49920
49921
49922
49923
49924
49925
49926
49927
49928
49929
49930
49931
49932
49933
49934
49935
49936
49937
49938
49939
49940
49941
49942
49943
49944
49945
49946
49947
49948
49949
49950
49951
49952
49953
49954
49955
49956
49957
49958
49959
49960
49961
49962
49963
49964
49965
49966
49967
49968
49969
49970
49971
49972
49973
49974
49975
49976
49977
49978
49979
49980
49981
49982
49983
49984
49985
49986
49987
49988
49989
49990
49991
49992
49993
49994
49995
49996
49997
49998
49999
50000
50001
50002
50003
50004
50005
50006
50007
50008
50009
50010
50011
50012
50013
50014
50015
50016
50017
50018
50019
50020
50021
50022
50023
50024
50025
50026
50027
50028
50029
50030
50031
50032
50033
50034
50035
50036
50037
50038
50039
50040
50041
50042
50043
50044
50045
50046
50047
50048
50049
50050
50051
50052
50053
50054
50055
50056
50057
50058
50059
50060
50061
50062
50063
50064
50065
50066
50067
50068
50069
50070
50071
50072
50073
50074
50075
50076
50077
50078
50079
50080
50081
50082
50083
50084
50085
50086
50087
50088
50089
50090
50091
50092
50093
50094
50095
50096
50097
50098
50099
50100
50101
50102
50103
50104
50105
50106
50107
50108
50109
50110
50111
50112
50113
50114
50115
50116
50117
50118
50119
50120
50121
50122
50123
50124
50125
50126
50127
50128
50129
50130
50131
50132
50133
50134
50135
50136
50137
50138
50139
50140
50141
50142
50143
50144
50145
50146
50147
50148
50149
50150
50151
50152
50153
50154
50155
50156
50157
50158
50159
50160
50161
50162
50163
50164
50165
50166
50167
50168
50169
50170
50171
50172
50173
50174
50175
50176
50177
50178
50179
50180
50181
50182
50183
50184
50185
50186
50187
50188
50189
50190
50191
50192
50193
50194
50195
50196
50197
50198
50199
50200
50201
50202
50203
50204
50205
50206
50207
50208
50209
50210
50211
50212
50213
50214
50215
50216
50217
50218
50219
50220
50221
50222
50223
50224
50225
50226
50227
50228
50229
50230
50231
50232
50233
50234
50235
50236
50237
50238
50239
50240
50241
50242
50243
50244
50245
50246
50247
50248
50249
50250
50251
50252
50253
50254
50255
50256
50257
50258
50259
50260
50261
50262
50263
50264
50265
50266
50267
50268
50269
50270
50271
50272
50273
50274
50275
50276
50277
50278
50279
50280
50281
50282
50283
50284
50285
50286
50287
50288
50289
50290
50291
50292
50293
50294
50295
50296
50297
50298
50299
50300
50301
50302
50303
50304
50305
50306
50307
50308
50309
50310
50311
50312
50313
50314
50315
50316
50317
50318
50319
50320
50321
50322
50323
50324
50325
50326
50327
50328
50329
50330
50331
50332
50333
50334
50335
50336
50337
50338
50339
50340
50341
50342
50343
50344
50345
50346
50347
50348
50349
50350
50351
50352
50353
50354
50355
50356
50357
50358
50359
50360
50361
50362
50363
50364
50365
50366
50367
50368
50369
50370
50371
50372
50373
50374
50375
50376
50377
50378
50379
50380
50381
50382
50383
50384
50385
50386
50387
50388
50389
50390
50391
50392
50393
50394
50395
50396
50397
50398
50399
50400
50401
50402
50403
50404
50405
50406
50407
50408
50409
50410
50411
50412
50413
50414
50415
50416
50417
50418
50419
50420
50421
50422
50423
50424
50425
50426
50427
50428
50429
50430
50431
50432
50433
50434
50435
50436
50437
50438
50439
50440
50441
50442
50443
50444
50445
50446
50447
50448
50449
50450
50451
50452
50453
50454
50455
50456
50457
50458
50459
50460
50461
50462
50463
50464
50465
50466
50467
50468
50469
50470
50471
50472
50473
50474
50475
50476
50477
50478
50479
50480
50481
50482
50483
50484
50485
50486
50487
50488
50489
50490
50491
50492
50493
50494
50495
50496
50497
50498
50499
50500
50501
50502
50503
50504
50505
50506
50507
50508
50509
50510
50511
50512
50513
50514
50515
50516
50517
50518
50519
50520
50521
50522
50523
50524
50525
50526
50527
50528
50529
50530
50531
50532
50533
50534
50535
50536
50537
50538
50539
50540
50541
50542
50543
50544
50545
50546
50547
50548
50549
50550
50551
50552
50553
50554
50555
50556
50557
50558
50559
50560
50561
50562
50563
50564
50565
50566
50567
50568
50569
50570
50571
50572
50573
50574
50575
50576
50577
50578
50579
50580
50581
50582
50583
50584
50585
50586
50587
50588
50589
50590
50591
50592
50593
50594
50595
50596
50597
50598
50599
50600
50601
50602
50603
50604
50605
50606
50607
50608
50609
50610
50611
50612
50613
50614
50615
50616
50617
50618
50619
50620
50621
50622
50623
50624
50625
50626
50627
50628
50629
50630
50631
50632
50633
50634
50635
50636
50637
50638
50639
50640
50641
50642
50643
50644
50645
50646
50647
50648
50649
50650
50651
50652
50653
50654
50655
50656
50657
50658
50659
50660
50661
50662
50663
50664
50665
50666
50667
50668
50669
50670
50671
50672
50673
50674
50675
50676
50677
50678
50679
50680
50681
50682
50683
50684
50685
50686
50687
50688
50689
50690
50691
50692
50693
50694
50695
50696
50697
50698
50699
50700
50701
50702
50703
50704
50705
50706
50707
50708
50709
50710
50711
50712
50713
50714
50715
50716
50717
50718
50719
50720
50721
50722
50723
50724
50725
50726
50727
50728
50729
50730
50731
50732
50733
50734
50735
50736
50737
50738
50739
50740
50741
50742
50743
50744
50745
50746
50747
50748
50749
50750
50751
50752
50753
50754
50755
50756
50757
50758
50759
50760
50761
50762
50763
50764
50765
50766
50767
50768
50769
50770
50771
50772
50773
50774
50775
50776
50777
50778
50779
50780
50781
50782
50783
50784
50785
50786
50787
50788
50789
50790
50791
50792
50793
50794
50795
50796
50797
50798
50799
50800
50801
50802
50803
50804
50805
50806
50807
50808
50809
50810
50811
50812
50813
50814
50815
50816
50817
50818
50819
50820
50821
50822
50823
50824
50825
50826
50827
50828
50829
50830
50831
50832
50833
50834
50835
50836
50837
50838
50839
50840
50841
50842
50843
50844
50845
50846
50847
50848
50849
50850
50851
50852
50853
50854
50855
50856
50857
50858
50859
50860
50861
50862
50863
50864
50865
50866
50867
50868
50869
50870
50871
50872
50873
50874
50875
50876
50877
50878
50879
50880
50881
50882
50883
50884
50885
50886
50887
50888
50889
50890
50891
50892
50893
50894
50895
50896
50897
50898
50899
50900
50901
50902
50903
50904
50905
50906
50907
50908
50909
50910
50911
50912
50913
50914
50915
50916
50917
50918
50919
50920
50921
50922
50923
50924
50925
50926
50927
50928
50929
50930
50931
50932
50933
50934
50935
50936
50937
50938
50939
50940
50941
50942
50943
50944
50945
50946
50947
50948
50949
50950
50951
50952
50953
50954
50955
50956
50957
50958
50959
50960
50961
50962
50963
50964
50965
50966
50967
50968
50969
50970
50971
50972
50973
50974
50975
50976
50977
50978
50979
50980
50981
50982
50983
50984
50985
50986
50987
50988
50989
50990
50991
50992
50993
50994
50995
50996
50997
50998
50999
51000
51001
51002
51003
51004
51005
51006
51007
51008
51009
51010
51011
51012
51013
51014
51015
51016
51017
51018
51019
51020
51021
51022
51023
51024
51025
51026
51027
51028
51029
51030
51031
51032
51033
51034
51035
51036
51037
51038
51039
51040
51041
51042
51043
51044
51045
51046
51047
51048
51049
51050
51051
51052
51053
51054
51055
51056
51057
51058
51059
51060
51061
51062
51063
51064
51065
51066
51067
51068
51069
51070
51071
51072
51073
51074
51075
51076
51077
51078
51079
51080
51081
51082
51083
51084
51085
51086
51087
51088
51089
51090
51091
51092
51093
51094
51095
51096
51097
51098
51099
51100
51101
51102
51103
51104
51105
51106
51107
51108
51109
51110
51111
51112
51113
51114
51115
51116
51117
51118
51119
51120
51121
51122
51123
51124
51125
51126
51127
51128
51129
51130
51131
51132
51133
51134
51135
51136
51137
51138
51139
51140
51141
51142
51143
51144
51145
51146
51147
51148
51149
51150
51151
51152
51153
51154
51155
51156
51157
51158
51159
51160
51161
51162
51163
51164
51165
51166
51167
51168
51169
51170
51171
51172
51173
51174
51175
51176
51177
51178
51179
51180
51181
51182
51183
51184
51185
51186
51187
51188
51189
51190
51191
51192
51193
51194
51195
51196
51197
51198
51199
51200
51201
51202
51203
51204
51205
51206
51207
51208
51209
51210
51211
51212
51213
51214
51215
51216
51217
51218
51219
51220
51221
51222
51223
51224
51225
51226
51227
51228
51229
51230
51231
51232
51233
51234
51235
51236
51237
51238
51239
51240
51241
51242
51243
51244
51245
51246
51247
51248
51249
51250
51251
51252
51253
51254
51255
51256
51257
51258
51259
51260
51261
51262
51263
51264
51265
51266
51267
51268
51269
51270
51271
51272
51273
51274
51275
51276
51277
51278
51279
51280
51281
51282
51283
51284
51285
51286
51287
51288
51289
51290
51291
51292
51293
51294
51295
51296
51297
51298
51299
51300
51301
51302
51303
51304
51305
51306
51307
51308
51309
51310
51311
51312
51313
51314
51315
51316
51317
51318
51319
51320
51321
51322
51323
51324
51325
51326
51327
51328
51329
51330
51331
51332
51333
51334
51335
51336
51337
51338
51339
51340
51341
51342
51343
51344
51345
51346
51347
51348
51349
51350
51351
51352
51353
51354
51355
51356
51357
51358
51359
51360
51361
51362
51363
51364
51365
51366
51367
51368
51369
51370
51371
51372
51373
51374
51375
51376
51377
51378
51379
51380
51381
51382
51383
51384
51385
51386
51387
51388
51389
51390
51391
51392
51393
51394
51395
51396
51397
51398
51399
51400
51401
51402
51403
51404
51405
51406
51407
51408
51409
51410
51411
51412
51413
51414
51415
51416
51417
51418
51419
51420
51421
51422
51423
51424
51425
51426
51427
51428
51429
51430
51431
51432
51433
51434
51435
51436
51437
51438
51439
51440
51441
51442
51443
51444
51445
51446
51447
51448
51449
51450
51451
51452
51453
51454
51455
51456
51457
51458
51459
51460
51461
51462
51463
51464
51465
51466
51467
51468
51469
51470
51471
51472
51473
51474
51475
51476
51477
51478
51479
51480
51481
51482
51483
51484
51485
51486
51487
51488
51489
51490
51491
51492
51493
51494
51495
51496
51497
51498
51499
51500
51501
51502
51503
51504
51505
51506
51507
51508
51509
51510
51511
51512
51513
51514
51515
51516
51517
51518
51519
51520
51521
51522
51523
51524
51525
51526
51527
51528
51529
51530
51531
51532
51533
51534
51535
51536
51537
51538
51539
51540
51541
51542
51543
51544
51545
51546
51547
51548
51549
51550
51551
51552
51553
51554
51555
51556
51557
51558
51559
51560
51561
51562
51563
51564
51565
51566
51567
51568
51569
51570
51571
51572
51573
51574
51575
51576
51577
51578
51579
51580
51581
51582
51583
51584
51585
51586
51587
51588
51589
51590
51591
51592
51593
51594
51595
51596
51597
51598
51599
51600
51601
51602
51603
51604
51605
51606
51607
51608
51609
51610
51611
51612
51613
51614
51615
51616
51617
51618
51619
51620
51621
51622
51623
51624
51625
51626
51627
51628
51629
51630
51631
51632
51633
51634
51635
51636
51637
51638
51639
51640
51641
51642
51643
51644
51645
51646
51647
51648
51649
51650
51651
51652
51653
51654
51655
51656
51657
51658
51659
51660
51661
51662
51663
51664
51665
51666
51667
51668
51669
51670
51671
51672
51673
51674
51675
51676
51677
51678
51679
51680
51681
51682
51683
51684
51685
51686
51687
51688
51689
51690
51691
51692
51693
51694
51695
51696
51697
51698
51699
51700
51701
51702
51703
51704
51705
51706
51707
51708
51709
51710
51711
51712
51713
51714
51715
51716
51717
51718
51719
51720
51721
51722
51723
51724
51725
51726
51727
51728
51729
51730
51731
51732
51733
51734
51735
51736
51737
51738
51739
51740
51741
51742
51743
51744
51745
51746
51747
51748
51749
51750
51751
51752
51753
51754
51755
51756
51757
51758
51759
51760
51761
51762
51763
51764
51765
51766
51767
51768
51769
51770
51771
51772
51773
51774
51775
51776
51777
51778
51779
51780
51781
51782
51783
51784
51785
51786
51787
51788
51789
51790
51791
51792
51793
51794
51795
51796
51797
51798
51799
51800
51801
51802
51803
51804
51805
51806
51807
51808
51809
51810
51811
51812
51813
51814
51815
51816
51817
51818
51819
51820
51821
51822
51823
51824
51825
51826
51827
51828
51829
51830
51831
51832
51833
51834
51835
51836
51837
51838
51839
51840
51841
51842
51843
51844
51845
51846
51847
51848
51849
51850
51851
51852
51853
51854
51855
51856
51857
51858
51859
51860
51861
51862
51863
51864
51865
51866
51867
51868
51869
51870
51871
51872
51873
51874
51875
51876
51877
51878
51879
51880
51881
51882
51883
51884
51885
51886
51887
51888
51889
51890
51891
51892
51893
51894
51895
51896
51897
51898
51899
51900
51901
51902
51903
51904
51905
51906
51907
51908
51909
51910
51911
51912
51913
51914
51915
51916
51917
51918
51919
51920
51921
51922
51923
51924
51925
51926
51927
51928
51929
51930
51931
51932
51933
51934
51935
51936
51937
51938
51939
51940
51941
51942
51943
51944
51945
51946
51947
51948
51949
51950
51951
51952
51953
51954
51955
51956
51957
51958
51959
51960
51961
51962
51963
51964
51965
51966
51967
51968
51969
51970
51971
51972
51973
51974
51975
51976
51977
51978
51979
51980
51981
51982
51983
51984
51985
51986
51987
51988
51989
51990
51991
51992
51993
51994
51995
51996
51997
51998
51999
52000
52001
52002
52003
52004
52005
52006
52007
52008
52009
52010
52011
52012
52013
52014
52015
52016
52017
52018
52019
52020
52021
52022
52023
52024
52025
52026
52027
52028
52029
52030
52031
52032
52033
52034
52035
52036
52037
52038
52039
52040
52041
52042
52043
52044
52045
52046
52047
52048
52049
52050
52051
52052
52053
52054
52055
52056
52057
52058
52059
52060
52061
52062
52063
52064
52065
52066
52067
52068
52069
52070
52071
52072
52073
52074
52075
52076
52077
52078
52079
52080
52081
52082
52083
52084
52085
52086
52087
52088
52089
52090
52091
52092
52093
52094
52095
52096
52097
52098
52099
52100
52101
52102
52103
52104
52105
52106
52107
52108
52109
52110
52111
52112
52113
52114
52115
52116
52117
52118
52119
52120
52121
52122
52123
52124
52125
52126
52127
52128
52129
52130
52131
52132
52133
52134
52135
52136
52137
52138
52139
52140
52141
52142
52143
52144
52145
52146
52147
52148
52149
52150
52151
52152
52153
52154
52155
52156
52157
52158
52159
52160
52161
52162
52163
52164
52165
52166
52167
52168
52169
52170
52171
52172
52173
52174
52175
52176
52177
52178
52179
52180
52181
52182
52183
52184
52185
52186
52187
52188
52189
52190
52191
52192
52193
52194
52195
52196
52197
52198
52199
52200
52201
52202
52203
52204
52205
52206
52207
52208
52209
52210
52211
52212
52213
52214
52215
52216
52217
52218
52219
52220
52221
52222
52223
52224
52225
52226
52227
52228
52229
52230
52231
52232
52233
52234
52235
52236
52237
52238
52239
52240
52241
52242
52243
52244
52245
52246
52247
52248
52249
52250
52251
52252
52253
52254
52255
52256
52257
52258
52259
52260
52261
52262
52263
52264
52265
52266
52267
52268
52269
52270
52271
52272
52273
52274
52275
52276
52277
52278
52279
52280
52281
52282
52283
52284
52285
52286
52287
52288
52289
52290
52291
52292
52293
52294
52295
52296
52297
52298
52299
52300
52301
52302
52303
52304
52305
52306
52307
52308
52309
52310
52311
52312
52313
52314
52315
52316
52317
52318
52319
52320
52321
52322
52323
52324
52325
52326
52327
52328
52329
52330
52331
52332
52333
52334
52335
52336
52337
52338
52339
52340
52341
52342
52343
52344
52345
52346
52347
52348
52349
52350
52351
52352
52353
52354
52355
52356
52357
52358
52359
52360
52361
52362
52363
52364
52365
52366
52367
52368
52369
52370
52371
52372
52373
52374
52375
52376
52377
52378
52379
52380
52381
52382
52383
52384
52385
52386
52387
52388
52389
52390
52391
52392
52393
52394
52395
52396
52397
52398
52399
52400
52401
52402
52403
52404
52405
52406
52407
52408
52409
52410
52411
52412
52413
52414
52415
52416
52417
52418
52419
52420
52421
52422
52423
52424
52425
52426
52427
52428
52429
52430
52431
52432
52433
52434
52435
52436
52437
52438
52439
52440
52441
52442
52443
52444
52445
52446
52447
52448
52449
52450
52451
52452
52453
52454
52455
52456
52457
52458
52459
52460
52461
52462
52463
52464
52465
52466
52467
52468
52469
52470
52471
52472
52473
52474
52475
52476
52477
52478
52479
52480
52481
52482
52483
52484
52485
52486
52487
52488
52489
52490
52491
52492
52493
52494
52495
52496
52497
52498
52499
52500
52501
52502
52503
52504
52505
52506
52507
52508
52509
52510
52511
52512
52513
52514
52515
52516
52517
52518
52519
52520
52521
52522
52523
52524
52525
52526
52527
52528
52529
52530
52531
52532
52533
52534
52535
52536
52537
52538
52539
52540
52541
52542
52543
52544
52545
52546
52547
52548
52549
52550
52551
52552
52553
52554
52555
52556
52557
52558
52559
52560
52561
52562
52563
52564
52565
52566
52567
52568
52569
52570
52571
52572
52573
52574
52575
52576
52577
52578
52579
52580
52581
52582
52583
52584
52585
52586
52587
52588
52589
52590
52591
52592
52593
52594
52595
52596
52597
52598
52599
52600
52601
52602
52603
52604
52605
52606
52607
52608
52609
52610
52611
52612
52613
52614
52615
52616
52617
52618
52619
52620
52621
52622
52623
52624
52625
52626
52627
52628
52629
52630
52631
52632
52633
52634
52635
52636
52637
52638
52639
52640
52641
52642
52643
52644
52645
52646
52647
52648
52649
52650
52651
52652
52653
52654
52655
52656
52657
52658
52659
52660
52661
52662
52663
52664
52665
52666
52667
52668
52669
52670
52671
52672
52673
52674
52675
52676
52677
52678
52679
52680
52681
52682
52683
52684
52685
52686
52687
52688
52689
52690
52691
52692
52693
52694
52695
52696
52697
52698
52699
52700
52701
52702
52703
52704
52705
52706
52707
52708
52709
52710
52711
52712
52713
52714
52715
52716
52717
52718
52719
52720
52721
52722
52723
52724
52725
52726
52727
52728
52729
52730
52731
52732
52733
52734
52735
52736
52737
52738
52739
52740
52741
52742
52743
52744
52745
52746
52747
52748
52749
52750
52751
52752
52753
52754
52755
52756
52757
52758
52759
52760
52761
52762
52763
52764
52765
52766
52767
52768
52769
52770
52771
52772
52773
52774
52775
52776
52777
52778
52779
52780
52781
52782
52783
52784
52785
52786
52787
52788
52789
52790
52791
52792
52793
52794
52795
52796
52797
52798
52799
52800
52801
52802
52803
52804
52805
52806
52807
52808
52809
52810
52811
52812
52813
52814
52815
52816
52817
52818
52819
52820
52821
52822
52823
52824
52825
52826
52827
52828
52829
52830
52831
52832
52833
52834
52835
52836
52837
52838
52839
52840
52841
52842
52843
52844
52845
52846
52847
52848
52849
52850
52851
52852
52853
52854
52855
52856
52857
52858
52859
52860
52861
52862
52863
52864
52865
52866
52867
52868
52869
52870
52871
52872
52873
52874
52875
52876
52877
52878
52879
52880
52881
52882
52883
52884
52885
52886
52887
52888
52889
52890
52891
52892
52893
52894
52895
52896
52897
52898
52899
52900
52901
52902
52903
52904
52905
52906
52907
52908
52909
52910
52911
52912
52913
52914
52915
52916
52917
52918
52919
52920
52921
52922
52923
52924
52925
52926
52927
52928
52929
52930
52931
52932
52933
52934
52935
52936
52937
52938
52939
52940
52941
52942
52943
52944
52945
52946
52947
52948
52949
52950
52951
52952
52953
52954
52955
52956
52957
52958
52959
52960
52961
52962
52963
52964
52965
52966
52967
52968
52969
52970
52971
52972
52973
52974
52975
52976
52977
52978
52979
52980
52981
52982
52983
52984
52985
52986
52987
52988
52989
52990
52991
52992
52993
52994
52995
52996
52997
52998
52999
53000
53001
53002
53003
53004
53005
53006
53007
53008
53009
53010
53011
53012
53013
53014
53015
53016
53017
53018
53019
53020
53021
53022
53023
53024
53025
53026
53027
53028
53029
53030
53031
53032
53033
53034
53035
53036
53037
53038
53039
53040
53041
53042
53043
53044
53045
53046
53047
53048
53049
53050
53051
53052
53053
53054
53055
53056
53057
53058
53059
53060
53061
53062
53063
53064
53065
53066
53067
53068
53069
53070
53071
53072
53073
53074
53075
53076
53077
53078
53079
53080
53081
53082
53083
53084
53085
53086
53087
53088
53089
53090
53091
53092
53093
53094
53095
53096
53097
53098
53099
53100
53101
53102
53103
53104
53105
53106
53107
53108
53109
53110
53111
53112
53113
53114
53115
53116
53117
53118
53119
53120
53121
53122
53123
53124
53125
53126
53127
53128
53129
53130
53131
53132
53133
53134
53135
53136
53137
53138
53139
53140
53141
53142
53143
53144
53145
53146
53147
53148
53149
53150
53151
53152
53153
53154
53155
53156
53157
53158
53159
53160
53161
53162
53163
53164
53165
53166
53167
53168
53169
53170
53171
53172
53173
53174
53175
53176
53177
53178
53179
53180
53181
53182
53183
53184
53185
53186
53187
53188
53189
53190
53191
53192
53193
53194
53195
53196
53197
53198
53199
53200
53201
53202
53203
53204
53205
53206
53207
53208
53209
53210
53211
53212
53213
53214
53215
53216
53217
53218
53219
53220
53221
53222
53223
53224
53225
53226
53227
53228
53229
53230
53231
53232
53233
53234
53235
53236
53237
53238
53239
53240
53241
53242
53243
53244
53245
53246
53247
53248
53249
53250
53251
53252
53253
53254
53255
53256
53257
53258
53259
53260
53261
53262
53263
53264
53265
53266
53267
53268
53269
53270
53271
53272
53273
53274
53275
53276
53277
53278
53279
53280
53281
53282
53283
53284
53285
53286
53287
53288
53289
53290
53291
53292
53293
53294
53295
53296
53297
53298
53299
53300
53301
53302
53303
53304
53305
53306
53307
53308
53309
53310
53311
53312
53313
53314
53315
53316
53317
53318
53319
53320
53321
53322
53323
53324
53325
53326
53327
53328
53329
53330
53331
53332
53333
53334
53335
53336
53337
53338
53339
53340
53341
53342
53343
53344
53345
53346
53347
53348
53349
53350
53351
53352
53353
53354
53355
53356
53357
53358
53359
53360
53361
53362
53363
53364
53365
53366
53367
53368
53369
53370
53371
53372
53373
53374
53375
53376
53377
53378
53379
53380
53381
53382
53383
53384
53385
53386
53387
53388
53389
53390
53391
53392
53393
53394
53395
53396
53397
53398
53399
53400
53401
53402
53403
53404
53405
53406
53407
53408
53409
53410
53411
53412
53413
53414
53415
53416
53417
53418
53419
53420
53421
53422
53423
53424
53425
53426
53427
53428
53429
53430
53431
53432
53433
53434
53435
53436
53437
53438
53439
53440
53441
53442
53443
53444
53445
53446
53447
53448
53449
53450
53451
53452
53453
53454
53455
53456
53457
53458
53459
53460
53461
53462
53463
53464
53465
53466
53467
53468
53469
53470
53471
53472
53473
53474
53475
53476
53477
53478
53479
53480
53481
53482
53483
53484
53485
53486
53487
53488
53489
53490
53491
53492
53493
53494
53495
53496
53497
53498
53499
53500
53501
53502
53503
53504
53505
53506
53507
53508
53509
53510
53511
53512
53513
53514
53515
53516
53517
53518
53519
53520
53521
53522
53523
53524
53525
53526
53527
53528
53529
53530
53531
53532
53533
53534
53535
53536
53537
53538
53539
53540
53541
53542
53543
53544
53545
53546
53547
53548
53549
53550
53551
53552
53553
53554
53555
53556
53557
53558
53559
53560
53561
53562
53563
53564
53565
53566
53567
53568
53569
53570
53571
53572
53573
53574
53575
53576
53577
53578
53579
53580
53581
53582
53583
53584
53585
53586
53587
53588
53589
53590
53591
53592
53593
53594
53595
53596
53597
53598
53599
53600
53601
53602
53603
53604
53605
53606
53607
53608
53609
53610
53611
53612
53613
53614
53615
53616
53617
53618
53619
53620
53621
53622
53623
53624
53625
53626
53627
53628
53629
53630
53631
53632
53633
53634
53635
53636
53637
53638
53639
53640
53641
53642
53643
53644
53645
53646
53647
53648
53649
53650
53651
53652
53653
53654
53655
53656
53657
53658
53659
53660
53661
53662
53663
53664
53665
53666
53667
53668
53669
53670
53671
53672
53673
53674
53675
53676
53677
53678
53679
53680
53681
53682
53683
53684
53685
53686
53687
53688
53689
53690
53691
53692
53693
53694
53695
53696
53697
53698
53699
53700
53701
53702
53703
53704
53705
53706
53707
53708
53709
53710
53711
53712
53713
53714
53715
53716
53717
53718
53719
53720
53721
53722
53723
53724
53725
53726
53727
53728
53729
53730
53731
53732
53733
53734
53735
53736
53737
53738
53739
53740
53741
53742
53743
53744
53745
53746
53747
53748
53749
53750
53751
53752
53753
53754
53755
53756
53757
53758
53759
53760
53761
53762
53763
53764
53765
53766
53767
53768
53769
53770
53771
53772
53773
53774
53775
53776
53777
53778
53779
53780
53781
53782
53783
53784
53785
53786
53787
53788
53789
53790
53791
53792
53793
53794
53795
53796
53797
53798
53799
53800
53801
53802
53803
53804
53805
53806
53807
53808
53809
53810
53811
53812
53813
53814
53815
53816
53817
53818
53819
53820
53821
53822
53823
53824
53825
53826
53827
53828
53829
53830
53831
53832
53833
53834
53835
53836
53837
53838
53839
53840
53841
53842
53843
53844
53845
53846
53847
53848
53849
53850
53851
53852
53853
53854
53855
53856
53857
53858
53859
53860
53861
53862
53863
53864
53865
53866
53867
53868
53869
53870
53871
53872
53873
53874
53875
53876
53877
53878
53879
53880
53881
53882
53883
53884
53885
53886
53887
53888
53889
53890
53891
53892
53893
53894
53895
53896
53897
53898
53899
53900
53901
53902
53903
53904
53905
53906
53907
53908
53909
53910
53911
53912
53913
53914
53915
53916
53917
53918
53919
53920
53921
53922
53923
53924
53925
53926
53927
53928
53929
53930
53931
53932
53933
53934
53935
53936
53937
53938
53939
53940
53941
53942
53943
53944
53945
53946
53947
53948
53949
53950
53951
53952
53953
53954
53955
53956
53957
53958
53959
53960
53961
53962
53963
53964
53965
53966
53967
53968
53969
53970
53971
53972
53973
53974
53975
53976
53977
53978
53979
53980
53981
53982
53983
53984
53985
53986
53987
53988
53989
53990
53991
53992
53993
53994
53995
53996
53997
53998
53999
54000
54001
54002
54003
54004
54005
54006
54007
54008
54009
54010
54011
54012
54013
54014
54015
54016
54017
54018
54019
54020
54021
54022
54023
54024
54025
54026
54027
54028
54029
54030
54031
54032
54033
54034
54035
54036
54037
54038
54039
54040
54041
54042
54043
54044
54045
54046
54047
54048
54049
54050
54051
54052
54053
54054
54055
54056
54057
54058
54059
54060
54061
54062
54063
54064
54065
54066
54067
54068
54069
54070
54071
54072
54073
54074
54075
54076
54077
54078
54079
54080
54081
54082
54083
54084
54085
54086
54087
54088
54089
54090
54091
54092
54093
54094
54095
54096
54097
54098
54099
54100
54101
54102
54103
54104
54105
54106
54107
54108
54109
54110
54111
54112
54113
54114
54115
54116
54117
54118
54119
54120
54121
54122
54123
54124
54125
54126
54127
54128
54129
54130
54131
54132
54133
54134
54135
54136
54137
54138
54139
54140
54141
54142
54143
54144
54145
54146
54147
54148
54149
54150
54151
54152
54153
54154
54155
54156
54157
54158
54159
54160
54161
54162
54163
54164
54165
54166
54167
54168
54169
54170
54171
54172
54173
54174
54175
54176
54177
54178
54179
54180
54181
54182
54183
54184
54185
54186
54187
54188
54189
54190
54191
54192
54193
54194
54195
54196
54197
54198
54199
54200
54201
54202
54203
54204
54205
54206
54207
54208
54209
54210
54211
54212
54213
54214
54215
54216
54217
54218
54219
54220
54221
54222
54223
54224
54225
54226
54227
54228
54229
54230
54231
54232
54233
54234
54235
54236
54237
54238
54239
54240
54241
54242
54243
54244
54245
54246
54247
54248
54249
54250
54251
54252
54253
54254
54255
54256
54257
54258
54259
54260
54261
54262
54263
54264
54265
54266
54267
54268
54269
54270
54271
54272
54273
54274
54275
54276
54277
54278
54279
54280
54281
54282
54283
54284
54285
54286
54287
54288
54289
54290
54291
54292
54293
54294
54295
54296
54297
54298
54299
54300
54301
54302
54303
54304
54305
54306
54307
54308
54309
54310
54311
54312
54313
54314
54315
54316
54317
54318
54319
54320
54321
54322
54323
54324
54325
54326
54327
54328
54329
54330
54331
54332
54333
54334
54335
54336
54337
54338
54339
54340
54341
54342
54343
54344
54345
54346
54347
54348
54349
54350
54351
54352
54353
54354
54355
54356
54357
54358
54359
54360
54361
54362
54363
54364
54365
54366
54367
54368
54369
54370
54371
54372
54373
54374
54375
54376
54377
54378
54379
54380
54381
54382
54383
54384
54385
54386
54387
54388
54389
54390
54391
54392
54393
54394
54395
54396
54397
54398
54399
54400
54401
54402
54403
54404
54405
54406
54407
54408
54409
54410
54411
54412
54413
54414
54415
54416
54417
54418
54419
54420
54421
54422
54423
54424
54425
54426
54427
54428
54429
54430
54431
54432
54433
54434
54435
54436
54437
54438
54439
54440
54441
54442
54443
54444
54445
54446
54447
54448
54449
54450
54451
54452
54453
54454
54455
54456
54457
54458
54459
54460
54461
54462
54463
54464
54465
54466
54467
54468
54469
54470
54471
54472
54473
54474
54475
54476
54477
54478
54479
54480
54481
54482
54483
54484
54485
54486
54487
54488
54489
54490
54491
54492
54493
54494
54495
54496
54497
54498
54499
54500
54501
54502
54503
54504
54505
54506
54507
54508
54509
54510
54511
54512
54513
54514
54515
54516
54517
54518
54519
54520
54521
54522
54523
54524
54525
54526
54527
54528
54529
54530
54531
54532
54533
54534
54535
54536
54537
54538
54539
54540
54541
54542
54543
54544
54545
54546
54547
54548
54549
54550
54551
54552
54553
54554
54555
54556
54557
54558
54559
54560
54561
54562
54563
54564
54565
54566
54567
54568
54569
54570
54571
54572
54573
54574
54575
54576
54577
54578
54579
54580
54581
54582
54583
54584
54585
54586
54587
54588
54589
54590
54591
54592
54593
54594
54595
54596
54597
54598
54599
54600
54601
54602
54603
54604
54605
54606
54607
54608
54609
54610
54611
54612
54613
54614
54615
54616
54617
54618
54619
54620
54621
54622
54623
54624
54625
54626
54627
54628
54629
54630
54631
54632
54633
54634
54635
54636
54637
54638
54639
54640
54641
54642
54643
54644
54645
54646
54647
54648
54649
54650
54651
54652
54653
54654
54655
54656
54657
54658
54659
54660
54661
54662
54663
54664
54665
54666
54667
54668
54669
54670
54671
54672
54673
54674
54675
54676
54677
54678
54679
54680
54681
54682
54683
54684
54685
54686
54687
54688
54689
54690
54691
54692
54693
54694
54695
54696
54697
54698
54699
54700
54701
54702
54703
54704
54705
54706
54707
54708
54709
54710
54711
54712
54713
54714
54715
54716
54717
54718
54719
54720
54721
54722
54723
54724
54725
54726
54727
54728
54729
54730
54731
54732
54733
54734
54735
54736
54737
54738
54739
54740
54741
54742
54743
54744
54745
54746
54747
54748
54749
54750
54751
54752
54753
54754
54755
54756
54757
54758
54759
54760
54761
54762
54763
54764
54765
54766
54767
54768
54769
54770
54771
54772
54773
54774
54775
54776
54777
54778
54779
54780
54781
54782
54783
54784
54785
54786
54787
54788
54789
54790
54791
54792
54793
54794
54795
54796
54797
54798
54799
54800
54801
54802
54803
54804
54805
54806
54807
54808
54809
54810
54811
54812
54813
54814
54815
54816
54817
54818
54819
54820
54821
54822
54823
54824
54825
54826
54827
54828
54829
54830
54831
54832
54833
54834
54835
54836
54837
54838
54839
54840
54841
54842
54843
54844
54845
54846
54847
54848
54849
54850
54851
54852
54853
54854
54855
54856
54857
54858
54859
54860
54861
54862
54863
54864
54865
54866
54867
54868
54869
54870
54871
54872
54873
54874
54875
54876
54877
54878
54879
54880
54881
54882
54883
54884
54885
54886
54887
54888
54889
54890
54891
54892
54893
54894
54895
54896
54897
54898
54899
54900
54901
54902
54903
54904
54905
54906
54907
54908
54909
54910
54911
54912
54913
54914
54915
54916
54917
54918
54919
54920
54921
54922
54923
54924
54925
54926
54927
54928
54929
54930
54931
54932
54933
54934
54935
54936
54937
54938
54939
54940
54941
54942
54943
54944
54945
54946
54947
54948
54949
54950
54951
54952
54953
54954
54955
54956
54957
54958
54959
54960
54961
54962
54963
54964
54965
54966
54967
54968
54969
54970
54971
54972
54973
54974
54975
54976
54977
54978
54979
54980
54981
54982
54983
54984
54985
54986
54987
54988
54989
54990
54991
54992
54993
54994
54995
54996
54997
54998
54999
55000
55001
55002
55003
55004
55005
55006
55007
55008
55009
55010
55011
55012
55013
55014
55015
55016
55017
55018
55019
55020
55021
55022
55023
55024
55025
55026
55027
55028
55029
55030
55031
55032
55033
55034
55035
55036
55037
55038
55039
55040
55041
55042
55043
55044
55045
55046
55047
55048
55049
55050
55051
55052
55053
55054
55055
55056
55057
55058
55059
55060
55061
55062
55063
55064
55065
55066
55067
55068
55069
55070
55071
55072
55073
55074
55075
55076
55077
55078
55079
55080
55081
55082
55083
55084
55085
55086
55087
55088
55089
55090
55091
55092
55093
55094
55095
55096
55097
55098
55099
55100
55101
55102
55103
55104
55105
55106
55107
55108
55109
55110
55111
55112
55113
55114
55115
55116
55117
55118
55119
55120
55121
55122
55123
55124
55125
55126
55127
55128
55129
55130
55131
55132
55133
55134
55135
55136
55137
55138
55139
55140
55141
55142
55143
55144
55145
55146
55147
55148
55149
55150
55151
55152
55153
55154
55155
55156
55157
55158
55159
55160
55161
55162
55163
55164
55165
55166
55167
55168
55169
55170
55171
55172
55173
55174
55175
55176
55177
55178
55179
55180
55181
55182
55183
55184
55185
55186
55187
55188
55189
55190
55191
55192
55193
55194
55195
55196
55197
55198
55199
55200
55201
55202
55203
55204
55205
55206
55207
55208
55209
55210
55211
55212
55213
55214
55215
55216
55217
55218
55219
55220
55221
55222
55223
55224
55225
55226
55227
55228
55229
55230
55231
55232
55233
55234
55235
55236
55237
55238
55239
55240
55241
55242
55243
55244
55245
55246
55247
55248
55249
55250
55251
55252
55253
55254
55255
55256
55257
55258
55259
55260
55261
55262
55263
55264
55265
55266
55267
55268
55269
55270
55271
55272
55273
55274
55275
55276
55277
55278
55279
55280
55281
55282
55283
55284
55285
55286
55287
55288
55289
55290
55291
55292
55293
55294
55295
55296
55297
55298
55299
55300
55301
55302
55303
55304
55305
55306
55307
55308
55309
55310
55311
55312
55313
55314
55315
55316
55317
55318
55319
55320
55321
55322
55323
55324
55325
55326
55327
55328
55329
55330
55331
55332
55333
55334
55335
55336
55337
55338
55339
55340
55341
55342
55343
55344
55345
55346
55347
55348
55349
55350
55351
55352
55353
55354
55355
55356
55357
55358
55359
55360
55361
55362
55363
55364
55365
55366
55367
55368
55369
55370
55371
55372
55373
55374
55375
55376
55377
55378
55379
55380
55381
55382
55383
55384
55385
55386
55387
55388
55389
55390
55391
55392
55393
55394
55395
55396
55397
55398
55399
55400
55401
55402
55403
55404
55405
55406
55407
55408
55409
55410
55411
55412
55413
55414
55415
55416
55417
55418
55419
55420
55421
55422
55423
55424
55425
55426
55427
55428
55429
55430
55431
55432
55433
55434
55435
55436
55437
55438
55439
55440
55441
55442
55443
55444
55445
55446
55447
55448
55449
55450
55451
55452
55453
55454
55455
55456
55457
55458
55459
55460
55461
55462
55463
55464
55465
55466
55467
55468
55469
55470
55471
55472
55473
55474
55475
55476
55477
55478
55479
55480
55481
55482
55483
55484
55485
55486
55487
55488
55489
55490
55491
55492
55493
55494
55495
55496
55497
55498
55499
55500
55501
55502
55503
55504
55505
55506
55507
55508
55509
55510
55511
55512
55513
55514
55515
55516
55517
55518
55519
55520
55521
55522
55523
55524
55525
55526
55527
55528
55529
55530
55531
55532
55533
55534
55535
55536
55537
55538
55539
55540
55541
55542
55543
55544
55545
55546
55547
55548
55549
55550
55551
55552
55553
55554
55555
55556
55557
55558
55559
55560
55561
55562
55563
55564
55565
55566
55567
55568
55569
55570
55571
55572
55573
55574
55575
55576
55577
55578
55579
55580
55581
55582
55583
55584
55585
55586
55587
55588
55589
55590
55591
55592
55593
55594
55595
55596
55597
55598
55599
55600
55601
55602
55603
55604
55605
55606
55607
55608
55609
55610
55611
55612
55613
55614
55615
55616
55617
55618
55619
55620
55621
55622
55623
55624
55625
55626
55627
55628
55629
55630
55631
55632
55633
55634
55635
55636
55637
55638
55639
55640
55641
55642
55643
55644
55645
55646
55647
55648
55649
55650
55651
55652
55653
55654
55655
55656
55657
55658
55659
55660
55661
55662
55663
55664
55665
55666
55667
55668
55669
55670
55671
55672
55673
55674
55675
55676
55677
55678
55679
55680
55681
55682
55683
55684
55685
55686
55687
55688
55689
55690
55691
55692
55693
55694
55695
55696
55697
55698
55699
55700
55701
55702
55703
55704
55705
55706
55707
55708
55709
55710
55711
55712
55713
55714
55715
55716
55717
55718
55719
55720
55721
55722
55723
55724
55725
55726
55727
55728
55729
55730
55731
55732
55733
55734
55735
55736
55737
55738
55739
55740
55741
55742
55743
55744
55745
55746
55747
55748
55749
55750
55751
55752
55753
55754
55755
55756
55757
55758
55759
55760
55761
55762
55763
55764
55765
55766
55767
55768
55769
55770
55771
55772
55773
55774
55775
55776
55777
55778
55779
55780
55781
55782
55783
55784
55785
55786
55787
55788
55789
55790
55791
55792
55793
55794
55795
55796
55797
55798
55799
55800
55801
55802
55803
55804
55805
55806
55807
55808
55809
55810
55811
55812
55813
55814
55815
55816
55817
55818
55819
55820
55821
55822
55823
55824
55825
55826
55827
55828
55829
55830
55831
55832
55833
55834
55835
55836
55837
55838
55839
55840
55841
55842
55843
55844
55845
55846
55847
55848
55849
55850
55851
55852
55853
55854
55855
55856
55857
55858
55859
55860
55861
55862
55863
55864
55865
55866
55867
55868
55869
55870
55871
55872
55873
55874
55875
55876
55877
55878
55879
55880
55881
55882
55883
55884
55885
55886
55887
55888
55889
55890
55891
55892
55893
55894
55895
55896
55897
55898
55899
55900
55901
55902
55903
55904
55905
55906
55907
55908
55909
55910
55911
55912
55913
55914
55915
55916
55917
55918
55919
55920
55921
55922
55923
55924
55925
55926
55927
55928
55929
55930
55931
55932
55933
55934
55935
55936
55937
55938
55939
55940
55941
55942
55943
55944
55945
55946
55947
55948
55949
55950
55951
55952
55953
55954
55955
55956
55957
55958
55959
55960
55961
55962
55963
55964
55965
55966
55967
55968
55969
55970
55971
55972
55973
55974
55975
55976
55977
55978
55979
55980
55981
55982
55983
55984
55985
55986
55987
55988
55989
55990
55991
55992
55993
55994
55995
55996
55997
55998
55999
56000
56001
56002
56003
56004
56005
56006
56007
56008
56009
56010
56011
56012
56013
56014
56015
56016
56017
56018
56019
56020
56021
56022
56023
56024
56025
56026
56027
56028
56029
56030
56031
56032
56033
56034
56035
56036
56037
56038
56039
56040
56041
56042
56043
56044
56045
56046
56047
56048
56049
56050
56051
56052
56053
56054
56055
56056
56057
56058
56059
56060
56061
56062
56063
56064
56065
56066
56067
56068
56069
56070
56071
56072
56073
56074
56075
56076
56077
56078
56079
56080
56081
56082
56083
56084
56085
56086
56087
56088
56089
56090
56091
56092
56093
56094
56095
56096
56097
56098
56099
56100
56101
56102
56103
56104
56105
56106
56107
56108
56109
56110
56111
56112
56113
56114
56115
56116
56117
56118
56119
56120
56121
56122
56123
56124
56125
56126
56127
56128
56129
56130
56131
56132
56133
56134
56135
56136
56137
56138
56139
56140
56141
56142
56143
56144
56145
56146
56147
56148
56149
56150
56151
56152
56153
56154
56155
56156
56157
56158
56159
56160
56161
56162
56163
56164
56165
56166
56167
56168
56169
56170
56171
56172
56173
56174
56175
56176
56177
56178
56179
56180
56181
56182
56183
56184
56185
56186
56187
56188
56189
56190
56191
56192
56193
56194
56195
56196
56197
56198
56199
56200
56201
56202
56203
56204
56205
56206
56207
56208
56209
56210
56211
56212
56213
56214
56215
56216
56217
56218
56219
56220
56221
56222
56223
56224
56225
56226
56227
56228
56229
56230
56231
56232
56233
56234
56235
56236
56237
56238
56239
56240
56241
56242
56243
56244
56245
56246
56247
56248
56249
56250
56251
56252
56253
56254
56255
56256
56257
56258
56259
56260
56261
56262
56263
56264
56265
56266
56267
56268
56269
56270
56271
56272
56273
56274
56275
56276
56277
56278
56279
56280
56281
56282
56283
56284
56285
56286
56287
56288
56289
56290
56291
56292
56293
56294
56295
56296
56297
56298
56299
56300
56301
56302
56303
56304
56305
56306
56307
56308
56309
56310
56311
56312
56313
56314
56315
56316
56317
56318
56319
56320
56321
56322
56323
56324
56325
56326
56327
56328
56329
56330
56331
56332
56333
56334
56335
56336
56337
56338
56339
56340
56341
56342
56343
56344
56345
56346
56347
56348
56349
56350
56351
56352
56353
56354
56355
56356
56357
56358
56359
56360
56361
56362
56363
56364
56365
56366
56367
56368
56369
56370
56371
56372
56373
56374
56375
56376
56377
56378
56379
56380
56381
56382
56383
56384
56385
56386
56387
56388
56389
56390
56391
56392
56393
56394
56395
56396
56397
56398
56399
56400
56401
56402
56403
56404
56405
56406
56407
56408
56409
56410
56411
56412
56413
56414
56415
56416
56417
56418
56419
56420
56421
56422
56423
56424
56425
56426
56427
56428
56429
56430
56431
56432
56433
56434
56435
56436
56437
56438
56439
56440
56441
56442
56443
56444
56445
56446
56447
56448
56449
56450
56451
56452
56453
56454
56455
56456
56457
56458
56459
56460
56461
56462
56463
56464
56465
56466
56467
56468
56469
56470
56471
56472
56473
56474
56475
56476
56477
56478
56479
56480
56481
56482
56483
56484
56485
56486
56487
56488
56489
56490
56491
56492
56493
56494
56495
56496
56497
56498
56499
56500
56501
56502
56503
56504
56505
56506
56507
56508
56509
56510
56511
56512
56513
56514
56515
56516
56517
56518
56519
56520
56521
56522
56523
56524
56525
56526
56527
56528
56529
56530
56531
56532
56533
56534
56535
56536
56537
56538
56539
56540
56541
56542
56543
56544
56545
56546
56547
56548
56549
56550
56551
56552
56553
56554
56555
56556
56557
56558
56559
56560
56561
56562
56563
56564
56565
56566
56567
56568
56569
56570
56571
56572
56573
56574
56575
56576
56577
56578
56579
56580
56581
56582
56583
56584
56585
56586
56587
56588
56589
56590
56591
56592
56593
56594
56595
56596
56597
56598
56599
56600
56601
56602
56603
56604
56605
56606
56607
56608
56609
56610
56611
56612
56613
56614
56615
56616
56617
56618
56619
56620
56621
56622
56623
56624
56625
56626
56627
56628
56629
56630
56631
56632
56633
56634
56635
56636
56637
56638
56639
56640
56641
56642
56643
56644
56645
56646
56647
56648
56649
56650
56651
56652
56653
56654
56655
56656
56657
56658
56659
56660
56661
56662
56663
56664
56665
56666
56667
56668
56669
56670
56671
56672
56673
56674
56675
56676
56677
56678
56679
56680
56681
56682
56683
56684
56685
56686
56687
56688
56689
56690
56691
56692
56693
56694
56695
56696
56697
56698
56699
56700
56701
56702
56703
56704
56705
56706
56707
56708
56709
56710
56711
56712
56713
56714
56715
56716
56717
56718
56719
56720
56721
56722
56723
56724
56725
56726
56727
56728
56729
56730
56731
56732
56733
56734
56735
56736
56737
56738
56739
56740
56741
56742
56743
56744
56745
56746
56747
56748
56749
56750
56751
56752
56753
56754
56755
56756
56757
56758
56759
56760
56761
56762
56763
56764
56765
56766
56767
56768
56769
56770
56771
56772
56773
56774
56775
56776
56777
56778
56779
56780
56781
56782
56783
56784
56785
56786
56787
56788
56789
56790
56791
56792
56793
56794
56795
56796
56797
56798
56799
56800
56801
56802
56803
56804
56805
56806
56807
56808
56809
56810
56811
56812
56813
56814
56815
56816
56817
56818
56819
56820
56821
56822
56823
56824
56825
56826
56827
56828
56829
56830
56831
56832
56833
56834
56835
56836
56837
56838
56839
56840
56841
56842
56843
56844
56845
56846
56847
56848
56849
56850
56851
56852
56853
56854
56855
56856
56857
56858
56859
56860
56861
56862
56863
56864
56865
56866
56867
56868
56869
56870
56871
56872
56873
56874
56875
56876
56877
56878
56879
56880
56881
56882
56883
56884
56885
56886
56887
56888
56889
56890
56891
56892
56893
56894
56895
56896
56897
56898
56899
56900
56901
56902
56903
56904
56905
56906
56907
56908
56909
56910
56911
56912
56913
56914
56915
56916
56917
56918
56919
56920
56921
56922
56923
56924
56925
56926
56927
56928
56929
56930
56931
56932
56933
56934
56935
56936
56937
56938
56939
56940
56941
56942
56943
56944
56945
56946
56947
56948
56949
56950
56951
56952
56953
56954
56955
56956
56957
56958
56959
56960
56961
56962
56963
56964
56965
56966
56967
56968
56969
56970
56971
56972
56973
56974
56975
56976
56977
56978
56979
56980
56981
56982
56983
56984
56985
56986
56987
56988
56989
56990
56991
56992
56993
56994
56995
56996
56997
56998
56999
57000
57001
57002
57003
57004
57005
57006
57007
57008
57009
57010
57011
57012
57013
57014
57015
57016
57017
57018
57019
57020
57021
57022
57023
57024
57025
57026
57027
57028
57029
57030
57031
57032
57033
57034
57035
57036
57037
57038
57039
57040
57041
57042
57043
57044
57045
57046
57047
57048
57049
57050
57051
57052
57053
57054
57055
57056
57057
57058
57059
57060
57061
57062
57063
57064
57065
57066
57067
57068
57069
57070
57071
57072
57073
57074
57075
57076
57077
57078
57079
57080
57081
57082
57083
57084
57085
57086
57087
57088
57089
57090
57091
57092
57093
57094
57095
57096
57097
57098
57099
57100
57101
57102
57103
57104
57105
57106
57107
57108
57109
57110
57111
57112
57113
57114
57115
57116
57117
57118
57119
57120
57121
57122
57123
57124
57125
57126
57127
57128
57129
57130
57131
57132
57133
57134
57135
57136
57137
57138
57139
57140
57141
57142
57143
57144
57145
57146
57147
57148
57149
57150
57151
57152
57153
57154
57155
57156
57157
57158
57159
57160
57161
57162
57163
57164
57165
57166
57167
57168
57169
57170
57171
57172
57173
57174
57175
57176
57177
57178
57179
57180
57181
57182
57183
57184
57185
57186
57187
57188
57189
57190
57191
57192
57193
57194
57195
57196
57197
57198
57199
57200
57201
57202
57203
57204
57205
57206
57207
57208
57209
57210
57211
57212
57213
57214
57215
57216
57217
57218
57219
57220
57221
57222
57223
57224
57225
57226
57227
57228
57229
57230
57231
57232
57233
57234
57235
57236
57237
57238
57239
57240
57241
57242
57243
57244
57245
57246
57247
57248
57249
57250
57251
57252
57253
57254
57255
57256
57257
57258
57259
57260
57261
57262
57263
57264
57265
57266
57267
57268
57269
57270
57271
57272
57273
57274
57275
57276
57277
57278
57279
57280
57281
57282
57283
57284
57285
57286
57287
57288
57289
57290
57291
57292
57293
57294
57295
57296
57297
57298
57299
57300
57301
57302
57303
57304
57305
57306
57307
57308
57309
57310
57311
57312
57313
57314
57315
57316
57317
57318
57319
57320
57321
57322
57323
57324
57325
57326
57327
57328
57329
57330
57331
57332
57333
57334
57335
57336
57337
57338
57339
57340
57341
57342
57343
57344
57345
57346
57347
57348
57349
57350
57351
57352
57353
57354
57355
57356
57357
57358
57359
57360
57361
57362
57363
57364
57365
57366
57367
57368
57369
57370
57371
57372
57373
57374
57375
57376
57377
57378
57379
57380
57381
57382
57383
57384
57385
57386
57387
57388
57389
57390
57391
57392
57393
57394
57395
57396
57397
57398
57399
57400
57401
57402
57403
57404
57405
57406
57407
57408
57409
57410
57411
57412
57413
57414
57415
57416
57417
57418
57419
57420
57421
57422
57423
57424
57425
57426
57427
57428
57429
57430
57431
57432
57433
57434
57435
57436
57437
57438
57439
57440
57441
57442
57443
57444
57445
57446
57447
57448
57449
57450
57451
57452
57453
57454
57455
57456
57457
57458
57459
57460
57461
57462
57463
57464
57465
57466
57467
57468
57469
57470
57471
57472
57473
57474
57475
57476
57477
57478
57479
57480
57481
57482
57483
57484
57485
57486
57487
57488
57489
57490
57491
57492
57493
57494
57495
57496
57497
57498
57499
57500
57501
57502
57503
57504
57505
57506
57507
57508
57509
57510
57511
57512
57513
57514
57515
57516
57517
57518
57519
57520
57521
57522
57523
57524
57525
57526
57527
57528
57529
57530
57531
57532
57533
57534
57535
57536
57537
57538
57539
57540
57541
57542
57543
57544
57545
57546
57547
57548
57549
57550
57551
57552
57553
57554
57555
57556
57557
57558
57559
57560
57561
57562
57563
57564
57565
57566
57567
57568
57569
57570
57571
57572
57573
57574
57575
57576
57577
57578
57579
57580
57581
57582
57583
57584
57585
57586
57587
57588
57589
57590
57591
57592
57593
57594
57595
57596
57597
57598
57599
57600
57601
57602
57603
57604
57605
57606
57607
57608
57609
57610
57611
57612
57613
57614
57615
57616
57617
57618
57619
57620
57621
57622
57623
57624
57625
57626
57627
57628
57629
57630
57631
57632
57633
57634
57635
57636
57637
57638
57639
57640
57641
57642
57643
57644
57645
57646
57647
57648
57649
57650
57651
57652
57653
57654
57655
57656
57657
57658
57659
57660
57661
57662
57663
57664
57665
57666
57667
57668
57669
57670
57671
57672
57673
57674
57675
57676
57677
57678
57679
57680
57681
57682
57683
57684
57685
57686
57687
57688
57689
57690
57691
57692
57693
57694
57695
57696
57697
57698
57699
57700
57701
57702
57703
57704
57705
57706
57707
57708
57709
57710
57711
57712
57713
57714
57715
57716
57717
57718
57719
57720
57721
57722
57723
57724
57725
57726
57727
57728
57729
57730
57731
57732
57733
57734
57735
57736
57737
57738
57739
57740
57741
57742
57743
57744
57745
57746
57747
57748
57749
57750
57751
57752
57753
57754
57755
57756
57757
57758
57759
57760
57761
57762
57763
57764
57765
57766
57767
57768
57769
57770
57771
57772
57773
57774
57775
57776
57777
57778
57779
57780
57781
57782
57783
57784
57785
57786
57787
57788
57789
57790
57791
57792
57793
57794
57795
57796
57797
57798
57799
57800
57801
57802
57803
57804
57805
57806
57807
57808
57809
57810
57811
57812
57813
57814
57815
57816
57817
57818
57819
57820
57821
57822
57823
57824
57825
57826
57827
57828
57829
57830
57831
57832
57833
57834
57835
57836
57837
57838
57839
57840
57841
57842
57843
57844
57845
57846
57847
57848
57849
57850
57851
57852
57853
57854
57855
57856
57857
57858
57859
57860
57861
57862
57863
57864
57865
57866
57867
57868
57869
57870
57871
57872
57873
57874
57875
57876
57877
57878
57879
57880
57881
57882
57883
57884
57885
57886
57887
57888
57889
57890
57891
57892
57893
57894
57895
57896
57897
57898
57899
57900
57901
57902
57903
57904
57905
57906
57907
57908
57909
57910
57911
57912
57913
57914
57915
57916
57917
57918
57919
57920
57921
57922
57923
57924
57925
57926
57927
57928
57929
57930
57931
57932
57933
57934
57935
57936
57937
57938
57939
57940
57941
57942
57943
57944
57945
57946
57947
57948
57949
57950
57951
57952
57953
57954
57955
57956
57957
57958
57959
57960
57961
57962
57963
57964
57965
57966
57967
57968
57969
57970
57971
57972
57973
57974
57975
57976
57977
57978
57979
57980
57981
57982
57983
57984
57985
57986
57987
57988
57989
57990
57991
57992
57993
57994
57995
57996
57997
57998
57999
58000
58001
58002
58003
58004
58005
58006
58007
58008
58009
58010
58011
58012
58013
58014
58015
58016
58017
58018
58019
58020
58021
58022
58023
58024
58025
58026
58027
58028
58029
58030
58031
58032
58033
58034
58035
58036
58037
58038
58039
58040
58041
58042
58043
58044
58045
58046
58047
58048
58049
58050
58051
58052
58053
58054
58055
58056
58057
58058
58059
58060
58061
58062
58063
58064
58065
58066
58067
58068
58069
58070
58071
58072
58073
58074
58075
58076
58077
58078
58079
58080
58081
58082
58083
58084
58085
58086
58087
58088
58089
58090
58091
58092
58093
58094
58095
58096
58097
58098
58099
58100
58101
58102
58103
58104
58105
58106
58107
58108
58109
58110
58111
58112
58113
58114
58115
58116
58117
58118
58119
58120
58121
58122
58123
58124
58125
58126
58127
58128
58129
58130
58131
58132
58133
58134
58135
58136
58137
58138
58139
58140
58141
58142
58143
58144
58145
58146
58147
58148
58149
58150
58151
58152
58153
58154
58155
58156
58157
58158
58159
58160
58161
58162
58163
58164
58165
58166
58167
58168
58169
58170
58171
58172
58173
58174
58175
58176
58177
58178
58179
58180
58181
58182
58183
58184
58185
58186
58187
58188
58189
58190
58191
58192
58193
58194
58195
58196
58197
58198
58199
58200
58201
58202
58203
58204
58205
58206
58207
58208
58209
58210
58211
58212
58213
58214
58215
58216
58217
58218
58219
58220
58221
58222
58223
58224
58225
58226
58227
58228
58229
58230
58231
58232
58233
58234
58235
58236
58237
58238
58239
58240
58241
58242
58243
58244
58245
58246
58247
58248
58249
58250
58251
58252
58253
58254
58255
58256
58257
58258
58259
58260
58261
58262
58263
58264
58265
58266
58267
58268
58269
58270
58271
58272
58273
58274
58275
58276
58277
58278
58279
58280
58281
58282
58283
58284
58285
58286
58287
58288
58289
58290
58291
58292
58293
58294
58295
58296
58297
58298
58299
58300
58301
58302
58303
58304
58305
58306
58307
58308
58309
58310
58311
58312
58313
58314
58315
58316
58317
58318
58319
58320
58321
58322
58323
58324
58325
58326
58327
58328
58329
58330
58331
58332
58333
58334
58335
58336
58337
58338
58339
58340
58341
58342
58343
58344
58345
58346
58347
58348
58349
58350
58351
58352
58353
58354
58355
58356
58357
58358
58359
58360
58361
58362
58363
58364
58365
58366
58367
58368
58369
58370
58371
58372
58373
58374
58375
58376
58377
58378
58379
58380
58381
58382
58383
58384
58385
58386
58387
58388
58389
58390
58391
58392
58393
58394
58395
58396
58397
58398
58399
58400
58401
58402
58403
58404
58405
58406
58407
58408
58409
58410
58411
58412
58413
58414
58415
58416
58417
58418
58419
58420
58421
58422
58423
58424
58425
58426
58427
58428
58429
58430
58431
58432
58433
58434
58435
58436
58437
58438
58439
58440
58441
58442
58443
58444
58445
58446
58447
58448
58449
58450
58451
58452
58453
58454
58455
58456
58457
58458
58459
58460
58461
58462
58463
58464
58465
58466
58467
58468
58469
58470
58471
58472
58473
58474
58475
58476
58477
58478
58479
58480
58481
58482
58483
58484
58485
58486
58487
58488
58489
58490
58491
58492
58493
58494
58495
58496
58497
58498
58499
58500
58501
58502
58503
58504
58505
58506
58507
58508
58509
58510
58511
58512
58513
58514
58515
58516
58517
58518
58519
58520
58521
58522
58523
58524
58525
58526
58527
58528
58529
58530
58531
58532
58533
58534
58535
58536
58537
58538
58539
58540
58541
58542
58543
58544
58545
58546
58547
58548
58549
58550
58551
58552
58553
58554
58555
58556
58557
58558
58559
58560
58561
58562
58563
58564
58565
58566
58567
58568
58569
58570
58571
58572
58573
58574
58575
58576
58577
58578
58579
58580
58581
58582
58583
58584
58585
58586
58587
58588
58589
58590
58591
58592
58593
58594
58595
58596
58597
58598
58599
58600
58601
58602
58603
58604
58605
58606
58607
58608
58609
58610
58611
58612
58613
58614
58615
58616
58617
58618
58619
58620
58621
58622
58623
58624
58625
58626
58627
58628
58629
58630
58631
58632
58633
58634
58635
58636
58637
58638
58639
58640
58641
58642
58643
58644
58645
58646
58647
58648
58649
58650
58651
58652
58653
58654
58655
58656
58657
58658
58659
58660
58661
58662
58663
58664
58665
58666
58667
58668
58669
58670
58671
58672
58673
58674
58675
58676
58677
58678
58679
58680
58681
58682
58683
58684
58685
58686
58687
58688
58689
58690
58691
58692
58693
58694
58695
58696
58697
58698
58699
58700
58701
58702
58703
58704
58705
58706
58707
58708
58709
58710
58711
58712
58713
58714
58715
58716
58717
58718
58719
58720
58721
58722
58723
58724
58725
58726
58727
58728
58729
58730
58731
58732
58733
58734
58735
58736
58737
58738
58739
58740
58741
58742
58743
58744
58745
58746
58747
58748
58749
58750
58751
58752
58753
58754
58755
58756
58757
58758
58759
58760
58761
58762
58763
58764
58765
58766
58767
58768
58769
58770
58771
58772
58773
58774
58775
58776
58777
58778
58779
58780
58781
58782
58783
58784
58785
58786
58787
58788
58789
58790
58791
58792
58793
58794
58795
58796
58797
58798
58799
58800
58801
58802
58803
58804
58805
58806
58807
58808
58809
58810
58811
58812
58813
58814
58815
58816
58817
58818
58819
58820
58821
58822
58823
58824
58825
58826
58827
58828
58829
58830
58831
58832
58833
58834
58835
58836
58837
58838
58839
58840
58841
58842
58843
58844
58845
58846
58847
58848
58849
58850
58851
58852
58853
58854
58855
58856
58857
58858
58859
58860
58861
58862
58863
58864
58865
58866
58867
58868
58869
58870
58871
58872
58873
58874
58875
58876
58877
58878
58879
58880
58881
58882
58883
58884
58885
58886
58887
58888
58889
58890
58891
58892
58893
58894
58895
58896
58897
58898
58899
58900
58901
58902
58903
58904
58905
58906
58907
58908
58909
58910
58911
58912
58913
58914
58915
58916
58917
58918
58919
58920
58921
58922
58923
58924
58925
58926
58927
58928
58929
58930
58931
58932
58933
58934
58935
58936
58937
58938
58939
58940
58941
58942
58943
58944
58945
58946
58947
58948
58949
58950
58951
58952
58953
58954
58955
58956
58957
58958
58959
58960
58961
58962
58963
58964
58965
58966
58967
58968
58969
58970
58971
58972
58973
58974
58975
58976
58977
58978
58979
58980
58981
58982
58983
58984
58985
58986
58987
58988
58989
58990
58991
58992
58993
58994
58995
58996
58997
58998
58999
59000
59001
59002
59003
59004
59005
59006
59007
59008
59009
59010
59011
59012
59013
59014
59015
59016
59017
59018
59019
59020
59021
59022
59023
59024
59025
59026
59027
59028
59029
59030
59031
59032
59033
59034
59035
59036
59037
59038
59039
59040
59041
59042
59043
59044
59045
59046
59047
59048
59049
59050
59051
59052
59053
59054
59055
59056
59057
59058
59059
59060
59061
59062
59063
59064
59065
59066
59067
59068
59069
59070
59071
59072
59073
59074
59075
59076
59077
59078
59079
59080
59081
59082
59083
59084
59085
59086
59087
59088
59089
59090
59091
59092
59093
59094
59095
59096
59097
59098
59099
59100
59101
59102
59103
59104
59105
59106
59107
59108
59109
59110
59111
59112
59113
59114
59115
59116
59117
59118
59119
59120
59121
59122
59123
59124
59125
59126
59127
59128
59129
59130
59131
59132
59133
59134
59135
59136
59137
59138
59139
59140
59141
59142
59143
59144
59145
59146
59147
59148
59149
59150
59151
59152
59153
59154
59155
59156
59157
59158
59159
59160
59161
59162
59163
59164
59165
59166
59167
59168
59169
59170
59171
59172
59173
59174
59175
59176
59177
59178
59179
59180
59181
59182
59183
59184
59185
59186
59187
59188
59189
59190
59191
59192
59193
59194
59195
59196
59197
59198
59199
59200
59201
59202
59203
59204
59205
59206
59207
59208
59209
59210
59211
59212
59213
59214
59215
59216
59217
59218
59219
59220
59221
59222
59223
59224
59225
59226
59227
59228
59229
59230
59231
59232
59233
59234
59235
59236
59237
59238
59239
59240
59241
59242
59243
59244
59245
59246
59247
59248
59249
59250
59251
59252
59253
59254
59255
59256
59257
59258
59259
59260
59261
59262
59263
59264
59265
59266
59267
59268
59269
59270
59271
59272
59273
59274
59275
59276
59277
59278
59279
59280
59281
59282
59283
59284
59285
59286
59287
59288
59289
59290
59291
59292
59293
59294
59295
59296
59297
59298
59299
59300
59301
59302
59303
59304
59305
59306
59307
59308
59309
59310
59311
59312
59313
59314
59315
59316
59317
59318
59319
59320
59321
59322
59323
59324
59325
59326
59327
59328
59329
59330
59331
59332
59333
59334
59335
59336
59337
59338
59339
59340
59341
59342
59343
59344
59345
59346
59347
59348
59349
59350
59351
59352
59353
59354
59355
59356
59357
59358
59359
59360
59361
59362
59363
59364
59365
59366
59367
59368
59369
59370
59371
59372
59373
59374
59375
59376
59377
59378
59379
59380
59381
59382
59383
59384
59385
59386
59387
59388
59389
59390
59391
59392
59393
59394
59395
59396
59397
59398
59399
59400
59401
59402
59403
59404
59405
59406
59407
59408
59409
59410
59411
59412
59413
59414
59415
59416
59417
59418
59419
59420
59421
59422
59423
59424
59425
59426
59427
59428
59429
59430
59431
59432
59433
59434
59435
59436
59437
59438
59439
59440
59441
59442
59443
59444
59445
59446
59447
59448
59449
59450
59451
59452
59453
59454
59455
59456
59457
59458
59459
59460
59461
59462
59463
59464
59465
59466
59467
59468
59469
59470
59471
59472
59473
59474
59475
59476
59477
59478
59479
59480
59481
59482
59483
59484
59485
59486
59487
59488
59489
59490
59491
59492
59493
59494
59495
59496
59497
59498
59499
59500
59501
59502
59503
59504
59505
59506
59507
59508
59509
59510
59511
59512
59513
59514
59515
59516
59517
59518
59519
59520
59521
59522
59523
59524
59525
59526
59527
59528
59529
59530
59531
59532
59533
59534
59535
59536
59537
59538
59539
59540
59541
59542
59543
59544
59545
59546
59547
59548
59549
59550
59551
59552
59553
59554
59555
59556
59557
59558
59559
59560
59561
59562
59563
59564
59565
59566
59567
59568
59569
59570
59571
59572
59573
59574
59575
59576
59577
59578
59579
59580
59581
59582
59583
59584
59585
59586
59587
59588
59589
59590
59591
59592
59593
59594
59595
59596
59597
59598
59599
59600
59601
59602
59603
59604
59605
59606
59607
59608
59609
59610
59611
59612
59613
59614
59615
59616
59617
59618
59619
59620
59621
59622
59623
59624
59625
59626
59627
59628
59629
59630
59631
59632
59633
59634
59635
59636
59637
59638
59639
59640
59641
59642
59643
59644
59645
59646
59647
59648
59649
59650
59651
59652
59653
59654
59655
59656
59657
59658
59659
59660
59661
59662
59663
59664
59665
59666
59667
59668
59669
59670
59671
59672
59673
59674
59675
59676
59677
59678
59679
59680
59681
59682
59683
59684
59685
59686
59687
59688
59689
59690
59691
59692
59693
59694
59695
59696
59697
59698
59699
59700
59701
59702
59703
59704
59705
59706
59707
59708
59709
59710
59711
59712
59713
59714
59715
59716
59717
59718
59719
59720
59721
59722
59723
59724
59725
59726
59727
59728
59729
59730
59731
59732
59733
59734
59735
59736
59737
59738
59739
59740
59741
59742
59743
59744
59745
59746
59747
59748
59749
59750
59751
59752
59753
59754
59755
59756
59757
59758
59759
59760
59761
59762
59763
59764
59765
59766
59767
59768
59769
59770
59771
59772
59773
59774
59775
59776
59777
59778
59779
59780
59781
59782
59783
59784
59785
59786
59787
59788
59789
59790
59791
59792
59793
59794
59795
59796
59797
59798
59799
59800
59801
59802
59803
59804
59805
59806
59807
59808
59809
59810
59811
59812
59813
59814
59815
59816
59817
59818
59819
59820
59821
59822
59823
59824
59825
59826
59827
59828
59829
59830
59831
59832
59833
59834
59835
59836
59837
59838
59839
59840
59841
59842
59843
59844
59845
59846
59847
59848
59849
59850
59851
59852
59853
59854
59855
59856
59857
59858
59859
59860
59861
59862
59863
59864
59865
59866
59867
59868
59869
59870
59871
59872
59873
59874
59875
59876
59877
59878
59879
59880
59881
59882
59883
59884
59885
59886
59887
59888
59889
59890
59891
59892
59893
59894
59895
59896
59897
59898
59899
59900
59901
59902
59903
59904
59905
59906
59907
59908
59909
59910
59911
59912
59913
59914
59915
59916
59917
59918
59919
59920
59921
59922
59923
59924
59925
59926
59927
59928
59929
59930
59931
59932
59933
59934
59935
59936
59937
59938
59939
59940
59941
59942
59943
59944
59945
59946
59947
59948
59949
59950
59951
59952
59953
59954
59955
59956
59957
59958
59959
59960
59961
59962
59963
59964
59965
59966
59967
59968
59969
59970
59971
59972
59973
59974
59975
59976
59977
59978
59979
59980
59981
59982
59983
59984
59985
59986
59987
59988
59989
59990
59991
59992
59993
59994
59995
59996
59997
59998
59999
60000
60001
60002
60003
60004
60005
60006
60007
60008
60009
60010
60011
60012
60013
60014
60015
60016
60017
60018
60019
60020
60021
60022
60023
60024
60025
60026
60027
60028
60029
60030
60031
60032
60033
60034
60035
60036
60037
60038
60039
60040
60041
60042
60043
60044
60045
60046
60047
60048
60049
60050
60051
60052
60053
60054
60055
60056
60057
60058
60059
60060
60061
60062
60063
60064
60065
60066
60067
60068
60069
60070
60071
60072
60073
60074
60075
60076
60077
60078
60079
60080
60081
60082
60083
60084
60085
60086
60087
60088
60089
60090
60091
60092
60093
60094
60095
60096
60097
60098
60099
60100
60101
60102
60103
60104
60105
60106
60107
60108
60109
60110
60111
60112
60113
60114
60115
60116
60117
60118
60119
60120
60121
60122
60123
60124
60125
60126
60127
60128
60129
60130
60131
60132
60133
60134
60135
60136
60137
60138
60139
60140
60141
60142
60143
60144
60145
60146
60147
60148
60149
60150
60151
60152
60153
60154
60155
60156
60157
60158
60159
60160
60161
60162
60163
60164
60165
60166
60167
60168
60169
60170
60171
60172
60173
60174
60175
60176
60177
60178
60179
60180
60181
60182
60183
60184
60185
60186
60187
60188
60189
60190
60191
60192
60193
60194
60195
60196
60197
60198
60199
60200
60201
60202
60203
60204
60205
60206
60207
60208
60209
60210
60211
60212
60213
60214
60215
60216
60217
60218
60219
60220
60221
60222
60223
60224
60225
60226
60227
60228
60229
60230
60231
60232
60233
60234
60235
60236
60237
60238
60239
60240
60241
60242
60243
60244
60245
60246
60247
60248
60249
60250
60251
60252
60253
60254
60255
60256
60257
60258
60259
60260
60261
60262
60263
60264
60265
60266
60267
60268
60269
60270
60271
60272
60273
60274
60275
60276
60277
60278
60279
60280
60281
60282
60283
60284
60285
60286
60287
60288
60289
60290
60291
60292
60293
60294
60295
60296
60297
60298
60299
60300
60301
60302
60303
60304
60305
60306
60307
60308
60309
60310
60311
60312
60313
60314
60315
60316
60317
60318
60319
60320
60321
60322
60323
60324
60325
60326
60327
60328
60329
60330
60331
60332
60333
60334
60335
60336
60337
60338
60339
60340
60341
60342
60343
60344
60345
60346
60347
60348
60349
60350
60351
60352
60353
60354
60355
60356
60357
60358
60359
60360
60361
60362
60363
60364
60365
60366
60367
60368
60369
60370
60371
60372
60373
60374
60375
60376
60377
60378
60379
60380
60381
60382
60383
60384
60385
60386
60387
60388
60389
60390
60391
60392
60393
60394
60395
60396
60397
60398
60399
60400
60401
60402
60403
60404
60405
60406
60407
60408
60409
60410
60411
60412
60413
60414
60415
60416
60417
60418
60419
60420
60421
60422
60423
60424
60425
60426
60427
60428
60429
60430
60431
60432
60433
60434
60435
60436
60437
60438
60439
60440
60441
60442
60443
60444
60445
60446
60447
60448
60449
60450
60451
60452
60453
60454
60455
60456
60457
60458
60459
60460
60461
60462
60463
60464
60465
60466
60467
60468
60469
60470
60471
60472
60473
60474
60475
60476
60477
60478
60479
60480
60481
60482
60483
60484
60485
60486
60487
60488
60489
60490
60491
60492
60493
60494
60495
60496
60497
60498
60499
60500
60501
60502
60503
60504
60505
60506
60507
60508
60509
60510
60511
60512
60513
60514
60515
60516
60517
60518
60519
60520
60521
60522
60523
60524
60525
60526
60527
60528
60529
60530
60531
60532
60533
60534
60535
60536
60537
60538
60539
60540
60541
60542
60543
60544
60545
60546
60547
60548
60549
60550
60551
60552
60553
60554
60555
60556
60557
60558
60559
60560
60561
60562
60563
60564
60565
60566
60567
60568
60569
60570
60571
60572
60573
60574
60575
60576
60577
60578
60579
60580
60581
60582
60583
60584
60585
60586
60587
60588
60589
60590
60591
60592
60593
60594
60595
60596
60597
60598
60599
60600
60601
60602
60603
60604
60605
60606
60607
60608
60609
60610
60611
60612
60613
60614
60615
60616
60617
60618
60619
60620
60621
60622
60623
60624
60625
60626
60627
60628
60629
60630
60631
60632
60633
60634
60635
60636
60637
60638
60639
60640
60641
60642
60643
60644
60645
60646
60647
60648
60649
60650
60651
60652
60653
60654
60655
60656
60657
60658
60659
60660
60661
60662
60663
60664
60665
60666
60667
60668
60669
60670
60671
60672
60673
60674
60675
60676
60677
60678
60679
60680
60681
60682
60683
60684
60685
60686
60687
60688
60689
60690
60691
60692
60693
60694
60695
60696
60697
60698
60699
60700
60701
60702
60703
60704
60705
60706
60707
60708
60709
60710
60711
60712
60713
60714
60715
60716
60717
60718
60719
60720
60721
60722
60723
60724
60725
60726
60727
60728
60729
60730
60731
60732
60733
60734
60735
60736
60737
60738
60739
60740
60741
60742
60743
60744
60745
60746
60747
60748
60749
60750
60751
60752
60753
60754
60755
60756
60757
60758
60759
60760
60761
60762
60763
60764
60765
60766
60767
60768
60769
60770
60771
60772
60773
60774
60775
60776
60777
60778
60779
60780
60781
60782
60783
60784
60785
60786
60787
60788
60789
60790
60791
60792
60793
60794
60795
60796
60797
60798
60799
60800
60801
60802
60803
60804
60805
60806
60807
60808
60809
60810
60811
60812
60813
60814
60815
60816
60817
60818
60819
60820
60821
60822
60823
60824
60825
60826
60827
60828
60829
60830
60831
60832
60833
60834
60835
60836
60837
60838
60839
60840
60841
60842
60843
60844
60845
60846
60847
60848
60849
60850
60851
60852
60853
60854
60855
60856
60857
60858
60859
60860
60861
60862
60863
60864
60865
60866
60867
60868
60869
60870
60871
60872
60873
60874
60875
60876
60877
60878
60879
60880
60881
60882
60883
60884
60885
60886
60887
60888
60889
60890
60891
60892
60893
60894
60895
60896
60897
60898
60899
60900
60901
60902
60903
60904
60905
60906
60907
60908
60909
60910
60911
60912
60913
60914
60915
60916
60917
60918
60919
60920
60921
60922
60923
60924
60925
60926
60927
60928
60929
60930
60931
60932
60933
60934
60935
60936
60937
60938
60939
60940
60941
60942
60943
60944
60945
60946
60947
60948
60949
60950
60951
60952
60953
60954
60955
60956
60957
60958
60959
60960
60961
60962
60963
60964
60965
60966
60967
60968
60969
60970
60971
60972
60973
60974
60975
60976
60977
60978
60979
60980
60981
60982
60983
60984
60985
60986
60987
60988
60989
60990
60991
60992
60993
60994
60995
60996
60997
60998
60999
61000
61001
61002
61003
61004
61005
61006
61007
61008
61009
61010
61011
61012
61013
61014
61015
61016
61017
61018
61019
61020
61021
61022
61023
61024
61025
61026
61027
61028
61029
61030
61031
61032
61033
61034
61035
61036
61037
61038
61039
61040
61041
61042
61043
61044
61045
61046
61047
61048
61049
61050
61051
61052
61053
61054
61055
61056
61057
61058
61059
61060
61061
61062
61063
61064
61065
61066
61067
61068
61069
61070
61071
61072
61073
61074
61075
61076
61077
61078
61079
61080
61081
61082
61083
61084
61085
61086
61087
61088
61089
61090
61091
61092
61093
61094
61095
61096
61097
61098
61099
61100
61101
61102
61103
61104
61105
61106
61107
61108
61109
61110
61111
61112
61113
61114
61115
61116
61117
61118
61119
61120
61121
61122
61123
61124
61125
61126
61127
61128
61129
61130
61131
61132
61133
61134
61135
61136
61137
61138
61139
61140
61141
61142
61143
61144
61145
61146
61147
61148
61149
61150
61151
61152
61153
61154
61155
61156
61157
61158
61159
61160
61161
61162
61163
61164
61165
61166
61167
61168
61169
61170
61171
61172
61173
61174
61175
61176
61177
61178
61179
61180
61181
61182
61183
61184
61185
61186
61187
61188
61189
61190
61191
61192
61193
61194
61195
61196
61197
61198
61199
61200
61201
61202
61203
61204
61205
61206
61207
61208
61209
61210
61211
61212
61213
61214
61215
61216
61217
61218
61219
61220
61221
61222
61223
61224
61225
61226
61227
61228
61229
61230
61231
61232
61233
61234
61235
61236
61237
61238
61239
61240
61241
61242
61243
61244
61245
61246
61247
61248
61249
61250
61251
61252
61253
61254
61255
61256
61257
61258
61259
61260
61261
61262
61263
61264
61265
61266
61267
61268
61269
61270
61271
61272
61273
61274
61275
61276
61277
61278
61279
61280
61281
61282
61283
61284
61285
61286
61287
61288
61289
61290
61291
61292
61293
61294
61295
61296
61297
61298
61299
61300
61301
61302
61303
61304
61305
61306
61307
61308
61309
61310
61311
61312
61313
61314
61315
61316
61317
61318
61319
61320
61321
61322
61323
61324
61325
61326
61327
61328
61329
61330
61331
61332
61333
61334
61335
61336
61337
61338
61339
61340
61341
61342
61343
61344
61345
61346
61347
61348
61349
61350
61351
61352
61353
61354
61355
61356
61357
61358
61359
61360
61361
61362
61363
61364
61365
61366
61367
61368
61369
61370
61371
61372
61373
61374
61375
61376
61377
61378
61379
61380
61381
61382
61383
61384
61385
61386
61387
61388
61389
61390
61391
61392
61393
61394
61395
61396
61397
61398
61399
61400
61401
61402
61403
61404
61405
61406
61407
61408
61409
61410
61411
61412
61413
61414
61415
61416
61417
61418
61419
61420
61421
61422
61423
61424
61425
61426
61427
61428
61429
61430
61431
61432
61433
61434
61435
61436
61437
61438
61439
61440
61441
61442
61443
61444
61445
61446
61447
61448
61449
61450
61451
61452
61453
61454
61455
61456
61457
61458
61459
61460
61461
61462
61463
61464
61465
61466
61467
61468
61469
61470
61471
61472
61473
61474
61475
61476
61477
61478
61479
61480
61481
61482
61483
61484
61485
61486
61487
61488
61489
61490
61491
61492
61493
61494
61495
61496
61497
61498
61499
61500
61501
61502
61503
61504
61505
61506
61507
61508
61509
61510
61511
61512
61513
61514
61515
61516
61517
61518
61519
61520
61521
61522
61523
61524
61525
61526
61527
61528
61529
61530
61531
61532
61533
61534
61535
61536
61537
61538
61539
61540
61541
61542
61543
61544
61545
61546
61547
61548
61549
61550
61551
61552
61553
61554
61555
61556
61557
61558
61559
61560
61561
61562
61563
61564
61565
61566
61567
61568
61569
61570
61571
61572
61573
61574
61575
61576
61577
61578
61579
61580
61581
61582
61583
61584
61585
61586
61587
61588
61589
61590
61591
61592
61593
61594
61595
61596
61597
61598
61599
61600
61601
61602
61603
61604
61605
61606
61607
61608
61609
61610
61611
61612
61613
61614
61615
61616
61617
61618
61619
61620
61621
61622
61623
61624
61625
61626
61627
61628
61629
61630
61631
61632
61633
61634
61635
61636
61637
61638
61639
61640
61641
61642
61643
61644
61645
61646
61647
61648
61649
61650
61651
61652
61653
61654
61655
61656
61657
61658
61659
61660
61661
61662
61663
61664
61665
61666
61667
61668
61669
61670
61671
61672
61673
61674
61675
61676
61677
61678
61679
61680
61681
61682
61683
61684
61685
61686
61687
61688
61689
61690
61691
61692
61693
61694
61695
61696
61697
61698
61699
61700
61701
61702
61703
61704
61705
61706
61707
61708
61709
61710
61711
61712
61713
61714
61715
61716
61717
61718
61719
61720
61721
61722
61723
61724
61725
61726
61727
61728
61729
61730
61731
61732
61733
61734
61735
61736
61737
61738
61739
61740
61741
61742
61743
61744
61745
61746
61747
61748
61749
61750
61751
61752
61753
61754
61755
61756
61757
61758
61759
61760
61761
61762
61763
61764
61765
61766
61767
61768
61769
61770
61771
61772
61773
61774
61775
61776
61777
61778
61779
61780
61781
61782
61783
61784
61785
61786
61787
61788
61789
61790
61791
61792
61793
61794
61795
61796
61797
61798
61799
61800
61801
61802
61803
61804
61805
61806
61807
61808
61809
61810
61811
61812
61813
61814
61815
61816
61817
61818
61819
61820
61821
61822
61823
61824
61825
61826
61827
61828
61829
61830
61831
61832
61833
61834
61835
61836
61837
61838
61839
61840
61841
61842
61843
61844
61845
61846
61847
61848
61849
61850
61851
61852
61853
61854
61855
61856
61857
61858
61859
61860
61861
61862
61863
61864
61865
61866
61867
61868
61869
61870
61871
61872
61873
61874
61875
61876
61877
61878
61879
61880
61881
61882
61883
61884
61885
61886
61887
61888
61889
61890
61891
61892
61893
61894
61895
61896
61897
61898
61899
61900
61901
61902
61903
61904
61905
61906
61907
61908
61909
61910
61911
61912
61913
61914
61915
61916
61917
61918
61919
61920
61921
61922
61923
61924
61925
61926
61927
61928
61929
61930
61931
61932
61933
61934
61935
61936
61937
61938
61939
61940
61941
61942
61943
61944
61945
61946
61947
61948
61949
61950
61951
61952
61953
61954
61955
61956
61957
61958
61959
61960
61961
61962
61963
61964
61965
61966
61967
61968
61969
61970
61971
61972
61973
61974
61975
61976
61977
61978
61979
61980
61981
61982
61983
61984
61985
61986
61987
61988
61989
61990
61991
61992
61993
61994
61995
61996
61997
61998
61999
62000
62001
62002
62003
62004
62005
62006
62007
62008
62009
62010
62011
62012
62013
62014
62015
62016
62017
62018
62019
62020
62021
62022
62023
62024
62025
62026
62027
62028
62029
62030
62031
62032
62033
62034
62035
62036
62037
62038
62039
62040
62041
62042
62043
62044
62045
62046
62047
62048
62049
62050
62051
62052
62053
62054
62055
62056
62057
62058
62059
62060
62061
62062
62063
62064
62065
62066
62067
62068
62069
62070
62071
62072
62073
62074
62075
62076
62077
62078
62079
62080
62081
62082
62083
62084
62085
62086
62087
62088
62089
62090
62091
62092
62093
62094
62095
62096
62097
62098
62099
62100
62101
62102
62103
62104
62105
62106
62107
62108
62109
62110
62111
62112
62113
62114
62115
62116
62117
62118
62119
62120
62121
62122
62123
62124
62125
62126
62127
62128
62129
62130
62131
62132
62133
62134
62135
62136
62137
62138
62139
62140
62141
62142
62143
62144
62145
62146
62147
62148
62149
62150
62151
62152
62153
62154
62155
62156
62157
62158
62159
62160
62161
62162
62163
62164
62165
62166
62167
62168
62169
62170
62171
62172
62173
62174
62175
62176
62177
62178
62179
62180
62181
62182
62183
62184
62185
62186
62187
62188
62189
62190
62191
62192
62193
62194
62195
62196
62197
62198
62199
62200
62201
62202
62203
62204
62205
62206
62207
62208
62209
62210
62211
62212
62213
62214
62215
62216
62217
62218
62219
62220
62221
62222
62223
62224
62225
62226
62227
62228
62229
62230
62231
62232
62233
62234
62235
62236
62237
62238
62239
62240
62241
62242
62243
62244
62245
62246
62247
62248
62249
62250
62251
62252
62253
62254
62255
62256
62257
62258
62259
62260
62261
62262
62263
62264
62265
62266
62267
62268
62269
62270
62271
62272
62273
62274
62275
62276
62277
62278
62279
62280
62281
62282
62283
62284
62285
62286
62287
62288
62289
62290
62291
62292
62293
62294
62295
62296
62297
62298
62299
62300
62301
62302
62303
62304
62305
62306
62307
62308
62309
62310
62311
62312
62313
62314
62315
62316
62317
62318
62319
62320
62321
62322
62323
62324
62325
62326
62327
62328
62329
62330
62331
62332
62333
62334
62335
62336
62337
62338
62339
62340
62341
62342
62343
62344
62345
62346
62347
62348
62349
62350
62351
62352
62353
62354
62355
62356
62357
62358
62359
62360
62361
62362
62363
62364
62365
62366
62367
62368
62369
62370
62371
62372
62373
62374
62375
62376
62377
62378
62379
62380
62381
62382
62383
62384
62385
62386
62387
62388
62389
62390
62391
62392
62393
62394
62395
62396
62397
62398
62399
62400
62401
62402
62403
62404
62405
62406
62407
62408
62409
62410
62411
62412
62413
62414
62415
62416
62417
62418
62419
62420
62421
62422
62423
62424
62425
62426
62427
62428
62429
62430
62431
62432
62433
62434
62435
62436
62437
62438
62439
62440
62441
62442
62443
62444
62445
62446
62447
62448
62449
62450
62451
62452
62453
62454
62455
62456
62457
62458
62459
62460
62461
62462
62463
62464
62465
62466
62467
62468
62469
62470
62471
62472
62473
62474
62475
62476
62477
62478
62479
62480
62481
62482
62483
62484
62485
62486
62487
62488
62489
62490
62491
62492
62493
62494
62495
62496
62497
62498
62499
62500
62501
62502
62503
62504
62505
62506
62507
62508
62509
62510
62511
62512
62513
62514
62515
62516
62517
62518
62519
62520
62521
62522
62523
62524
62525
62526
62527
62528
62529
62530
62531
62532
62533
62534
62535
62536
62537
62538
62539
62540
62541
62542
62543
62544
62545
62546
62547
62548
62549
62550
62551
62552
62553
62554
62555
62556
62557
62558
62559
62560
62561
62562
62563
62564
62565
62566
62567
62568
62569
62570
62571
62572
62573
62574
62575
62576
62577
62578
62579
62580
62581
62582
62583
62584
62585
62586
62587
62588
62589
62590
62591
62592
62593
62594
62595
62596
62597
62598
62599
62600
62601
62602
62603
62604
62605
62606
62607
62608
62609
62610
62611
62612
62613
62614
62615
62616
62617
62618
62619
62620
62621
62622
62623
62624
62625
62626
62627
62628
62629
62630
62631
62632
62633
62634
62635
62636
62637
62638
62639
62640
62641
62642
62643
62644
62645
62646
62647
62648
62649
62650
62651
62652
62653
62654
62655
62656
62657
62658
62659
62660
62661
62662
62663
62664
62665
62666
62667
62668
62669
62670
62671
62672
62673
62674
62675
62676
62677
62678
62679
62680
62681
62682
62683
62684
62685
62686
62687
62688
62689
62690
62691
62692
62693
62694
62695
62696
62697
62698
62699
62700
62701
62702
62703
62704
62705
62706
62707
62708
62709
62710
62711
62712
62713
62714
62715
62716
62717
62718
62719
62720
62721
62722
62723
62724
62725
62726
62727
62728
62729
62730
62731
62732
62733
62734
62735
62736
62737
62738
62739
62740
62741
62742
62743
62744
62745
62746
62747
62748
62749
62750
62751
62752
62753
62754
62755
62756
62757
62758
62759
62760
62761
62762
62763
62764
62765
62766
62767
62768
62769
62770
62771
62772
62773
62774
62775
62776
62777
62778
62779
62780
62781
62782
62783
62784
62785
62786
62787
62788
62789
62790
62791
62792
62793
62794
62795
62796
62797
62798
62799
62800
62801
62802
62803
62804
62805
62806
62807
62808
62809
62810
62811
62812
62813
62814
62815
62816
62817
62818
62819
62820
62821
62822
62823
62824
62825
62826
62827
62828
62829
62830
62831
62832
62833
62834
62835
62836
62837
62838
62839
62840
62841
62842
62843
62844
62845
62846
62847
62848
62849
62850
62851
62852
62853
62854
62855
62856
62857
62858
62859
62860
62861
62862
62863
62864
62865
62866
62867
62868
62869
62870
62871
62872
62873
62874
62875
62876
62877
62878
62879
62880
62881
62882
62883
62884
62885
62886
62887
62888
62889
62890
62891
62892
62893
62894
62895
62896
62897
62898
62899
62900
62901
62902
62903
62904
62905
62906
62907
62908
62909
62910
62911
62912
62913
62914
62915
62916
62917
62918
62919
62920
62921
62922
62923
62924
62925
62926
62927
62928
62929
62930
62931
62932
62933
62934
62935
62936
62937
62938
62939
62940
62941
62942
62943
62944
62945
62946
62947
62948
62949
62950
62951
62952
62953
62954
62955
62956
62957
62958
62959
62960
62961
62962
62963
62964
62965
62966
62967
62968
62969
62970
62971
62972
62973
62974
62975
62976
62977
62978
62979
62980
62981
62982
62983
62984
62985
62986
62987
62988
62989
62990
62991
62992
62993
62994
62995
62996
62997
62998
62999
63000
63001
63002
63003
63004
63005
63006
63007
63008
63009
63010
63011
63012
63013
63014
63015
63016
63017
63018
63019
63020
63021
63022
63023
63024
63025
63026
63027
63028
63029
63030
63031
63032
63033
63034
63035
63036
63037
63038
63039
63040
63041
63042
63043
63044
63045
63046
63047
63048
63049
63050
63051
63052
63053
63054
63055
63056
63057
63058
63059
63060
63061
63062
63063
63064
63065
63066
63067
63068
63069
63070
63071
63072
63073
63074
63075
63076
63077
63078
63079
63080
63081
63082
63083
63084
63085
63086
63087
63088
63089
63090
63091
63092
63093
63094
63095
63096
63097
63098
63099
63100
63101
63102
63103
63104
63105
63106
63107
63108
63109
63110
63111
63112
63113
63114
63115
63116
63117
63118
63119
63120
63121
63122
63123
63124
63125
63126
63127
63128
63129
63130
63131
63132
63133
63134
63135
63136
63137
63138
63139
63140
63141
63142
63143
63144
63145
63146
63147
63148
63149
63150
63151
63152
63153
63154
63155
63156
63157
63158
63159
63160
63161
63162
63163
63164
63165
63166
63167
63168
63169
63170
63171
63172
63173
63174
63175
63176
63177
63178
63179
63180
63181
63182
63183
63184
63185
63186
63187
63188
63189
63190
63191
63192
63193
63194
63195
63196
63197
63198
63199
63200
63201
63202
63203
63204
63205
63206
63207
63208
63209
63210
63211
63212
63213
63214
63215
63216
63217
63218
63219
63220
63221
63222
63223
63224
63225
63226
63227
63228
63229
63230
63231
63232
63233
63234
63235
63236
63237
63238
63239
63240
63241
63242
63243
63244
63245
63246
63247
63248
63249
63250
63251
63252
63253
63254
63255
63256
63257
63258
63259
63260
63261
63262
63263
63264
63265
63266
63267
63268
63269
63270
63271
63272
63273
63274
63275
63276
63277
63278
63279
63280
63281
63282
63283
63284
63285
63286
63287
63288
63289
63290
63291
63292
63293
63294
63295
63296
63297
63298
63299
63300
63301
63302
63303
63304
63305
63306
63307
63308
63309
63310
63311
63312
63313
63314
63315
63316
63317
63318
63319
63320
63321
63322
63323
63324
63325
63326
63327
63328
63329
63330
63331
63332
63333
63334
63335
63336
63337
63338
63339
63340
63341
63342
63343
63344
63345
63346
63347
63348
63349
63350
63351
63352
63353
63354
63355
63356
63357
63358
63359
63360
63361
63362
63363
63364
63365
63366
63367
63368
63369
63370
63371
63372
63373
63374
63375
63376
63377
63378
63379
63380
63381
63382
63383
63384
63385
63386
63387
63388
63389
63390
63391
63392
63393
63394
63395
63396
63397
63398
63399
63400
63401
63402
63403
63404
63405
63406
63407
63408
63409
63410
63411
63412
63413
63414
63415
63416
63417
63418
63419
63420
63421
63422
63423
63424
63425
63426
63427
63428
63429
63430
63431
63432
63433
63434
63435
63436
63437
63438
63439
63440
63441
63442
63443
63444
63445
63446
63447
63448
63449
63450
63451
63452
63453
63454
63455
63456
63457
63458
63459
63460
63461
63462
63463
63464
63465
63466
63467
63468
63469
63470
63471
63472
63473
63474
63475
63476
63477
63478
63479
63480
63481
63482
63483
63484
63485
63486
63487
63488
63489
63490
63491
63492
63493
63494
63495
63496
63497
63498
63499
63500
63501
63502
63503
63504
63505
63506
63507
63508
63509
63510
63511
63512
63513
63514
63515
63516
63517
63518
63519
63520
63521
63522
63523
63524
63525
63526
63527
63528
63529
63530
63531
63532
63533
63534
63535
63536
63537
63538
63539
63540
63541
63542
63543
63544
63545
63546
63547
63548
63549
63550
63551
63552
63553
63554
63555
63556
63557
63558
63559
63560
63561
63562
63563
63564
63565
63566
63567
63568
63569
63570
63571
63572
63573
63574
63575
63576
63577
63578
63579
63580
63581
63582
63583
63584
63585
63586
63587
63588
63589
63590
63591
63592
63593
63594
63595
63596
63597
63598
63599
63600
63601
63602
63603
63604
63605
63606
63607
63608
63609
63610
63611
63612
63613
63614
63615
63616
63617
63618
63619
63620
63621
63622
63623
63624
63625
63626
63627
63628
63629
63630
63631
63632
63633
63634
63635
63636
63637
63638
63639
63640
63641
63642
63643
63644
63645
63646
63647
63648
63649
63650
63651
63652
63653
63654
63655
63656
63657
63658
63659
63660
63661
63662
63663
63664
63665
63666
63667
63668
63669
63670
63671
63672
63673
63674
63675
63676
63677
63678
63679
63680
63681
63682
63683
63684
63685
63686
63687
63688
63689
63690
63691
63692
63693
63694
63695
63696
63697
63698
63699
63700
63701
63702
63703
63704
63705
63706
63707
63708
63709
63710
63711
63712
63713
63714
63715
63716
63717
63718
63719
63720
63721
63722
63723
63724
63725
63726
63727
63728
63729
63730
63731
63732
63733
63734
63735
63736
63737
63738
63739
63740
63741
63742
63743
63744
63745
63746
63747
63748
63749
63750
63751
63752
63753
63754
63755
63756
63757
63758
63759
63760
63761
63762
63763
63764
63765
63766
63767
63768
63769
63770
63771
63772
63773
63774
63775
63776
63777
63778
63779
63780
63781
63782
63783
63784
63785
63786
63787
63788
63789
63790
63791
63792
63793
63794
63795
63796
63797
63798
63799
63800
63801
63802
63803
63804
63805
63806
63807
63808
63809
63810
63811
63812
63813
63814
63815
63816
63817
63818
63819
63820
63821
63822
63823
63824
63825
63826
63827
63828
63829
63830
63831
63832
63833
63834
63835
63836
63837
63838
63839
63840
63841
63842
63843
63844
63845
63846
63847
63848
63849
63850
63851
63852
63853
63854
63855
63856
63857
63858
63859
63860
63861
63862
63863
63864
63865
63866
63867
63868
63869
63870
63871
63872
63873
63874
63875
63876
63877
63878
63879
63880
63881
63882
63883
63884
63885
63886
63887
63888
63889
63890
63891
63892
63893
63894
63895
63896
63897
63898
63899
63900
63901
63902
63903
63904
63905
63906
63907
63908
63909
63910
63911
63912
63913
63914
63915
63916
63917
63918
63919
63920
63921
63922
63923
63924
63925
63926
63927
63928
63929
63930
63931
63932
63933
63934
63935
63936
63937
63938
63939
63940
63941
63942
63943
63944
63945
63946
63947
63948
63949
63950
63951
63952
63953
63954
63955
63956
63957
63958
63959
63960
63961
63962
63963
63964
63965
63966
63967
63968
63969
63970
63971
63972
63973
63974
63975
63976
63977
63978
63979
63980
63981
63982
63983
63984
63985
63986
63987
63988
63989
63990
63991
63992
63993
63994
63995
63996
63997
63998
63999
64000
64001
64002
64003
64004
64005
64006
64007
64008
64009
64010
64011
64012
64013
64014
64015
64016
64017
64018
64019
64020
64021
64022
64023
64024
64025
64026
64027
64028
64029
64030
64031
64032
64033
64034
64035
64036
64037
64038
64039
64040
64041
64042
64043
64044
64045
64046
64047
64048
64049
64050
64051
64052
64053
64054
64055
64056
64057
64058
64059
64060
64061
64062
64063
64064
64065
64066
64067
64068
64069
64070
64071
64072
64073
64074
64075
64076
64077
64078
64079
64080
64081
64082
64083
64084
64085
64086
64087
64088
64089
64090
64091
64092
64093
64094
64095
64096
64097
64098
64099
64100
64101
64102
64103
64104
64105
64106
64107
64108
64109
64110
64111
64112
64113
64114
64115
64116
64117
64118
64119
64120
64121
64122
64123
64124
64125
64126
64127
64128
64129
64130
64131
64132
64133
64134
64135
64136
64137
64138
64139
64140
64141
64142
64143
64144
64145
64146
64147
64148
64149
64150
64151
64152
64153
64154
64155
64156
64157
64158
64159
64160
64161
64162
64163
64164
64165
64166
64167
64168
64169
64170
64171
64172
64173
64174
64175
64176
64177
64178
64179
64180
64181
64182
64183
64184
64185
64186
64187
64188
64189
64190
64191
64192
64193
64194
64195
64196
64197
64198
64199
64200
64201
64202
64203
64204
64205
64206
64207
64208
64209
64210
64211
64212
64213
64214
64215
64216
64217
64218
64219
64220
64221
64222
64223
64224
64225
64226
64227
64228
64229
64230
64231
64232
64233
64234
64235
64236
64237
64238
64239
64240
64241
64242
64243
64244
64245
64246
64247
64248
64249
64250
64251
64252
64253
64254
64255
64256
64257
64258
64259
64260
64261
64262
64263
64264
64265
64266
64267
64268
64269
64270
64271
64272
64273
64274
64275
64276
64277
64278
64279
64280
64281
64282
64283
64284
64285
64286
64287
64288
64289
64290
64291
64292
64293
64294
64295
64296
64297
64298
64299
64300
64301
64302
64303
64304
64305
64306
64307
64308
64309
64310
64311
64312
64313
64314
64315
64316
64317
64318
64319
64320
64321
64322
64323
64324
64325
64326
64327
64328
64329
64330
64331
64332
64333
64334
64335
64336
64337
64338
64339
64340
64341
64342
64343
64344
64345
64346
64347
64348
64349
64350
64351
64352
64353
64354
64355
64356
64357
64358
64359
64360
64361
64362
64363
64364
64365
64366
64367
64368
64369
64370
64371
64372
64373
64374
64375
64376
64377
64378
64379
64380
64381
64382
64383
64384
64385
64386
64387
64388
64389
64390
64391
64392
64393
64394
64395
64396
64397
64398
64399
64400
64401
64402
64403
64404
64405
64406
64407
64408
64409
64410
64411
64412
64413
64414
64415
64416
64417
64418
64419
64420
64421
64422
64423
64424
64425
64426
64427
64428
64429
64430
64431
64432
64433
64434
64435
64436
64437
64438
64439
64440
64441
64442
64443
64444
64445
64446
64447
64448
64449
64450
64451
64452
64453
64454
64455
64456
64457
64458
64459
64460
64461
64462
64463
64464
64465
64466
64467
64468
64469
64470
64471
64472
64473
64474
64475
64476
64477
64478
64479
64480
64481
64482
64483
64484
64485
64486
64487
64488
64489
64490
64491
64492
64493
64494
64495
64496
64497
64498
64499
64500
64501
64502
64503
64504
64505
64506
64507
64508
64509
64510
64511
64512
64513
64514
64515
64516
64517
64518
64519
64520
64521
64522
64523
64524
64525
64526
64527
64528
64529
64530
64531
64532
64533
64534
64535
64536
64537
64538
64539
64540
64541
64542
64543
64544
64545
64546
64547
64548
64549
64550
64551
64552
64553
64554
64555
64556
64557
64558
64559
64560
64561
64562
64563
64564
64565
64566
64567
64568
64569
64570
64571
64572
64573
64574
64575
64576
64577
64578
64579
64580
64581
64582
64583
64584
64585
64586
64587
64588
64589
64590
64591
64592
64593
64594
64595
64596
64597
64598
64599
64600
64601
64602
64603
64604
64605
64606
64607
64608
64609
64610
64611
64612
64613
64614
64615
64616
64617
64618
64619
64620
64621
64622
64623
64624
64625
64626
64627
64628
64629
64630
64631
64632
64633
64634
64635
64636
64637
64638
64639
64640
64641
64642
64643
64644
64645
64646
64647
64648
64649
64650
64651
64652
64653
64654
64655
64656
64657
64658
64659
64660
64661
64662
64663
64664
64665
64666
64667
64668
64669
64670
64671
64672
64673
64674
64675
64676
64677
64678
64679
64680
64681
64682
64683
64684
64685
64686
64687
64688
64689
64690
64691
64692
64693
64694
64695
64696
64697
64698
64699
64700
64701
64702
64703
64704
64705
64706
64707
64708
64709
64710
64711
64712
64713
64714
64715
64716
64717
64718
64719
64720
64721
64722
64723
64724
64725
64726
64727
64728
64729
64730
64731
64732
64733
64734
64735
64736
64737
64738
64739
64740
64741
64742
64743
64744
64745
64746
64747
64748
64749
64750
64751
64752
64753
64754
64755
64756
64757
64758
64759
64760
64761
64762
64763
64764
64765
64766
64767
64768
64769
64770
64771
64772
64773
64774
64775
64776
64777
64778
64779
64780
64781
64782
64783
64784
64785
64786
64787
64788
64789
64790
64791
64792
64793
64794
64795
64796
64797
64798
64799
64800
64801
64802
64803
64804
64805
64806
64807
64808
64809
64810
64811
64812
64813
64814
64815
64816
64817
64818
64819
64820
64821
64822
64823
64824
64825
64826
64827
64828
64829
64830
64831
64832
64833
64834
64835
64836
64837
64838
64839
64840
64841
64842
64843
64844
64845
64846
64847
64848
64849
64850
64851
64852
64853
64854
64855
64856
64857
64858
64859
64860
64861
64862
64863
64864
64865
64866
64867
64868
64869
64870
64871
64872
64873
64874
64875
64876
64877
64878
64879
64880
64881
64882
64883
64884
64885
64886
64887
64888
64889
64890
64891
64892
64893
64894
64895
64896
64897
64898
64899
64900
64901
64902
64903
64904
64905
64906
64907
64908
64909
64910
64911
64912
64913
64914
64915
64916
64917
64918
64919
64920
64921
64922
64923
64924
64925
64926
64927
64928
64929
64930
64931
64932
64933
64934
64935
64936
64937
64938
64939
64940
64941
64942
64943
64944
64945
64946
64947
64948
64949
64950
64951
64952
64953
64954
64955
64956
64957
64958
64959
64960
64961
64962
64963
64964
64965
64966
64967
64968
64969
64970
64971
64972
64973
64974
64975
64976
64977
64978
64979
64980
64981
64982
64983
64984
64985
64986
64987
64988
64989
64990
64991
64992
64993
64994
64995
64996
64997
64998
64999
65000
65001
65002
65003
65004
65005
65006
65007
65008
65009
65010
65011
65012
65013
65014
65015
65016
65017
65018
65019
65020
65021
65022
65023
65024
65025
65026
65027
65028
65029
65030
65031
65032
65033
65034
65035
65036
65037
65038
65039
65040
65041
65042
65043
65044
65045
65046
65047
65048
65049
65050
65051
65052
65053
65054
65055
65056
65057
65058
65059
65060
65061
65062
65063
65064
65065
65066
65067
65068
65069
65070
65071
65072
65073
65074
65075
65076
65077
65078
65079
65080
65081
65082
65083
65084
65085
65086
65087
65088
65089
65090
65091
65092
65093
65094
65095
65096
65097
65098
65099
65100
65101
65102
65103
65104
65105
65106
65107
65108
65109
65110
65111
65112
65113
65114
65115
65116
65117
65118
65119
65120
65121
65122
65123
65124
65125
65126
65127
65128
65129
65130
65131
65132
65133
65134
65135
65136
65137
65138
65139
65140
65141
65142
65143
65144
65145
65146
65147
65148
65149
65150
65151
65152
65153
65154
65155
65156
65157
65158
65159
65160
65161
65162
65163
65164
65165
65166
65167
65168
65169
65170
65171
65172
65173
65174
65175
65176
65177
65178
65179
65180
65181
65182
65183
65184
65185
65186
65187
65188
65189
65190
65191
65192
65193
65194
65195
65196
65197
65198
65199
65200
65201
65202
65203
65204
65205
65206
65207
65208
65209
65210
65211
65212
65213
65214
65215
65216
65217
65218
65219
65220
65221
65222
65223
65224
65225
65226
65227
65228
65229
65230
65231
65232
65233
65234
65235
65236
65237
65238
65239
65240
65241
65242
65243
65244
65245
65246
65247
65248
65249
65250
65251
65252
65253
65254
65255
65256
65257
65258
65259
65260
65261
65262
65263
65264
65265
65266
65267
65268
65269
65270
65271
65272
65273
65274
65275
65276
65277
65278
65279
65280
65281
65282
65283
65284
65285
65286
65287
65288
65289
65290
65291
65292
65293
65294
65295
65296
65297
65298
65299
65300
65301
65302
65303
65304
65305
65306
65307
65308
65309
65310
65311
65312
65313
65314
65315
65316
65317
65318
65319
65320
65321
65322
65323
65324
65325
65326
65327
65328
65329
65330
65331
65332
65333
65334
65335
65336
65337
65338
65339
65340
65341
65342
65343
65344
65345
65346
65347
65348
65349
65350
65351
65352
65353
65354
65355
65356
65357
65358
65359
65360
65361
65362
65363
65364
65365
65366
65367
65368
65369
65370
65371
65372
65373
65374
65375
65376
65377
65378
65379
65380
65381
65382
65383
65384
65385
65386
65387
65388
65389
65390
65391
65392
65393
65394
65395
65396
65397
65398
65399
65400
65401
65402
65403
65404
65405
65406
65407
65408
65409
65410
65411
65412
65413
65414
65415
65416
65417
65418
65419
65420
65421
65422
65423
65424
65425
65426
65427
65428
65429
65430
65431
65432
65433
65434
65435
65436
65437
65438
65439
65440
65441
65442
65443
65444
65445
65446
65447
65448
65449
65450
65451
65452
65453
65454
65455
65456
65457
65458
65459
65460
65461
65462
65463
65464
65465
65466
65467
65468
65469
65470
65471
65472
65473
65474
65475
65476
65477
65478
65479
65480
65481
65482
65483
65484
65485
65486
65487
65488
65489
65490
65491
65492
65493
65494
65495
65496
65497
65498
65499
65500
65501
65502
65503
65504
65505
65506
65507
65508
65509
65510
65511
65512
65513
65514
65515
65516
65517
65518
65519
65520
65521
65522
65523
65524
65525
65526
65527
65528
65529
65530
65531
65532
65533
65534
65535
65536
65537
65538
65539
65540
65541
65542
65543
65544
65545
65546
65547
65548
65549
65550
65551
65552
65553
65554
65555
65556
65557
65558
65559
65560
65561
65562
65563
65564
65565
65566
65567
65568
65569
65570
65571
65572
65573
65574
65575
65576
65577
65578
65579
65580
65581
65582
65583
65584
65585
65586
65587
65588
65589
65590
65591
65592
65593
65594
65595
65596
65597
65598
65599
65600
65601
65602
65603
65604
65605
65606
65607
65608
65609
65610
65611
65612
65613
65614
65615
65616
65617
65618
65619
65620
65621
65622
65623
65624
65625
65626
65627
65628
65629
65630
65631
65632
65633
65634
65635
65636
65637
65638
65639
65640
65641
65642
65643
65644
65645
65646
65647
65648
65649
65650
65651
65652
65653
65654
65655
65656
65657
65658
65659
65660
65661
65662
65663
65664
65665
65666
65667
65668
65669
65670
65671
65672
65673
65674
65675
65676
65677
65678
65679
65680
65681
65682
65683
65684
65685
65686
65687
65688
65689
65690
65691
65692
65693
65694
65695
65696
65697
65698
65699
65700
65701
65702
65703
65704
65705
65706
65707
65708
65709
65710
65711
65712
65713
65714
65715
65716
65717
65718
65719
65720
65721
65722
65723
65724
65725
65726
65727
65728
65729
65730
65731
65732
65733
65734
65735
65736
65737
65738
65739
65740
65741
65742
65743
65744
65745
65746
65747
65748
65749
65750
65751
65752
65753
65754
65755
65756
65757
65758
65759
65760
65761
65762
65763
65764
65765
65766
65767
65768
65769
65770
65771
65772
65773
65774
65775
65776
65777
65778
65779
65780
65781
65782
65783
65784
65785
65786
65787
65788
65789
65790
65791
65792
65793
65794
65795
65796
65797
65798
65799
65800
65801
65802
65803
65804
65805
65806
65807
65808
65809
65810
65811
65812
65813
65814
65815
65816
65817
65818
65819
65820
65821
65822
65823
65824
65825
65826
65827
65828
65829
65830
65831
65832
65833
65834
65835
65836
65837
65838
65839
65840
65841
65842
65843
65844
65845
65846
65847
65848
65849
65850
65851
65852
65853
65854
65855
65856
65857
65858
65859
65860
65861
65862
65863
65864
65865
65866
65867
65868
65869
65870
65871
65872
65873
65874
65875
65876
65877
65878
65879
65880
65881
65882
65883
65884
65885
65886
65887
65888
65889
65890
65891
65892
65893
65894
65895
65896
65897
65898
65899
65900
65901
65902
65903
65904
65905
65906
65907
65908
65909
65910
65911
65912
65913
65914
65915
65916
65917
65918
65919
65920
65921
65922
65923
65924
65925
65926
65927
65928
65929
65930
65931
65932
65933
65934
65935
65936
65937
65938
65939
65940
65941
65942
65943
65944
65945
65946
65947
65948
65949
65950
65951
65952
65953
65954
65955
65956
65957
65958
65959
65960
65961
65962
65963
65964
65965
65966
65967
65968
65969
65970
65971
65972
65973
65974
65975
65976
65977
65978
65979
65980
65981
65982
65983
65984
65985
65986
65987
65988
65989
65990
65991
65992
65993
65994
65995
65996
65997
65998
65999
66000
66001
66002
66003
66004
66005
66006
66007
66008
66009
66010
66011
66012
66013
66014
66015
66016
66017
66018
66019
66020
66021
66022
66023
66024
66025
66026
66027
66028
66029
66030
66031
66032
66033
66034
66035
66036
66037
66038
66039
66040
66041
66042
66043
66044
66045
66046
66047
66048
66049
66050
66051
66052
66053
66054
66055
66056
66057
66058
66059
66060
66061
66062
66063
66064
66065
66066
66067
66068
66069
66070
66071
66072
66073
66074
66075
66076
66077
66078
66079
66080
66081
66082
66083
66084
66085
66086
66087
66088
66089
66090
66091
66092
66093
66094
66095
66096
66097
66098
66099
66100
66101
66102
66103
66104
66105
66106
66107
66108
66109
66110
66111
66112
66113
66114
66115
66116
66117
66118
66119
66120
66121
66122
66123
66124
66125
66126
66127
66128
66129
66130
66131
66132
66133
66134
66135
66136
66137
66138
66139
66140
66141
66142
66143
66144
66145
66146
66147
66148
66149
66150
66151
66152
66153
66154
66155
66156
66157
66158
66159
66160
66161
66162
66163
66164
66165
66166
66167
66168
66169
66170
66171
66172
66173
66174
66175
66176
66177
66178
66179
66180
66181
66182
66183
66184
66185
66186
66187
66188
66189
66190
66191
66192
66193
66194
66195
66196
66197
66198
66199
66200
66201
66202
66203
66204
66205
66206
66207
66208
66209
66210
66211
66212
66213
66214
66215
66216
66217
66218
66219
66220
66221
66222
66223
66224
66225
66226
66227
66228
66229
66230
66231
66232
66233
66234
66235
66236
66237
66238
66239
66240
66241
66242
66243
66244
66245
66246
66247
66248
66249
66250
66251
66252
66253
66254
66255
66256
66257
66258
66259
66260
66261
66262
66263
66264
66265
66266
66267
66268
66269
66270
66271
66272
66273
66274
66275
66276
66277
66278
66279
66280
66281
66282
66283
66284
66285
66286
66287
66288
66289
66290
66291
66292
66293
66294
66295
66296
66297
66298
66299
66300
66301
66302
66303
66304
66305
66306
66307
66308
66309
66310
66311
66312
66313
66314
66315
66316
66317
66318
66319
66320
66321
66322
66323
66324
66325
66326
66327
66328
66329
66330
66331
66332
66333
66334
66335
66336
66337
66338
66339
66340
66341
66342
66343
66344
66345
66346
66347
66348
66349
66350
66351
66352
66353
66354
66355
66356
66357
66358
66359
66360
66361
66362
66363
66364
66365
66366
66367
66368
66369
66370
66371
66372
66373
66374
66375
66376
66377
66378
66379
66380
66381
66382
66383
66384
66385
66386
66387
66388
66389
66390
66391
66392
66393
66394
66395
66396
66397
66398
66399
66400
66401
66402
66403
66404
66405
66406
66407
66408
66409
66410
66411
66412
66413
66414
66415
66416
66417
66418
66419
66420
66421
66422
66423
66424
66425
66426
66427
66428
66429
66430
66431
66432
66433
66434
66435
66436
66437
66438
66439
66440
66441
66442
66443
66444
66445
66446
66447
66448
66449
66450
66451
66452
66453
66454
66455
66456
66457
66458
66459
66460
66461
66462
66463
66464
66465
66466
66467
66468
66469
66470
66471
66472
66473
66474
66475
66476
66477
66478
66479
66480
66481
66482
66483
66484
66485
66486
66487
66488
66489
66490
66491
66492
66493
66494
66495
66496
66497
66498
66499
66500
66501
66502
66503
66504
66505
66506
66507
66508
66509
66510
66511
66512
66513
66514
66515
66516
66517
66518
66519
66520
66521
66522
66523
66524
66525
66526
66527
66528
66529
66530
66531
66532
66533
66534
66535
66536
66537
66538
66539
66540
66541
66542
66543
66544
66545
66546
66547
66548
66549
66550
66551
66552
66553
66554
66555
66556
66557
66558
66559
66560
66561
66562
66563
66564
66565
66566
66567
66568
66569
66570
66571
66572
66573
66574
66575
66576
66577
66578
66579
66580
66581
66582
66583
66584
66585
66586
66587
66588
66589
66590
66591
66592
66593
66594
66595
66596
66597
66598
66599
66600
66601
66602
66603
66604
66605
66606
66607
66608
66609
66610
66611
66612
66613
66614
66615
66616
66617
66618
66619
66620
66621
66622
66623
66624
66625
66626
66627
66628
66629
66630
66631
66632
66633
66634
66635
66636
66637
66638
66639
66640
66641
66642
66643
66644
66645
66646
66647
66648
66649
66650
66651
66652
66653
66654
66655
66656
66657
66658
66659
66660
66661
66662
66663
66664
66665
66666
66667
66668
66669
66670
66671
66672
66673
66674
66675
66676
66677
66678
66679
66680
66681
66682
66683
66684
66685
66686
66687
66688
66689
66690
66691
66692
66693
66694
66695
66696
66697
66698
66699
66700
66701
66702
66703
66704
66705
66706
66707
66708
66709
66710
66711
66712
66713
66714
66715
66716
66717
66718
66719
66720
66721
66722
66723
66724
66725
66726
66727
66728
66729
66730
66731
66732
66733
66734
66735
66736
66737
66738
66739
66740
66741
66742
66743
66744
66745
66746
66747
66748
66749
66750
66751
66752
66753
66754
66755
66756
66757
66758
66759
66760
66761
66762
66763
66764
66765
66766
66767
66768
66769
66770
66771
66772
66773
66774
66775
66776
66777
66778
66779
66780
66781
66782
66783
66784
66785
66786
66787
66788
66789
66790
66791
66792
66793
66794
66795
66796
66797
66798
66799
66800
66801
66802
66803
66804
66805
66806
66807
66808
66809
66810
66811
66812
66813
66814
66815
66816
66817
66818
66819
66820
66821
66822
66823
66824
66825
66826
66827
66828
66829
66830
66831
66832
66833
66834
66835
66836
66837
66838
66839
66840
66841
66842
66843
66844
66845
66846
66847
66848
66849
66850
66851
66852
66853
66854
66855
66856
66857
66858
66859
66860
66861
66862
66863
66864
66865
66866
66867
66868
66869
66870
66871
66872
66873
66874
66875
66876
66877
66878
66879
66880
66881
66882
66883
66884
66885
66886
66887
66888
66889
66890
66891
66892
66893
66894
66895
66896
66897
66898
66899
66900
66901
66902
66903
66904
66905
66906
66907
66908
66909
66910
66911
66912
66913
66914
66915
66916
66917
66918
66919
66920
66921
66922
66923
66924
66925
66926
66927
66928
66929
66930
66931
66932
66933
66934
66935
66936
66937
66938
66939
66940
66941
66942
66943
66944
66945
66946
66947
66948
66949
66950
66951
66952
66953
66954
66955
66956
66957
66958
66959
66960
66961
66962
66963
66964
66965
66966
66967
66968
66969
66970
66971
66972
66973
66974
66975
66976
66977
66978
66979
66980
66981
66982
66983
66984
66985
66986
66987
66988
66989
66990
66991
66992
66993
66994
66995
66996
66997
66998
66999
67000
67001
67002
67003
67004
67005
67006
67007
67008
67009
67010
67011
67012
67013
67014
67015
67016
67017
67018
67019
67020
67021
67022
67023
67024
67025
67026
67027
67028
67029
67030
67031
67032
67033
67034
67035
67036
67037
67038
67039
67040
67041
67042
67043
67044
67045
67046
67047
67048
67049
67050
67051
67052
67053
67054
67055
67056
67057
67058
67059
67060
67061
67062
67063
67064
67065
67066
67067
67068
67069
67070
67071
67072
67073
67074
67075
67076
67077
67078
67079
67080
67081
67082
67083
67084
67085
67086
67087
67088
67089
67090
67091
67092
67093
67094
67095
67096
67097
67098
67099
67100
67101
67102
67103
67104
67105
67106
67107
67108
67109
67110
67111
67112
67113
67114
67115
67116
67117
67118
67119
67120
67121
67122
67123
67124
67125
67126
67127
67128
67129
67130
67131
67132
67133
67134
67135
67136
67137
67138
67139
67140
67141
67142
67143
67144
67145
67146
67147
67148
67149
67150
67151
67152
67153
67154
67155
67156
67157
67158
67159
67160
67161
67162
67163
67164
67165
67166
67167
67168
67169
67170
67171
67172
67173
67174
67175
67176
67177
67178
67179
67180
67181
67182
67183
67184
67185
67186
67187
67188
67189
67190
67191
67192
67193
67194
67195
67196
67197
67198
67199
67200
67201
67202
67203
67204
67205
67206
67207
67208
67209
67210
67211
67212
67213
67214
67215
67216
67217
67218
67219
67220
67221
67222
67223
67224
67225
67226
67227
67228
67229
67230
67231
67232
67233
67234
67235
67236
67237
67238
67239
67240
67241
67242
67243
67244
67245
67246
67247
67248
67249
67250
67251
67252
67253
67254
67255
67256
67257
67258
67259
67260
67261
67262
67263
67264
67265
67266
67267
67268
67269
67270
67271
67272
67273
67274
67275
67276
67277
67278
67279
67280
67281
67282
67283
67284
67285
67286
67287
67288
67289
67290
67291
67292
67293
67294
67295
67296
67297
67298
67299
67300
67301
67302
67303
67304
67305
67306
67307
67308
67309
67310
67311
67312
67313
67314
67315
67316
67317
67318
67319
67320
67321
67322
67323
67324
67325
67326
67327
67328
67329
67330
67331
67332
67333
67334
67335
67336
67337
67338
67339
67340
67341
67342
67343
67344
67345
67346
67347
67348
67349
67350
67351
67352
67353
67354
67355
67356
67357
67358
67359
67360
67361
67362
67363
67364
67365
67366
67367
67368
67369
67370
67371
67372
67373
67374
67375
67376
67377
67378
67379
67380
67381
67382
67383
67384
67385
67386
67387
67388
67389
67390
67391
67392
67393
67394
67395
67396
67397
67398
67399
67400
67401
67402
67403
67404
67405
67406
67407
67408
67409
67410
67411
67412
67413
67414
67415
67416
67417
67418
67419
67420
67421
67422
67423
67424
67425
67426
67427
67428
67429
67430
67431
67432
67433
67434
67435
67436
67437
67438
67439
67440
67441
67442
67443
67444
67445
67446
67447
67448
67449
67450
67451
67452
67453
67454
67455
67456
67457
67458
67459
67460
67461
67462
67463
67464
67465
67466
67467
67468
67469
67470
67471
67472
67473
67474
67475
67476
67477
67478
67479
67480
67481
67482
67483
67484
67485
67486
67487
67488
67489
67490
67491
67492
67493
67494
67495
67496
67497
67498
67499
67500
67501
67502
67503
67504
67505
67506
67507
67508
67509
67510
67511
67512
67513
67514
67515
67516
67517
67518
67519
67520
67521
67522
67523
67524
67525
67526
67527
67528
67529
67530
67531
67532
67533
67534
67535
67536
67537
67538
67539
67540
67541
67542
67543
67544
67545
67546
67547
67548
67549
67550
67551
67552
67553
67554
67555
67556
67557
67558
67559
67560
67561
67562
67563
67564
67565
67566
67567
67568
67569
67570
67571
67572
67573
67574
67575
67576
67577
67578
67579
67580
67581
67582
67583
67584
67585
67586
67587
67588
67589
67590
67591
67592
67593
67594
67595
67596
67597
67598
67599
67600
67601
67602
67603
67604
67605
67606
67607
67608
67609
67610
67611
67612
67613
67614
67615
67616
67617
67618
67619
67620
67621
67622
67623
67624
67625
67626
67627
67628
67629
67630
67631
67632
67633
67634
67635
67636
67637
67638
67639
67640
67641
67642
67643
67644
67645
67646
67647
67648
67649
67650
67651
67652
67653
67654
67655
67656
67657
67658
67659
67660
67661
67662
67663
67664
67665
67666
67667
67668
67669
67670
67671
67672
67673
67674
67675
67676
67677
67678
67679
67680
67681
67682
67683
67684
67685
67686
67687
67688
67689
67690
67691
67692
67693
67694
67695
67696
67697
67698
67699
67700
67701
67702
67703
67704
67705
67706
67707
67708
67709
67710
67711
67712
67713
67714
67715
67716
67717
67718
67719
67720
67721
67722
67723
67724
67725
67726
67727
67728
67729
67730
67731
67732
67733
67734
67735
67736
67737
67738
67739
67740
67741
67742
67743
67744
67745
67746
67747
67748
67749
67750
67751
67752
67753
67754
67755
67756
67757
67758
67759
67760
67761
67762
67763
67764
67765
67766
67767
67768
67769
67770
67771
67772
67773
67774
67775
67776
67777
67778
67779
67780
67781
67782
67783
67784
67785
67786
67787
67788
67789
67790
67791
67792
67793
67794
67795
67796
67797
67798
67799
67800
67801
67802
67803
67804
67805
67806
67807
67808
67809
67810
67811
67812
67813
67814
67815
67816
67817
67818
67819
67820
67821
67822
67823
67824
67825
67826
67827
67828
67829
67830
67831
67832
67833
67834
67835
67836
67837
67838
67839
67840
67841
67842
67843
67844
67845
67846
67847
67848
67849
67850
67851
67852
67853
67854
67855
67856
67857
67858
67859
67860
67861
67862
67863
67864
67865
67866
67867
67868
67869
67870
67871
67872
67873
67874
67875
67876
67877
67878
67879
67880
67881
67882
67883
67884
67885
67886
67887
67888
67889
67890
67891
67892
67893
67894
67895
67896
67897
67898
67899
67900
67901
67902
67903
67904
67905
67906
67907
67908
67909
67910
67911
67912
67913
67914
67915
67916
67917
67918
67919
67920
67921
67922
67923
67924
67925
67926
67927
67928
67929
67930
67931
67932
67933
67934
67935
67936
67937
67938
67939
67940
67941
67942
67943
67944
67945
67946
67947
67948
67949
67950
67951
67952
67953
67954
67955
67956
67957
67958
67959
67960
67961
67962
67963
67964
67965
67966
67967
67968
67969
67970
67971
67972
67973
67974
67975
67976
67977
67978
67979
67980
67981
67982
67983
67984
67985
67986
67987
67988
67989
67990
67991
67992
67993
67994
67995
67996
67997
67998
67999
68000
68001
68002
68003
68004
68005
68006
68007
68008
68009
68010
68011
68012
68013
68014
68015
68016
68017
68018
68019
68020
68021
68022
68023
68024
68025
68026
68027
68028
68029
68030
68031
68032
68033
68034
68035
68036
68037
68038
68039
68040
68041
68042
68043
68044
68045
68046
68047
68048
68049
68050
68051
68052
68053
68054
68055
68056
68057
68058
68059
68060
68061
68062
68063
68064
68065
68066
68067
68068
68069
68070
68071
68072
68073
68074
68075
68076
68077
68078
68079
68080
68081
68082
68083
68084
68085
68086
68087
68088
68089
68090
68091
68092
68093
68094
68095
68096
68097
68098
68099
68100
68101
68102
68103
68104
68105
68106
68107
68108
68109
68110
68111
68112
68113
68114
68115
68116
68117
68118
68119
68120
68121
68122
68123
68124
68125
68126
68127
68128
68129
68130
68131
68132
68133
68134
68135
68136
68137
68138
68139
68140
68141
68142
68143
68144
68145
68146
68147
68148
68149
68150
68151
68152
68153
68154
68155
68156
68157
68158
68159
68160
68161
68162
68163
68164
68165
68166
68167
68168
68169
68170
68171
68172
68173
68174
68175
68176
68177
68178
68179
68180
68181
68182
68183
68184
68185
68186
68187
68188
68189
68190
68191
68192
68193
68194
68195
68196
68197
68198
68199
68200
68201
68202
68203
68204
68205
68206
68207
68208
68209
68210
68211
68212
68213
68214
68215
68216
68217
68218
68219
68220
68221
68222
68223
68224
68225
68226
68227
68228
68229
68230
68231
68232
68233
68234
68235
68236
68237
68238
68239
68240
68241
68242
68243
68244
68245
68246
68247
68248
68249
68250
68251
68252
68253
68254
68255
68256
68257
68258
68259
68260
68261
68262
68263
68264
68265
68266
68267
68268
68269
68270
68271
68272
68273
68274
68275
68276
68277
68278
68279
68280
68281
68282
68283
68284
68285
68286
68287
68288
68289
68290
68291
68292
68293
68294
68295
68296
68297
68298
68299
68300
68301
68302
68303
68304
68305
68306
68307
68308
68309
68310
68311
68312
68313
68314
68315
68316
68317
68318
68319
68320
68321
68322
68323
68324
68325
68326
68327
68328
68329
68330
68331
68332
68333
68334
68335
68336
68337
68338
68339
68340
68341
68342
68343
68344
68345
68346
68347
68348
68349
68350
68351
68352
68353
68354
68355
68356
68357
68358
68359
68360
68361
68362
68363
68364
68365
68366
68367
68368
68369
68370
68371
68372
68373
68374
68375
68376
68377
68378
68379
68380
68381
68382
68383
68384
68385
68386
68387
68388
68389
68390
68391
68392
68393
68394
68395
68396
68397
68398
68399
68400
68401
68402
68403
68404
68405
68406
68407
68408
68409
68410
68411
68412
68413
68414
68415
68416
68417
68418
68419
68420
68421
68422
68423
68424
68425
68426
68427
68428
68429
68430
68431
68432
68433
68434
68435
68436
68437
68438
68439
68440
68441
68442
68443
68444
68445
68446
68447
68448
68449
68450
68451
68452
68453
68454
68455
68456
68457
68458
68459
68460
68461
68462
68463
68464
68465
68466
68467
68468
68469
68470
68471
68472
2020-12-14  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 5.10 release.
	* NEWS: Update for 5.10 release.

2020-12-13  Dmitry V. Levin  <ldv@altlinux.org>

	Update .mailmap.
	* .mailmap: Add both email addresses of Sven Schnelle to avoid
	duplication in CREDITS file.

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

	tests: check decoding of clock_gettime64, clock_settime64, and clock_getres_time64 syscalls
	* tests/clock_xettime-common.c: New file.
	* tests/clock_xettime64.c: Likewise.
	* tests/Makefile.am (EXTRA_DIST): Add clock_xettime-common.c.
	* tests/clock_xettime.c: Turn into a wrapper around
	clock_xettime-common.c.
	* tests/pure_executables.list: Add clock_xettime64.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (clock_xettime64): New entry.
	* tests/clock.in (clock_xettime64): Likewise.
	* tests/trace_clock.in (clock_xettime64): Likewise.
	* tests/trace_personality_regex_32.in (clock_xettime64): Likewise.
	* tests/trace_personality_regex_64.in (clock_xettime64): Likewise.
	* tests/trace_personality_regex_x32.in (clock_xettime64): Likewise.

	tests: check decoding of clock_adjtime64 syscall.
	* tests/clock_adjtime-common.c: New file.
	* tests/clock_adjtime64.c: Likewise.
	* tests/Makefile.am (EXTRA_DIST): Add clock_adjtime-common.c.
	* tests/clock_adjtime.c: Turn into a wrapper around
	clock_adjtime-common.c.
	* tests/pure_executables.list: Add clock_adjtime64.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (clock_adjtime64): New entry.
	* tests/clock.in (clock_adjtime64): Likewise.
	* tests/trace_clock.in (clock_adjtime64): Likewise.
	* tests/trace_personality_regex_32.in (clock_adjtime64): Likewise.
	* tests/trace_personality_regex_64.in (clock_adjtime64): Likewise.
	* tests/trace_personality_regex_x32.in (clock_adjtime64): Likewise.

2020-12-13  Dmitry V. Levin  <ldv@altlinux.org>

	Fix %clock trace class.
	Four syscalls (clock_gettime64, clock_settime64, clock_adjtime64, and
	clock_getres_time64) were missed when the %clock trace class was
	introduced.

	* linux/syscallent-common-32.h (clock_gettime64, clock_settime64,
	clock_adjtime64, clock_getres_time64): Add TCL flag.
	* NEWS: Mention this change.

	Fixes: v5.7~72 "Add %clock trace class"

2020-12-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite pselect6 test.
	Starting with glibc commit glibc-2.32.9000-132-g2433d39b69, pselect
	function in glibc is implemented on top of pselect6_time64 syscall
	on 32-bit architectures, which makes it unsuitable for the test of
	pselect6 decoder.

	Resolve this issue by creating two tests that check decoding
	of __NR_pselect6 and __NR_pselect6_time64 syscalls.

	* tests/pselect6-common.c: New file.
	* tests/pselect6_time64.c: Likewise.
	* tests/Makefile.am (EXTRA_DIST): Add pselect6-common.c.
	* tests/pselect6.c: Rewrite using __NR_pselect6.
	* tests/pure_executables.list: Add pselect6_time64.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (pselect6_time64): New entry.

2020-12-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite semtimedop test.
	Starting with glibc commit glibc-2.32.9000-105-g7c437d3778, semtimedop
	function in glibc is implemented on top of semtimedop_time64 syscall on
	32-bit architectures, which makes it unsuitable for the test of
	semtimedop decoder.

	Resolve this issue by creating three tests that check decoding
	of __NR_semtimedop, __NR_semtimedop_time64, and __NR_ipc SEMTIMEDOP.

	* tests/semtimedop-common.c: New file.
	* tests/semtimedop-syscall.c: Likewise.
	* tests/semtimedop-ipc.c: Likewise.
	* tests/semtimedop_time64.c: Likewise.
	* tests/Makefile.am (EXTRA_DIST): Add semtimedop-common.c and
	semtimedop-syscall.c.
	* tests/semtimedop.c: Rewrite using __NR_semtimedop.
	* tests/pure_executables.list: Add semtimedop-ipc and semtimedop_time64.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (semtimedop-ipc, semtimedop_time64): New entries.

2020-12-12  Dmitry V. Levin  <ldv@altlinux.org>

	mips o32: set true_scno in decode_syscall_subcall.
	This change makes the strace-n test pass on mips o32.

	* linux/mips/get_syscall_args.c [SYS_syscall_subcall]
	(decode_syscall_subcall): Set tcp->true_scno.

	Fixes: v5.9~55 "strace: add an option for printing syscall numbers"

2020-12-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests: workaround -Wall regressions in Red Hat gcc.
	The version of gcc packaged into Rawhide erroneously produces false
	positive diagnostics in dozens of strace tests.

	Check at configure stage whether the C compiler is broken, and
	enable workarounds in tests when the broken C compiler is detected.

	Tested with:
	$ gcc --version |head -1
	gcc (GCC) 11.0.0 20201204 (Red Hat 11.0.0-0)

	* m4/st_broken_cc.m4: New file.
	* configure.ac: Call st_BROKEN_CC after st_WARN_CFLAGS.
	* tests/tests.h (tail_alloc, tail_memdup) [HAVE_BROKEN_CC]: Do not
	add ATTRIBUTE_ALLOC_SIZE.
	* NEWS: Mention this change.

2020-12-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use direct __NR_write invocation instead of C function in pc.test
	gcc-11 -Werror=stringop-overread along with glibc >= 2.32 are not happy
	about our use of write function, so replace it with a direct syscall
	invocation.

	* tests/pc.c: Include "scno.h".
	(main): Call syscall(__NR_write) instead of write().

2020-12-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests: workaround inline optimization in strace -k tests.
	Try to disable unwanted inline optimization that breaks these tests.

	* tests/stack-fcall.h: Include "gcc_compat.h".
	(f0, f1, f2, f3): Add ATTRIBUTE_NOINLINE.

2020-12-11  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v5.10.
	* linux/32/ioctls_inc_align16.h: Update from linux v5.10-rc7
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/i386/ioctls_arch0.h: Likewise.
	* linux/s390/ioctls_arch0.h: Likewise.
	* linux/s390x/ioctls_arch0.h: Likewise.
	* linux/x86_64/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

	maint: adapt to the future versions of readelf.
	* maint/ioctls_sym.awk: Update DW_AT_type regexp.

2020-12-11  Dmitry V. Levin  <ldv@altlinux.org>

	Update the number of arguments of membarrier syscall.
	Apply the following change:
	$ git grep -Fl 'SEN(membarrier)' |xargs sed -i '/SEN(membarrier)/ s/2,/3,/'

	* linux/*/syscallent*.h (membarrier): Change nargs from 2 to 3.

	Fixes: 176cbdc69 "membarrier: implement decoding of cpu_id argument"

2020-12-11  Dmitry V. Levin  <ldv@altlinux.org>

	mmsghdr: workaround -Warray-bounds regression in Red Hat gcc.
	The version of gcc packaged into Rawhide erroneously produces
	the following false positive diagnostics:

	mmsghdr.c: In function 'do_recvmmsg':
	mmsghdr.c:87:23: error: array subscript 'struct mmsgvec_data[0]' is partly outside array bounds of 'unsigned char[4108]' [-Werror=array-bounds]
	   87 |         data->timeout = xstrdup(timeout);
	      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~

	Tested with:
	$ gcc --version |head -1
	gcc (GCC) 11.0.0 20201204 (Red Hat 11.0.0-0)

	* mmsghdr.c (struct mmsgvec_data): Change namelen[IOV_MAX] to an array
	of zero length.

2020-12-11  Elvira Khabirova  <lineprinter0@gmail.com>

	membarrier: implement decoding of cpu_id argument.
	Introduced by Linux kernel commit v5.10-rc1~203^2~5.

	* membarrier.c: Decode cpu_id argument.
	* tests/membarrier.c: Add MEMBARRIER_CMD_FLAG_CPU cases.
	* xlat/membarrier_flags.in: New file.
	* NEWS: Mention the change.

2020-12-07  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: annotate uring_register_opcodes with #enum.
	Starting with Linux kernel commit v5.10-rc1~167^2~52, <linux/io_uring.h>
	uses an enumeration to define io_uring_register(2) opcodes.

	* xlat/uring_register_opcodes.in: Add #enum, include <linux/io_uring.h>.

2020-12-07  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: annotate uring_ops with #enum.
	Starting with Linux kernel commit v5.5-rc2~24^2, <linux/io_uring.h>
	uses an enumeration to define io_uring_enter(2) opcodes.

	* xlat/uring_ops.in: Add #enum, include <linux/io_uring.h>.

2020-12-07  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of process_madvise syscall.
	Introduced by Linux kernel commit v5.10-rc1~87^2~14.

	* mem.c (SYS_FUNC(process_madvise)): New function.
	* linux/syscallent-common.h [BASE_NR + 440]: Wire up process_madvise.
	* NEWS: Mention this change.
	* tests/process_madvise.c: New file.
	* tests/process_madvise-y.c: Likewise.
	* tests/process_madvise-yy.c: Likewise.
	* tests/gen_tests.in (process_madvise, process_madvise-y,
	process_madvise-yy): New entries.
	* tests/pure_executables.list: Add process_madvise, process_madvise-y,
	and process_madvise-yy.
	* tests/.gitignore: Likewise.

2020-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	pidfd_open: decode flags argument.
	Starting with Linux kernel commit v5.10-rc1~141^2~3, pidfd_open syscall
	supports PIDFD_NONBLOCK flag.

	* xlat/pidfd_open_flags.in: New file.
	* pidfd_open.c: Include <fcntl.h> and "xlat/pidfd_open_flags.h".
	(SYS_FUNC(pidfd_open)): Print flags argument using printflags.
	* tests/pidfd_open.c (main): Check it.
	* NEWS: Mention this change.

2020-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: disable tests for invalid shmctl commands on glibc >= 2.32.
	Starting with commit glibc-2.32.9000-207-g9ebaabeaac1a96b0d91f,
	glibc skips shmctl syscall invocations and returns EINVAL
	for invalid shmctl commands.

	* tests/ipc_shm.c [GLIBC_PREREQ_GE(2, 32)] (TEST_SHMCTL_BOGUS_CMD):
	Define to 0.
	[!TEST_SHMCTL_BOGUS_CMD] (TEST_SHMCTL_BOGUS_CMD): Define to 1.
	(main) [!TEST_SHMCTL_BOGUS_CMD] (bogus_cmd): Do not define and do not
	use.

2020-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: disable tests for invalid msgctl commands on glibc >= 2.32.
	Starting with commit glibc-2.32.9000-149-gbe9b0b9a012780a403a2,
	glibc skips msgctl syscall invocations and returns EINVAL
	for invalid msgctl commands.

	* tests/ipc_msg.c [GLIBC_PREREQ_GE(2, 32)] (TEST_MSGCTL_BOGUS_CMD):
	Define to 0.
	[!TEST_MSGCTL_BOGUS_CMD] (TEST_MSGCTL_BOGUS_CMD): Define to 1.
	(main) [!TEST_MSGCTL_BOGUS_CMD] (bogus_cmd): Do not define and do not
	use.

2020-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: disable tests for invalid semctl commands on glibc >= 2.32.
	Starting with commit glibc-2.32.9000-147-ga16d2abd496bd974a882,
	glibc skips semctl syscall invocations and returns EINVAL
	for invalid semctl commands.

	* tests/ipc_sem.c [GLIBC_PREREQ_GE(2, 32)] (TEST_SEMCTL_BOGUS_CMD):
	Define to 0.
	[!TEST_SEMCTL_BOGUS_CMD] (TEST_SEMCTL_BOGUS_CMD): Define to 1.
	(main) [!TEST_SEMCTL_BOGUS_CMD] (bogus_semid, bogus_semnum, bogus_cmd,
	bogus_arg): Do not define and do not use.

2020-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: mark some of #unconditional files with #value_indexed.
	* xlat/btrfs_dev_stats_values.in: Prepend #value_indexed.
	* xlat/cap.in: Likewise.
	* xlat/inet_diag_attrs.in: Likewise.
	* xlat/inet_diag_bytecodes.in: Likewise.
	* xlat/inet_diag_req_attrs.in: Likewise.
	* xlat/mtd_file_mode_options.in: Likewise.
	* xlat/mtd_mode_options.in: Likewise.
	* xlat/netlink_diag_attrs.in: Likewise.
	* xlat/packet_diag_attrs.in: Likewise.
	* xlat/smc_diag_attrs.in: Likewise.
	* xlat/unix_diag_attrs.in: Likewise.

	xlat: update V4L2_* constants.
	* xlat/v4l2_format_description_flags.in (V4L2_FMT_FLAG_CSC_COLORSPACE,
	V4L2_FMT_FLAG_CSC_XFER_FUNC, V4L2_FMT_FLAG_CSC_YCBCR_ENC,
	V4L2_FMT_FLAG_CSC_QUANTIZATION): New constants introduced
	by Linux kernel commit v5.10-rc1~175^2~172.
	* NEWS: Mention this change.
	* tests/ioctl_v4l2-success.c (main): Update expected output.

	xlat: update STATX_* constants.
	* xlat/statx_attrs.in (STATX_ATTR_DAX): New constant introduced
	by Linux kernel commit v5.8-rc1~51^2~9 and updated by Linux kernel
	commit v5.10-rc6-63-g72d1249e2ffd.
	* NEWS: Mention this change.

	xlat: update NLMSGERR_* constants.
	* xlat/nlmsgerr_attrs.in (NLMSGERR): New constant introduced
	by Linux kernel commit v5.10-rc1~107^2~33^2.
	* NEWS: Mention this change.

	xlat: update MS_* constants.
	* xlat/mount_flags.in (MS_NOSYMFOLLOW): New constant introduced
	by Linux kernel commit v5.10-rc1~19^2~9.
	* NEWS: Mention this change.
	* tests/mount.c (str_unknown, main): Update.

	xlat: update MEMBARRIER_CMD_* constants.
	* xlat/membarrier_cmds.in (MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ,
	MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ): New constants
	introduced by Linux kernel commit v5.10-rc1~203^2~5.
	* NEWS: Mention this change.
	* tests/membarrier.c (main): Update expected output.

	xlat: update KVM_* constants.
	* xlat/kvm_exit_reason.in (KVM_EXIT_X86_RDMSR, KVM_EXIT_X86_WRMSR): New
	constants introduced by Linux kernel commit v5.10-rc1~21^2~62.
	* xlat/kvm_cap.in (KVM_CAP_X86_USER_SPACE_MSR): Likewise.
	(KVM_CAP_X86_MSR_FILTER): New constant introduced by Linux kernel
	commit v5.10-rc1~21^2~57.
	(KVM_CAP_ENFORCE_PV_FEATURE_CPUID): New constant introduced
	by Linux kernel commit v5.10-rc1~21^2~42.
	* NEWS: Mention this change.

	xlat: update IORING_* constants.
	* xlat/uring_enter_flags.in (IORING_ENTER_SQ_WAIT): New constant
	introduced by Linux kernel commit v5.10-rc1~167^2~39.
	* xlat/uring_register_opcodes.in (IORING_REGISTER_RESTRICTIONS): New
	constant introduced by Linux kernel commit v5.10-rc1~167^2~51.
	(IORING_REGISTER_ENABLE_RINGS): New constant introduced by Linux kernel
	commit v5.10-rc1~167^2~50.
	* xlat/uring_setup_flags.in (IORING_SETUP_R_DISABLED: New constant
	introduced by Linux kernel commit v5.10-rc1~167^2~50.
	* NEWS: Mention this change.
	* tests/io_uring_enter.c (main): Update expected output.
	* tests/io_uring_setup.c (main): Likewise.

	xlat: update KEY* constants.
	* xlat/evdev_keycode.in (KEY_NOTIFICATION_CENTER, KEY_PICKUP_PHONE,
	KEY_HANGUP_PHONE): New constants introduced by Linux kernel commit
	v5.10-rc1~36^2^2~27.
	(KEY_FN_RIGHT_SHIFT): New constant introduced by Linux kernel commit
	v5.10-rc1~36^2^2~26.
	* NEWS: Mention this change.

	xlat: update INET_DIAG_* constants.
	* linux/inet_diag.h (INET_DIAG_SOCKOPT): New constant introduced
	by Linux kernel commit v5.10-rc1~107^2~376.
	* xlat/inet_diag_attrs.in (INET_DIAG_SOCKOPT): Likewise.
	* xlat/inet_diag_extended_flags.in (1<<(INET_DIAG_SOCKOPT-1)): Likewise.
	* NEWS: Mention this change.

	xlat: update MDBA_* constants.
	* xlat/mdb_flags.in (MDB_FLAGS_STAR_EXCL): New constant introduced
	by Linux kernel commit v5.10-rc1~107^2~166^2~3.
	(MDB_FLAGS_BLOCKED): New constant introduced by Linux kernel commit
	v5.10-rc1~107^2~166^2~2.
	* xlat/rtnl_mdba_mdb_eattr_attrs.in (MDBA_MDB_EATTR_SRC_LIST,
	MDBA_MDB_EATTR_GROUP_MODE): New constants introduced by Linux kernel
	commit v5.10-rc1~107^2~359^2~11.
	(MDBA_MDB_EATTR_SOURCE): New constant introduced by Linux kernel commit
	v5.10-rc1~107^2~166^2~8.
	(MDBA_MDB_EATTR_RTPROT): New constant introduced by Linux kernel commit
	v5.10-rc1~107^2~166^2~6.
	* NEWS: Mention this change.

	xlat: update ALG_* constants.
	* xlat/sock_alg_options.in (ALG_SET_DRBG_ENTROPY): New constant
	introduced by Linux kernel commit v5.10-rc1~181^2~51.
	* NEWS: Mention this change.

	xlat: update NT_* constants.
	* xlat/nt_descriptor_types.in (NT_ARM_TAGGED_ADDR_CTRL): New constant
	introduced by Linux kernel commit v5.10-rc1~49^2~9^2~7.
	* NEWS: Mention this change.

	xlat: update BPF_* constants.
	* xlat/bpf_commands.in (BPF_PROG_BIND_MAP): New constant introduced
	by Linux kernel commit v5.10-rc1~107^2~169^2~20^2~3.
	* xlat/bpf_map_flags.in (BPF_F_PRESERVE_ELEMS): New constant introduced
	by Linux kernel commit v5.10-rc1~107^2~96^2^2~1.
	(BPF_F_INNER_MAP): New constant introduced by Linux kernel commit
	v5.10-rc1~107^2~16^2~5^2~3.
	* xlat/bpf_map_types.in (BPF_MAP_TYPE_INODE_STORAGE): New constant
	introduced by Linux kernel commit v5.10-rc1~107^2~394^2~51.
	* xlat/bpf_prog_flags.in (BPF_F_SLEEPABLE): New constant introduced
	by Linux kernel commit v5.10-rc1~107^2~394^2~21^2~3.
	* NEWS: Mention this change.
	* tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks,
	print_BPF_PROG_LOAD_attr3, print_BPF_PROG_LOAD_attr4): Update.

	xlat: update SEGV_* constants.
	* xlat/sigsegv_codes.in (SEGV_MTEAERR, SEGV_MTESERR): New constants
	introduced by Linux kernel commit v5.10-rc1~49^2~9^2~25.
	* NEWS: Mention this change.

2020-12-04  Dmitry V. Levin  <ldv@altlinux.org>

	README.md: remove the reference to Travis CI builds.
	Apparently, Travis CI no longer welcomes building on public repositories:
	strace builds "have been temporarily disabled for public repositories
	due to a negative credit balance".

	Link: https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing

2020-12-02  Dmitry V. Levin  <ldv@altlinux.org>

	mpers: consistently use readelf --wide.
	* mpers.sh: Pass --wide to readelf.
	* mpers.awk: Update DW_AT_type regexp.

2020-11-29  Dmitry V. Levin  <ldv@altlinux.org>

	.github: partially migrate from ubuntu-18.04 to ubuntu-20.04.
	* .github/workflows/ci.yml (runs-on): Stick gcc7 jobs with ubuntu-18.04,
	switch all the rest from ubuntu-latest to ubuntu-20.04.

	Fix various typos found using codespell tool.
	* defs.h: Replace "namepace" with "namespace".
	* pidns.c: Replace "Paramters" with "Parameters".
	* strace.1.in: Replace "descritors" with "descriptors",
	replace "asociated" with "associated".
	* strace.c: Replace "descritor" with "descriptor".
	* tests/pidns.c: Replace "Wheather" with "Whether".
	* tests/pidns.h: Replace "succesful" with "successful".
	* maint/README-release: Add spellcheck.

2020-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	st_libunwind.m4: fix --with-libunwind=path.
	* m4/st_libunwind.m4 (st_LIBUNWIND): Move initialization of
	libunwind_CPPFLAGS, libunwind_LDFLAGS, and libunwind_LIBS variables ...
	(st_ARG_LIBUNWIND): ... here.

2020-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	st_demangle.m4: fix --with-libiberty=path.
	* m4/st_demangle.m4 (st_DEMANGLE): Clear libiberty_CPPFLAGS and
	libiberty_LDFLAGS variables prior to their initialization in
	--with-libiberty=path.

	Reported-by: Renaud Métrich <rmetrich@redhat.com>

2020-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: remove IPPROTO_MAX.
	* xlat/inet_protocols.in (IPPROTO_MAX): Remove.

	Reported-by: Khem Raj <raj.khem@gmail.com>
	Suggested-by: Eugene Syromiatnikov <esyr@redhat.com>
	Resolves: https://github.com/strace/strace/issues/164

2020-11-10  Dmitry V. Levin  <ldv@altlinux.org>

	tests: disable TEST_MSGCTL_BOGUS_ADDR in ipc_msg test on glibc >= 2.31.
	Starting with commit glibc-2.31~358, on every architecture where
	__ASSUME_SYSVIPC_BROKEN_MODE_T is defined, glibc tries to modify the
	data provided in the third argument of msgctl call.  This results
	to segfaults inside glibc if TEST_MSGCTL_BOGUS_ADDR is enabled.

	* tests/ipc_msg.c [GLIBC_PREREQ_GE(2, 31) && (__m68k__ || __s390__ ||
	(WORDS_BIGENDIAN && (__arm__ || __microblaze__ || __sh__)))]
	(TEST_MSGCTL_BOGUS_ADDR): Define to 0.

	Reported-by: Sven Schnelle <svens@linux.ibm.com>

2020-11-10  Sven Schnelle  <svens@stackframe.org>

	tests: fix execve test with fresh linux kernels.
	Starting with Linux commit v5.9-rc1~164^2^2~2, execve copies syscall
	arguments before trying to find the executable, failing with EFAULT
	in case of a faulty address.  Adjust the test to handle both variants
	of execve behaviour.

	* tests/execve.c (errstr): New variable.
	(call_execve): New function.
	(main): Use it instead of execve.  Do not hardcode ENOENT in expected
	output of tests, use errstr instead.

2020-11-09  Sven Schnelle  <svens@linux.ibm.com>

	tests: remove close_range* executables from pure_executables.list.
	close_range* executables rely on /dev/full being opened on fd 7,
	so remove them from pure_executable.list.


	* tests/pure_executables.list: Move close_range, close_range-P,
	close_range-y, and close_range-yy ...
	* tests/Makefile.am (check_PROGRAMS): ... here.

	Fixes: v5.9~44 "Implement decoding of close_range syscall"

2020-10-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Enable stack tracing with libdw for non-native personality tracees.
	libdw can handle compat processes, so it makes little sense to have
	stack tracing disabled when it is used.

	* syscall.c [!defined(USE_LIBUNWIND) && ENABLE_STACKTRACE]
	(update_personality): Re-initialise unwinder on personality change.
	* unwind.c [!defined(USE_LIBUNWIND) && (SUPPORTED_PERSONALITIES > 1)]
	(unwind_tcb_print, unwind_tcb_capture): Do not return early.
	* tests/Makefile.am (STACKTRACE_XFAIL_TESTS): New variable, initialise
	it to $(STACKTRACE_TESTS) if ENABLE_STACKTRACE and USE_LIBUNWIND
	are true, otherwise make it empty.
	(XFAIL_TESTS_m32, XFAIL_TESTS_mx32): Initialise
	it to $(STACKTRACE_XFAIL_TESTS) and not $(STACKTRACE_TESTS).
	* NEWS: Mention the change.

	Closes: https://github.com/strace/strace/issues/162

2020-10-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mmap_cache: remove personality check.
	mmap_cache is detached from the unwinder code now, and it has other
	users, so it makes little sense to keep it here.

	* mmap_cache.c (mmap_cache_invalidate): Remove conditional avoidance
	of mmap_cache_generation increment for non-native mpers.

2020-10-21  Dmitry V. Levin  <ldv@altlinux.org>

	Revert "types/v4l2.h: update definition of struct_v4l2_create_buffers"
	The change introduced by Linux commit v5.9-rc1~94^2~295 was reverted
	later by Linux commit v5.9-rc7~25^2~1.

	This reverts commit e877fe48187eea9c24ec539fe7875bdc0de74b86.

	* types/v4l2.h (struct_v4l2_create_buffers): Remove "flags" field and
	update "reserved" field to sync with changes introduced by Linux kernel
	commit v5.9-rc7~25^2~1.

2020-10-21  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 5.9-1.
	* strace.spec.in: Likewise.

2020-09-24  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 5.9 release.
	* NEWS: Update for 5.9 release.

2020-09-23  Dmitry V. Levin  <ldv@altlinux.org>

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2020-09-23  Dmitry V. Levin  <ldv@altlinux.org>

	Fix preprocessor indentation.
	Indent the C preprocessor directives to reflect their nesting
	using the following script:

	$ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do
		cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
	done

2020-09-23  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v5.9.
	* linux/32/ioctls_inc_align16.h: Update from linux v5.9-rc6
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* NEWS: Mention this.
	* tests/ioctl_v4l2.c (main): Skip conflicting ioctl command
	VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES.

	maint: update for linux v5.9.
	* maint/ioctls_gen.sh: Add arch/<arch>/include/generated/uapi and
	arch/<arch>/include/generated directories to INCLUDES.
	* maint/ioctls_sym.sh: Add workaround definitions of
	__no_kasan_or_inline and __no_sanitize_or_inline macros.

2020-09-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: mention --seccomp-bpf in "A traced process runs slowly" bug
	As it is worth mentioning here, probably.

	* strace.1.in (.SH BUGS): Refer to --seccomp-bpf option description in
	"A traced process runs slowly" bug.

2020-09-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	NEWS: provide a Fedora bug number for the --pidns-translation entry.

2020-09-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tee: use types/ directory for the type definitions header.
	Also, switch ioctl_tee test to system header usage, to double-check
	things.

	* tee.h: Rename to...
	* types/tee.h: ...this.  Remove "xlat/tee_ioctl_cmds.h",
	"xlat/tee_ioctl_gen_caps.h", "xlat/tee_ioctl_impl_ids.h",
	"xlat/tee_ioctl_login_types.h", "xlat/tee_ioctl_max_arg_size.h",
	"xlat/tee_ioctl_origins.h", "xlat/tee_ioctl_optee_caps.h",
	"xlat/tee_ioctl_param_attr_types.h", "xlat/tee_ioctl_shm_flags.h"
	includes.  Add header guard.
	[!HAVE_STRUCT_TEE_IOCTL_BUF_DATA, !HAVE_STRUCT_TEE_IOCTL_CANCEL_ARG,
	!HAVE_STRUCT_TEE_IOCTL_CLOSE_SESSION_ARG,
	!HAVE_STRUCT_TEE_IOCTL_SHM_ALLOC_DATA,
	!HAVE_STRUCT_TEE_IOCTL_SHM_REGISTER_FD_DATA,
	!HAVE_STRUCT_TEE_IOCTL_SHM_REGISTER_DATA,
	!HAVE_STRUCT_TEE_IOCTL_VERSION_DATA, !HAVE_STRUCT_TEE_IOCTL_PARAM,
	!HAVE_STRUCT_TEE_IOCTL_INVOKE_ARG, !HAVE_STRUCT_TEE_IOCL_SUPP_RECV_ARG,
	!HAVE_STRUCT_TEE_IOCL_SUPP_SEND_ARG,
	!HAVE_STRUCT_TEE_IOCTL_OPEN_SESSION_ARG]: Remove ifdefs.
	(struct tee_ioctl_buf_data): Change to...
	(typedef struct_tee_ioctl_buf_data): ...this.
	(struct tee_ioctl_cancel_arg): Change to...
	(typedef struct_tee_ioctl_cancel_arg): ...this.
	(struct tee_ioctl_close_session_arg): Change to...
	(typedef struct_tee_ioctl_close_session_arg): ...this.
	(struct tee_ioctl_shm_alloc_data): Change to...
	(typedef struct_tee_ioctl_shm_alloc_data): ...this.
	(struct tee_ioctl_shm_register_fd_data): Change to...
	(typedef struct_tee_ioctl_shm_register_fd_data): ...this.
	(struct tee_ioctl_shm_register_data): Change to...
	(typedef struct_tee_ioctl_shm_register_data): ...this.
	(struct tee_ioctl_version_data): Change to...
	(typedef struct_tee_ioctl_version_data): ...this.
	(struct tee_ioctl_param): Change to...
	(typedef struct_tee_ioctl_param): ...this.
	(struct tee_ioctl_invoke_arg): Change to...
	(typedef struct_tee_ioctl_invoke_arg): ...this.  Change params field
	type from struct tee_ioctl_param to struct_tee_ioctl_param.
	(struct tee_iocl_supp_recv_arg): Change to...
	(typedef struct_tee_iocl_supp_recv_arg): ...this.  Change params field
	type from struct tee_ioctl_param to struct_tee_ioctl_param.
	(struct tee_iocl_supp_send_arg): Change to...
	(typedef struct_tee_iocl_supp_send_arg): ...this.  Change params field
	type from struct tee_ioctl_param to struct_tee_ioctl_param.
	(struct tee_ioctl_open_session_arg): Change to...
	(typedef struct_tee_ioctl_open_session_arg): ...this.  Change params
	field type from struct tee_ioctl_param to struct_tee_ioctl_param.
	[TEE_IOCTL_PARAM_SIZE]: Move to tee.c.
	* Makefile.am (libstrace_a_SOURCES): Remove tee.h.
	* configure.ac (AC_CHECK_HEADERS([linux/tee.h])): Remove in favour of
	auto-generated checks courtesy of types/tee.h.
	* tee.c: Remove "tee.h" include.  Add "types/tee.h",
	"xlat/tee_ioctl_cmds.h" (under XLAT_MACROS_ONLY definition),
	"xlat/tee_ioctl_gen_caps.h", "xlat/tee_ioctl_impl_ids.h",
	"xlat/tee_ioctl_login_types.h", "xlat/tee_ioctl_max_arg_size.h",
	"xlat/tee_ioctl_origins.h", "xlat/tee_ioctl_optee_caps.h",
	"xlat/tee_ioctl_param_attr_types.h", "xlat/tee_ioctl_shm_flags.h"
	includes.
	[TEE_IOCTL_PARAM_SIZE]: Move from tee.h.
	(tee_print_buf, tee_fetch_buf_data): Change the buf argument type
	from struct tee_ioctl_buf_data to struct_tee_ioctl_buf_data.
	(tee_print_param_fn): Change the param variable type from
	struct tee_ioctl_param to struct_tee_ioctl_param.
	(tee_print_params): Change the param_buffer variable type from
	struct tee_ioctl_param to struct_tee_ioctl_param.
	(tee_version): Change the version variable type from
	struct tee_ioctl_version_data to struct_tee_ioctl_version_data.
	(tee_open_session): Change the buf_data variable type from
	struct_tee ioctl_buf_data to struct_tee_ioctl_buf_data.  Change
	the open_session variable type from struct tee_ioctl_open_session_arg
	to struct_tee_ioctl_open_session_arg.
	(tee_invoke): Change the buf_data variable type from
	struct_tee ioctl_buf_data to struct_tee_ioctl_buf_data.  Change
	the invoke variable type from struct tee_ioctl_invoke_arg to
	struct_tee_ioctl_invoke_arg.
	(tee_cancel): Change the cancel variable type from
	struct tee_ioctl_cancel_arg to struct_tee_ioctl_cancel_arg.
	(tee_close_session): Change the close_session variable type from
	struct tee_ioctl_close_session_arg to
	struct_tee_ioctl_close_session_arg.
	(tee_suppl_recv): Change the buf_data variable type from
	struct_tee ioctl_buf_data to struct_tee_ioctl_buf_data.  Change
	the supp_recv variable type from struct tee_iocl_supp_recv_arg
	to struct_tee_iocl_supp_recv_arg.
	(tee_suppl_send): Change the buf_data variable type from
	struct_tee ioctl_buf_data to struct_tee_ioctl_buf_data.  Change
	the supp_send variable type from struct tee_iocl_supp_send_arg
	to struct_tee_iocl_supp_send_arg.
	(tee_shm_alloc): Change the shm_alloc variable type from
	struct tee_ioctl_shm_alloc_data to struct_tee_ioctl_shm_alloc_data.
	(tee_shm_register_fd): Change the shm_register_fd variable type from
	struct tee_ioctl_shm_register_fd_data to
	struct_tee_ioctl_shm_register_fd_data.
	(tee_shm_register): Change the shm_register variable type from
	struct tee_ioctl_shm_register_data to
	struct_tee_ioctl_shm_register_data.
	* tests/ioctl_tee.c: Put the contents under HAVE_LINUX_TEE_H ifdef.
	Remove "tee.h" include.  Add <linux/tee.h> include.
	[!TEE_IOCTL_PARAM_ATTR_META] (TEE_IOCTL_PARAM_ATTR_META): New
	definition.
	[!HAVE_STRUCT_TEE_IOCTL_SHM_REGISTER_FD_DATA] (struct
	tee_ioctl_shm_register_fd_data): New type definition.
	[!HAVE_STRUCT_TEE_IOCTL_SHM_REGISTER_DATA] (struct
	tee_ioctl_shm_register_data): Likewise.
	[!TEE_IOC_SHM_REGISTER_FD] (TEE_IOC_SHM_REGISTER_FD): New definition.
	[!TEE_IOC_SHM_REGISTER] (TEE_IOC_SHM_REGISTER): Likewise.
	* xlat/tee_ioctl_cmds.in (TEE_IOC_VERSION): Change type in the _IOR
	macro argument from struct tee_ioctl_version_data to
	struct_tee_ioctl_version_data.
	(TEE_IOC_SHM_ALLOC): Change the type in the _IOWR macro argument from
	struct tee_ioctl_shm_alloc_data to struct_tee_ioctl_shm_alloc_data.
	(TEE_IOC_OPEN_SESSION): Change the type in the _IOR macro argument from
	struct tee_ioctl_buf_data to struct_tee_ioctl_buf_data.
	(TEE_IOC_INVOKE): Change the type in the _IOR macro argument from
	struct tee_ioctl_buf_data to struct_tee_ioctl_buf_data.
	(TEE_IOC_CANCEL): Change the type in the _IOR macro argument from
	struct tee_ioctl_cancel_arg to struct_tee_ioctl_cancel_arg.
	(TEE_IOC_CLOSE_SESSION): Change the type in the _IOR macro argument
	from struct tee_ioctl_close_session_arg
	to struct_tee_ioctl_close_session_arg.
	(TEE_IOC_SUPPL_RECV): Change the type in the _IOR macro argument
	from struct tee_ioctl_buf_data to struct_tee_ioctl_buf_data.
	(TEE_IOC_SUPPL_SEND): Change the type in the _IOR macro argument
	from struct tee_ioctl_buf_data to struct_tee_ioctl_buf_data.
	(TEE_IOC_SHM_REGISTER_FD): Change the type in the _IOWR macro argument
	from struct tee_ioctl_shm_register_fd_data
	to struct_tee_ioctl_shm_register_fd_data.
	(TEE_IOC_SHM_REGISTER): Change the type in the _IOWR macro argument
	from struct tee_ioctl_shm_register_data
	to struct_tee_ioctl_shm_register_data.

2020-09-23  Elvira Khabirova  <lineprinter0@gmail.com>

	Implement decoding of TEE_* ioctls.
	* tee.c: New file.
	* tee.h: Likewise.
	* Makefile.am (libstrace_a_SOURCES): Add them.
	* configure.ac (AC_CHECK_HEADERS): Add linux/tee.h.
	* defs.h (DECL_IOCTL): Add tee.
	* ioctl.c (ioctl_decode): Add 0xa4 (tee) case.
	* xlat/tee_ioctl_cmds.in: New file.
	* xlat/tee_ioctl_gen_caps.in: Likewise.
	* xlat/tee_ioctl_impl_ids.in: Likewise.
	* xlat/tee_ioctl_login_types.in: Likewise.
	* xlat/tee_ioctl_max_arg_size.in: Likewise.
	* xlat/tee_ioctl_optee_caps.in: Likewise.
	* xlat/tee_ioctl_origins.in: Likewise.
	* xlat/tee_ioctl_param_attr_types.in: Likewise.
	* xlat/tee_ioctl_shm_flags.in: Likewise.
	* tests/gen_tests.in (ioctl_tee): New entry.
	* tests/ioctl_tee.c: New file.
	* tests/.gitignore: Add ioctl_tee.
	* tests/pure_executables.list: Likewise.
	* NEWS: Mention the change.

2020-09-20  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update KVM_* constants.
	* xlat/kvm_cap.in (KVM_CAP_STEAL_TIME): New constant introduced by Linux
	kernel commit v5.9-rc5~6^2~16^2~3.

2020-09-19  Dmitry V. Levin  <ldv@altlinux.org>

	semctl: decode struct arguments of IPC_* and SEM_* commands.
	* ipc_semctl.c: New file.
	* Makefile.am (libstrace_a_SOURCES): Add it.
	* ipc_defs.h (NAME_OF_STRUCT_SEMID_DS): New macro.
	* ipc_sem.c: Stop including "xlat/semctl_flags.h".
	(SYS_FUNC(semctl)): Remove.
	* tests/ipc_sem.c (str_ipc_info): New macro.
	(print_semid_ds, print_sem_info): New functions.
	(main): Use them to check decoding IPC_INFO, SEM_INFO, IPC_SET,
	IPC_STAT, SEM_STAT, and SEM_STAT_ANY semctl syscall commands.
	* NEWS: Mention this change.

2020-09-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: disable shmctl IPC_STAT test with a bogus address on glibc >= 2.32
	Starting with commit glibc-2.32~80, on every 32-bit architecture where
	32-bit time_t support is enabled, glibc tries to retrieve the data
	provided in the third argument of shmctl call.  This results to
	segfaults inside glibc when shmctl is called with a bogus address.

	* tests/ipc_shm.c [GLIBC_PREREQ_GE(2, 32) && __TIMESIZE != 64]
	(TEST_SHMCTL_BOGUS_ADDR): Define to 0.
	(main): Conditionalize on TEST_SHMCTL_BOGUS_ADDR the shmctl IPC_STAT
	invocation with a bogus address.

2020-09-19  Dmitry V. Levin  <ldv@altlinux.org>

	shmctl: decode some commands on entering syscall.
	* ipc_shmctl.c (SYS_FUNC(shmctl)): Handle all commands except IPC_INFO,
	IPC_STAT, SHM_INFO, SHM_STAT, and SHM_STAT_ANY on entering syscall.

	shmctl: decode struct shminfo argument of IPC_INFO command.
	* ipc_defs.h (NAME_OF_STRUCT_SHMINFO): New macro.
	* ipc_shmctl.c (struct_shm_ipc_info_t): New typedef.  Mpersify it.
	(print_ipc_info): New function.
	(SYS_FUNC(shmctl)): Use it to decode struct shminfo argument
	of IPC_INFO command.
	* tests/ipc_shm.c (str_ipc_info): New macro.
	(print_ipc_info): New function.
	(main): Use it to check decoding of IPC_INFO command.
	* NEWS: Mention this change.

	shmctl: decode struct shm_info argument of SHM_INFO command.
	* ipc_shmctl.c (struct_shm_info_t): New typedef.  Mpersify it.
	(print_shm_info): New function.
	(SYS_FUNC(shmctl)): Use it to decode struct shm_info argument
	of SHM_INFO command.
	* tests/ipc_shm.c (print_shm_info): New function.
	(main): Use it to check decoding of SHM_INFO command.
	* NEWS: Mention this change.

	shmctl: fix printing of struct shmid_ds argument of IPC_SET command.
	* ipc_shmctl.c (print_shmid_ds) <cmd == IPC_SET>: Do not print
	misleading ellipsis.
	* tests/ipc_shm.c (main): Update expected output.

	shmctl: decode struct shmid_ds argument of SHM_STAT and SHM_STAT_ANY commands
	* ipc_shmctl.c (print_shmid_ds): Handle SHM_STAT and SHM_STAT_ANY.
	* tests/ipc_shm.c (print_shmid_ds): New function.
	(main): Use it to update expected output.
	* NEWS: Mention this change.

	shmctl: consistently use macros from print_fields.h.
	* ipc_shmctl.c (key): Define.
	(print_shmid_ds): Use PRINT_FIELD_U instead of tprintf.

	msgctl: decode some commands on entering syscall.
	* ipc_msgctl.c (SYS_FUNC(msgctl)): Handle all commands except IPC_INFO,
	IPC_STAT, MSG_INFO, MSG_STAT, and MSG_STAT_ANY on entering syscall.

	msgctl: decode struct msginfo argument of IPC_INFO and MSG_INFO commands
	* ipc_msgctl.c (print_msginfo): New function.
	(SYS_FUNC(msgctl)): Use it to decode struct msginfo argument of IPC_INFO
	and MSG_INFO commands.
	* tests/ipc_msg.c (print_msginfo): New function.
	(main): Use it to check decoding of IPC_INFO and MSG_INFO commands.
	* NEWS: Mention this change.

	msgctl: print struct msqid_ds.msg_qbytes of IPC_SET command.
	* ipc_msgctl.c (print_msqid_ds) <cmd == IPC_SET>: Print
	struct msqid_ds.msg_qbytes.
	* tests/ipc_msg.c (main): Update expected output.

	msgctl: decode struct msqid_ds argument of MSG_STAT and MSG_STAT_ANY commands
	* ipc_msgctl.c (print_msqid_ds): Handle MSG_STAT and MSG_STAT_ANY.
	* tests/ipc_msg.c (print_msqid_ds): New function.
	(main): Use it to update expected output.
	* NEWS: Mention this change.

	msgctl: consistently use macros from print_fields.h.
	* ipc_msgctl.c (key): Define.
	(print_msqid_ds): Use PRINT_FIELD_U instead of tprintf.

2020-09-18  Dmitry V. Levin  <ldv@altlinux.org>

	ci: add a git status check.
	* ci/run-build-and-tests.sh: Check that "git status" does not report
	any differences or untracked files.
	[$CHECK == coverage]: Remove ./codecov.bash after use.
	* .gitignore: Add "/travis_wait_*.log".

	.gitignore: ignore files generated by gcov.
	* .gitignore: Add *.gcov.

2020-09-18  Elvira Khabirova  <lineprinter0@gmail.com>

	xlat: fix file descriptor closing typo.
	* xlat/gen.sh (gen_header): Replace 3>- with 3>&-.

	Fixes: v5.7~28 "xlat: generate m4 checks for enumerations"

2020-09-14  Elvira Khabirova  <lineprinter0@gmail.com>

	.gitignore: add missing files that should be ignored.
	ar-lib is an autotools helper script.
	tags, TAGS, cscope.* and ncscope.* are files generated by ctags and cscope,
	source code analysers and navigation tools.

	* .gitignore: Add /ar-lib, /cscope.*, /ncscope.*, /tags and /TAGS.

2020-09-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests/ipc_msg.c: disable TEST_MSGCTL_BOGUS_ADDR on glibc >= 2.32.
	Starting with commit glibc-2.32~83, on every 32-bit architecture where
	32-bit time_t support is enabled, glibc tries to retrieve the data
	provided in the third argument of msgctl call.  This results to
	segfaults inside glibc if TEST_MSGCTL_BOGUS_ADDR is enabled.

	* tests/ipc_msg.c [GLIBC_PREREQ_GE(2, 32) && __TIMESIZE != 64]
	(TEST_MSGCTL_BOGUS_ADDR): Define to 0.

	Reported-by: Ruinland ChuanTzu Tsai <ruinland@andestech.com>

2020-09-12  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce GLIBC_PREREQ_GE and GLIBC_PREREQ_LT macros.
	* gcc_compat.h (GLIBC_PREREQ_GE, GLIBC_PREREQ_LT): New macros.
	* tests/ipc_msg.c: Use GLIBC_PREREQ_LT instead of manual checking
	for __GLIBC__ and __GLIBC_MINOR__.
	* tests/readahead.c: Likewise.

2020-09-06  Dmitry V. Levin  <ldv@altlinux.org>

	ci: re-enable testing with the latest mainline kernel headers.
	There should be no issues with v5.9-rc4.
	This reverts commit 1c84f0b04d0fd8d37afd29a4c959fb8c863bcfdb.

	* .github/workflows/ci.yml (env): Remove KBRANCH.
	* .gitlab-ci.yml (variables): Likewise.
	* .travis.yml (env:global): Likewise.

2020-09-06  Dmitry V. Levin  <ldv@altlinux.org>

	types/v4l2.h: update definition of struct_v4l2_create_buffers.
	* types/v4l2.h (struct_v4l2_create_buffers): Add "flags" field and
	update "reserved" field to sync with changes introduced by Linux kernel
	commit v5.9-rc1~94^2~295.

	xlat: update V4L2_FMT_FLAG_* constants.
	* xlat/v4l2_format_description_flags.in
	(V4L2_FMT_FLAG_ENC_CAP_FRAME_INTERVAL): New constant introduced by Linux
	kernel commit v5.9-rc1~94^2~283.
	* NEWS: Mention this change.
	* tests/ioctl_v4l2-success.c (fmtdesc_flags): Update expected output.

	xlat: update RTPROT_* constants.
	* xlat/routing_protocols.in (RTPROT_KEEPALIVED): New constant introduced
	by Linux kernel commit v5.9-rc1~133^2~449.
	* NEWS: Mention this change.

	xlat: update PTP_PEROUT_* constants.
	* xlat/rtnl_neigh_attrs.in (PTP_PEROUT_DUTY_CYCLE): New constant
	introduced by Linux kernel commit v5.9-rc1~133^2~199^2~2.
	(PTP_PEROUT_PHASE): New constant introduced by Linux kernel commit
	v5.9-rc1~133^2~199^2~1.
	* NEWS: Mention this change.

	xlat: update NDA_* constants.
	* xlat/rtnl_neigh_attrs.in (NDA_FDB_EXT_ATTRS): New constant introduced
	by Linux kernel commit v5.9-rc1~133^2~430^2~2.
	* NEWS: Mention this change.

	xlat: update KVM_* constants.
	* xlat/kvm_cap.in (KVM_CAP_LAST_CPU): New constant introduced by Linux
	kernel commit v5.9-rc1~121^2~108.
	(KVM_CAP_SMALLER_MAXPHYADDR): New constant introduced by Linux kernel
	commit v5.9-rc1~121^2~15.
	(KVM_CAP_S390_DIAG318): New constant introduced by Linux kernel commit
	v5.9-rc1~121^2^2.
	* NEWS: Mention this change.

	xlat: update IORING_FEAT_* constants.
	* xlat/uring_setup_features.in (IORING_FEAT_POLL_32BITS): New constant
	introduced by Linux kernel commit v5.9-rc1~212^2~116.
	* NEWS: Mention this change.

	xlat: update INET_DIAG_REQ_* constants.
	* linux/inet_diag.h (INET_DIAG_REQ_SK_BPF_STORAGES): New constant
	introduced by Linux kernel commit v5.7-rc1~146^2~287^2^2.
	(INET_DIAG_REQ_PROTOCOL): New constant introduced by Linux kernel commit
	v5.9-rc1~133^2~292^2~3.
	* xlat/inet_diag_req_attrs.in: Likewise.
	* NEWS: Mention this change.

	xlat: update IFLA_* constants.
	* xlat/rtnl_link_attrs.in (IFLA_PROTO_DOWN_REASON): New constant
	introduced by Linux kernel commit v5.9-rc1~133^2~77.
	* NEWS: Mention this change.

	xlat: update IPV6_* constants.
	* xlat/sock_ip_options.in (IPV6_RECVERR_RFC4884): New constant
	introduced by Linux kernel commit v5.9-rc1~133^2~130^2.
	* NEWS: Mention this change.

	xlat: update IP_* constants.
	* xlat/sock_ip_options.in (IP_RECVERR_RFC4884): New constant introduced
	by Linux kernel commit v5.9-rc1~133^2~200.
	* NEWS: Mention this change.

	xlat: update FAN_* constants.
	* xlat/fan_init_flags.in (FAN_REPORT_DIR_FID): New constant introduced
	by Linux kernel commit v5.9-rc1~110^2~6.
	(FAN_REPORT_NAME): New constant introduced by Linux kernel commit
	v5.9-rc1~110^2~4.
	* NEWS: Mention this change.
	* tests/fanotify_init.c (main): Update expected output.

	xlat: update CAP_* constants.
	* caps1.h (CAP_CHECKPOINT_RESTORE): New constant introduced
	by Linux kernel commit v5.9-rc1~161^2~6.
	* xlat/cap.in (CAP_CHECKPOINT_RESTORE): Likewise.
	* xlat/cap_mask1.in (1<<CAP_CHECKPOINT_RESTORE): Likewise.
	* NEWS: Mention this change.
	* tests/caps.awk: Update expected output.
	* tests/caps-abbrev.awk: Likewise.

	xlat: update BPF_* constants.
	* xlat/bpf_attach_type.in (BPF_CGROUP_INET_SOCK_RELEASE): New constant
	introduced by Linux kernel commit v5.9-rc1~133^2~259^2~18.
	(BPF_XDP_CPUMAP): New constant introduced by Linux kernel commit
	v5.9-rc1~133^2~164^2~22.
	(BPF_SK_LOOKUP): New constant introduced by Linux kernel commit
	v5.9-rc1~133^2~164^2~14^2~13.
	(BPF_XDP): New constant introduced by Linux kernel commit
	v5.9-rc1~133^2~23^2~28^2~5.
	* xlat/bpf_commands.in (BPF_LINK_DETACH): New constant introduced
	by Linux kernel commit v5.9-rc1~133^2~23^2~6^2~4.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_SK_LOOKUP): New constant
	introduced by Linux kernel commit v5.9-rc1~133^2~164^2~14^2~13.
	* NEWS: Mention this change.
	* tests/bpf.c (BPF_PROG_LOAD_checks, BPF_PROG_QUERY_checks): Update.
	* tests/kernel_version.c (print_bpf_attr, main): Likewise.

2020-09-06  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of close_range syscall.
	Introduced by Linux kernel commit v5.9-rc1~160.

	* close_range.c: New file.
	* Makefile.am (libstrace_a_SOURCES): Add it.
	* configure.ac (AC_CHECK_HEADERS): Add linux/close_range.h.
	* xlat/close_range_flags.in: New file.
	* pathtrace.c (pathtrace_match_set): Handle SEN_close_range.
	* linux/syscallent-common.h [BASE_NR + 436]: Wire up close_range.
	* NEWS: Mention this change.
	* tests/close_range.c: New file.
	* tests/close_range-P.c: Likewise.
	* tests/close_range-y.c: Likewise.
	* tests/close_range-yy.c: Likewise.
	* tests/gen_tests.in (close_range. close_range-P, close_range-y,
	close_range-yy): New entries.
	* tests/pure_executables.list: Add close_range, close_range-P,
	close_range-y, and close_range-yy.
	* tests/.gitignore: Likewise.

2020-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: reduce looping_threads iteration duration to 1/16th of TIMEOUT_DURATION
	* tests/looping_threads.test (timeout_8): Rename to...
	(timeout_16): ...this, reduce value by half.
	Use $timeout_16 instead of $timeout_8.

	Complements: v5.7~4 "tests: increase default TIMEOUT_DURATION"

2020-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Tom Stellard  <tstellar@redhat.com>

	strace.spec.in: use %make_build/%make_install macros.
	As suggested in [1][2].

	[1] https://src.fedoraproject.org/fork/tstellar/rpms/strace/c/c7358b588cb5f2893dec3b7daa84e63d9389773a.patch
	[2] https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro

	* strace.spec.in [?!__make] (%__make): New definition.
	[?!__install] (%__install): Likewise.
	[?!make_build] (%make_build): Likewise.
	[?!make_install] (%make_install): Likewise.
	(%build, %check): Use %make_build.
	(%install): Use %make_install.

2020-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mpers_test.sh: check proper handling of sized integer types.
	The commit v5.6~62 ("v4l2: always decode VIDIOC_*_EXT_CTRLS ioctl
	commands") unraveled a possibility of buggy handling of sized integer
	types in some libc implementations[1][2].  Add checks for these types
	to mpers_test.sh to catch such issues early.

	[1] https://strace.io/logs/strace/2020-04-22#17477;
	[2] https://lists.strace.io/pipermail/strace-devel/2020-August/010213.html

	* mpers_test.sh: Add checks for (u)int{8,16,32,64}_t types.

	Complements: v5.6~62 "v4l2: always decode VIDIOC_*_EXT_CTRLS ioctl commands"

2020-08-25  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	Add tests for PID namespace translation.
	* Makefile.am (CODE_COVERAGE_IGNORE_PATTERN): Add test directories.
	* tests/.gitignore: Add new test executables.
	* tests/Makefile.am (check_PROGRAMS): Add new test executables.
	(DECODER_TESTS) Add new test files.
	(libtests_a_SOURCES): Add trie_for_tests.c, xmalloc_for_tests.c.
	* tests/gen_tests.in: Add new tests.
	* tests/trie_test.c: New file.
	* tests/trie_for_tests.c: New file.
	* tests/xmalloc_for_tests.c: New file.
	* tests/pidns-cache.c: New file.
	* tests/pidns-cache.test: New file.
	* tests/fcntl--pidns-translation.c: New file.
	* tests/fcntl64--pidns-translation.c: New file.
	* tests/fork--pidns-translation.awk: New file.
	* tests/fork--pidns-translation.c: New file.
	* tests/fork--pidns-translation.test: New file.
	* tests/getpgrp--pidns-translation.c: New file.
	* tests/getpid--pidns-translation.c: New file.
	* tests/getsid--pidns-translation.c: New file.
	* tests/gettid--pidns-translation.c: New file.
	* tests/gettid--pidns-translation.test: New file.
	* tests/ioctl_block--pidns-translation.c: New file.
	* tests/ioctl_block--pidns-translation.test: New file.
	* tests/ioprio--pidns-translation.c: New file.
	* tests/kill--pidns-translation.c: New file.
	* tests/migrate_pages--pidns-translation.c: New file.
	* tests/move_pages--pidns-translation.c: New file.
	* tests/net-sockaddr--pidns-translation.c: New file.
	* tests/netlink_audit--pidns-translation.c: New file.
	* tests/netlink_audit--pidns-translation.test: New file.
	* tests/pidfd_open--pidns-translation.c: New file.
	* tests/pidfd_send_signal--pidns-translation.c: New file.
	* tests/prlimit64--pidns-translation.c: New file.
	* tests/process_vm_readv--pidns-translation.c: New file.
	* tests/process_vm_writev--pidns-translation.c: New file.
	* tests/rt_sigqueueinfo--pidns-translation.c: New file.
	* tests/rt_tgsigqueueinfo--pidns-translation.c: New file.
	* tests/sched_xetaffinity--pidns-translation.c: New file.
	* tests/sched_xetattr--pidns-translation.c: New file.
	* tests/sched_xetparam--pidns-translation.c: New file.
	* tests/sched_xetscheduler--pidns-translation.c: New file.
	* tests/signal_receive--pidns-translation.c: New file.
	* tests/so_peercred--pidns-translation.c: New file.
	* tests/tkill--pidns-translation.c: New file.
	* tests/tgkill--pidns-translation.c: New file.
	* tests/xet_robust_list--pidns-translation.c: New file.
	* tests/xetpgid--pidns-translation.c: New file.
	* tests/xetpriority--pidns-translation.c: New file.
	* tests/fcntl-common.c: Print PID translation string after PIDs.
	* tests/fcntl.c: Likewise.
	* tests/fcntl64.c: Likewise.
	* tests/getpgrp.c: Likewise.
	* tests/getpid.c: Likewise.
	* tests/getsid.c: Likewise.
	* tests/gettid.c: Likewise.
	* tests/ioctl_block.c: Likewise.
	* tests/ioprio.c: Likewise.
	* tests/kcmp.c: Likewise.
	* tests/kill.c: Likewise.
	* tests/migrate_pages.c: Likewise.
	* tests/move_pages.c: Likewise.
	* tests/net-sockaddr.c: Likewise.
	* tests/netlink_audit.c: Likewise.
	* tests/pidfd_open.c: Likewise.
	* tests/pidfd_send_signal.c: Likewise.
	* tests/prlimit64.c: Likewise.
	* tests/process_vm_readv_writev.c: Likewise.
	* tests/rt_sigqueueinfo.c: Likewise.
	* tests/rt_tgsigqueueinfo.c: Likewise.
	* tests/sched_xetaffinity.c: Likewise.
	* tests/sched_xetattr.c: Likewise.
	* tests/sched_xetparam.c: Likewise.
	* tests/sched_xetscheduler.c: Likewise.
	* tests/signal_receive.c: Likewise.
	* tests/so_peercred.c: Likewise.
	* tests/tgkill.c: Likewise.
	* tests/tkill.c: Likewise.
	* tests/xet_robust_list.c: Likewise.
	* tests/xetpgid.c: Likewise.
	* tests/xetpriority.c: Likewise.

	Implement testing framework for pidns.
	* tests/pidns.c: New file.
	* tests/pidns.h: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add pidns.c, pidns.h.
	* tests/init.sh (test_pidns, test_pidns_run_strace): New functions.

	Use get_proc_pid for /proc paths.
	* mmap_cache.c (mmap_cache_rebuild_if_invalid): Use proc pid instead of
	tcp->pid for /proc path.
	* util.c (getfdproto): Likewise.
	(pidfd_get_pid): Likewise.
	* pathtrace.c (getfdpath_pid): Likewise.
	* strace.c (attach_tcb): Likewise.

	Use printpid in decoders.
	* getpid.c: New file.
	* Makefile.am (libstrace_a_SOURCES): Add it.
	* linux/dummy.h (sys_getpid, sys_getppid, sys_gettid,
	sys_setpgid, sys_setpgrp): Remove.
	* util.c (printfd_pid_tracee_ns): Implement using translate_pid.
	* defs.h (printnum_pid): New function definition.
	(printfd_pid_tracee_ns): Update documentation
	* util.c: (printnum_pid): New function.
	* print_fields.h (PRINT_FIELD_TID): New macro.
	(PRINT_FIELD_TGID): Likewise.
	(PRINT_FIELD_PGID): Likewise.
	(PRINT_FIELD_SID): Likewise.
	* affinity.c: Print PIDs with printpid.
	* block.c: Likewise.
	* bpf.c: Likewise.
	* capability.c: Likewise.
	* clone.c: Likewise.
	* fcntl.c: Likewise.
	* get_robust_list.c: Likewise.
	* ioprio.c: Likewise.
	* kcmp.c: Likewise.
	* msghdr.c: Likewise.
	* net.c: Likewise.
	* netlink.c: Likewise.
	* numa.c: Likewise.
	* pidfd_open.c: Likewise.
	* printsiginfo.c: Likewise.
	* process.c: Likewise.
	* process_vm.c: Likewise.
	* resource.c: Likewise.
	* sched.c: Likewise.
	* signal.c: Likewise.
	* sockaddr.c: Likewise.
	* wait.c: Likewise.
	* kcmp.c (SYS_FUNC(kcmp)): Fix KCMP_FILE pid arguments.
	* tests/kcmp.c (printpidfd): Print path if VERBOSE_FD.
	(main): Use our real pid if real fds are used.

2020-08-25  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	PID namespace translation support.
	* defs.h (pidns_translation): New variable.
	(tcb): Add pid_ns field.
	(RVAL_MASK): Change value from 013 to 017.
	(RVAL_TID, RVAL_SID, RVAL_TGID, RVAL_PGID): New definitions.
	(pid_type): New enum.
	(pidns_init, translate_pid, get_proc_pid, printpid, printpid_tgid_pgid):
	New function declarations.
	* largefile_wrappers.h (fstat_fd): New macro.
	* pidns.c: New file.
	* trie.c: New file.
	* trie.h: New file.
	* Makefile.am (libstrace_a_SOURCES): Add trie.c, trie.h, pidns.c.
	* strace.c (pidns_translation): New variable.
	(init): Add --pidns-translation option.
	* syscall.c (syscall_exiting_trace): Handle RVAL_* return values.
	* NEWS: Mention this.
	* strace.1.in: Add description for new option.

	Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2020-08-25  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	tests/mknod.c: add workaround for ppc bug in travis.
	On ppc travis builds syscall(mknod) sometimes does not fail with EEXISTS
	as expected, but returns successfully. This commit uses sprintrc for
	errno printing, which handles successful return values too.

	* tests/mknod.c (main): Use sprintrc for printing errno.

2020-08-21  Elvira Khabirova  <lineprinter0@gmail.com>

	tests: check -n/--syscall-number option.
	* tests/strace-n.c: New file.
	* tests/gen_tests.in (strace-n): New entry.
	* tests/pure_executables.list: Add strace-n.
	* tests/.gitignore: Likewise.

	strace: add an option for printing syscall numbers.
	* print_syscall_number.c: New file.
	* Makefile.am (libstrace_a_SOURCES): Add it.
	* defs.h (struct tcb): Add true_scno field.
	(print_syscall_number): New function declaration.
	* strace.c: Add -n/--syscall-number option.
	(printleader): Call print_syscall_number.
	* syscall.c (get_scno): Assign tcp->true_scno.
	* tests/options-syntax.test: Check with -c/--summary-only.
	* strace.1.in: Document new option.
	* NEWS: Mention the new option.

2020-08-06  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 5.8-1.
	* strace.spec.in: Likewise.

	Prepare for 5.8 release.
	* NEWS: Update for 5.8 release.

2020-08-04  Dmitry V. Levin  <ldv@altlinux.org>

	ci: use kernel headers from Linux kernel v5.8.
	When Linux kernel merge window opens, changes of all sorts start to pour
	down, breaking UAPI in various ways.  This does not work for strace,
	we need a stable UAPI.

	* .github/workflows/ci.yml (env): Add KBRANCH.
	* .gitlab-ci.yml (variables): Likewise.
	* .travis.yml (env:global): Likewise.

2020-08-03  Dmitry V. Levin  <ldv@altlinux.org>

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2020-08-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of tgkill syscall.
	* tests/tgkill.c: New file.
	* tests/gen_tests.in (tgkill): New entry.
	* tests/pure_executables.list: Add tgkill.
	* tests/.gitignore: Likewise.

	tests: check decoding of tkill syscall.
	* tests/tkill.c: New file.
	* tests/gen_tests.in (tkill): New entry.
	* tests/pure_executables.list: Add tkill.
	* tests/.gitignore: Likewise.

2020-08-01  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	Introduce SYS_FUNC(tkill)
	This is going to be needed to implement pidns support
	in tkill syscall decoder.

	syscallent*.h files are updated automatically by:
	  git grep -l 'SEN(kill).*"tkill"' |
	  xargs sed -i '/"tkill"/ s/SEN(kill)/SEN(tkill)/'

	* signal.c (SYS_FUNC(tkill)): New syscall decoder.
	* linux/32/syscallent.h: Use SEN(tkill) for "tkill" syscall.
	* linux/64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

2020-08-01  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	Add "struct tcb *" parameters to various functions.
	This is going to be needed to implement pidns support.

	* defs.h (print_sockaddr): Add a "struct tcb *" parameter.
	* printsiginfo.h (printsiginfo): Likewise.
	* fcntl.c (print_struct_flock64): Likewise.  All callers updated.
	* print_fields.h (PRINT_FIELD_SOCKADDR): Likewise.   All callers updated.
	* printsiginfo.c (printsigsource, print_si_info, printsiginfo): Likewise.
	All callers updated.
	* sockaddr.c (print_sockaddr_data_un, print_sockaddr_data_in,
	print_sockaddr_data_in6, print_sockaddr_data_ax25,
	print_sockaddr_data_ipx, print_sockaddr_data_x25,
	print_sockaddr_data_nl, print_sockaddr_data_ll,
	print_sockaddr_data_bt, sockaddr_printer, print_sockaddr): Likewise.
	All callers updated.

2020-07-30  Dmitry V. Levin  <ldv@altlinux.org>

	Use tprints instead of tprintf in a few more places.
	* bpf.c (BPF_PROG_LOAD, BPF_OBJ_PIN, BPF_OBJ_GET_INFO_BY_FD,
	BPF_RAW_TRACEPOINT_OPEN, BPF_TASK_FD_QUERY, BPF_MAP_LOOKUP_BATCH,
	BPF_MAP_UPDATE_BATCH, BPF_MAP_DELETE_BATCH): Replace tprintf
	with tprints for printing strings without format specifiers.
	* btrfs.c (btrfs_ioctl): Likewise.
	* ioctl.c (evdev_decode_number): Likewise.
	* perf_ioctl.c (perf_ioctl): Likewise.
	* rtnl_addr.c (decode_ifa_cacheinfo): Likewise.
	* v4l2.c (print_v4l2_capability, print_v4l2_requestbuffers,
	print_v4l2_streamparm): Likewise.

2020-07-24  Janosch Frank  <frankja@linux.ibm.com>

	s390x: sthyi: Fix section size requirement and error.
	Some old z/VM instances report only 40 bytes for the partition
	section, as they don't report the last three struct members.

	Let's lower the size check of that section to 40 to accommodate them.

	Also we expect a section to be at least x bytes, so we should make
	that clear in the error message.

	Reviewed-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2020-07-21  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	Remove tcb parameter of read_int_from_file.
	* defs.h (read_int_from_file): Remove tcb parameter.
	* util.c (read_int_from_file): Likewise.
	* msghdr.c (get_optmem_max): Remove tcb parameter of read_int_from_file.

2020-07-18  Dmitry V. Levin  <ldv@altlinux.org>

	Consistently print process ids as signed integers.
	* block.c (block_ioctl): Print struct_blk_user_trace_setup.pid using
	PRINT_FIELD_D instead of PRINT_FIELD_U.
	* bpf.c (BPF_TASK_FD_QUERY): Print task_fd_query.pid using PRINT_FIELD_D
	instead of PRINT_FIELD_U.
	* ipc_msgctl.c (print_msqid_ds): Print msqid_ds.msg_lspid
	and msqid_ds.msg_lrpid using PRINT_FIELD_D.
	* ipc_shmctl.c (print_shmid_ds): Print shmid_ds.shm_cpid and shm_lpid
	using PRINT_FIELD_D.
	* msghdr.c (print_scm_creds): Print ucred.pid using PRINT_FIELD_D
	instead of PRINT_FIELD_U.
	* netlink.c (print_nlmsghdr): Print nlmsghdr.nlmsg_pid using %d format
	instead of %u.
	* tests/bpf.c (BPF_TASK_FD_QUERY_checks): Update expected output.
	* tests/ioctl_block.c (main): Update expected output.
	* tests/ipc_msg.c (main): Likewise.
	* tests/ipc_shm.c (main): Likewise.
	* tests/net-yy-netlink.c (main): Likewise.
	* tests/netlink_protocol.c (test_nlmsgerr): Likewise.

	Introduce PRINT_FIELD_NUMERIC_UMODE_T.
	* print_fields.h (PRINT_FIELD_NUMERIC_UMODE_T): New macro.
	* ipc_msgctl.c (print_msqid_ds): Use it instead of print_numeric_umode_t.
	* ipc_shmctl.c (print_shmid_ds): Likewise.
	* open.c (print_open_how): Use it instead of print_numeric_ll_umode_t.

	Fix printing of syscall return value in octal mode.
	* defs.h (print_numeric_long_umask): Remove.
	* printmode.c (print_numeric_long_umask): Likewise.
	* syscall.c (syscall_exiting_trace) <case RVAL_OCTAL>: Fix printing
	of tcp->u_rval when sizeof(tcp->u_rval) > sizeof(long) or when
	sizeof(tcp->u_rval) > current_klongsize.

	Rename print_numeric_umode_t_64 to print_numeric_ll_umode_t.
	* printmode.c (print_numeric_umode_t_64): Rename
	to print_numeric_ll_umode_t, change the type of its argument
	to unsigned long long.
	* defs.h: Likewise.
	* open.c (print_open_how): Use print_numeric_ll_umode_t instead of
	print_numeric_umode_t_64.

2020-07-17  Dmitry V. Levin  <ldv@altlinux.org>

	Use PRINT_FIELD_UID instead of printuid where appropriate.
	* ipc_msgctl.c: Include "print_fields.h".
	(print_msqid_ds): Use PRINT_FIELD_UID instead of printuid.
	* ipc_shmctl.c: Include "print_fields.h".
	(print_shmid_ds): Use PRINT_FIELD_UID instead of printuid.
	* statx.c (SYS_FUNC(statx)): Use PRINT_FIELD_UID instead of printuid.

	printsiginfo: fix printing of siginfo_t.si_pid and siginfo_t.si_uid.
	* printsiginfo.c (printsigsource): Print siginfo_t.si_pid using
	PRINT_FIELD_D, print siginfo_t.si_uid using PRINT_FIELD_UID.
	* tests/clone_ptrace.c (main): Update expected output.
	* tests/orphaned_process_group.c (main): Likewise.
	* tests/pidfd_send_signal.c (main): Likewise.
	* tests/ptrace.c (test_peeksiginfo): Likewise.
	* tests/rt_sigqueueinfo.c (main): Likewise.
	* tests/rt_tgsigqueueinfo.c (main): Likewise.
	* tests/siginfo.c (main): Likewise.
	* tests/waitid.c (sprint_siginfo): Likewise.

	statx: use PRINT_FIELD_FLAGS.
	* statx.c (SYS_FUNC(statx)): Use PRINT_FIELD_FLAGS instead of
	printflags.

2020-07-17  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	kcmp: fix KCMP_FILE decoding.
	* kcmp.c (SYS_FUNC(kcmp)): Fix KCMP_FILE pid arguments.

	Fixes: v4.20~66 ("kcmp: output fds using a separate function")

2020-07-13  Dmitry V. Levin  <ldv@altlinux.org>

	fcntl: use print_fields.h macros.
	* fcntl.c: Include "print_fields.h".
	(print_struct_flock64, print_f_owner_ex): Use PRINT_FIELD_* macros
	from print_fields.h.

	evdev_mpers: use print_fields.h macros.
	* evdev_mpers.c: Include "print_fields.h".
	(decode_envelope, ff_effect_ioctl): Use PRINT_FIELD_* macros
	from print_fields.h.
	* tests/ioctl_evdev.c (print_ffe_common): Update expected output.

2020-07-12  Dmitry V. Levin  <ldv@altlinux.org>

	ustat: use print_fields.h macros.
	* ustat.c: Include "print_fields.h".
	(SYS_FUNC(ustat)): Use PRINT_FIELD_* macros from print_fields.h.

	file_ioctl: use print_fields.h macros.
	* file_ioctl.c: Include "print_fields.h".
	(print_file_dedupe_range_info, print_fiemap_extent, file_ioctl): Use
	PRINT_FIELD_* macros from print_fields.h.

	evdev: use print_fields.h macros.
	* evdev.c (abs_ioctl, keycode_V2_ioctl): Use PRINT_FIELD_* macros
	from print_fields.h.

	evdev: fix formatting of struct input_id.
	* evdev.c (getid_ioctl): Use PRINT_FIELD_U.
	* tests/ioctl_evdev.c (main): Update expected output.

	btrfs: use PRINT_FIELD_X_ARRAY.
	* types/btrfs.h: New file.
	* btrfs.c: Include "types/btrfs.h".
	(btrfs_ioctl): Use struct_btrfs_ioctl_logical_ino_args and
	PRINT_FIELD_X_ARRAY.
	* configure.ac (AC_CHECK_MEMBERS): Remove
	struct btrfs_ioctl_search_args_v2.buf_size and
	struct btrfs_ioctl_logical_ino_args.flags.

2020-07-10  Dmitry V. Levin  <ldv@altlinux.org>

	travis: reintroduce ppc64le and s390x builds.
	Let's give travis another chance.
	This reverts commits 86a53f791ad34a825b8633eb0272d954647ce705
	and 36f32a255db09886f7f9ba08ec712b8742f0c312.

	* .travis.yml (arch: ppc64le, arch: s390x): New entries.

2020-07-10  Dmitry V. Levin  <ldv@altlinux.org>

	README.md: migrate from travis-ci.org to travis-ci.com.

2020-07-08  Dmitry V. Levin  <ldv@altlinux.org>

	evdev: fix formatting of struct input_keymap_entry.scancode.
	* evdev.c (keycode_V2_ioctl): Use PRINT_FIELD_X_ARRAY.
	* tests/ioctl_evdev.c (main): Update expected output.

	x86_64/arch_kvm: use PRINT_FIELD_X_ARRAY.
	* linux/x86_64/arch_kvm.c (arch_print_kvm_sregs): Use PRINT_FIELD_X_ARRAY.

	loop: implement decoding of LOOP_CONFIGURE ioctl command.
	* types/loop.h: New file.
	* loop.c: Include it instead of <linux/ioctl.h> and <linux/loop.h>.
	(ecode_loop_config): New function.
	(loop_ioctl): Use it to decode LOOP_CONFIGURE ioctl command.
	* NEWS: Mention this change.
	* tests/ioctl_loop.c: Check it.

2020-07-08  Dmitry V. Levin  <ldv@altlinux.org>

	loop: factor out print_loop_info64.
	It is going to be used to implement LOOP_CONFIGURE decoding.

	* loop.c (print_loop_info64): New function.
	(decode_loop_info64): Use it.

2020-07-08  Dmitry V. Levin  <ldv@altlinux.org>

	loop: use print_fields.h macros.
	* loop.c (decode_loop_info, decode_loop_info64): Use PRINT_FIELD_*
	macros from print_fields.h.

	print_fields: introduce PRINT_FIELD_U_ARRAY and PRINT_FIELD_X_ARRAY.
	* print_fields.h: Include "static_assert.h".
	(PRINT_FIELD_UINT_ARRAY, PRINT_FIELD_U_ARRAY, PRINT_FIELD_X_ARRAY):
	New macros.
	(PRINT_FIELD_COOKIE): Rewrite using PRINT_FIELD_U_ARRAY.

2020-07-06  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v5.8.
	* linux/32/ioctls_inc_align16.h: Update from linux v5.8-rc4
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/powerpc/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.
	* tests/ioctl_loop.c (main): Update.

2020-07-04  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of faccessat2 syscall.
	Introduced by Linux kernel commit v5.8-rc1~203^2.

	* xlat/faccessat_flags.in: New file.
	* access.c: Include "xlat/faccessat_flags.h".
	(decode_access): Change return type to void.
	(SYS_FUNC(access)): Return RVAL_DECODED.
	(decode_faccessat): New function.
	(SYS_FUNC(faccessat)): Use it.
	(SYS_FUNC(faccessat2)): New function.
	* pathtrace.c (pathtrace_match_set): Handle SEN_faccessat2.
	* linux/syscallent-common.h [BASE_NR + 439]: Wire up faccessat2.
	* NEWS: Mention this change.
	* tests/faccessat2.c: New file.
	* tests/faccessat2-P.c: Likewise.
	* tests/faccessat2-y.c: Likewise.
	* tests/faccessat2-yy.c: Likewise.
	* tests/faccessat2.test: New test.
	* tests/Makefile.am (DECODER_TESTS): Add faccessat2.test.
	* tests/gen_tests.in (faccessat2-P, faccessat2-y, faccessat2-yy): New
	entries.
	* tests/pure_executables.list: Add faccessat2, faccessat2-P,
	faccessat2-y, and faccessat2-yy.
	* tests/.gitignore: Likewise.

2020-07-04  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: rename access_flags to access_modes.
	Since faccessat2 syscall has both "mode" and "flags" arguments,
	rename access_flags to access_modes to avoid confusion.

	* xlat/access_flags.in: Rename to ...
	* xlat/access_modes.in: ... this file, add fallback definitions.
	(EFF_ONLY_OK, EX_OK): Remove non-Linux constants.
	* access.c: Include "xlat/access_modes.h" instead of
	"xlat/access_flags.h".
	(decode_access): Replace access_flags woth access_modes.

2020-07-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of faccessat syscall in -P, -y, and -yy modes.
	* tests/faccessat.c: Rewrite.
	* tests/faccessat-P.c: New file.
	* tests/faccessat-y.c: Likewise.
	* tests/faccessat-yy.c: Likewise.
	* tests/faccessat.test: New test.
	* tests/Makefile.am (DECODER_TESTS): Add faccessat.test.
	* tests/gen_tests.in (faccessat): Remove.
	(faccessat-P, faccessat-y, faccessat-yy): New entries.
	* tests/pure_executables.list: Add faccessat-P, faccessat-y,
	and faccessat-yy.
	* tests/.gitignore: Likewise.

2020-06-30  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update BPF_* constants.
	* xlat/bpf_attach_type.in (BPF_TRACE_ITER): New constant introduced
	by Linux kernel commit v5.8-rc1~165^2~185^2~16^2~19.
	(BPF_CGROUP_INET4_GETPEERNAME, BPF_CGROUP_INET6_GETPEERNAME,
	BPF_CGROUP_INET4_GETSOCKNAME, BPF_CGROUP_INET6_GETSOCKNAME): New
	constants introduced by Linux kernel commit v5.8-rc1~165^2~130^2~8^2~3.`
	(BPF_XDP_DEVMAP): New constant introduced by Linux kernel commit
	v5.8-rc1~165^2~6^2~9^2~3.
	* xlat/bpf_commands.in (BPF_LINK_GET_FD_BY_ID, BPF_LINK_GET_NEXT_ID):
	New constants introduced by Linux kernel commit
	v5.8-rc1~165^2~343^2~16^2~7.
	(BPF_ENABLE_STATS): New constant introduced by Linux kernel commit
	v5.8-rc1~165^2~343^2~3^2~2.
	(BPF_ITER_CREATE): New constant introduced by Linux kernel commit
	v5.8-rc1~165^2~185^2~16^2~15.
	* xlat/bpf_map_types.in (BPF_MAP_TYPE_RINGBUF): New constant introduced
	by Linux kernel commit v5.8-rc1~165^2~6^2~12^2~4.
	* NEWS: Mention this change.
	* tests/bpf.c: Update.

2020-06-29  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	.gitignore: add missing files that should be ignored.
	* .gitignore: Add .dirstamp.
	* tests/.gitignore: Add setpgrp-exec and stack-fcall-attach.

2020-06-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update STATX_* constants.
	* xlat/statx_attrs.in (STATX_ATTR_MOUNT_ROOT): New constant introduced
	by Linux kernel commit v5.8-rc1~203^2~4.
	* xlat/statx_masks.in (STATX_MNT_ID): New constant introduced by Linux
	kernel commit v5.8-rc1~203^2~5.
	* NEWS: Mention this change.
	* tests/xstatx.c (main): Update expected output.

	xlat: update TCA_* constants.
	* xlat/rtnl_tc_attrs.in (TCA_DUMP_FLAGS): New constant introduced
	by Linux kernel commit v5.8-rc1~165^2~183^2~3.
	* rtnl_tc.c (tcmsg_nla_decoders): Add TCA_DUMP_FLAGS.
	* NEWS: Mention this change.

	xlat: update RTC_* constants.
	* xlat/rtc_vl_flags.in (RTC_VL_BACKUP_SWITCH): New constant introduced
	by Linux kernel commit v5.8-rc1~100^2~23.
	* NEWS: Mention this change.

2020-06-28  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update NDA_* constants.
	* xlat/rtnl_neigh_attrs.in (NDA_NH_ID): New constant introduced by Linux
	kernel commit v5.8-rc1~165^2~141^2~3.
	* rtnl_neigh.c (ndmsg_nla_decoders): Add NDA_NH_ID.
	* NEWS: Mention this change.

	xlat: update *_MAGIC constants.
	* xlat/fsmagic.in (DEVMEM_MAGIC): New constant introduced by Linux
	kernel commit v5.8-rc1~104^2~8.
	* NEWS: Mention this change.

	xlat: update LOOP_* constants.
	* xlat/loop_cmds.in (LOOP_CONFIGURE): New constant introduced by Linux
	kernel commit v5.8-rc1~191^2~11.
	* NEWS: Mention this change.

	xlat: update KVM_* constants.
	* xlat/kvm_cap.in (KVM_CAP_HALT_POLL): New constant introduced by Linux
	kernel commit v5.8-rc1~168^2~136.
	(KVM_CAP_ASYNC_PF_INT): New constant introduced by Linux kernel commit
	v5.8-rc1~168^2~14.
	* NEWS: Mention this change.

	xlat: update KEYCTL_* constants.
	* xlat/keyctl_commands.in (KEYCTL_WATCH_KEY): New constant introduced
	by Linux kernel commit v5.8-rc1~22^2~6.
	* xlat/keyctl_caps1.in (KEYCTL_CAPS1_NOTIFICATIONS): Likewise.
	* NEWS: Mention this change.

	xlat: update IORING_* constants.
	* xlat/uring_ops.in (IORING_OP_TEE): New constant introduced by Linux
	kernel commit v5.8-rc1~190^2~14.
	* tests/io_uring_register.c: Update expected output.

	xlat: update INET_DIAG_* constants.
	* linux/inet_diag.h (INET_DIAG_MD5SIG): New constant introduced
	by Linux kernel commit v4.14-rc1~130^2~39^2.
	(INET_DIAG_ULP_INFO): New constant introduced by Linux kernel commit
	v5.4-rc1~131^2~103^2~1.
	(INET_DIAG_SK_BPF_STORAGES): New constant introduced by Linux kernel
	commit v5.7-rc1~146^2~287^2^2.
	(INET_DIAG_CGROUP_ID): New constant introduced by Linux kernel commit
	v5.8-rc1~165^2~383^2~1.
	(INET_DIAG_BC_CGROUP_COND): New constant introduced by Linux kernel
	commit v5.8-rc1~165^2~383^2.
	* xlat/inet_diag_attrs.in (INET_DIAG_MD5SIG, INET_DIAG_ULP_INFO,
	INET_DIAG_SK_BPF_STORAGES, INET_DIAG_CGROUP_ID): Likewise.
	* xlat/inet_diag_bytecodes.in (INET_DIAG_BC_CGROUP_COND): Likewise.
	* xlat/inet_diag_extended_flags.in (1<<(INET_DIAG_MD5SIG-1),
	1<<(INET_DIAG_ULP_INFO-1), 1<<(INET_DIAG_SK_BPF_STORAGES-1),
	1<<(INET_DIAG_CGROUP_ID-1)): Likewise.
	* NEWS: Mention this change.

	xlat: update ETH_* constants.
	* xlat/ethernet_protocols.in (ETH_P_MRP): New constant introduced
	by Linux kernel commit v5.8-rc1~165^2~412^2~10.
	* NEWS: Mention this change.

	xlat: update CAP_* constants.
	* caps1.h (CAP_PERFMON): New constant introduced by Linux kernel commit
	v5.8-rc1~224^2~14^2~55.
	(CAP_BPF): New constant introduced by Linux kernel commit
	v5.8-rc1~165^2~181^2^2~2.
	* xlat/cap.in (CAP_PERFMON, CAP_BPF): Likewise.
	* xlat/cap_mask1.in (1<<CAP_PERFMON, 1<<CAP_BPF): Likewise.
	* NEWS: Mention this change.
	* tests/caps.awk: Update expected output.
	* tests/caps-abbrev.awk: Likewise.

	xlat: update AUDIT_* constants.
	* xlat/nl_audit_types.in (AUDIT_EVENT_LISTENER): New constant introduced
	by Linux kernel commit v5.8-rc1~188^2~5.
	* NEWS: Mention this change.

2020-06-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: workaround LTO in strace -k tests.
	Link time optimization in gcc 10 became too smart, resulting to most
	of function calls in strace -k tests being optimized out,
	subsequently breaking these tests.

	Make the functions more complex to bypass unwanted side effects
	of link time optimization in strace -k tests.

	* tests/stack-fcall.h: Include <unistd.h> and "scno.h".
	(COMPLEX_BODY): New macro.
	* tests/stack-fcall-0.c (f0): Use it.
	* tests/stack-fcall-1.c (f1): Likewise.
	* tests/stack-fcall-2.c (f2): Likewise.
	* tests/stack-fcall-3.c (f3): Likewise.  Rewrite switch.
	* tests/stack-fcall.c (main): Call f0 in a loop.

2020-06-16  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	Modify %process class: trace syscalls associated with process lifecycle.
	The description is rephrased as:
	"Trace system calls associated with process lifecycle
	(creation, exec, termination)."

	kill, tkill, tgkill, pidfd_send_signal and rt_sigqueueinfo are added,
	arch_prctl and unshare are removed from the %process class.

	syscallent*.h files are updated automatically by:
	find linux -name syscallent*.h -exec \
	sed -i -r -e '
	    /(arch_prctl|unshare)/ {
	        s/(\{[^,]*,\t[^,]*)TP\|/\1/
	        s/(\{[^,]*,\t[^,]*)\|TP/\1/
	        s/(\{[^,]*,\t[^,]*)TP,/\10,/
	    }
	' -e '
	    /(kill|pidfd_send_signal|rt_sigqueueinfo)/ {
	        s/(\{[^,]*,\t[^0][^,]*)/\1|TP/
	        s/(\{[^,]*,\s*)0/\1TP/
	    }
	' {} +

	[ldv: document this change in NEWS.]

	* strace.1.in: Rephrase %process description.
	* linux/32/syscallent.h: Add TP flag to *kill, pidfd_send_signal and
	rt_sigqueueinfo; remove TP flag from arch_prctl and unshare.
	* linux/64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-compat.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/syscallent-common.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* NEWS: Mention this change.

2020-06-16  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	tests/inject-nf.test: replace getpid with geteuid.
	Since we treat PIDs as signed integers, large values (>=2^31) will
	cause overflow when we use printpid.
	UIDs are treated as unsigned integers, so geteuid is a good alternative.
	(getuid would be problematic, as it does not exists on alpha).
	Also, on systems where geteuid32 exists, geteuid returns maximum 16 bit
	values, so we have to use geteuid32 in this case.

	[ldv: geteuid syscall was introduced on Alpha by Linux kernel commit
	v5.1-rc1~160^2~3^2~1, so this test will not work on old Alpha kernels.]

	* tests/inject-nf.c: Replace getpid with either geteuid32 or geteuid.
	[__alpha__]: Remove.
	[__NR_geteuid32]: New condition.
	* tests/inject-nf.test (SYSCALL): Replace getpid with '/^geteuid(32)?$'.
	Remove alpha workaround.

2020-06-16  Dmitry V. Levin  <ldv@altlinux.org>

	travis: remove s390x builds.
	They are currently unusable, permanently failing without any reason
	whatsoever.

	* .travis.yml (arch: s390x): Remove.

2020-06-16  Dmitry V. Levin  <ldv@altlinux.org>

	ci: re-enable testing with the latest mainline kernel headers.
	There should be no issues with v5.8-rc1.
	This reverts commit 734066585ba865740ab45651bc6e3e8ab249927f.

	* .github/workflows/ci.yml (env): Remove KBRANCH.
	* .gitlab-ci.yml (variables): Likewise.
	* .travis.yml (env:global): Likewise.

2020-06-16  Chris Packham  <chris.packham@alliedtelesis.co.nz>
	    Dmitry V. Levin  <ldv@altlinux.org>

	io_uring: Add io_cqring_offset flags.
	Add support for displaying struct io_cqring_offsets.flags introduced
	by Linux kernel commits v5.8-rc1~190^2~22 and v5.8-rc1~190^2~21.

	* types/io_uring.h (struct_io_cqring_offsets): Replace resv array
	with flags, resv1, and resv2 fields.
	* xlat/uring_cqring_flags.in: New file.
	* configure.ac (AC_CHECK_MEMBERS): Check struct io_cqring_offsets.flags.
	* io_uring.c: Include "xlat/uring_cqring_flags.h".
	(SYS_FUNC(io_uring_setup)): Replace printing of the resv array
	of struct io_cqring_offsets with flags, resv1, and resv2 fields.
	* tests/io_uring_setup.c: Check it.

	Resolves: https://github.com/strace/strace/issues/138

2020-06-16  Chris Packham  <chris.packham@alliedtelesis.co.nz>

	io_uring: Remove struct io_cqring_offsets compile time asserts.
	The generated types/check-io_uring.c already checks the kernel's struct
	io_cqring_offsets for compatibility with the strace definition so
	there's no need for manual checks.

	* io_uring.c [HAVE_STRUCT_IO_CQRING_OFFSETS]: Remove static_asserts.

2020-06-16  Dmitry V. Levin  <ldv@altlinux.org>

	types: skip field lines that start with comments.
	This allows to exclude certain fields from type checks by placing
	comments at the beginning of the corresponding lines.

	* types/find_last_type_fields.awk: Skip lines starting with spaces
	followed by "/".

2020-06-14  Dmitry V. Levin  <ldv@altlinux.org>

	Add statx syscall to %fstat trace class.
	statx syscall with AT_EMPTY_PATH flag is similar to newfstatat/fstatat64
	syscall with AT_EMPTY_PATH flag.

	* linux/32/syscallent.h (statx): Add TFST flag.
	* linux/64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* strace.1.in (.SS Filtering): Document it.
	* NEWS: Mention this fix.
	* tests/trace_fstat.in (statx): New entry.

2020-06-13  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	Move ilog* functions from util.c to defs.h.
	* util.c (ILOG2_ITER_, ilog2_klong, ilog2_64, ilog2_32): Move ...
	* defs.h: ... here.

	print_fields.h: add PRINT_FIELD_LEN macro.
	* print_fields.h (PRINT_FIELD_LEN): New macro.
	* net.c: (print_get_linger, print_get_ucred, print_tpacket_stats):
	Rewrite using PRINT_FIELD_LEN.

2020-06-10  Dmitry V. Levin  <ldv@altlinux.org>

	Move make-dist and make-dsc scripts to maint/
	* make-dsc: Rename to maint/make-dsc.
	* make-dist: Rename to maint/make-dist.
	* maint/README-release: Update.
	* dist/INSTALL: Likewise.

2020-06-07  Sven Schnelle  <svens@stackframe.org>

	tests: clone3 might return EBADF with invalid cgroup.
	Both on s390 and x86 linux-5.7 return EBADF when an invalid cgroup
	is supplied, so add that to the list of possible return values.


	* tests/clone3.c (main): Add EBADF to the list of possible
	CLONE_INTO_CGROUP return values.

2020-06-03  Dmitry V. Levin  <ldv@altlinux.org>

	ci: use kernel headers from Linux kernel v5.7.
	When Linux kernel merge window opens, changes of all sorts start to pour
	down, breaking UAPI in various ways.  This does not work for strace,
	we need a stable UAPI.

	* .github/workflows/ci.yml (env): Add KBRANCH.
	* .gitlab-ci.yml (variables): Likewise.
	* .travis.yml (env:global): Likewise.

2020-06-02  Dmitry V. Levin  <ldv@altlinux.org>

	s390: use a more appropriate regset type.
	* linux/s390/arch_regs.c (s390_regset): Change the type from
	struct user_regs_struct to s390_regs, the latter is the subset of
	struct user_regs_struct used by the kernel, it's also the type
	used on s390x.

2020-06-02  Steve Langasek  <steve.langasek@ubuntu.com>

	tests/perf_event_open: avoid unaligned access on ARM.
	The test suite already handles alignment requirements on POWER and
	Sparc, add ARM to the list as well.  Not all ARM environments raise
	SIGBUS on unaligned access, but some do.

	* tests/perf_event_open.c (ATTR_REC) [ARM]: Use aligned access.

2020-06-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests/wait4: invoke wait4 syscall directly instead of using libc wait4.
	glibc-2.31.9000-312-g600f00b747ff42eb0aa778536d3ef602e8bcd550 introduced
	a change in its wait4 implementation that makes it unsuitable for the
	wait4 test.

	* tests/wait4.c: Include "kernel_rusage.h" instead of <sys/resource.h>.
	(sprint_rusage): Replace struct rusage with kernel_rusage_t,
	cast member values from kernel_long_t to unsigned long long
	using zero_extend_signed_to_ull, update format strings.
	(k_wait4): New function.
	(do_wait4, main): Use it instead of wait4.

2020-06-02  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 5.7-1.
	* strace.spec.in: Likewise.

2020-06-01  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 5.7 release.
	* NEWS: Update for 5.7 release.

	.mailmap: add more entries to avoid duplication in CREDITS.

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2020-06-01  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v5.7.
	* linux/32/ioctls_inc_align16.h: Update from linux v5.7
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/s390/ioctls_arch0.h: Likewise.
	* linux/s390x/ioctls_arch0.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* NEWS: Mention this.

2020-05-31  Dmitry V. Levin  <ldv@altlinux.org>

	tests: increase default TIMEOUT_DURATION.
	* tests/init.sh (TIMEOUT_DURATION): Increase from 600 to 1500.
	* .travis.yml (matrix): Remove TIMEOUT_DURATION.

2020-05-31  Dmitry V. Levin  <ldv@altlinux.org>

	configure.ac: robustify linux headers checks.
	Some linux headers used to require other headers to be included
	beforehand.  While these linux headers are no longer insufficient
	nowadays, configure checks need to handle old headers properly.

	* configure.ac (AC_CHECK_TYPES): Include <sys/socket.h> before
	<linux/fib_rules.h>.
	(AC_CHECK_HEADERS): Include <sys/socket.h> and <linux/types.h>
	before linux/if_addr.h, linux/if_link.h, linux/neighbour.h.
	Include <linux/types.h> before other linux headers.

2020-05-31  Dmitry V. Levin  <ldv@altlinux.org>

	Include <linux/types.h> before <linux/fiemap.h> and <linux/hiddev.h>
	<linux/fiemap.h> and <linux/hiddev.h> used to require <linux/types.h>
	to be included beforehand.

	* file_ioctl.c [HAVE_LINUX_FIEMAP_H]: Include <linux/types.h>
	before <linux/fiemap.h>.
	* tests/file_ioctl.c: Likewise.
	* tests/ioctl.c: Include <linux/types.h> before <linux/hiddev.h>.

2020-05-31  Dmitry V. Levin  <ldv@altlinux.org>

	debian/rules: fix build-udeb/Makefile target.
	* debian/rules (build-udeb/Makefile): Rename --without-stacktrace
	to --disable-stacktrace.

2020-05-30  Dmitry V. Levin  <ldv@altlinux.org>

	Turn getfdpath and printfd functions into static inline wrappers.
	* defs.h (printfd): Copy here from util.c, turn into an inline wrapper.
	(getfdpath): Copy here from pathtrace.c, turn into an inline wrapper.
	* pathtrace.c (getfdpath): Remove.
	* util.c (printfd): Remove.

2020-05-30  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	tests/pidfd_getfd.c: test decoding of targetfd.
	* tests/pidfd_getfd.c (k_pidfd_getfd): Rename pid argument to pidfd.
	(main): Test decoding of targetfd.
	* tests/gen_tests.in: Add "-e signal=none" argument to pidfd_getfd
	tests.

2020-05-30  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	pidfd_getfd: fix decoder.
	The decoder incorrectly assumed the first argument being a pid,
	but actually it is a pidfd.

	The patch also makes the decoder be able to decode the targetfd
	(-y and -yy options).

	* pidfd_getfd.c: Include "number_set.h".
	(SYS_FUNC(pidfd_getfd)): Rewrite using pidfd_get_pid.

	Fixes: v5.6~46 "Implement pidfd_getfd syscall decoding"

2020-05-30  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	util.c: add pidfd_get_pid.
	* defs.h (pidfd_get_pid): New function declaration.
	* utils.c (pidfd_get_pid): New function, returns the pid of a pidfd.
	(printpidfd): Rewrite using pidfd_get_pid.
	(printfd_pid): Change printpidfd arguments.

2020-05-30  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	Rename print_pid_fd to printfd_pid_tracee_ns.
	To avoid confusion with the new printfd_pid fucntion.

	defs.h (print_pid_fd): Rename to printfd_pid_tracee_ns.
	util.c: Likewise.  All users updated.

2020-05-30  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	util.c: add printfd_pid.
	defs.h (printfd_pid): New function definition.
	util.c (printfd_pid): New function printing the fd of an other process.
	(printfd): Rewritten using printfd_pid.

	pathtrace.c: add getfdpath_pid.
	* defs.h (getfdpath_pid): New function definition.
	* pathtrace.c (getfdpath_pid): New function, returns the path
	associated with fd of the process with pid.
	(getfdpath): Rewrite using getfdpath_pid.

2020-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: annotate btrfs_compress_types with #enum.
	* xlat/btrfs_compress_types.in: Add #enum, #include <stdio.h>,
	and #include <linux/btrfs.h>
	* configure.ac (AC_CHECK_DECL(BTRFS_COMPRESS_*)): Remove.

2020-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: annotate rtnl_ifla_xdp_attached_mode with #enum.
	And use proper checks in tests/nlattr_ifla_xdp.c.

	* xlat/rtnl_ifla_xdp_attached_mode.in: Add #enum, #include <netinet/in.h>,
	and #include <linux/rtnetlink.h> annotations.
	* tests/nlattr_ifla_xdp.c [!XDP_ATTACHED_NONE] (XDP_ATTACHED_NONE):
	Remove.
	[!XDP_ATTACHED_MULTI] (XDP_ATTACHED_MULTI): Remove.
	[!HAVE_DECL_XDP_ATTACHED_NONE] (XDP_ATTACHED_NONE): New enum definition.
	[!HAVE_DECL_XDP_ATTACHED_MULTI] (XDP_ATTACHED_MULTI): Likewise.

2020-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: support IFLA_XDP_EXPECTED_FD attribute decoding.
	Introduced by Linux commit v5.7-rc1~146^2~10^2~13^2~3.

	* xlat/rtnl_ifla_xdp_attrs.in: Add #enum, #include <netlink/in.h>,
	and #include <linux/rtnetlink.h> annotations.
	(IFLA_XDP_EXPECTED_FD): New constant.
	* rtnl_link.c (ifla_xdp_nla_decoders): Add [IFLA_XDP_EXPECTED_FD], set
	value to decode_nla_fd.
	* tests/nlattr_ifla_xdp-y.c: New file.
	* tests/.gitignore: Add nlattr_ifla_xdp-y.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	* tests/gen_tests.in: Add nlattr_ifla_xdp-y test.
	* tests/nlattr_ifla_xdp.c: Include "xlat/rtnl_ifla_xdp_attrs.h" under
	XLAT_MACROS_ONLY definition.
	(IFLA_XDP_FD, IFLA_XDP_ATTACHED, IFLA_XDP_PROG_ID, IFLA_XDP_DRV_PROG_ID,
	IFLA_XDP_SKB_PROG_ID, IFLA_XDP_HW_PROG_ID): Remove.
	[!FD9_PATH] (FD9_PATH): New macro, define to empty string.
	(main): Add checks for IFLA_XDP_EXPECTED_FD.

2020-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: support -y mode for sockfd printing.
	* tests/test_nlattr.h [!PRINT_SOCK] (PRINT_SOCK): New macro, define to 0.
	(print_sockfd): New function.
	(TEST_NLATTR_EX_): Call print_sockfd for sock fd printing.

	rtnl_tc_action: implement TCA_ACT_HW_STATS and TCA_ACT_USED_HW_STATS decoding
	* xlat/rtnl_tca_act_hw_stats.in: New file.
	* rtnl_tc_action.c: Include "xlat/rtnl_tca_act_hw_stats.h".
	(decode_tca_act_hw_stats): New function.
	(tcamsg_nla_decoders): Add [TCA_ACT_HW_STATS]
	and [TCA_ACT_USED_HW_STATS], set them to decode_tca_act_hw_stats.
	* tests/nlattr_tcamsg.c: Add checks, update expected output.
	* xlat/rtnl_tc_action_attrs.in (TCA_ACT_HW_STATS): New constant,
	introduced by Linux commit v5.7-rc1~146^2~230^2 and renamed in Linux
	commit v5.7-rc1~146^2~101.
	(TCA_ACT_USED_HW_STATS): New constant, introduced by Linux commit
	v5.7-rc1~146^2~25^2.

	xlat: annotate rtnl_tca_stab_attrs with #enum.
	* xlat/rtnl_tca_stab_attrs.in: Add #enum, #include <linux/types.h>,
	 #include <linux/pkt_sched.h>.
	* configure.ac (AC_CHECK_DECLS(TCA_STAB_DATA)): Remove.

	xlat: annotate rtnl_tca_stats_attrs with #enum.
	* xlat/rtnl_tca_stats_attrs.in: Add #enum, #include <linux/gen_stats.h>.
	* configure.ac (AC_CHECK_DECL(TCA_STATS_PKT64)): Remove.

	xlat: add #enum to v4l2 xlats.
	* xlat/v4l2_buf_types.in: Add #enum, #include <sys/time.h>, #include
	<linux/ioctl.h>, #include <linux/types.h>, and #include
	<linux/videodev2.h>.
	* xlat/v4l2_colorspaces.in: Likewise.
	* xlat/v4l2_control_types.in: Likewise.
	* xlat/v4l2_fields.in: Likewise.
	* xlat/v4l2_framesize_types.in: Likewise.
	* xlat/v4l2_memories.in: Likewise.
	* xlat/v4l2_tuner_types.in: Likewise.
	* configure.ac (AC_CHECK_DECL(V4L2_*)): Remove.

	xlat: annotate rtnl_link_attrs with #enum.
	* xlat/rtnl_link_attrs.in: Add #enum, #include <sys/socket.h>, #include
	<linux/rtnetlink.h>.
	* configure.ac (AC_CHECK_DECL(IFLA_*)): Remove.

	xlat: annotate rtnl_tc_action_attrs with #enum.
	* xlat/rtnl_tc_action_attrs.in: Add #enum, #include <linux/pkt_cls.h>
	* configure.ac (AC_CHECK_DECL(TCA_ACT_*)): Remove.

	xlat: annotate sysctl xlats with #enum.
	* configure.ac (AC_CHECK_DECL(CTL_* KERN_* NET_* VM_*)): Remove.
	* xlat/sysctl_kern.in: Add #enum, #include <sys/types.h>, #include
	<linux/sysctl.h> descriptors.
	* xlat/sysctl_net.in: Likewise.
	* xlat/sysctl_net_core.in: Likewise.
	* xlat/sysctl_net_ipv4.in: Likewise.
	* xlat/sysctl_net_ipv4_conf.in: Likewise.
	* xlat/sysctl_net_ipv4_route.in: Likewise.
	* xlat/sysctl_net_ipv6.in: Likewise.
	* xlat/sysctl_net_ipv6_route.in: Likewise.
	* xlat/sysctl_net_unix.in: Likewise.
	* xlat/sysctl_root.in: Likewise.
	* xlat/sysctl_vm.in: Likewise.

2020-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	configure: annotate waitid_types with #enum.
	This also syncs up the configure checks with the actual list of xlat
	values.

	* xlat/waitid_types.in: Add #enum, #include <sys/types.h>, and #include
	<sys/wait.h>.
	* configure.ac (AC_CHECK_DECL(P_*)): Remove.

	Complements: v5.4~82 "xlat: update waitid_types"

2020-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: mark loop_flags_options as #enum.
	* xlat/loop_flags_options.in: Add #enum and #include <linux/loop.h>
	descriptors.
	* configure.ac (AC_CHECK_DECLS(LO_FLAGS_*)): Remove.

	xlat: generate m4 checks for enumerations.
	* xlat/gen.sh (print_m4_record, gen_m4_entry): New functions.
	(print_xlat_pair): Accept macro name in the third argument.
	(print_xlat, print_xlat_pair): Call print_m4_record.
	(cond_xlat): Pass $m to print_xlat_pair call. Set first_enum to 0.
	(gen_header, gen_make, gen_git): Output the "generating ..." line
	to stderr.
	(gen_header): Get output_m4 as the fourth parameter, redirect fd 3
	to stdout, set enum to 1 if #enum is present and $output_m4 is set,
	append #include argument to includes, generate $output_m4 is $enum
	is set to 1, pass macro name to print_xlat_pair call, close fd 3.
	(gen_git): Add st_check_enums.m4 and "/*.m4".
	(main): Allow passing $output_m4 as the third argument, pass m4 file
	name as the fourth argument to gen_header calls, pipe gen_header output
	to gen_m4_entry in case of no-argument invocation, redirect gen_header
	output to /dev/null in case of single-file invocation.
	* Makefile.am (ACLOCAL_AMFLAGS): Add "-I xlat".
	* configure.ac: Add st_CHECK_ENUMS.

2020-05-30  Pierre Marsais  <pierre.marsais@lse.epita.fr>

	configure.ac: remove unused checks.
	Those unused configure.ac checks were found with the following commands:

	$ ./bootstrap
	$ ./configure
	$ grep '^#undef HAVE' config.h.in | cut -d' ' -f2 | sort >in_configure
	$ find -iname '*.[ch]' -exec ifnames \{\} + | grep ^HAVE | \
	  cut -d' ' -f1 | sort >in_source
	$ comm -23 in_configure in_source | grep -vE '^HAVE_(UNION|STRUCT)'

	* configure.ac (AC_CHECK_FUNCS): Remove utimensat, the last user was
	removed by commit 589cff6.  Remove strsignal, the last user was
	removed by commit 2c4fb90.
	(AC_CHECK_HEADERS): Remove sys/conf.h, the last user was removed by
	commit 811bda6.  Remove inttypes.h, the last user was removed by commit
	a6d91de.  Remove stropts.h, the last user was removed by commit a56a81c.
	(AC_CHECK_DECLS): remove P_PPID, P_PGID, P_SID, P_CID, P_UID, P_GID,
	P_ALL, and P_LWPID, the last user was removed by commit 7da9d19.

2020-05-29  Dmitry V. Levin  <ldv@altlinux.org>

	maint: remove ioctl duplicates generated from linux/dma-buf.h.
	Starting with commit v5.7-rc4~13^2~2^2~7, linux/dma-buf.h defines
	DMA_BUF_SET_NAME_A and DMA_BUF_SET_NAME_B constants, and
	DMA_BUF_SET_NAME equals to one of them.

	* maint/ioctls_sym.sh: Edit linux/dma-buf.h to omit DMA_BUF_SET_NAME.

2020-05-29  Dmitry V. Levin  <ldv@altlinux.org>

	maint: force time64 based definitions in linux/videodev2.h.
	Starting with commit v5.6-rc1~93^2~103, linux/videodev2.h provides either
	time32 or time64 based definitions depending on the flavour provided by
	libc headers.  While media/v4l2-ioctl.h already provides time32 based
	definitions, linux/videodev2.h has to be twisted to force time64 based
	definitions.

	* maint/ioctls_sym.sh: Edit linux/videodev2.h to force time64 based API.

2020-05-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: add 1<<_UFFDIO_WRITEPROTECT to uffd_register_ioctl_flags.
	* xlat/uffd_register_ioctl_flags.in (1<<_UFFDIO_WRITEPROTECT): New
	constant introduced by Linux kernel commit v5.7-rc1~58^2~113.

2020-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	Replace struct v4l2_event with a reliable alternative definition.
	Since the definition of struct v4l2_event provided by the kernel depends
	on the flavour of struct timespec provided by libc, we cannot use the
	definition provided by the kernel, neither in the decoder nor in tests.

	* kernel_v4l2_types.h: Include "kernel_timespec.h".
	(kernel_v4l2_event_t): New type.
	* linux/32/ioctls_inc_align16.h (VIDIOC_DQEVENT): Update.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* xlat/v4l2_ioctl_cmds.in (VIDIOC_DQEVENT): Redefine.
	* v4l2.c (kernel_v4l2_event_t): Mpersify.

2020-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	v4l2: move redefinitions of v4l2_buffer based constants to xlat.
	* kernel_v4l2_types.h: Include "types/v4l2.h".
	* v4l2.c (VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF,
	VIDIOC_PREPARE_BUF): Move redefinitions ...
	* xlat/v4l2_ioctl_cmds.in: ... here.
	* tests/ioctl_v4l2.c: Include "xlat/v4l2_ioctl_cmds.h"
	in XLAT_MACROS_ONLY mode.
	(VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF, VIDIOC_PREPARE_BUF): Remove.
	(main): Check for HAVE_STRUCT_V4L2_FRMSIZEENUM,
	HAVE_STRUCT_V4L2_FRMIVALENUM, and HAVE_STRUCT_V4L2_CREATE_BUFFERS
	instead of VIDIOC_ENUM_FRAMESIZES, VIDIOC_ENUM_FRAMEINTERVALS, and
	VIDIOC_CREATE_BUFS as the latter are always defined now.
	* tests/ioctl_v4l2-success.c: Likewise.

2020-05-27  Dmitry V. Levin  <ldv@altlinux.org>

	Update NEWS.

	tests: robustify strace-D.test against personality mismatch issues.
	* tests/print_ppid_tracerpid.c: New file.
	* tests/.gitignore: Add print_ppid_tracerpid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	* tests/strace-D.test: Use print_ppid_tracerpid instead of
	"sed -r -n '/^(P|Tracer)Pid:/p' /proc/self/status" to avoid
	unrelated issues caused by potential personality mismatch.

	tests: robustify pc.test against personality mismatch issues.
	* tests/pc.test: Pass --quiet=attach,personality option to strace
	to suppress some unrelated diagnostics that can confuse scripts
	that parse strace output.

2020-05-27  Dmitry V. Levin  <ldv@altlinux.org>

	ci: re-enable testing with the latest mainline kernel headers.
	There should be no issues with v5.7-rc7.
	This reverts commit dc6a196f3a83103e8ba21b6809246d37356ffd3d.

	* .github/workflows/ci.yml (env): Remove KBRANCH.
	* .gitlab-ci.yml (variables): Likewise.
	* .travis.yml (env:global): Likewise.

2020-05-27  Dmitry V. Levin  <ldv@altlinux.org>

	clone: implement decoding of cgroup field in struct clone_args.
	* configure.ac (AC_CHECK_MEMBERS): Check for struct clone_args.cgroup
	instead of struct clone_args.set_tid_size.
	* clone.c (struct strace_clone_args): Add cgroup field.
	(SYS_FUNC(clone3)): Decode cgroup field of struct clone_args introduced
	by Linux kernel commit v5.7-rc1~107^2~9.
	* NEWS: Mention this change.
	* tests/clone3.c: Check HAVE_STRUCT_CLONE_ARGS_CGROUP instead of
	HAVE_STRUCT_CLONE_ARGS_SET_TID_SIZE.
	(struct test_clone_args): Add cgroup field.
	(main): Check decoding of cgroup field.

	xlat: update CLONE_* constants.
	* xlat/clone3_flags.in (CLONE_INTO_CGROUP): New constant, introduced
	by Linux kernel commit v5.7-rc1~107^2~9.
	* NEWS: Mention this.
	* tests/clone3.c (main): Update the expected output.

	x32: workaround syscall(2) limitations in PTRACE_GET_SYSCALL_INFO check.
	* ptrace_syscall_info.c (test_ptrace_get_syscall_info)
	[SIZEOF_KERNEL_LONG_T > SIZEOF_LONG]: Cast elements of info.entry.args
	array to (unsigned long).
	* tests/ptrace_syscall_info.c (test_entry): Likewise.

2020-05-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: silence compilation warnings in pc.test.
	Silence the following compilation warnings produced by fresh gcc+glibc:

	In file included from pc.c:9:
	pc.c: In function 'main':
	pc.c:30:9: warning: argument 2 is null but the corresponding size argument 3 value is 16 [-Wnonnull]
	   30 |  assert(write(-1, NULL, 2 * sizeof(void *)) < 0);
	      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	In file included from pc.c:12:
	/usr/include/unistd.h:367:16: note: in a call to function 'write' declared with attribute 'read_only (2, 3)'
	  367 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
	      |                ^~~~~

	* tests/pc.c (main): Use 8UL instead of NULL as a marker.
	* tests/pc.test: Update expected output.

2020-05-26  Dmitry V. Levin  <ldv@altlinux.org>

	Replace struct v4l2_buffer with a reliable alternative definition.
	Starting with Linux kernel commit v5.6-rc1~93^2~102, the definition
	of struct v4l2_buffer provided by the kernel depends on the flavour
	of struct timeval provided by libc.  This effectively means that we
	cannot use the definition provided by the kernel, neither in the decoder
	nor in tests.

	* kernel_v4l2_types.h: New file.
	* Makefile.am (libstrace_a_SOURCES): Add it.
	* types/v4l2.h (struct_v4l2_buffer): Remove.
	* v4l2.c: Include "kernel_v4l2_types.h".
	Replace struct_v4l2_buffer with kernel_v4l2_buffer_t.
	(VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF, VIDIOC_PREPARE_BUF):
	Redefine.
	(print_v4l2_buffer): Use print_timeval64_data_size to print timestamp
	field.
	* linux/32/ioctls_inc_align16.h (VIDIOC_QUERYBUF, VIDIOC_QBUF,
	VIDIOC_DQBUF, VIDIOC_PREPARE_BUF): Update.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* xlat/v4l2_ioctl_cmds.in (VIDIOC_QUERYBUF, VIDIOC_QBUF,
	VIDIOC_DQBUF, VIDIOC_PREPARE_BUF): Comment out.
	* tests/ioctl_v4l2.c: Include "kernel_v4l2_types.h".
	(main): Replace struct_v4l2_buffer with kernel_v4l2_buffer_t.
	(VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF, VIDIOC_PREPARE_BUF):
	Redefine.
	* tests/ioctl_v4l2-success.c: Likewise.

	Resolves: https://github.com/strace/strace/issues/133

2020-05-26  Dmitry V. Levin  <ldv@altlinux.org>

	configure: move AM_PROG_AR after AC_USE_SYSTEM_EXTENSIONS.
	This fixes the following autoreconf warning:
	configure.ac:41: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS

	* configure.ac: Move AM_PROG_AR after AC_USE_SYSTEM_EXTENSIONS.

	Fixes: v5.6-65-g81e11a9b8 "configure: check AR variable for 'ar' tool"

2020-05-02  Mike Gilbert  <floppym@gentoo.org>

	configure: check AR variable for 'ar' tool.
	Without this, automake always hardcodes 'AR = ar' in Makefile.in

	Bug: https://bugs.gentoo.org/720712

2020-05-02  Dmitry V. Levin  <ldv@altlinux.org>

	configure.ac: do not check for perl.
	The last user of this check was removed by commit v4.7~160.

	* configure.ac (AC_PATH_PROG): Remove perl.

	Complements: v4.7~160 "Manual removal of non-Linux source, documentation, etc."

2020-04-27  Dmitry V. Levin  <ldv@altlinux.org>

	configure.ac: fix dladdr check.
	* configure.ac: Check for the library providing dladdr using
	AC_SEARCH_LIBS instead of AC_CHECK_LIB to handle the case when dladdr
	is a part of libc.

2020-04-24  Dmitry V. Levin  <ldv@altlinux.org>

	Rewrite decoders of dup, dup2, and dup3 syscalls.
	* dup.c: New file.
	* Makefile.am (libstrace_a_SOURCES): Add it.
	* desc.c (do_dup2, SYS_FUNC(dup), SYS_FUNC(dup2), SYS_FUNC(dup3)):
	Remove.

	tests: check decoding of dup3 syscall in -y, -yy, and -P modes.
	* tests/dup3.c: Rewrite.
	* tests/dup3-P.c: New file.
	* tests/dup3-y.c: Likewise.
	* tests/dup3-yy.c: Likewise.
	* tests/gen_tests.in (dup3): Add 7>>/dev/full.
	(dup3-P, dup3-y, dup3-yy): New entries.
	* tests/pure_executables.list: Add dup3-P, dup3-y, and dup3-yy.
	* tests/.gitignore: Likewise.

	tests: check decoding of dup2 syscall in -y, -yy, and -P modes.
	* tests/dup2.c: Rewrite.
	* tests/dup2-P.c: New file.
	* tests/dup2-y.c: Likewise.
	* tests/dup2-yy.c: Likewise.
	* tests/gen_tests.in (dup2): Add 9>>/dev/full.
	(dup2-P, dup2-y, dup2-yy): New entries.
	* tests/pure_executables.list: Add dup2-P, dup2-y, and dup2-yy.
	* tests/.gitignore: Likewise.

	tests: check decoding of dup syscall in -y, -yy, and -P modes.
	* tests/dup.c: Rewrite.
	* tests/dup-P.c: New file.
	* tests/dup-y.c: Likewise.
	* tests/dup-yy.c: Likewise.
	* tests/gen_tests.in (dup): Add 9>>/dev/full.
	(dup-P, dup-y, dup-yy): New entries.
	* tests/pure_executables.list: Add dup-P, dup-y, and dup-yy.
	* tests/.gitignore: Likewise.

2020-04-24  Niklas Cathor  <niklas.cathor@gmx.de>

	strace.1: fix description of "open" example.
	* strace.1.in (DESCRIPTION): In the example of "open" syscall with three
	arguments, the rest of the sentence talks about the `flag` and the
	`mode` arguments, not just about the `mode`.

	Resolves: https://gitlab.com/strace/strace/merge_requests/1

2020-04-24  Dmitry V. Levin  <ldv@altlinux.org>

	github: add gcc-10 jobs.
	* .github/workflows/ci.yml (gcc10-x86_64-kheaders, gcc10-x86_64-dw,
	gcc10-x86_64-unwind, gcc10-x32-kheaders, gcc10-x32-nostacktrace,
	gcc10-x86-kheaders, gcc10-x86-nostacktrace): New jobs.

2020-04-23  Maxim Akhmedov  <max42@yandex-team.ru>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Implement interval specification in syscall tampering expressions.
	Before this change, strace allows syscall tampering only for syscalls
	with 1) fixed invocation index or 2) all invocations starting from n-th
	(possibly with some step).

	These two options do not cover a useful scenario of testing
	retrying/backoffing policy of traced program, which may be done by
	introducing delays/errors on first n invocations, and then stopping
	tampering.

	This change adds possibility to invoke strace like the following:

	  strace -e inject=recvfrom:delay_exit=100000:when=3,100 ./bin

	which results in invocations from third to hundredth (inclusive) being
	tampered.  Formally, syntax now looks like `when=first[..last][+step]`.

	This change does not affect the existing behavior.

	* defs.h (INJECT_LAST_INF): New macro.
	(struct inject_opts): Add "last" field.
	* filter_qualify.c (parse_inject_token) <when>: Add interval support.
	(qualify_inject_common): Initialize struct inject_opts.last.
	* syscall.c (tamper_with_syscall_entering): Handle
	struct inject_opts.last.
	* strace.1.in (Tampering): Document the new feature.
	* strace.c (usage): Likewise.
	* NEWS: Mention this change.
	* tests/qual_fault-syntax.test: Check handling of invalid "when"
	intervals.
	* tests/qual_inject-syntax.test: Likewise.
	* tests/qual_fault.c (last): New variable.
	(main): Take "last" argument, handle it.
	* tests/qual_fault.test: Check handling of valid "when" intervals.

	Resolves: https://github.com/strace/strace/pull/136

2020-04-21  Dmitry V. Levin  <ldv@altlinux.org>

	pathtrace: fix matching of openat2 syscall.
	* pathtrace.c (pathtrace_match_set): Handle SEN_openat2.

	Fixes: v5.6~48 "open: implement openat2 syscall decoding"

2020-04-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add BTRFS_COMPRESS_ZSTD to btrfs_compress_types.
	* xlat/btrfs_compress_types.in (BTRFS_COMPRESS_ZSTD): New constant,
	introduced by Linux commit v4.14-rc1~22^2~1.
	* tests/btrfs.c (BTRFS_COMPRESS_TYPES): Change value to 3.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>

	tests/xetitimer: Use syscalls instead of libc functions.
	The new glibc implementation for y2038 safe arches (32-bit arch with
	64-bit time_t) will set the itimerval struct inside libc instead of
	inside the kernel. This is because the kernel expects a 32-bit version
	of timeval while libc exposes a 64-bit version. As libc sets this, when
	we pass a faulting pointer we will get a segfault instead of the kernel
	reporint EFAULT back.

	To avoid a seg fault let's use the kernel's equivalent of struct
	__kernel_old_itimerval in the tests and call the syscall directly
	instead of using libc. This way we can trigger the kernels EFAULT
	response correctly.


	* tests/xetitimer.c: Include "kernel_timeval.h"
	(kernel_old_itimerval_t): New type.
	(main): Use it instead of struct itimerval, replace getitimer with
	syscall(__NR_getitimer), replace setitimer with syscall(__NR_setitimer).

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	tests/semtimedop: Skip tests if semtimedop syscall is not available.
	New y2038 safe 32-bit architectures don't have the __NR_semtimedop
	syscall, so let's skip the test.


	* tests/semtimedop.c: Include "scno.h".
	[!(__NR_semtimedop || __NR_socketcall)]: Skip the test.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>

	tests/xettimeofday: Skip tests if __NR_gettimeofday syscall is not defined
	New y2038 safe 32-bit architectures don't have the
	__NR_gettimeofday/__NR_settimeofday syscalls, so let's skip the test.


	* tests/xettimeofday.c: Include "scno.h".
	[!__NR_gettimeofday]: Skip the test.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>

	tests/wait4: Skip tests if __NR_wait4 syscall is not defined.
	New y2038 safe 32-bit architectures don't have the __NR_wait4 syscall,
	so let's skip the test.


	* tests/wait4.c: Include "scno.h".
	[!__NR_wait4]: Skip the test.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>

	tests/msg_control: Use old time structures for old timestamps.
	The SO_TIMESTAMP_OLD returns a timeval that matches the struct
	kernel_old_timeval_t instead of the struct timeval. This is different
	on new 32-bit architectures (like RV32) where timeval uses 64-bit time_t
	while kernel_old_timeval_t uses 32-bit.

	To fix overflow errors let's use kernel_old_timeval_t instead of
	the libc struct timeval.


	Likewise, SO_TIMESTAMPNS_OLD and SO_TIMESTAMPING_OLD return
	kernel_old_timespec_t.

	* tests/msg_control.c: Include "kernel_timeval.h" and
	"kernel_old_timespec.h".
	(test_scm_timestamp_old): Replace struct timeval with
	kernel_old_timeval_t.
	(test_scm_timestampns_old, test_scm_timestamping_old): Replace
	struct timespec with kernel_old_timespec_t.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>

	tests/sockopt-timestamp: Use old time structures for old timestamps.
	The SO_TIMESTAMP_OLD returns a timeval that matches the struct
	kernel_old_timeval_t instead of the struct timeval. This is different
	on new 32-bit architectures (like RV32) where timeval uses 64-bit time_t
	while kernel_old_timeval_t uses 32-bit.

	To fix overflow errors let's use kernel_old_timeval_t instead of
	the libc struct timeval.


	Likewise, SO_TIMESTAMPNS_OLD returns kernel_old_timespec_t.

	* tests/sockopt-timestamp.c: Include "kernel_timeval.h" and
	"kernel_old_timespec.h".
	(print_timestamp_old): Replace struct timeval with kernel_old_timeval_t.
	(print_timestampns_old): Replace struct timespec with
	kernel_old_timespec_t.

2020-04-19  Dmitry V. Levin  <ldv@altlinux.org>

	Rework printing of SO_TIMESTAMPNS_OLD and SO_TIMESTAMPING_OLD timestamps
	On architectures with 32-bit kernel_long_t the kernel sends 32-bit
	timespecs in SO_TIMESTAMPNS_OLD and SO_TIMESTAMPING_OLD messages.
	Unfortunately, this applies to all 32-bit architectures including
	those (like RV32) that do not define __ARCH_WANT_TIME32_SYSCALLS.

	* print_timespec.c: Remove.
	* Makefile.am (libstrace_a_SOURCES): Remove it.
	* linux/arch_defs_.h (ARCH_TIMESIZE): Remove.
	(MIN_KLONGSIZE, HAVE_ARCH_TIMESPEC32): New macros.
	* linux/x32/arch_defs_.h (ARCH_TIMESIZE): Remove.
	* defs.h (print_timespec32_data_size, print_timespec32_array_data_size):
	Declare for [HAVE_ARCH_TIMESPEC32].
	* kernel_timespec.h (kernel_timespec32_t): Define for
	[HAVE_ARCH_TIMESPEC32].
	* print_timespec32.c (TIMESPEC_T, PRINT_TIMESPEC_DATA_SIZE,
	PRINT_TIMESPEC_ARRAY_DATA_SIZE): Define for [HAVE_ARCH_TIMESPEC32].
	* msghdr.c (PRINT_TIMESPEC_DATA_SIZE, PRINT_TIMESPEC_ARRAY_DATA_SIZE):
	Define.
	(print_scm_timestampns_old): Use PRINT_TIMESPEC_DATA_SIZE
	instead of print_struct_timespec_data_size.
	(print_scm_timestamping_old): Use PRINT_TIMESPEC_ARRAY_DATA_SIZE
	instead of print_struct_timespec_array_data_size.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>

	tests/waitid: Correctly use the long types from the rusage struct.
	The kernel's rusage struct uses the kernel's __kernel_old_timeval which
	means that even for 32-bit archs with 64-bit time_t (like RV32) the time
	values are 32-bit.

	We can fix this by making sure we don't use libc's rusage struct and
	instead use our own with the kernel's old timeval.


	* configure.ac (AC_CHECK_MEMBERS): Do not check for members of struct
	rusage.
	* tests/waitid.c: Include "kernel_rusage.h" instead of <sys/resource.h>.
	(RU_MAXRSS, RU_IXRSS, RU_IDRSS, RU_ISRSS, RU_MINFLT, RU_MAJFLT,
	RU_NSWAP, RU_INBLOCK, RU_OUBLOCK, RU_MSGSND, RU_MSGRCV, RU_NSIGNALS,
	RU_NVCSW, RU_NIVCSW): Remove.
	(sprint_rusage): Replace struct rusage with kernel_rusage_t.
	Use the respective ru_* field names instead of removed macros.
	(do_waitid, main): Replace struct rusage with kernel_rusage_t.

	This partially reverts commit v5.6~192.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	tests/getrusage: Correctly use the long types from the rusage struct.
	The kernel's rusage struct uses the kernel's __kernel_old_timeval which
	means that even for 32-bit archs with 64-bit time_t (like RV32) the time
	values are 32-bit.

	We can fix this by making sure we don't use libc's rusage struct and
	instead use our own with the kernel's old timeval.


	* tests/getrusage.c: Include "kernel_rusage.h".
	(invoke_print): Replace struct rusage with kernel_rusage_t,
	cast member values from kernel_long_t to unsigned long long
	using zero_extend_signed_to_ull, update format strings.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	kernel_rusage.h: introduce kernel_rusage_t.

	* printrusage.c: Include "kernel_rusage.h" instead of "kernel_timeval.h".
	(rusage_t): Rename to kernel_rusage_t, move the definition to ...
	* kernel_rusage.h: ... new file.
	* Makefile.am (libstrace_a_SOURCES): Add it.

2020-04-19  Alistair Francis  <alistair.francis@wdc.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	time: Protect the print_timezone() function.
	To avoid the following error:
	time.c:17:1: error: 'print_timezone' defined but not used [-Werror=unused-function]

	ensure that print_timezone is only defined if we are going to use it.


	* time.c (print_timezone): Place under
	[HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS] guard.

	Complements: v5.6~28 "linux/32: move wait4 and [gs]ettimeofday from syscallent.h to syscallent-time32.h"

2020-04-18  Kemeng Shi  <shikemeng@huawei.com>

	tests: correct error message in io_uring_register test.
	* tests/io_uring_register.c (main): If path_full failed to open,
	print its name instead of mistakenly used path_null.

2020-04-18  Paul Chaignon  <paul@cilium.io>

	bpf: support new commands BPF_LINK_{CREATE,UPDATE}
	* xlat/bpf_commands.in (BPF_LINK_CREATE): New constant introduced by Linux
	commit v5.7-rc1~146^2~10^2^2~3.
	(BPF_LINK_UPDATE): New constant introduced by Linux commit
	v5.7-rc1~146^2~10^2^2~2.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_LINK_CREATE),
	BEGIN_BPF_CMD_DECODER(BPF_LINK_UPDATE)): Decode the new commands.
	(SYS_FUNC(bpf)): Decode the new commands.
	* bpf_attr.h (BPF_LINK_CREATE_struct): New structure introduced by Linux
	commit v5.7-rc1~146^2~10^2^2~3.
	(BPF_LINK_UPDATE_struct): New structure introduced by Linux commit
	v5.7-rc1~146^2~10^2^2~2.
	(BPF_LINK_CREATE_struct_size, BPF_LINK_UPDATE_struct_size): New macros.
	* NEWS: Mention this.
	* tests/bpf.c (BPF_LINK_CREATE_checks, BPF_LINK_UPDATE_checks): Tests for
	the new commands.

2020-04-18  Dmitry V. Levin  <ldv@altlinux.org>

	types: do not generate TYPES_M4_FILES variable.
	* types/gen.sh (gen_makefile): Do not generate TYPES_M4_FILES variable,
	it isn't used anywhere.

2020-04-17  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	Add test for %clock trace class.
	* tests/Makefile.am (EXTRA_DIST): Add trace_clock.in.
	* tests/gen_tests.in (trace_clock): New entry.
	* tests/trace_clock.in: New file.

2020-04-17  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	Add %clock trace class.
	The %clock class includes the syscalls that read or modify system clock.

	linux/*/syscallent*.h part is updated automatically by:
	sed -i -r '
	    /"(.*adjtime.*|.*clock_([gs]et|adj).*|.*[gs]ettimeofday.*|time)"/ {
	        s/(\{[^,]*,\t[^0][^,]*)/\1|TCL/
	        s/(\{[^,]*,\s*)0/\1TCL/
	    }
	' linux/*/syscallent*.h

	* basic_filters.c (loopup_class): Add %clock member to syscall_class[].
	* linux/32/syscallent-time32.h: Add TCL flag to clock related syscalls.
	* linux/64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-compat.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* strace.1.in: Add %clock description.
	* strace.c (usage): Add %clock group to help message.
	* sysent.h (TRACE_CLOCK): New definition.
	* sysent_shorthand_defs.h (TC): Likewise.
	* sysent_shorthand_undefs.h (TC): Add undef.
	* NEWS: Mention this.

2020-04-17  Ákos Uzonyi  <uzonyi.akos@gmail.com>

	sysent_shorthand_undefs.h: add missing undefs.
	Add undefs that were missing from sysent_shorthand_undefs.h
	(mirroring defs in sysent_shorthand_defs.h).

	* sysent_shorthand_undefs.h (PU): Add undef.
	(TSD): Likewise.
	(TC): Likewise.

	Fixes: v4.21~29 "Add pure syscall flag"
	Fixes: v5.3~36 "Add seccomp filter syscall flag"
	Fixes: v5.5~100 "Implement %creds trace class"

2020-04-17  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use create_tmpfile.
	* tests/fchmod.c (main): Use create_tmpfile instead of open+unlink.
	* tests/preadv.c: Likewise.
	* tests/sendfile.c: Likewise.
	* tests/sendfile64.c: Likewise.
	* tests/fcntl-common.c (create_sample): Use create_tmpfile instead of
	mkstemp.

2020-04-17  Dmitry V. Levin  <ldv@altlinux.org>

	tests: introduce create_tmpfile function.
	There are few cases in tests where a file is created and immediately
	unlinked.  Add a function to perform this action in a more systematic
	way.

	* tests/tests.h (create_tmpfile): New prototype.
	* tests/create_tmpfile.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add create_tmpfile.c.

2020-04-16  Dmitry V. Levin  <ldv@altlinux.org>

	Extend memory caching of umove* functions.
	* ucopy.c (cached_raddr): Double the size.
	(get_next_unused_idx, lookup_cached_raddr_idx, set_cached_raddr_idx):
	New functions.
	(vm_read_mem): Use them.  When the data to be fetched resides in
	up to 4 adjacent memory pages, fetch these pages and cache them.
	* tests/umovestr_cached_adjacent.c: New file.
	* tests/pure_executables.list: Add umovestr_cached_adjacent.
	* tests/.gitignore: Likewise.
	* tests/umovestr_cached.test: Handle the first argument.
	* tests/gen_tests.in (umovestr_cached_adjacent): New test.

2020-04-15  Dmitry V. Levin  <ldv@altlinux.org>

	filter_seccomp: implement on systems without <linux/seccomp.h>
	Provide fallback definitions required to implement seccomp-assisted
	syscall filtering.

	* filter_seccomp.c [!HAVE_LINUX_SECCOMP_H]: Include
	"xlat/prctl_options.h", "xlat/seccomp_mode.h" and
	"xlat/seccomp_ret_action.h" in XLAT_MACROS_ONLY mode, remove #warning.
	[!HAVE_LINUX_SECCOMP_H] (struct seccomp_data): Define.
	[!HAVE_LINUX_SECCOMP_H] (check_seccomp_filter_properties,
	init_seccomp_filter, seccomp_filter_restart_operator): Remove stubs.

	Complements: v5.3~7 "Introduce seccomp-assisted syscall filtering"

2020-04-15  Dmitry V. Levin  <ldv@altlinux.org>

	x86_64: provide a fallback definition of __X32_SYSCALL_BIT.
	Make sure __X32_SYSCALL_BIT is defined on __x86_64__,
	move fallback definitions from various files to x86_64/arch_defs_.h.

	* linux/x86_64/arch_defs_.h [!__X32_SYSCALL_BIT] (__X32_SYSCALL_BIT):
	Define.
	* linux/x86_64/arch_get_personality.c [!__X32_SYSCALL_BIT]
	(__X32_SYSCALL_BIT): Remove.
	* linux/x86_64/get_scno.c: Likewise.
	* tests/filter_seccomp-flag.c [__x86_64__]: Likewise.

	Complements: v5.3~7 "Introduce seccomp-assisted syscall filtering"

2020-04-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add UFFDIO_COPY_MODE_WP to uffd_copy_flags.
	* xlat/uffd_copy_flags.in (UFFDIO_COPY_MODE_WP): New constant,
	introduced by Linux commit v5.7-rc1~58^2~121.
	(UFFDIO_COPY_MODE_DONTWAKE): Add fall-back value.
	* tests/ioctl_uffdio.c: Add a check for the new flag.

	xlat: update mremap_flags.
	* xlat/mremap_flags.in: Add fallback values.
	(MREMAP_DONTUNMAP): New constant, introduced by Linux commit
	v5.7-rc1~124^2~49.

	xlat: update lwtunnel_encap_types.
	* xlat/lwtunnel_encap_types.in (LWTUNNEL_ENCAP_SEG6_LOCAL): New
	constant, introduced by Linux commit v4.14-rc1~130^2~348^2~2.
	(LWTUNNEL_ENCAP_RPL): New constant, introduced by Linux commit
	v5.7-rc1~146^2~38^2.

	xlat: add XDP_FLAGS_REPLACE to xdp_flags.
	* xlat/xdp_flags.in: Add leading zeroes to fallback values.
	(XDP_FLAGS_REPLACE): New constant, introduced by Linux commit
	v5.7-rc1~146^2~10^2~13^2~3.

	xlat: add FAN_DIR_MODIFY to fan_event_flags.
	* xlat/fan_event_flags.in (FAN_DIR_MODIFY): New constant, introduced
	by Linux commit v5.7-rc1~72^2~5.
	* tests/fanotify_mark.c: Update expected output.

	xlat: update v4l2_pix_fmts.
	* xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_SBGGR14, V4L2_PIX_FMT_SGBRG14,
	V4L2_PIX_FMT_SGRBG14, V4L2_PIX_FMT_SRGGB14): New constants, introduced
	by Linux commit v5.7-rc1~193^2~35.
	(V4L2_PIX_FMT_Y14): New constant, introduced by Linux commit
	v5.7-rc1~193^2~34.

	xlat: update uring_ops.
	* xlat/uring_ops.in (IORING_OP_SPLICE): New constant, introduced
	by Linux commit v5.7-rc1~201^2~46.
	(IORING_OP_PROVIDE_BUFFERS): New constant, introduced by Linux commit
	v5.7-rc1~201^2~23.
	(IORING_OP_REMOVE_BUFFERS): New constant, introduced by Linux commit
	v5.7-rc1~201^2~18.
	* tests/io_uring_register.c: Update expected output.

	xlat: add SECCOMP_FILTER_FLAG_TSYNC_ESRCH to seccomp_filter_flags.
	* xlat/seccomp_filter_flags.in: Use (1<<BIT) syntax.
	(SECCOMP_FILTER_FLAG_TSYNC_ESRCH): New constant, introduced by Linux
	commit v5.7-rc1~198^2~1.
	* tests/seccomp-filter.c: Update expected output.
	* tests/seccomp-filter-v.c: Likewise.

	xlat: add IORING_FEAT_FAST_POLL to uring_setup_features.
	* xlat/uring_setup_features.in (IORING_FEAT_FAST_POLL): New constant,
	introduced by Linux commit v5.7-rc1~201^2~36.

	xlat: add V4L2_CID_USER_ATMEL_ISC_BASE to v4l2_control_id_bases.
	* xlat/v4l2_control_id_bases.in (V4L2_CID_USER_ATMEL_ISC_BASE): New
	constant, introdued by Linux commit v5.7-rc1~193^2~219.

	xlat: add KVM_CAP_S390_PROTECTED and KVM_CAP_PPC_SECURE_GUEST to kvm_cap
	* xlat/kvm_cap.in (KVM_CAP_S390_PROTECTED): New constant, introduced
	by Linux commit v5.7-rc1~121^2~15^2~4.
	(KVM_CAP_PPC_SECURE_GUEST): New constant, introduced by Linux commit
	v5.7-rc1~121^2~12^2.

	xlat: add PERF_SAMPLE_BRANCH_HW_INDEX to perf_branch_sample_type.
	* xlat/perf_branch_sample_type.in (PERF_SAMPLE_BRANCH_HW_INDEX): New
	constant, introduced by Linux commit v5.7-rc1~180^2~23.
	* tests/perf_event_open.c: Update expected output.

2020-04-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: allow passing arguments to netlink_sock_diag.test.
	And remove netlink_sock_diag-v.sh, since it is no longer needed.

	* tests/netlink_sock_diag.test: Pass script's arguments to
	run_strace_match_diff call.
	* tests/gen_tests.in (nlattr_packet_diag_msg): Call
	netlink_sock_diag.test with -v instead of netlink_sock_diag-v.sh..
	* tests/netlink_sock_diag-v.sh: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove netlink_sock_diag-v.sh.

2020-04-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: use the FLAG macro instead of a locally defined one in clone3 test
	* tests/clone3.c (_): Remove.
	(enum validity_flags): Use FLAG() instead of _().

2020-04-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	clone: add more elaborate comments for struct strace_clone_args field.
	Try to capture field semantics and type.

	* clone.c (struct strace_clone_args): Add/extend comments for the
	fields.

2020-04-14  Fabrice Fontaine  <fontaine.fabrice@gmail.com>

	ptrace_syscall_info.c: fix build without fork.
	Build without fork fails on:

	ptrace_syscall_info.c:33:27: error: 'expected_entry_size' defined but not used [-Werror=unused-const-variable=]
	 static const unsigned int expected_entry_size =
	                           ^~~~~~~~~~~~~~~~~~~
	ptrace_syscall_info.c:31:27: error: 'expected_none_size' defined but not used [-Werror=unused-const-variable=]
	 static const unsigned int expected_none_size =
	                           ^~~~~~~~~~~~~~~~~~
	ptrace_syscall_info.c:24:1: error: 'kill_tracee' defined but not used [-Werror=unused-function]
	 kill_tracee(pid_t pid)
	 ^~~~~~~~~~~

	Fixes:
	 - http://autobuild.buildroot.org/results/ffc81d3798379a9c34c7a708ebbdea27409f755d


	* ptrace_syscall_info.c (kill_tracee, expected_none_size,
	expected_entry_size): Move definitions under [HAVE_FORK] guard.

	Resolves: https://github.com/strace/strace/pull/135

2020-04-13  Paul Chaignon  <paul@cilium.io>

	bpf: update BPF_* constants.
	* xlat/bpf_attach_types.in (BPF_MODIFY_RETURN): New constant introduced by
	Linux kernel commit v5.7-rc1~146^2~174^2~45^2~4.
	(BPF_LSM_MAC): New constant introduced by Linux kernel commit
	v5.7-rc1~146^2~10^2~9^2~7.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_LSM): New constant introduced by
	Linux kernel commit v5.7-rc1~146^2~10^2~9^2~7.
	* NEWS: Mention this.
	* tests/bpf.c (BPF_PROG_LOAD_checks, BPF_PROG_QUERY_checks): Update checks
	and their expected output.
	* tests/kernel_version.c (print_bpf_attr, main): Likewise.

2020-04-12  Dmitry V. Levin  <ldv@altlinux.org>

	Makefile.am: move almost all of strace_SOURCES to libstrace_a_SOURCES.
	There is no need to track files that are used conditionally.

	* Makefile.am (strace_SOURCES): Move all except strace.c ...
	(libstrace_a_SOURCES): ... here.

2020-04-12  Dmitry V. Levin  <ldv@altlinux.org>

	Rewrite decoders of getdents, getdents64, and readdir syscalls.
	The old approach of allocating memory for all dentries returned by
	getdents/getdents64 was problematic, fix it by fetching and printing
	dentries sequentially.

	* dirent_types.c: New file.
	* xgetdents.c: Likewise.
	* xgetdents.h: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* dirent.c: Include "xgetdents.h" and "print_fields.h".
	(header_size): New variable.
	(print_dentry_head, decode_dentry_head, decode_dentry_tail): New
	functions.
	(print_old_dirent): Rewrite using print_dentry_head.
	(SYS_FUNC(getdents)): Rewrite using xgetdents, decode_dentry_head,
	and decode_dentry_tail.
	* dirent64.c: Include "xgetdents.h", "kernel_dirent.h"
	and "print_fields.h" instead of "defs.h", <dirent.h>
	and "xlat/dirent_types.h".
	(decode_dentry_head, decode_dentry_tail): New functions.
	(SYS_FUNC(getdents64)): Rewrite using xgetdents, decode_dentry_head,
	and decode_dentry_tail.

	Resolves: https://github.com/strace/strace/issues/19
	Resolves: https://github.com/strace/strace/pull/20

2020-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	Guard against invalid return values of getdents/getdents64 syscalls.
	The kernel is not expected to return more bytes than requested.
	If this ever happens, treat it as an error.

	* dirent.c (SYS_FUNC(getdents)): Treat the return value greater than
	the third argument of syscall as an error.
	* dirent64.c (SYS_FUNC(getdents64)): Likewise.

2020-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	Print the second argument of getdents/getdents64 syscalls in abbrev mode
	* dirent.c (SYS_FUNC(getdents)) [!abbrev(tcp)]: Print u_arg[1] along
	with the number of entries.
	* dirent64.c (SYS_FUNC(getdents64)) [!abbrev(tcp)]: Likewise.
	* tests/xgetdents.c (ls): Update expected output.

	tests: check abbreviated decoding of getdents and getdents64 syscalls.
	* tests/getdents-v.c: New file.
	* tests/getdents64-v.c: Likewise.
	* tests/pure_executables.list: Add getdents-v and getdents64-v.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (getdents-v, getdents64-v): New entries.
	(getdents, getdents64): Update.
	* tests/getdents.c (print_dirent): Define only if [VERBOSE].
	* tests/getdents64.c (print_dirent): Likewise.
	* tests/xgetdents.c (str_d_type): Likewise.
	(ls): Handle [!VERBOSE] case.
	(main) [VERBOSE]: Add "-v" to dname.

	tests: refactor getdents and getdents64 tests.
	* tests/xgetdents.c: New file.
	* tests/Makefile.am (EXTRA_DIST): Add xgetdents.c.
	* tests/getdents.c: Rewrite using xgetdents.c.
	* tests/getdents64.c: Likewise.

2020-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	Move kernel_dirent64 definition to kernel_dirent.h.
	... and rename kernel_dirent64 type to kernel_dirent64_t

	* tests/getdents64.c: Include "kernel_dirent.h", rename kernel_dirent64
	to kernel_dirent64_t.
	(kernel_dirent64_t): Move ...
	* kernel_dirent.h: ... here.

2020-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	Move kernel_dirent definition from kernel_types.h to a separate header.
	... and rename kernel_dirent type to kernel_dirent_t

	* kernel_types.h (kernel_dirent): Rename to kernel_dirent_t, move ...
	* kernel_dirent.h: ... to new file.
	* Makefile.am (strace_SOURCES): Add it.
	* dirent.c: Include "kernel_dirent.h", rename kernel_dirent
	to kernel_dirent_t.
	* tests/getdents.c: Likewise.

2020-04-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	strace: fix -E/--env options affecting strace environment.
	The current approach with putenv() during parsing has a problem:
	it changes strace's own environment which may affect its behaviour
	in an unacceptable way.

	As a solution, let's apply an approach similar to path tracing option
	parsing: collect the provided optarg's in an array, then construct
	a new environment and pass it to startup_child().

	* strace.c (struct exec_params): Add env field.
	(exec_or_die): Call execve() instead of execv(); pass params->env
	as the third argument.
	(startup_child): Add env parameter, set params_for_tracee.env to it.
	(remove_from_env, add_to_env, update_env, make_env): New functions.
	(init): Add env_changes, env_change_size, env_change_count local
	variables; store optarg in env_changes array on -E option occurrence;
	construct new environment using make_env and pass it to startup_child
	in the second argument.
	* tests/strace-E-override.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add strace-E-override.test.

2020-04-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	xmalloc: add xallocarray.
	Add a wrapper around malloc with calloc interface.

	* xmalloc.h (xallocarray): New function declaration.
	* xmalloc.c (xallocarray): New function.

2020-04-09  Eugene Syromiatnikov  <esyr@redhat.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	strace: move pathtrace_select calls to a later initialisation stage.
	Since path name resolution is specific to the tracing backend
	(especially when tracees are remote), let's first collect the list
	of paths to trace in a temporary array and add it later during the
	initialisation.

	* strace.c (init): Add pathtrace_paths temporary array, with its
	element count stored in pathtrace_count and size in pathtrace_size.
	(init) <case 'P'>: Store argument in pathtrace_paths, grow it if needed.
	(init): Iterate over pathtrace_paths and call pathtrace_select for each
	element.  Free the array.
	* tests/options-syntax.test: Check that path name resolution happens
	but not too early.

2020-04-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	tests: check -E/--env unset behaviour.
	* tests/strace-E-unset.test: Likewise.
	* tests/strace-E-unset.expected: New file.
	* tests/Makefile.am (MISC_TESTS): Add strace-E-unset.test.
	(EXTRA_DIST): Add strace-E-unset.expected.

2020-04-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	tests: add support for negative match patterns to match_grep.
	For the cases when we want that some patterns do not appear in the
	output.

	* tests/init.sh (match_grep): Add rc and negated local variables; set
	negated to 1 if pattern starts with "!", otherwise to 0; fail if negated
	pattern has been matched.

2020-04-09  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 5.6-1.
	* strace.spec.in: Likewise.

2020-04-07  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 5.6 release.
	* NEWS: Update for 5.6 release.

	.mailmap: add more entries to avoid duplication in CREDITS.

2020-04-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: cleanup temporary files left by read-write test executable.
	This test executable is invoked by 19 tests, leaving about 100M
	of data in temporary files.

	In each of these tests read-write is invoked twice: the first time by
	run_prog and the second time by run_strace.  Since the temporary file
	created during the first invocation is used by strace during the second
	invocation, this file can only be cleaned up at the end of the second
	invocation.

	* tests/read-write.c (main): If the temporary file was not created,
	unlink it before the exit.

2020-04-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite redirect.test without a busy loop.
	* tests/redirect.test: Invoke $SLEEP_A_BIT while waiting
	for synchronization with the tracer.

2020-04-06  Dmitry V. Levin  <ldv@altlinux.org>

	README.md: add github CI status badge.

2020-04-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: make -yy equivalent to --decode-fds=all.
	With inclusion of device file and, later, pidfd decoding into -yy
	semantics, it is clear that one cannot rely on stability of set
	of file descriptor decoding features enabled by -yy.  State that
	formally by aliasing -yy to --decode-fds=all.  Those who want only
	specific FD decoding capabilities being enabled know that they need
	it and can resort to --decode-fds=SET syntax.

	* strace.1.in (.SS Output formatting): Change -yy alias
	to --decode-fds=all, update the -yy option description.
	* strace.c (usage): Likewise; expand --decode-fds description.
	(init): Change yyflag_qual value to "all".

2020-04-06  Dmitry V. Levin  <ldv@altlinux.org>

	travis: remove build jobs covered by github actions.
	* .travis.yml: Remove all bionic build jobs on x86_64, x86, and x32 except
	the first one which is probably the fasted and is kept for reference.
	Remove all gcc-8 and gcc-9 jobs since the corresponding repositories
	are broken.

2020-04-06  Dmitry V. Levin  <ldv@altlinux.org>

	github: add CI action.
	Somewhat similar to Travis CI, this runs "make distcheck" on Ubuntu
	18.04 using gcc-9, gcc-7, clang-9, and clang-6 on x86_64, x86, and x32
	architectures.

	Compared with Travis CI, GitHub Actions service currently provides
	a significantly better parallelism as well as (unsurprisingly)
	better integration with github.

	However, GitHub Actions cannot replace Travis CI completely as
	the latter can build on aarch64, s390x, and ppc64le architectures.

	* .github/workflows/source-code-check.yml: Remove.
	* .github/workflows/ci.yml: New file.

2020-04-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix poll-P.test.
	All invocations of poll-P executable must have a properly created
	descriptor 9.

	* tests/poll-P.test: Fix run_prog invocations.

	Fixes: v4.21~122 "tests: check path tracing of poll syscall"

2020-04-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: remove poll-P and ppoll-P from pure_executables.list.
	Since these executables have to be invoked in a special way,
	it was not correct to include them into pure_executables.list.

	* tests/pure_executables.list: Move poll-P and ppoll-P ...
	* tests/Makefile.am (check_PROGRAMS): ... here.

	Fixes: v4.21~122 "tests: check path tracing of poll syscall"
	Fixes: v4.21~121 "tests: check path tracing of ppoll syscall"

2020-04-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: workaround clang compilation warning.
	Silence the following incorrect compilation warning produced by clang:

	tests/io_uring_register.c:271:10: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
	                        probe->ops[i].flags & (typeof(probe->ops[i].flags)) ~1,
	                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

	* tests/io_uring_register.c (main): Cast the whole
	struct io_uring_probe_op.flags based expression
	to the type of the first operand.

	Complements: v5.5-183-g8b6487f9a "tests: fix clang compilation warning"

2020-04-05  Dmitry V. Levin  <ldv@altlinux.org>

	travis: update coverage configuration.
	* .travis.yml [$CHECK == coverage]: Change dist from trusty to bionic,
	change the compiler from gcc to gcc-9, change STACKTRACE from libunwind
	to libdw.
	* ci/run-build-and-tests.sh [$CHECK == coverage] (GCOV): New variable,
	pass its value to ./codecov.bash.

2020-04-05  Dmitry V. Levin  <ldv@altlinux.org>

	ci: workaround unusable codecov-python.
	As codecov-python, starting with commit
	v2.0.15-44-g9f50cca7e5c5e0bb5e2859db238da08e3195e105 released almost
	a month ago, became an utterly unusable pile of garbage, switch to
	codecov-bash that still works.

	* ci/install-dependencies.sh [$CHECK == coverage]: Do not install
	lcov, python-pip, python-setuptools, and codecov.  Download
	https://codecov.io/bash and save it as codecov.bash.
	* ci/run-build-and-tests.sh [$CHECK == coverage] (ac_cv_prog_LCOV,
	ac_cv_prog_GENHTML): New variables, export them.
	[[$CHECK == coverage]: Invoke codecov.bash instead of codecov.

2020-04-05  Dmitry V. Levin  <ldv@altlinux.org>

	ci: use twice as many cpus for tests.
	Since many tests sleep a lot, running more of them in parallel
	increases overall performance.

	* ci/run-build-and-tests.sh (j2): New variable.
	Use it instead of $j for "make check" and "make distcheck".

2020-04-05  Dmitry V. Levin  <ldv@altlinux.org>

	ci: use -Og instead of -O0 for coverage builds.
	Also, do not apply this debugging optimization level to tests.

	* ci/run-build-and-tests.sh [$CHECK == coverage] (CFLAGS,
	CFLAGS_FOR_BUILD): Remove.
	[$CHECK == coverage]: Specify CFLAGS='-g -Og' to "make all".

2020-04-05  Dmitry V. Levin  <ldv@altlinux.org>

	travis: switch from clang 7 to clang-9.
	* .travis.yml (matrix): Switch all clang 7 builds to clang-9.

2020-04-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	NEWS: mention libdw symbol-to-address cache introduction.
	Complements: v5.5-178-g2101456 "unwind-libdw: add caching"

2020-04-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix clang compilation warning.
	Silence the following compilation warning produced by clang:

	tests/io_uring_register.c:271:10: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
	                        probe->ops[i].flags & ~1,
	                        ^~~~~~~~~~~~~~~~~~~~~~~~

	* tests/io_uring_register.c (main): Cast the second operand
	of struct io_uring_probe_op.flags based expression to the type
	of the first operand.

2020-04-05  Paul Chaignon  <paul.chaignon@gmail.com>

	bpf: support new commands BPF_MAP_*_BATCH.
	* xlat/bpf_commands.in (BPF_MAP_LOOKUP_BATCH): New constant introduced
	by Linux commit v5.6-rc1~151^2~46^2~23^2~7.
	(BPF_MAP_LOOKUP_AND_DELETE_BATCH): New constant introduced by Linux
	commit v5.6-rc1~151^2~46^2~23^2~4.
	(BPF_MAP_UPDATE_BATCH, BPF_MAP_DELETE_BATCH): New constants introduced
	by Linux commit v5.6-rc1~151^2~46^2~23^2~6.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_BATCH),
	BEGIN_BPF_CMD_DECODER(BPF_MAP_UPDATE_BATCH),
	BEGIN_BPF_CMD_DECODER(BPF_MAP_DELETE_BATCH)): Decode the new commands.
	(decode_BPF_MAP_LOOKUP_AND_DELETE_BATCH): New macro.
	(SYS_FUNC(bpf)): Decode the new commands.
	* bpf_attr.h (BPF_MAP_LOOKUP_BATCH_struct,
	BPF_MAP_LOOKUP_AND_DELETE_BATCH_struct, BPF_MAP_UPDATE_BATCH_struct,
	BPF_MAP_DELETE_BATCH_struct): New structs introduced by Linux commit
	v5.6-rc1~151^2~46^2~23^2~7.
	(BPF_MAP_LOOKUP_BATCH_struct_size,
	BPF_MAP_LOOKUP_AND_DELETE_BATCH_struct_size,
	BPF_MAP_UPDATE_BATCH_struct_size, BPF_MAP_DELETE_BATCH_struct_size): New
	macros.
	* NEWS: Mention this.
	* tests/bpf.c (BPF_MAP_LOOKUP_BATCH_checks, BPF_MAP_UPDATE_BATCH_checks,
	BPF_MAP_DELETE_BATCH_checks): Tests for the new commands.

2020-04-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Print PIDs associated with pidfds.
	* number_set.h (decode_fd_bits): Add DECODE_FD_PIDFD to enum.
	* filter_qualify.c (decode_fd_str_to_uint) <decode_fd_strs>: Add pidfd
	argument name and value.
	* util.c (printpidfd): New function.
	(printfd): Call printpidfd if DECODE_FD_PIDFD is set.
	* strace.c (init) <yyflag_qual>: Add pidfd.
	(usage): Document pidfd option argument.
	* strace.1.in (.SS Output format): Likewise.
	* tests/pidfd_getfd-yy.c: New file.
	* tests/pidfd_open--decode-fd-pidfd.c: Likewise.
	* tests/pidfd_open--decode-fd-socket.c: Likewise.
	* tests/pidfd_open-yy.c: Likewise.
	* tests/.gitignore: Add pidfd_getfd-yy, pidfd_open--decode-fd-pidfd,
	pidfd_open--decode-fd-socket, and pidfd_open-yy.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in: Add pidfd_getfd-yy, pidfd_open--decode-fd-pidfd,
	pidfd_open--decode-fd-socket, and pidfd_open-yy tests.
	* tests/pidfd_getfd.c [!PRINT_PIDFD] (PRINT_PIDFD): New macro, define
	to 0.
	(main) [PRINT_PIDFD]: New variable pidfd_str, print expected pidfd
	string to it.
	(main) [!PRINT_PIDFD]: New variable pidfd_str, set it to PIDFD_PATH.
	(main): Print pidfd_str instead of PIDFD_PATH.
	* tests/pidfd_open.c (main) [PRINT_PIDFD]: Print pidfd using "<pid:%d>"
	format.
	* NEWS: Mention the change.

2020-04-03  Dmitry V. Levin  <ldv@altlinux.org>

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2020-04-03  Dmitry V. Levin  <ldv@altlinux.org>

	Fix preprocessor indentation.
	Indent the C preprocessor directives to reflect their nesting
	using the following script:

	$ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do
		cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
	done

2020-04-03  Jann Horn  <jannh@google.com>

	unwind-libdw: add caching.
	libdw's address-to-symbol logic is quite slow. Since when stracing a
	process, it is normal to see the same call sites over and over again,
	let's address that by adding a straightforward N-way associative cache
	in front of libdw.

	The cache parameters could probably use some fine-tuning,
	but ought to be good enough for now.

	The resulting performance improvement:

	$ time ./strace-orig -o /dev/null -k bash -c 'for i in {0..10000}; do echo; done' >/dev/null

	real	0m12,014s
	user	0m11,512s
	sys	0m0,575s
	$ time ./strace-cache -o /dev/null -k bash -c 'for i in {0..10000}; do echo; done' >/dev/null

	real	0m0,765s
	user	0m0,451s
	sys	0m0,371s

	Reviewed-By: Masatake YAMATO <yamato@redhat.com>

	* unwind-libdw.c: Include "static_assert.h".
	(STRACE_UW_CACHE_SIZE, STRACE_UW_CACHE_ASSOC): New macros.
	(struct cache_entry): New type.
	(struct ctx): Add "cache" field, extend the type of "last_proc_updating"
	field.
	(mapping_generation): Extend the type, initialize to 1.
	(uwcache_clock): New variable.
	(tcb_init): Initialize struct ctx.cache.
	(truct frame_user_data): Add "ctx" field.
	(find_bucket): New function.
	(frame_callback): Use it.
	(tcb_walk): Initialize user_data.ctx.

2020-04-02  Dmitry V. Levin  <ldv@altlinux.org>

	sparc, sparc64: wire up former vserver syscall.
	... because Linux kernel arch/sparc/kernel/syscalls/syscall.tbl
	still lists it.

	* linux/sparc/syscallent.h [267]: Add vserver entry.
	* linux/sparc64/syscallent.h [267]: Add vserver entry.

2020-04-02  Dmitry V. Levin  <ldv@altlinux.org>

	hppa: wire up kexec_file_load syscall.
	... introduced on hppa by Linux kernel commit v5.4-rc1~188^2~3.

	* linux/hppa/syscallent.h [355]: Add kexec_file_load entry.
	* NEWS: Mention this.

2020-04-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	hdio: implement HDIO_DRIVE_CMD ioctl command decoding.
	* xlat/hdio_drive_cmds.in: New file.
	* hdio.c: Include "xlat/hdio_drive_cmds.h".
	(print_hdio_drive_cmd): New function.
	(hdio_ioctl): Call print_hdio_drive_cmd if code is HDIO_DRIVE_CMD.
	* tests/ioctl_hdio.c (main) <unsupp_cmds>: Remove HDIO_DRIVE_CMD.
	(main): Add HDIO_DRIVE_CMD checks.

	Closes: https://github.com/strace/strace/issues/83

2020-04-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	hdio: factor out the HDIO_GETGEO handler into a separate function.
	And update it up to the current coding style.

	* hdio.c: Include "print_fields.h".
	(print_hdio_getgeo): New function.
	(hdio_ioctl) <case HDIO_GETGEO>: Call print_hdio_getgeo instead
	of decoding in place.

2020-04-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of HDIO_* ioctls.
	* tests/.gitignore: Add ioctl_hdio, ioctl_hdio-success,
	ioctl_hdio-success-Xabbrev, ioctl_hdio-success-Xraw,
	ioctl_hdio-success-Xverbose, ioctl_hdio-success-v,
	ioctl_hdio-success-v-Xabbrev, ioctl_hdio-success-v-Xraw,
	ioctl_hdio-success-v-Xverbose, ioctl_hdio-Xabbrev,
	ioctl_hdio-Xraw, ioctl_hdio-Xverbose, ioctl_hdio-v,
	ioctl_hdio-v-Xabbrev, ioctl_hdio-v-Xraw, and ioctl_hdio-v-Xverbose.
	* tests/Makefile.am (check_PROGRAMS): Add ioctl_hdio-success,
	ioctl_hdio-success-Xabbrev, ioctl_hdio-success-Xraw,
	ioctl_hdio-success-Xverbose, ioctl_hdio-success-v,
	ioctl_hdio-success-v-Xabbrev, ioctl_hdio-success-v-Xraw,
	and ioctl_hdio-success-v-Xverbose.
	* tests/gen_tests.in (ioctl_hdio, ioctl_hdio-Xabbrev, ioctl_hdio-Xraw,
	ioctl_hdio-Xverbose, ioctl_hdio-v, ioctl_hdio-v-Xabbrev,
	ioctl_hdio-v-Xraw, ioctl_hdio-v-Xverbose, ioctl_hdio-success,
	ioctl_hdio-success-Xabbrev, ioctl_hdio-success-Xraw,
	ioctl_hdio-success-Xverbose, ioctl_hdio-success-v,
	ioctl_hdio-success-v-Xabbrev, ioctl_hdio-success-v-Xraw,
	ioctl_hdio-success-v-Xverbose): New tests.
	* tests/ioctl_hdio.c: New file.
	* tests/ioctl_hdio-Xabbrev.c: Likewise.
	* tests/ioctl_hdio-Xraw.c: Likewise.
	* tests/ioctl_hdio-Xverbose.c: Likewise.
	* tests/ioctl_hdio-success.c: Likewise.
	* tests/ioctl_hdio-success-Xabbrev.c: Likewise.
	* tests/ioctl_hdio-success-Xraw.c: Likewise.
	* tests/ioctl_hdio-success-Xverbose.c: Likewise.
	* tests/ioctl_hdio-success-v.c: Likewise.
	* tests/ioctl_hdio-success-v-Xabbrev.c: Likewise.
	* tests/ioctl_hdio-success-v-Xraw.c: Likewise.
	* tests/ioctl_hdio-success-v-Xverbose.c: Likewise.
	* tests/ioctl_hdio-v.c: Likewise.
	* tests/ioctl_hdio-v-Xabbrev.c: Likewise.
	* tests/ioctl_hdio-v-Xraw.c: Likewise.
	* tests/ioctl_hdio-v-Xverbose.c: Likewise.
	* tests/pure_executables.list: Add ioctl_hdio, ioctl_hdio-Xabbrev,
	ioctl_hdio-Xraw, ioctl_hdio-Xverbose, ioctl_hdio-v,
	ioctl_hdio-v-Xabbrev, ioctl_hdio-v-Xraw, and ioctl_hdio-v-Xverbose.

2020-04-02  Dmitry V. Levin  <ldv@altlinux.org>

	linux/32: move wait4 and [gs]ettimeofday from syscallent.h to syscallent-time32.h
	According to Linux kernel include/uapi/asm-generic/unistd.h, starting
	with commit v5.1-rc1~160^2~1^2~3 __NR_wait4, __NR_gettimeofday, and
	__NR_settimeofday are placed under __ARCH_WANT_TIME32_SYSCALLS and
	therefore should belong to syscallent-time32.h along with other 32-bit
	time_t based syscalls.

	* linux/32/syscallent.h [169, 170, 260]: Move entries ...
	* linux/32/syscallent-time32.h: ... here.
	* time.c (SYS_FUNC(gettimeofday), SYS_FUNC(settimeofday)): Place under
	[HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS] guard.
	* wait.c (SYS_FUNC(wait4)): Likewise.

	Complements: v5.5-39-gcc7e89011 "linux/32: Split 32-bit time_t based syscalls into a separate header"

2020-04-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix another race condition in strace-DD.test.
	Apparently, timeout(1) utility first sends its signal to the child
	process, then installs a signal handler, and finally sends its signal to
	the process group.  This creates a race between timeout(1) and strace,
	the latter can manage to handle tracee syscall exit trap before a signal
	to the process group is delivered.

	* tests/setpgrp-exec.c: New file.
	* tests/strace-DD.test: Rewrite without use of timeout(1).
	* tests/strace-DD.expected: Remove.
	* tests/Makefile.am (check_PROGRAMS): Add setpgrp-exec.
	(EXTRA_DIST): Remove strace-DD.expected.

	Fixes: v5.4~106 "tests: check -DD and -DDD options"

2020-04-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a workaround for trace_creds test on mips o32.
	Since every mips o32 executable used by trace_creds test invokes
	prctl(PR_GET_FP_MODE) on their own and these calls are not filtered out
	by %creds, they have to be filtered out manually before comparison.

	* tests/init.sh (test_pure_prog_set) [$STRACE_ARCH == mips &&
	$MIPS_ABI == o32 && $NAME == *creds]: Filter out prctl(PR_GET_FP_MODE)
	from the strace log before comparison.

2020-04-01  Dmitry V. Levin  <ldv@altlinux.org>

	Lift experimental status from --seccomp-bpf feature.
	* strace.1.in (.SH OPTIONS) <--seccomp-bpf>: Remove " (experimental)".

	strace.1: enhance --seccomp-bpf description.
	* strace.1.in (.SH OPTIONS) <--seccomp-bpf>: Reword for clarity.

2020-04-01  Dmitry V. Levin  <ldv@altlinux.org>

	strace.1: fix --seccomp-bpf description.
	* strace.1.in (.SH OPTIONS) <--seccomp-bpf>: Remove the claim that this
	option implies -f, document that --seccomp-bpf has no effect unless
	-f/--follow-forks is also specified.

	Complements: v5.5-38-g2a7ba2a97 "strace: disable seccomp-bpf instead of enabling following forks"

2020-04-01  Dmitry V. Levin  <ldv@altlinux.org>

	ci: use kernel headers from Linux kernel v5.6.
	When Linux kernel merge window opens, changes of all sorts start to pour
	down, breaking UAPI in various ways.  This does not work for strace,
	we need a stable UAPI.

	* .gitlab-ci.yml (variables): Add KBRANCH.
	* .travis.yml (env:global): Likewise.

2020-03-31  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix get*id-creds tests on mips.
	Apparently, mips executables may invoke prctl(PR_GET_FP_MODE) on their
	own.  Since these calls are not filtered out by %creds, they have to be
	dealt with before comparison.

	* tests/getuid.test [$STRACE_ARCH == mips]: Filter out
	prctl(PR_GET_FP_MODE) from the log of %creds tests.

2020-03-31  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v5.6.
	* linux/32/ioctls_inc_align16.h: Update from linux v5.6
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/s390/ioctls_arch0.h: Likewise.
	* linux/s390x/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

	maint: update for linux v5.6.
	* maint/ioctls_sym.sh: Add workarounds for media/v4l2-ioctl.h and
	sound/pcm.h headers.

2020-03-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.

2020-03-31  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix race condition in strace-D.test.
	* tests/strace-D.test (test_parent_tracer_pid): Wait for the tracer
	completion before checking its log.

	Fixes: v5.4~110 "tests: check -D option"

2020-03-31  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix race condition in strace-DDD.test.
	* tests/tracer_ppid_pgid_sid.c (main): Print tracer pid.
	* tests/strace-DDD.test: Check tracer pid, wait for the tracer
	completion before checking its log.

	Reported-by: Eugene Syromyatnikov <evgsyr@gmail.com>
	Fixes: v5.4~106 "tests: check -DD and -DDD options"

2020-03-31  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix race condition in strace-DD.test.
	Apparently, $SLEEP_A_BIT might be insufficient for the tracer
	to complete.

	* tests/strace-DD.test: Find out the tracer pid and wait for the tracer
	completion before checking its log.

	Suggested-by: Eugene Syromyatnikov <evgsyr@gmail.com>
	Fixes: v5.4~106 "tests: check -DD and -DDD options"

2020-03-31  Dmitry V. Levin  <ldv@altlinux.org>

	tests: split getxxid test.
	getxxid used to test alpha-specific getxgid, getxuid, and getxgid
	syscalls.  Now each of these syscalls has its own test.
	This hopefully fixes trace_creds test on alpha.

	* tests/getxxid.c: Split into getxpid.c, getxuid.c, and getxgid.c.
	* tests/gen_tests.in (getxxid): Remove.
	(getxgid, getxpid, getxuid): New tests.
	* tests/pure_executables.list: Replace getxxid with getxgid, getxpid,
	and getxuid.
	* tests/.gitignore: Likewise.

2020-03-30  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: rename getpagesize syscall entry to old_getpagesize.
	... to match the Linux kernel that introduced __NR_old_getpagesize
	by commit v5.0-rc1~164^2~4.

	* linux/ia64/syscallent.h [BASE_NR + 147]: Rename "getpagesize"
	to "old_getpagesize".

2020-03-30  Dmitry V. Levin  <ldv@altlinux.org>

	tests: disable umovestr_cached.test on mips o32 unless PTRACE_GET_SYSCALL_INFO works
	If PTRACE_GET_SYSCALL_INFO does not work, then the test has to be
	skipped on mips o32 because only the first four syscall arguments are
	obtained from registers on that architecture, remaining syscall
	arguments have to be fetched from the tracee memory.

	* tests/umovestr_cached.test [$STRACE_ARCH == mips && $MIPS_ABI == o32]:
	Skip the test if PTRACE_GET_SYSCALL_INFO does not work.

2020-03-30  Dmitry V. Levin  <ldv@altlinux.org>

	tests: re-enable umovestr_cached.test on ia64 if PTRACE_GET_SYSCALL_INFO works
	If PTRACE_GET_SYSCALL_INFO works, then the exception made for ia64
	earlier is not relevant.

	* tests/umovestr_cached.test [$STRACE_ARCH == ia64]: Do not skip
	the test if PTRACE_GET_SYSCALL_INFO works.

	Complements: v5.3~23 "tests: disable umovestr_cached.test on ia64"

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement pidfd_getfd syscall decoding.
	Introduced by Linux commit v5.6-rc1~122^2~4 and wired up in Linux commit
	v5.6-rc1~122^2~3.

	* pidfd_getfd.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/syscallent-common.h ([BASE_NR + 438]): Wire up pidfd_getfd.
	* tests/pidfd_getfd.c: New file.
	* tests/pidfd_getfd-y.c: Likewise.
	* tests/.gitignore: Add pidfd_getfd and pidfd_getfd-y.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in: Add pidfd_getfd and pidfd_getfd-y tests.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Move printpidfd from kcmp.c to util.c.
	And rename it to print_pid_fd in an attempt to minimise confusion with
	the kernel's pidfd concept.

	* kcmp (PRINT_FIELD_PIDFD, SYS_FUNC(kcmp)): Change printpidfd calls to
	print_pid_fd.
	(printpidfd): Move it...
	* util.c (print_pid_fd): ...here. Drop the static qualifier, update
	the comment describing why this is a stub.
	* defs.h (print_pid_fd): New declaration.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	open: implement openat2 syscall decoding.
	Introduced by Linux commit v5.6-rc1~133^2~2.

	* configure.ac (AC_CHECK_HEADERS): Check for linux/openat2.h.
	* defs.h (print_numeric_umode_t_64): New declaration.
	* linux/syscallent-common.h ([BASE_NR + 437]): Wire up openat2.
	* types/openat2.h: New file.
	* open.c: Include "print_fields.h", "types/openat2.h",
	and "xlat/open_resolve_flags.h".
	(sprint_open_modes64): Rename from sprint_open_modes, change argument
	type to uint64_t.
	(sprint_open_modes): New function, a wrapper for sprint_open_modes64
	with argument type of unsigned int.
	(tprint_open_modes64): Rename from tprint_open_modes, change argument
	type to uint64_t, call sprint_open_modes64 instead of sprint_open_modes.
	(tprint_open_modes): New function, a wrapper for tprint_open_modes64
	with an argument of type unsigned int.
	(print_open_how): New function.
	(SYS_FUNC(openat2)): New decoder.
	* printmode.c (print_numeric_umode_t_64): New function.
	* tests/openat2.c: New file.
	* tests/openat2-Xabbrev.c: Likewise.
	* tests/openat2-Xraw.c: Likewise.
	* tests/openat2-Xverbose.c: Likewise.
	* tests/openat2-v.c: Likewise.
	* tests/openat2-v-y.c: Likewise.
	* tests/openat2-v-y-Xabbrev.c: Likewise.
	* tests/openat2-v-y-Xraw.c: Likewise.
	* tests/openat2-v-y-Xverbose.c: Likewise.
	* tests/openat2-y.c: Likewise.
	* tests/.gitignore: Add openat2, openat2-Xabbrev, openat2-Xraw,
	openat2-Xverbose, openat2-v, openat2-v-y, openat2-v-y-Xabbrev,
	openat2-v-y-Xraw, openat2-v-y-Xverbose, openat2-y.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in: Add openat2, openat2-Xabbrev, openat2-Xraw,
	openat2-Xverbose, openat2-v, openat2-v-y, openat2-v-y-Xabbrev,
	openat2-v-y-Xraw, openat2-v-y-Xverbose, openat2-y tests.
	* xlat/open_resolve_flags.in: New file.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Move print_nonzero_bytes from clone.c to util.c.
	As it is to be used elsewhere.

	* clone.c (print_nonzero_bytes): Move it...
	* util.c (print_nonzero_bytes): ...here.  Remove static qualifier.
	* defs.h (print_nonzero_bytes): New declaration.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	travis: remove ppc64le builds.
	They are currently unusable, permanently failing with
	"Disk quota exceeded" error diagnostics.

	* .travis.yml (arch: ppc64le): Remove.

2020-03-30  Dmitry V. Levin  <ldv@altlinux.org>

	xtensa: switch to PTRACE_GETREGS API.
	Implement PTRACE_GETREGS API introduced on xtensa by Linux kernel commit
	v2.6.13-rc1~68^2~366.

	* configure.ac [xtensa]: Remove arch_enable_Werror=no.
	* linux/xtensa/get_syscall_result.c: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* linux/xtensa/arch_regs.c (xtensa_regs): New variable.
	(ARCH_REGS_FOR_GETREGS, ARCH_PC_REG, ARCH_SP_REG): New macros.
	(xtensa_a2, ARCH_PC_PEEK_ADDR, ARCH_SP_PEEK_ADDR): Remove.
	* linux/xtensa/get_error.c (arch_get_error): Use xtensa_regs.a[2].
	* linux/xtensa/get_syscall_args.c (arch_get_syscall_args): Use
	xtensa_regs.a.
	* linux/xtensa/set_error.c (arch_set_error, arch_set_success): Use
	xtensa_regs.a[2].
	* NEWS: Mention this change.

2020-03-30  Dmitry V. Levin  <ldv@altlinux.org>

	sh64: switch to PTRACE_GETREGS API.
	Implement PTRACE_GETREGS API introduced on sh64 by Linux kernel commit
	v2.6.28-rc1~99^2~56.

	* configure.ac [sh64]: Remove arch_enable_Werror=no.
	* linux/sh64/arch_regs.h: Remove.
	* linux/sh64/get_syscall_result.c: Likewise.
	* Makefile.am (EXTRA_DIST): Remove them.
	* linux/sh64/arch_regs.c (sh64_regs): New variable.
	(ARCH_REGS_FOR_GETREGS, ARCH_PC_REG, ARCH_SP_REG): New macros.
	(sh64_r9, ARCH_PC_PEEK_ADDR, ARCH_SP_PEEK_ADDR): Remove.
	* linux/sh64/get_error.c (arch_get_error): Use sh64_regs.regs[9].
	* linux/sh64/get_scno.c (arch_get_scno): Use sh64_regs.regs[9].
	* linux/sh64/get_syscall_args.c (arch_get_syscall_args): Use sh64_regs.regs.
	* linux/sh64/set_error.c (arch_set_error, arch_set_success): Use
	sh64_regs.gr[9].
	* linux/sh64/set_scno.c (arch_set_scno): Use sh64_regs.regs[9].
	* NEWS: Mention this change.

2020-03-30  Dmitry V. Levin  <ldv@altlinux.org>

	sh: switch to PTRACE_GETREGS API.
	Implement PTRACE_GETREGS API introduced on sh by Linux kernel commit
	v2.6.28-rc1~99^2~56.

	* configure.ac [sh]: Remove arch_enable_Werror=no.
	* linux/sh/get_syscall_result.c: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* linux/sh/arch_regs.c (sh_regs): New variable.
	(ARCH_REGS_FOR_GETREGS, ARCH_PC_REG, ARCH_SP_REG): New macros.
	(sh_r0, ARCH_PC_PEEK_ADDR, ARCH_SP_PEEK_ADDR): Remove.
	* linux/sh/arch_getrval2.c (getrval2): Use sh_regs.regs[1].
	* linux/sh/get_error.c (arch_get_error): Use sh_regs.regs[0].
	* linux/sh/get_scno.c (arch_get_scno): Use sh_regs.regs[3].
	* linux/sh/get_syscall_args.c (arch_get_syscall_args): Use sh_regs.regs.
	* linux/sh/set_error.c (arch_set_error, arch_set_success): Use
	sh_regs.gr[0].
	* linux/sh/set_scno.c (arch_set_scno): Use sh_regs.regs[3].
	* NEWS: Mention this change.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: use PRINT_FIELD_* macros, add abbreviating in print_v4l2_queryctrl
	* v4l2.c (print_v4l2_queryctrl): Use PRINT_FIELD_XVAL for the type field
	printing; use PRINT_FIELD_D for minimum, maximum, step, and
	default_value fields printing; use PRINT_FIELD_FLAGS for the flags field
	printing; print minimum, maximum, step, default_value, and flags fields
	only if abbrev(tcp) is not set.
	* tests/ioctl_v4l2-success.c: Update expected output.

	Suggested-by: Philippe De Muyter <phdm@macqel.be>
	References: https://github.com/strace/strace/issues/63

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: simplify print_v4l2_queryctrl and use print_v4l2_cid.
	Instead of fragile hacks aroung V4L2_CTRL_FLAG_NEXT_CTRL flag, (always)
	save the id field on entering, restore it later on exiting, and print it
	second time only if it has changed.  That also simplifies the flow
	with clear entering/exiting code parts separation.

	The usage of print_v4l2_cid for id field printing has introduced several
	(anticipated) output formatting changes, hence the changes in expected
	output.

	* v4l2.c (print_v4l2_queryctrl): Save c.id on entering, print it using
	print_v4l2_cid with next_flags set to true, and return 0; remove
	"entering(tcp) || get_tcb_priv_ulong(tcp)" logic; restore the entering
	id value  into entry_id variable on exiting, compare it to the exiting
	c.id value and print c.id again if it is different; do not check if tcp
	is exiting; always return RVAL_IOCTL_DECODED at the end of the function.
	* tests/ioctl_v4l2.c: Update expected output.
	* tests/ioctl_v4l2-success.c: Likewise.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: add support for V4L2_CTRL_FLAG_NEXT_* flags printing to print_v4l2_cid
	* v4l2.c: Move "xlat/v4l2_control_query_flags.h" inclusion before
	print_v4l2_cid.
	(print_v4l2_cid): Remove const qualifier from cid, add bool next_flags
	argument; print v4l2_control_query_flags and NAND them from cid if they
	are present.
	(print_v4l2_control): Pass false as next_flags to the print_v4l2_cid
	call.

	References: https://github.com/strace/strace/issues/63

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add generation of flags-related fields.
	Generate known flags mask and maximum string length.

	* xlat.h (struct xlat): Add fields flags_strsz and flags_mask.
	* xlat/gen.sh (print_xlat, print_xlat_pair): Add generation of
	XLAT_VAL_n and XLAT_STR_n macros.
	(gen_header): Generate flags_strsz and flags_mask fields' values using
	the generated XLAT_VAL_n and XLAT_STR_n macros, undefine them
	afterwards.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: handle -Xraw in print_v4l2_cid.
	Print class ID as simple hex value in that case.

	* v4l2.c (print_v4l2_cid): Print cid as hex and return if
	xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: use xsprintf instead of asprintf in print_v4l2_cid.
	Avoid an allocation and steamline code a bit.

	* v4l2.c (print_v4l2_cid): Change tmp_str to a stack-allocated char array,
	print to it with xsprintf, eliminate no longer needed free() call.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: provide V4L2_CTRL_FLAG_NEXT_CTRL in an xlat.
	* xlat/v4l2_control_query_flags.in: New file.
	* v4l2.c: Include "xlat/v4l2_control_query_flags.h".
	(print_v4l2_queryctrl): Remove "ifdef V4L2_CTRL_FLAG_NEXT_CTRL" guard.
	* tests/ioctl_v4l2.c [!V4L2_CTRL_FLAG_NEXT_CTRL]
	(V4L2_CTRL_FLAG_NEXT_CTRL): New macro.
	(main) [!V4L2_CTRL_FLAG_NEXT_CTRL]: Remove.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: decode frame intervals/sizes unconditionally.
	* configure.ac (AC_CHECK_TYPES): Check for struct v4l2_frmsizeenum
	and struct v4l2_frmivalenum.
	* types/v4l2.h (struct_v4l2_frmsize_discrete, struct_v4l2_frmsize_stepwise,
	struct_v4l2_frmsizeenum, struct_v4l2_frmival_stepwise,
	struct_v4l2_frmivalenum): New type definitions.
	v4l2.c: Remove "ifdef VIDIOC_ENUM_FRAMESIZES" guards.
	* xlat/v4l2_ioctl_cmds.in (VIDIOC_ENUM_FRAMESIZES,
	VIDIOC_ENUM_FRAMEINTERVALS): Uncomment.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: always decode VIDIOC_*_EXT_CTRLS ioctl commands.
	* types/v4l2.h (struct_v4l2_area, struct_v4l2_ext_control,
	struct_v4l2_ext_controls): New type definitions.
	* v4l2.c (print_v4l2_ext_control, print_v4l2_ext_controls): Do not guard
	with VIDIOC_S_EXT_CTRLS anymore.
	(v4l2_ioctl) <case VIDIOC_S_EXT_CTRLS, case VIDIOC_TRY_EXT_CTRLS, case
	VIDIOC_G_EXT_CTRLS>: Likewise.
	(print_v4l2_ext_control): Do not guard size and string field printing
	with HAVE_STRUCT_V4L2_EXT_CONTROL_STRING.
	* xlat/v4l2_ioctl_cmds.in (VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
	VIDIOC_TRY_EXT_CTRLS): Uncomment.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: bundle struct v4l2_format and related types.
	* configure.ac (AC_CHECK_TYPES): Check for struct v4l2_meta_format,
	struct v4l2_pix_format_mplane, struct v4l2_plane_pix_format,
	and struct v4l2_sdr_format.
	* types/v4l2.h (struct_v4l2_clip, struct_v4l2_format): Typedef to an anonymous
	type definition.
	(struct_v4l2_pix_format, struct_v4l2_plane_pix_format,
	struct_v4l2_pix_format_mplane, struct_v4l2_window,
	struct_v4l2_vbi_format, struct_v4l2_sliced_vbi_format,
	struct_v4l2_sliced_vbi_cap, struct_v4l2_sdr_format,
	struct_v4l2_meta_format): New typedefs.
	* v4l2.c (print_v4l2_format_fmt): Remove guard macros, decode
	fmt.win.global_alpha and fmt.sdr.buffersize only when they are non-zero.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: provide struct v4l2_capability definition.
	* types/v4l2.h (struct_v4l2_capability): New typedef.
	* v4l2.c: Check struct v4l2_capability
	with CHECK_V4L2_STRUCT_RESERVED_SIZE.
	(print_v4l2_capability): Change type of caps variable
	to struct_v4l2_capability; drop HAVE_STRUCT_V4L2_CAPABILITY_DEVICE_CAPS
	guard; print device_caps field only if it's non-zero.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: bundle struct v4l2_create_buffers definition.
	* configure.ac (AC_CHECK_TYPES): Add a check for
	struct v4l2_create_buffers definition.
	* types/v4l2.h: New file.
	* v4l2.c (DEF_MPERS_TYPE(struct_v4l2_create_buffers)): Remove
	VIDIOC_CREATE_BUFS guard.
	(struct_v4l2_create_buffers): Remove typedef.
	(struct_v4l2_buffer, struct_v4l2_clip, struct_v4l2_ext_control,
	struct_v4l2_ext_controls, struct_v4l2_format, struct_v4l2_framebuffer,
	struct_v4l2_input, struct_v4l2_standard): Move to types/v4l2.h.
	[HAVE_STRUCT_V4L2_CREATE_BUFFERS]: Check struct v4l2_create_buffers
	with CHECK_V4L2_STRUCT_RESERVED_SIZE.
	* xlat/v4l2_ioctl_cmds.in (VIDIOC_CREATE_BUFS): Uncomment.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: add V4L2 ioctl command constant macros.
	For now, only those that we support, and only for those we don't
	conditionalise in code, since the fall-back definitions require
	the relevant type definitions, and not all of them are always
	available.

	* xlat/v4l2_ioctl_cmds.in: New file.
	* v4l2.c: Include "xlat/v4l2_ioctl_cmds.h" under XLAT_MACRO_ONLY
	definition.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: add shorthand macros for v4l2 type checks.
	Some wrappers for common static_assert checks.

	* v4l2.c (CHECK_V4L2_STRUCT_SIZE, CHECK_V4L2_RESERVED_SIZE.
	CHECK_V4L2_STRUCT_RESERVED_SIZE): New macros.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: improve buffer flag decoding.
	* xlat/v4l2_buf_flags.in: Add fallback values.
	* xlat/v4l2_buf_flags_masks.in: New file.
	* xlat/v4l2_buf_flags_ts_src.in: Likewise.
	* xlat/v4l2_buf_flags_ts_type.in: Likewise.
	* v4l2.c: Include xlat/v4l2_buf_flags_ts_type.h,
	xlat/v4l2_buf_flags_ts_src.h, xlat/v4l2_buf_flags_masks.h.
	(print_v4l2_buffer_flags): New function.
	(print_v4l2_buffer): Call print_v4l2_buffer_flags for printing flags field.
	* tests/ioctl_v4l2-success.c: Update expected output.

	References: https://github.com/strace/strace/issues/63

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: use standard kernel version printing routine.
	The way kernel version is printed in print_v4l2_capability was
	non-standard, didn't respect xlat styles, and was incorrect for major
	values 256 and greater.  Moreover, there is a routine that exists
	specifically for this purpose now.  Let's use it and solve all
	the aforementioned issues.

	* v4l2.c (print_v4l2_capability): Use print_kernel_version for the
	kernel version printing.
	* tests/ioctl_v4l2-success.c: Update the expected output.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add v4l2 ioctl success injection-based tests.
	* tests/ioctl_v4l2-success.c: New file.
	* tests/ioctl_v4l2-success-Xabbrev.c: Likewise.
	* tests/ioctl_v4l2-success-Xraw.c: Likewise.
	* tests/ioctl_v4l2-success-Xverbose.c: Likewise.
	* tests/ioctl_v4l2-success-v.c: Likewise.
	* tests/ioctl_v4l2-success-v-Xabbrev.c: Likewise.
	* tests/ioctl_v4l2-success-v-Xraw.c: Likewise.
	* tests/ioctl_v4l2-success-v-Xverbose.c: Likewise.
	* tests/.gitignore: Add ioctl_v4l2-success,
	ioctl_v4l2-success-Xabbrev, ioctl_v4l2-success-Xraw,
	ioctl_v4l2-success-Xverbose, ioctl_v4l2-success-v,
	ioctl_v4l2-success-v-Xabbrev, ioctl_v4l2-success-v-Xraw,
	ioctl_v4l2-success-v-Xverbose.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	* tests/gen_tests.in: Add ioctl_v4l2-success,
	ioctl_v4l2-success-Xabbrev, ioctl_v4l2-success-Xraw,
	ioctl_v4l2-success-Xverbose, ioctl_v4l2-success-v,
	ioctl_v4l2-success-v-Xabbrev, ioctl_v4l2-success-v-Xraw tests,
	* tests/tests.h (struct strval32): New type, similar to struct strval64.

	tests: use ioctl-success.sh for ioctl_perf-success test.
	* tests/ioctl_perf-success.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove it.
	* tests/gen_tests.in: Add ioctl_perf-success test.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: always check ioctl_perf-success.
	It makes little sense to conditionalise this test, since it bundles
	all the required definitions and types in case of absense of them
	in the kernel headers.

	* tests/ioctl_perf-success.c: Remove HAVE_LINUX_PERF_EVENT_H guard,
	update directives' indentation.
	(include <linux/perf_event.h>): Put under HAVE_LINUX_PERF_EVENT_H guard.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add a runner for ioctl decoder tests that use success injection.
	* tests/ioctl-success.sh: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.

	v4l2: print capability and rxsubchans fields of struct v4l2_tuner as flags
	* v4l2.c (print_v4l2_tuner): Use printflags instead of printxval
	for printing capability and rxsubchans fields of struct v4l2_tuner.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: comment unknown tuner types with "V4L2_TUNER_???" and not "V4L2_TUNER_TYPE_???"
	All the xlat constants include only "V4L2_TUNER_" part.

	* v4l2.c (print_v4l2_tuner) <printxval(v4l2_tuner_types, ...)>: Change
	the last argument from V4L2_TUNER_TYPE_???" to "V4L2_TUNER_???"

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: do not print struct v4l2_control.value field name second time on exiting
	To conform the output formatting in other places.

	* v4l2.c (print_v4l2_control): Do not print "value=" on exiting to
	prefix the changed value.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: print exiting structure fields as a separate structure.
	To conform with the output formatting in other places.

	* v4l2.c (print_v4l2_format, print_v4l2_streamparm): Close the structure
	with "}" before the arrow and open it again with "{".

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: print struct v4l2_standard.framelines as unsigned.
	Since it is defined that way.

	* v4l2.c (print_v4l2_standard): Print framelines as unsigned.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: print struct v4l2_outputparm.outputmode using v4l2_capture_modes flags
	As it is treated the same way as struct v4l2_captureparm.capturemode.

	* v4l2.c (print_v4l2_streamparm): Print struct
	v4l2_outputparm.outputmode using v4l2_capture_modes flags.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: print struct v4l2_{capture,output}parm.extendedmode as hex.
	As it is likely to be treated similarly to capturemode/outputmode, which
	are bit sets.

	* v4l2.c (print_v4l2_streamparm): Print extendedmode field as hex.
	* tests/ioctl_v4l2.c: Update expected output.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/fill_memory: add 16-bit-wide and 32-bit-wide memory-filling routines
	* tests/tests.h (fill_memory16_ex, fill_memory16, fill_memory32_ex,
	fill_memory32): New declarations.
	* tests/fill_memory.c (fill_memory16_ex, fill_memory16,
	fill_memory32_ex, fill_memory32): New functions.

	tests: move struct strval64 definition to tests.h.
	* tests/fanotify_mark.c (struct strval64): Move it...
	* tests/tests.h: ...here. Include <stdint.h>.

	v4l2: remove spaces around "=" in struct v4l2_buffer.timestamp output.
	* v4l2.c (print_v4l2_buffer): Remove spaces around equality sign
	in ", timestamp = ".

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: print struct v4l2_vbi_format.flags as flags.
	Since V4L2_VBI_UNSYNC and V4L2_VBI_INTERLACED are treated as independent
	bits in code.

	* v4l2.c (print_v4l2_format_fmt): Use printflags instead of printxval
	for f->fmt.vbi.flags printing.

	Fixes: v4.17~103 "v4l2: Implement decoding of the remaining V4L2_BUF_TYPE_* types"

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: print struct v4l2_vbi_format.start elements as signed integers.
	Since they are defined in videodev2.h that way.

	* v4l2.c (dprint_ioctl_v4l2): Print struct v4l2_vbi_format.start
	elements using %d and not %u.
	* tests/ioctl_v4l2.c (print_v4l2_format_fmt): Likewise.

	Fixes: v4.17~103 "v4l2: Implement decoding of the remaining V4L2_BUF_TYPE_* types"

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/ioctl_v4l2: add checks for decoding unknown/unsupported commands.
	* tests/ioctl_v4l2.c: Include <stdint.h>.
	(main): Add checks for decoding of unknown and unsupported ioctl
	commands that have 'V' command type.

2020-03-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ioctl: re-define broken _IOC_SIZE on sparc.
	_IOC_SIZE macro definition on sparc breaks the invariant

	     _IOC_SIZE(_IOC(dir, type, nr, size)) == size

	for _IOC_DIR(val) that contains neither _IOC_READ nor _IOC_WRITE,
	so it is unsuitable for strace's purposes. Re-define it in a way
	that preserves the aforementioned invariant.

	* ioctl.c [SPARC || SPARC64] (_IOC_SIZE): Re-define.

2020-03-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: short-circuit handling of unknown buffer types.
	We do not need to call print_v4l2_format_fmt on exiting to get empty
	output again.

	* v4l2.c (print_v4l2_format_fmt): Add a default branch that returns
	false.

2020-03-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/ioctl_v4l2: increase coverage a bit.
	Try to hit some previously missed branches.

	* tests/ioctl_v4l2.c (init_v4l2_format): Set num_planes to 1 if buffer
	type is V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; set clipcount to 3 if
	buffer type is V4L2_BUF_TYPE_VIDEO_OVERLAY.
	(dprint_ioctl_v4l2): Update expected output.

2020-03-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add KEY_SELECTIVE_SCREENSHOT to evdev_keycode.
	* xlat/evdev_keycode.in (KEY_SELECTIVE_SCREENSHOT): New constant,
	introduced by Linux commit v5.5-rc5-51-g3b059da9835c and updated
	in Linux commit v5.5-rc5-55-gfbf66796a0ae.

2020-03-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	debian/control: remove ppc64el from gcc-multilib architectures.
	Little-endian POWER ISA has no 32-bit compat on Linux (and strace has
	no mpers support on ppc64le), so gcc-multilib package is not needed
	there.

	* debian/control (Build-Depends): Remove ppc64el from the list
	of gcc-multilib architectures.

	Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
	Fixes: v4.23~364 "debian: enable mpers support for ppc64el and s390x"

2020-03-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: warn about -S option uselessness in absence of -c/-C.
	* strace.c (init): Add sortby_set local variable.
	(init) <case 'S'>: Set sortby_set to true.
	(init): Warn if sortby_set is set and cflag is not.
	* tests/options-syntax.test: Add a check.

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	io_uring: add support for IORING_{UN,}REGISTER_PERSONALITY commands.
	Introduced by Linux commit v5.6-rc1~123^2~5.

	* xlat/uring_register_opcodes.in (IORING_REGISTER_PERSONALITY,
	IORING_UNREGISTER_PERSONALITY): New constants.
	* tests/io_uring_register.c: Update expected output.

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	io_uring: support IORING_REGISTER_PROBE io_uring_register command.
	Introduced by Linux commit v5.6-rc1~123^2~22.

	* xlat/uring_op_flags.in: New file.
	* xlat/uring_ops.in: Likewise.
	* xlat/uring_register_opcodes.in (IORING_REGISTER_PROBE): New constant.
	* types/io_uring.h (struct_io_uring_probe_op, struct_io_uring_probe):
	New type definitions.
	* io_uring.c: Include "xlat/uring_op_flags.h", "xlat/uring_ops.h".
	(print_io_uring_probe_op, print_io_uring_probe): New functions.
	(SYS_FUNC(io_uring_register)): Add rc variable; print fd and opcode
	on entering only, call print_io_uring_probe if opcode
	is IORING_REGISTER_PROBE; print nargs if rc is non-zero or if it is
	exiting; return rc in the end.
	* tests/io_uring_register.c [HAVE_STRUCT_IO_URING_PROBE]: Add checks.

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	io_uring: de-indent some code in io_uring_setup decoder.
	* io_uring.c (SYS_FUNC(io_uring_setup)): De-indent code in the exiting
	path.

2020-03-28  Dmitry V. Levin  <ldv@altlinux.org>

	Fix various typos found using codespell tool.
	* NEWS: Replace "Enchanced" with "Enhanced".
	* list.h: Replace "embedded withing" with "embedded within".
	* maint/gen-contributors-list.sh: Replace "contributer"
	with "contributor".
	* tests/futex.c: Replace "succeedes" with "succeeds".
	* tests/nsyscalls-d.test: Replace "debug ouput" with "debug output".
	* tests/s390_sthyi.c: Replace "descriptior" with "descriptor".

2020-03-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix strace-DDD.test for the case when strace has a process subreaper
	The test used to assume that the process reaper has pid 1, which is not
	necessarily the case, e.g. there might be a process subreaper different
	from pid 1.

	* tests/get_process_reaper.c: New file.
	* tests/Makefile.am (check_PROGRAMS): Add get_process_reaper.
	* tests/.gitignore: Likewise.
	* tests/strace-DDD.test: Invoke get_process_reaper to find out
	the process reaper id, use the latter in subsequent checks
	instead of pid 1.

	References: https://bugs.debian.org/947396
	Resolves: https://github.com/strace/strace/issues/129

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/ioctl_v4l2.c: whitespace fix.

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add ARG_XLAT_KNOWN and ARG_XLAT_UNKNOWN macros.
	An amalgam of ARG_STR and XLAT_KNOWN/XLAT_UNKNOWN.

	* tests/tests.h (ARG_XLAT_KNOWN, ARG_XLAT_UNKNOWN): New macros.

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add v4l2 ioctl -v tests.
	* tests/ioctl_v4l2-v.c: New file.
	* tests/ioctl_v4l2-v-Xabbrev.c: Likewise.
	* tests/ioctl_v4l2-v-Xraw.c: Likewise.
	* tests/ioctl_v4l2-v-Xverbose.c: Likewise.
	* tests/.gitignore: Add ioctl_v4l2-v, ioctl_v4l2-v-Xabbrev,
	ioctl_v4l2-v-Xraw, ioctl_v4l2-v-Xverbose.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (ioctl_v4l2-v, ioctl_v4l2-v-Xabbrev,
	ioctl_v4l2-v-Xraw, ioctl_v4l2-v-Xverbose): New tests.

	v4l2: do not fancy-print fourcc if -Xraw is set.
	* v4l2.c (print_pixelformat): Print fourcc as a hexadecimal value and
	return.
	* tests/ioctl_v4l2.c (dprint_ioctl_v4l2, main): Update expected output.

	tests: add ioctl_v4l2 xlat style tests.
	* tests/ioctl_v4l2-Xabbrev.c: New file.
	* tests/ioctl_v4l2-Xraw.c: Likewise.
	* tests/ioctl_v4l2-Xverbose.c: Likewise.
	* tests/.gitignore: Add ioctl_v4l2-Xabbrev, ioctl_v4l2-Xraw,
	ioctl_v4l2-Xverbose.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (ioctl_v4l2-Xabbrev, ioctl_v4l2-Xraw,
	ioctl_v4l2-Xverbose): New tests.
	* tests/tests.h: (XLAT_SEL, ABBR, RAW, VERB, NABBR, NRAW, NVERB): New
	macros.
	* tests/ioctl_v4l2.c (dprint_ioctl_v4l2): Change request
	to XLAT_SEL(reqval, reqstr); use XLAT_SEL(buf_type, buf_type_string)
	in printed strings.
	(print_ioctl_v4l2): Pass XLAT_SEL(request, #request) instead of the
	second argument.
	(main): Update expected output.

2020-03-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: move XLAT_FMT and XLAT_ARGS macros from sock_filter-v.c to tests.h
	In preparation of using elsewhere.

	* tests/sock_filter-v.c (XLAT_FMT, XLAT_ARGS): Move ...
	* tests/tests.h: ... here, replacing HEX_FMT with "%#x".

2020-03-27  Dmitry V. Levin  <ldv@altlinux.org>

	hppa: switch to PTRACE_GETREGS API.
	Implement PTRACE_GETREGS API introduced on hppa by Linux kernel commit
	v4.7-rc1~58^2~10.

	* configure.ac [hppa]: Remove arch_enable_Werror=no.
	* linux/hppa/get_syscall_result.c: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* linux/hppa/arch_regs.c (hppa_regs): New variable.
	(ARCH_REGS_FOR_GETREGS, ARCH_PC_REG, ARCH_SP_REG): New macros.
	(hppa_r28, PT_GR20, PT_GR28, ARCH_PC_PEEK_ADDR, ARCH_SP_PEEK_ADDR):
	Remove.
	* linux/hppa/get_error.c (arch_get_error): Use hppa_regs.gr[28].
	* linux/hppa/get_scno.c (arch_get_scno): Use hppa_regs.gr[20].
	* linux/hppa/get_syscall_args.c (arch_get_syscall_args): Use
	hppa_regs.gr.
	* linux/hppa/set_error.c (arch_set_error, arch_set_success): Use
	hppa_regs.gr[28].
	* linux/hppa/set_scno.c (arch_set_scno): Use hppa_regs.gr[20].
	* NEWS: Mention this change.

2020-03-26  Dmitry V. Levin  <ldv@altlinux.org>

	build: enable compiler -Werror option by default.
	If gcc is 4.8+ or clang is 6.0+, and the architecture implements either
	PTRACE_GETREGS or PTRACE_GETREGSET, enable compiler -Werror option
	by default.

	* configure.ac: Call st_WARN_CFLAGS and AX_PROG_CC_FOR_BUILD after
	architecture checks.
	(arch_enable_Werror): New variable, defined to "yes" on all architectures
	except alpha, bfin, hppa, microblaze, sh, sh64, and xtensa.
	* m4/st_warn_cflags.m4 (st_cv_cc_enable_Werror, st_cv_enable_Werror):
	Compute new cached variables.
	(AC_ARG_ENABLE(gcc-Werror)): Default to $st_cv_enable_Werror
	if no option was given, do not add -Werror to WARN_CFLAGS.
	[enable_gcc_Werror == yes]: Add -Werror to WARN_CFLAGS.
	* m4/ax_prog_cc_for_build.m4 (AX_PROG_CC_FOR_BUILD): Redirect
	st_cv_enable_Werror and st_cv_cc_enable_Werror using pushdef/popdef.
	* ci/run-build-and-tests.sh (DISTCHECK_CONFIGURE_FLAGS): Add
	--enable-gcc-Werror unconditionally.

2020-03-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: workaround clang compilation warnings.
	Silence the following incorrect compilation warnings produced by clang:

	tests/filter_seccomp-flag.c:39:28: warning: variable 'sysent1' is not needed and will not be emitted [-Wunneeded-internal-declaration]
	static const struct_sysent sysent1[] = {
	tests/filter_seccomp-flag.c:45:28: warning: variable 'sysent2' is not needed and will not be emitted [-Wunneeded-internal-declaration]
	static const struct_sysent sysent2[] = {

	* tests/filter_seccomp-flag.c (sysent1, sysent2): Remove static
	qualifier.

2020-03-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix musl compilation warnings.
	Silence the following types of compilation warnings generated by gcc
	with musl system headers:

	tests/net-sockaddr.c: In function 'check_x25':
	tests/net-sockaddr.c:430:19: warning: passing argument 2 of 'connect' from incompatible pointer type [-Wincompatible-pointer-types]
	  rc = connect(-1, x25, sizeof(c_x25) - 1);
	                   ^~~
	In file included from tests/net-sockaddr.c:16:0:
	/opt/musl/include/sys/socket.h:332:5: note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_x25 *'
	 int connect (int, const struct sockaddr *, socklen_t);
	     ^~~~~~~

	tests/so_error.c: In function 'reserve_ephemeral_port':
	tests/so_error.c:40:16: warning: passing argument 2 of 'bind' from incompatible pointer type [-Wincompatible-pointer-types]
	   if (bind(sd, &addr, sizeof(addr)) == 0)
	                ^
	In file included from /opt/musl/include/netinet/in.h:10:0,
	                 from tests/so_error.c:14:
	/opt/musl/include/sys/socket.h:331:5: note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_in *'
	 int bind (int, const struct sockaddr *, socklen_t);
	     ^~~~

	* tests/net-sockaddr.c (check_x25): Pass a pointer of type 'void *' as
	the second argument of connect() call.
	* tests/so_error.c (main): Likewise.
	(reserve_ephemeral_port): Pass a pointer of type 'void *' as the second
	argument of bind() call.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count: store average time as struct timespec.
	* count.c (struct call_counts): Change the type of time_avg field
	to struct timespec, all users updated.

	util: change the integer type in ts_mul and ts_div to uint64_t.
	* defs.h (ts_mul, ts_div): Change the type of the last argument
	to uint64_t.
	* util.c (ts_mul, ts_div): Likewise.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count: use dashes in option argument names.
	Dashes are more common among long optiona arguments, so let's support
	(and prefer) them.

	* count.c (column_aliases): Add variants with dashes for aliases with
	underscores.
	* strace.1.in (.SS Statistics): Use dashes in column names in -S and -U
	option descriptions.
	* strace.c (usage): Likewise.
	* tests/options-syntax.test: Add checks.
	* tests/strace-S.test: Use dashes in some column names.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count: add information about minimum and maximum call duration.
	* count.c (struct call_counts): Add time_min, time_max fields.
	(max_ts): New constant.
	(enum count_summary_columns): Add CSC_TIME_MIN, CSC_TIME_MAX.
	(count_syscall): Fill time_min field with max_ts in counts
	initialisation, update time_min and time_max.
	(min_time_cmp, max_time_cmp): New functions.
	(set_sortby): Add keys for them.
	(set_count_summary_columns): Add support for time_min and time_max
	fields printing.
	* strace.1.in (.SH OPTIONS) <-S, -U>: Document it.
	* strace.c (usage): Likewise.
	* tests/strace-S.test: Add checks.
	* tests/options-syntax.test: Likewise.

	Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=240945
	Closes: https://github.com/strace/strace/issues/32

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	count: add ability to select columns being shown.
	* count.c (set_count_summary_columns): New function.
	* defs.h (set_count_summary_columns): New declaration.
	* strace.c (init) <columns_set>: New local variable.
	(init) <optstring>: Add "U:".
	(init) <longopts>: Add "summary-columns" long option.
	(init) <case 'U'>: Pass option argument to set_count_summary_columns.
	(usage): Document it. Add missing -O/-S options to synopsis.
	* strace.1.in (.SS Statistics): Likewise.
	* strace.c (usage): Likewise.
	* tests/options-syntax.test: Add option syntax checks.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count: factor out column alias names.
	Since any column can be sorted now, we can maintain just an alias
	to column mapping, which is also going to be used for column selection
	functionality.

	* count.c (column_aliases): New static constant array.
	(sort_func): New typedef.
	(sortfun): Change type to sort_func.
	(set_sortby): Replace alias to sort function mapping with an
	column-indexed array of sorting functions in sort_fns, ajust the code
	accordingly.
	* tests/options-syntax.test: Add checks.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count: add ability to sort on avg_time field.
	For completeness.

	* count.c (avg_time_cmp): New function.
	(set_sortby): Add sort keys for avg_time sorting.
	* strace.1.in (.SH OPTIONS) <-S>: Document it.
	* strace.c (usage): Likewise.
	* tests/strace-S.test: Add check.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count: refactor statistics calculation/output.
	In preparation to extension.

	* count.c (enum count_summary_columns): New enumeration type.
	(struct call_counts): Add time_avg field.
	(DEF_COLUMNS): New macro.
	(columns, visible): New variables.
	(num_chars): New function.
	(call_summary_pers): Calculate aggregate data first, then output table
	based on columns configuration.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: wire up PR_SET_IO_FLUSHER and PR_GET_IO_FLUSHER prctl options.
	* xlat/prctl_options.in (PR_SET_IO_FLUSHER, PR_GET_IO_FLUSHER): New
	constants, introduced by Linux kernel commit v5.6-rc1~122^2.
	* prctl.c (SYS_FUNC(prctl)): Wire up PR_SET_IO_FLUSHER
	and PR_GET_IO_FLUSHER options.

	xlat: sort prctl_options entries, add #sorted.
	* xlat/prctl_options.in: Sort the entries, align the values, add #sorted,
	add comments about PR_SET_VMA and PR_SET_PTRACER.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtc: decode RTC Voltage Low value as flags.
	Introduced by Linux kernel commit v5.6-rc1~71^2~57

	* xlat/rtc_vl_flags.in: New file.
	* rtc.c (decode_rtc_vl): New function.
	(rtc_ioctl) <case RTC_VL_READ>: Call it instead of printnum_int.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtc: bundle ioctl number definitions.
	This makes decoding more reliable as it no longer depends
	on definitions of these ioctl commands the kernel headers.

	* xlat/rtc_ioctl_cmds.in: New file.
	* rtc.c: Include <xlat/rtc_ioctl_cmds.h>.
	(rtc_ioctl): Remove RTC_VL_READ and RTC_VL_CLR guards.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sched: implement utilisation clamping fields decoding.
	And also handle the piggybacked SCHED_FLAG_KEEP_PARAMS flag
	introduced by Linux kernel commit v5.3-rc1~201^2~5.

	* xlat/sched_flags.in (SCHED_FLAG_KEEP_PARAMS,
	SCHED_FLAG_UTIL_CLAMP_MIN, SCHED_FLAG_UTIL_CLAMP_MAX): New constants.
	* sched_attr.h (struct sched_attr): Add sched_util_min and
	sched_util_max fields.
	(SCHED_ATTR_SIZE_VER1): New macro.
	* sched.c (print_sched_attr): Do not print sched_policy field if
	SCHED_FLAG_KEEP_PARAMS flag is set in sched_setattr; do not print
	sched_nice, sched_priority, sched_runtime, sched_deadline,
	and sched_period fields if SCHED_FLAG_KEEP_PARAMS flag is set
	in sched_setattr; print sched_util_min and sched_util_max field if
	size is at least PRINT_FIELD_U; use attr.size instead of usize in
	sched_getattr for determining whether ellipsis is needed to be printed.
	* tests/sched_xetattr.c: Update expected output, add checks.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	sched: add SCHED_FLAG_KEEP_POLICY flag support.
	Introduced by Linux kernel commit v5.3-rc1~201^2~6.

	* xlat/sched_flags.in (SCHED_FLAG_KEEP_POLICY): New constant.
	* sched.c (print_sched_attr): Add is_set variable, set it to true
	if passed usize is zero, print policy if it is sched_getattr,
	it is negative, or if SCHED_FLAG_KEEP_POLICY is not set.
	* tests/sched_xetattr.c: Update expected output, add a check.

2020-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sched: refactor print_sched_attr.
	Steamline it a bit and convert to PRINT_FIELD_* macros usage,
	in anticipation of the upcoming changes.

	* sched.c: Include "print_fields.h".
	(PRINT_SCHED_FIELD): Remove macro.
	(print_sched_attr): Use PRINT_FIELD_* macros for printing fields, use
	goto instead of size-checking condition block.

2020-03-20  Dmitry V. Levin  <ldv@altlinux.org>

	github: check source code for whitespace errors on every push and pull request
	* .github/workflows/source-code-check.yml: New file.

2020-03-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: decode IFLA_PERM_ADDRESS attribute.
	Introduced by Linux commit v5.6-rc1~151^2~262^2~4.

	* configure.ac (AC_CHECK_DECLS): Check for IFLA_PERM_ADDRESS.
	* rtnl_link.c (ifinfomsg_nla_decoders): Wire up IFLA_PERM_ADDRESS
	attribute using decode_nla_hwaddr.
	* xlat/rtnl_link_attrs.in (IFLA_PERM_ADDRESS): New constant.

2020-03-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: use the family from ifinfomsg.
	* rtnl_link.c (decode_ifla_hwaddr): New function,
	decode_nla_hwaddr_family wrapper that passes the value from
	struct ifinfomsg (passed in opaque data) to it.
	(ifinfomsg_nla_decoders) <IFLA_ADDRESS, IFLA_BROADCAST>: Use
	decode_ifla_hwaddr as decoder.
	(decode_ifinfomsg): Pass ifinfo as opaque_data in decode_nlattr call.

	nlattr: implement generic hardware address nlattr decoder.
	* nlattr.c (decode_nla_hwaddr): New function.
	* nlattr.h (DECL_NLA(hwaddr)): New declaration.
	(NLA_HWADDR_FAMILY_OFFSET): New macro.
	(decode_nla_hwaddr_family, decode_nla_hwaddr_nofamily): New functions.
	* rtnl_link.c (ifla_info_data_bridge_nla_decoders) <IFLA_BR_GROUP_ADDR>:
	Use nlattr_hwaddr_nofamily.
	* rtnl_neigh.c (decode_neigh_lladdr): Remove.
	(ndmsg_nla_decoders) <NDA_LLADDR>: Change decoder
	from decode_neigh_lladdr to decode_nla_hwaddr_nofamily.
	* tests/nlattr_ifla_linkinfo.c: Update expected output.
	* tests/nlattr_ndmsg.c: Likewise.

2020-03-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_mac: avoid passing sizes greater than MAX_ADDR_LEN to sprint_mac_addr
	As sprint_mac_addr (rightfully) bails out on those, simply print those
	as strings.

	* print_mac.c (print_mac_addr, print_hwaddr): Print address raw and
	avoid calling sprint_mac_addr if the size is greater than MAX_ADDR_LEN.

2020-03-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_mac: do not limit address length for hwaddr families 806..819.
	It seems that it has been overlooked.

	* print_mac.c (hwaddr_sizes): Initialise array with default value of 255
	up to ARPHRD_VSOCKMON.

	Fixes: v4.23~129 "sock: guess ifr_hwaddr size in SIOCSIFHWADDR/SIOCGIFHWADDR"

2020-03-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: add IFLA_PROP_LIST and IFLA_ALT_IFNAME attribute type support
	Introduced by Linux commit v5.5-rc1~174^2~448^2~4.

	* configure.ac (AC_CHECK_DECLS): Check for IFLA_PROP_LIST
	and IFLA_ALT_IFNAME.
	* rtnl_link.c (decode_ifla_prop_list_attr, decode_ifla_prop_list): New
	functions.
	(ifinfomsg_nla_decoders): Decode IFLA_PROP_LIST with
	decode_ifla_prop_list, decode IFLA_ALT_IFNAME with decode_nla_str.
	* tests/nlattr_ifinfomsg.c: Add checks.
	* xlat/rtnl_link_attrs.in (IFLA_PROP_LIST, IFLA_ALT_IFNAME): New
	constants.

2020-03-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nlattr: use QUOTE_EXPECT_TRAILING_0 in decode_nla_str.
	In order to signify the absence of the trailing \0 in string
	and print embedded \0 at the same time.

	* nlattr.c (decode_nla_str): Provide
	QUOTE_OMIT_TRAILING_0 | QUOTE_EXPECT_TRAILING_0 flags instead
	of QUOTE_0_TERMINATED flag to printstr_ex call.

2020-03-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: add a separate flag for printing ellipsis in absence of \0 in strings
	In cases where we know the size of the string to be printed
	(for example, in decode_nla_str and likely somewhere else),
	it is probably better to print embedded \0's (so, do not pass
	QUOTE_0_TERMINATED).  Unfortunately, printstr_ex doesn't have a separate
	flag for printing ellipsis in case no \0 occurred at all, so let's
	introduce it.

	* defs.h (QUOTE_EXPECT_TRAILING_0): New macro.
	(QUOTE_0_TERMINATED, QUOTE_OMIT_LEADING_TRAILING_QUOTES,
	QUOTE_OMIT_TRAILING_0): Document.
	(QUOTE_FORCE_HEX, QUOTE_EMIT_COMMENT): Update values, document.
	* util.c (printstr_ex): Print ellipsis not only on QUOTE_0_TERMINATED,
	but also on QUOTE_EXPECT_TRAILING_0.

2020-03-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add IPPROTO_ETHERNET to inet_protocols.
	* xlat/inet_protocols.in (IPPROTO_ETHERNET): New constant, introduced
	by Linux commit v5.6-rc6~23^2~9.

2020-03-15  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify read-write test.
	* tests/read-write.c (main): Explicitly close descriptors 4 and 5 that
	might be inherited from the parent process.

2020-03-10  Dmitry V. Levin  <ldv@altlinux.org>

	Robustify <linux/if_bridge.h> configure checks.
	Prior to Linux kernel commit v3.18-rc5~22^2~32 <linux/if_bridge.h> was
	incomplete: it used struct in6_addr but didn't include a header with a
	definition.  Apply the same workaround in configure checks as in other
	parts of strace: include <netinet/in.h> before <linux/if_bridge.h>.

	* configure.ac: Include <netinet/in.h> before <linux/if_bridge.h>.
	* types/gen.sh (gen_m4_check): Specify INCLUDES parameter in the
	generated AC_CHECK_HEADERS invocation.

2020-03-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: change style argument type of print_xlat_ex to uint32_t.
	...and add some documentation. Otherwise, clang complains about it:

	    warning: implicit conversion from enumeration type
	    'enum xlat_style_private_flags' to different enumeration type
	    'enum xlat_style' [-Wenum-conversion]
	                    print_xlat_ex(cid, "V4L2_CID_???", PXF_DEFAULT_STR);
	                    ~~~~~~~~~~~~~                      ^~~~~~~~~~~~~~~

	* defs.h (print_xlat_ex): Change the type of style argument to uint32_t,
	add doxydoc.
	* xlat.c (print_xlat_ex): Change the type of style argument to uint32_t.

2020-03-09  Dmitry V. Levin  <ldv@altlinux.org>

	util: define either ilog2_64 or ilog2_32.
	Depending on the value of SIZEOF_KERNEL_LONG_T, either ilog2_64 or
	ilog2_32 is used as an implementation of ilog2_klong.  Do not define
	the other one to pacify clang that otherwise complains with either

	  util.c:1060:1: warning: unused function 'ilog2_32' [-Wunused-function]
	  ilog2_32(uint32_t val)

	or

	  util.c:1038:1: warning: unused function 'ilog2_64' [-Wunused-function]
	  ilog2_64(uint64_t val)

	* util.c (ilog2_64): Define only for [SIZEOF_KERNEL_LONG_T > 4].
	(ilog2_32): Define only for [SIZEOF_KERNEL_LONG_T == 4].

2020-03-09  Dmitry V. Levin  <ldv@altlinux.org>

	tests: include <signal.h> instead of <sys/signal.h>
	<sys/signal.h> is an old stub that exists for compatibility with some
	ancient systems, it just includes <signal.h>.

	* tests/prctl-pdeathsig.c: Include <signal.h> instead of <sys/signal.h>.

2020-03-09  Dmitry V. Levin  <ldv@altlinux.org>

	Assume that prctl() and <sys/prctl.h> are always available.
	They were introduced in the GNU libc back in 1997,
	so we can safely use them without further checks.

	* configure.ac (AC_CHECK_FUNCS): Remove prctl.
	* strace.c: Include <sys/prctl.h> unconditionally.
	(startup_child): Do not test for HAVE_PRCTL.
	* tests/prctl-name.c: Include <sys/prctl.h> unconditionally, do not test
	for HAVE_PRCTL.
	* tests/prctl-seccomp-filter-v.c: Likewise.
	* tests/prctl-seccomp-strict.c: Likewise.
	* tests/printpath-umovestr-undumpable.c: Likewise.
	* tests/printstrn-umoven-undumpable.c: Likewise.
	* tests/set_ptracer_any.c: Likewise.
	* tests/seccomp-filter-v.c: Include <sys/prctl.h> unconditionally.

2020-03-09  Dmitry V. Levin  <ldv@altlinux.org>

	strace.1: fix typo.
	* strace.1.in (.SH HISTORY): Fix spelling of OpenRISC.

	Resolves: https://github.com/strace/strace/issues/128

2020-03-06  Dmitry V. Levin  <ldv@altlinux.org>

	print_timeval: do not use struct timeval provided by libc.
	Use kernel_old_timeval_t provided by our kernel_timeval.h instead of
	struct timeval provided by libc to avoid potential issues if libc
	changes the definition of struct timeval to use 64-bit types on 32-bit
	systems.

	* print_timeval.c: Include "kernel_timeval.h".
	(timeval_t): Change from struct timeval to kernel_old_timeval_t.

	Complements: v5.5-8-g94d56c9c3 "printrusage: bundle rusage_t definition"

2020-03-06  Dmitry V. Levin  <ldv@altlinux.org>

	Move kernel_old_timeval definition to kernel_timeval.h.
	It's going to be used later in print_timeval.c

	* kernel_timeval.h: Include "kernel_types.h".
	(kernel_old_timeval_t): New type.
	* printrusage.c: Include "kernel_timeval.h".
	(struct kernel_old_timeval): Remove.
	(rusage_t): Replace struct kernel_old_timeval with kernel_old_timeval_t.

2020-03-06  Dmitry V. Levin  <ldv@altlinux.org>

	printrusage: fix kernel_old_timeval definition to match the kernel.
	The type of struct kernel_old_timeval.tv_usec field is the same
	kernel_long_t as the type of tv_sec field, with one notable exception:
	sparc64 is the only 64-bit architecture where tv_usec field is 32-bit.

	* printrusage.c (struct kernel_old_timeval) [__sparc__ && __arch64__]:
	Change the type of tv_usec field from long to int.
	[!(__sparc__ && __arch64__)]: Change the type of tv_usec field
	from long to kernel_long_t.

	Fixes: v5.5-8-g94d56c9c3 "printrusage: bundle rusage_t definition"

2020-03-06  Alistair Francis  <alistair.francis@wdc.com>

	printrusage: fix kernel_old_timeval typo.
	The timeval struct should contain a tv_sec and tv_usec type,
	fix the typo to indicate that it's usec and not nsec.

	This member is never directly accessed here so there are no other
	changes required.


	* printrusage.c (struct kernel_old_timeval): Rename tv_nsec to tv_usec.

	Fixes: v5.5-8-g94d56c9c3 "printrusage: bundle rusage_t definition"

2020-03-02  Paul Chaignon  <paul.chaignon@gmail.com>
	    Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	bpf: implement decoding of BPF_PROG_ATTACH replace_bpf_fd field.
	* bpf_attr.h (BPF_PROG_ATTACH_struct): Add replace_bpf_fd field
	introduced by Linux kernel commit v5.6-rc1~151^2~199^2~7^2~3.
	(expected_BPF_PROG_ATTACH_struct_size): Update.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_ATTACH)): Decode the new field.
	* NEWS: Mention this.
	* tests/bpf.c (BPF_PROG_ATTACH_checks): Check it.

	bpf: update BPF_* constants.
	* xlat/bpf_attach_flags.in (BPF_F_REPLACE): New constant introduced
	by Linux kernel commit v5.6-rc1~151^2~199^2~7^2~3.
	* xlat/bpf_map_types.in (BPF_MAP_TYPE_STRUCT_OPS): New constant
	introduced by Linux kernel commit v5.6-rc1~151^2~46^2~37^2~5.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_STRUCT_OPS): New constant
	introduced by Linux kernel commit v5.6-rc1~151^2~46^2~37^2~6.
	(BPF_PROG_TYPE_EXT): New constant introduced by Linux kernel commit
	v5.6-rc1~151^2~46^2~1^2~2.
	* NEWS: Mention this.
	* tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks,
	BPF_PROG_QUERY_checks): Update checks and their expected output.
	* tests/kernel_version.c (print_bpf_attr, main): Likewise.

2020-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	tests/bpf: add a guard against untested bpf_map_types updates.
	* tests/bpf.c: Include "xlat/bpf_map_types.h", add a static_assert
	for bpf_map_types_xdata.
	(BPF_MAP_CREATE_checks): Update the first check.

	bpf: implement decoding of struct bpf_map_info.btf_vmlinux_value_type_id field
	* bpf_attr.h (struct bpf_map_info_struct): Insert
	btf_vmlinux_value_type_id field between ifindex and netns_dev fields
	introduced by Linux kernel commit v5.6-rc1~151^2~46^2~37^2~5.
	* bpf.c (print_bpf_map_info): Print btf_vmlinux_value_type_id field.
	* tests/bpf-obj_get_info_by_fd.c [VERBOSE] (main): Print
	btf_vmlinux_value_type_id field if the structure is big enough.

2020-03-02  Paul Chaignon  <paul.chaignon@gmail.com>
	    Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	bpf: implement decoding of BPF_MAP_CREATE btf_vmlinux_value_type_id field
	* bpf_attr.h (BPF_MAP_CREATE_struct): Add btf_vmlinux_value_type_id
	field introduced by Linux kernel commit v5.6-rc1~151^2~46^2~37^2~5.
	(expected_BPF_MAP_CREATE_struct_size): Update.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Decode the new field.
	* NEWS: Mention this.
	* tests/bpf-obj_get_info_by_fd.c (print_map_create): Update expected
	output.
	* tests/bpf.c (BPF_MAP_CREATE_checks): Add a check that includes
	btf_vmlinux_value_type_id field.

2020-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ioctl: add HIDIOCGRAWUNIQ ioctl number decoding.
	* ioctl.c (hiddev_decode_number): Decode HIDIOCGRAWUNIQ introduced
	by Linux kernel commit v5.6-rc1~198^2~1^2.

	ioctl: fix indentation in switch clauses.
	* ioctl.c: Fix indentation in switch clauses, no code changes.

	xlat: update AUDIT_* constants.
	* xlat/nl_audit_types.in: Add #sorted.
	(AUDIT_BPF): New constant, introduced by Linux kernel commit
	v5.6-rc1~151^2~199^2~47.

	xlat: update CLONE_* constants.
	* xlat/clone3_flags.in (CLONE_NEWTIME): New constant, introduced
	by Linux kernel commit v5.6-rc1~177^2~41.
	* xlat/setns_types.in (CLONE_NEWTIME): Likewise.
	* xlat/unshare_flags.in (CLONE_NEWTIME): Likewise.
	* tests/clone3.c (main): Update the expected output.
	* tests/unshare.c (main): Likewise.

	xlat/unshare_flags: reorder and provide fallback definitions for constants
	* xlat/unshare_flags.in: Provide fallback definitions for constants,
	reorder in the ascending order, add #sorted.
	* tests/unshare.c (main): Update the expected output.

	xlat: update GRND_* constants.
	* xlat/getrandom_flags.in (GRND_INSECURE): New constant, introduced
	by Linux kernel commit v5.6-rc1~91^2~20.

	xlat: update IPPROTO_* constants.
	* xlat/inet_protocols.in (IPPROTO_MPTCP): New constant, introduced
	by Linux kernel commit v5.6-rc1~151^2~118^2~8.

	xlat: update RTM_F_* constants.
	* xlat/routing_flags.in: Add #sorted.
	(RTM_F_NOTIFY, RTM_F_CLONED, RTM_F_EQUALIZE, RTM_F_PREFIX,
	RTM_F_LOOKUP_TABLE): Add fallback definitions.
	(RTM_F_FIB_MATCH): New constant, introduced by Linux kernel commit
	v4.13-rc1~157^2~364^2~2.
	(RTM_F_OFFLOAD, RTM_F_TRAP): New constants, introduced by Linux kernel
	commit v5.6-rc1~151^2~91^2~7.

	io_uring: decode IORING_REGISTER_EVENTFD_ASYNC io_uring_reginster command
	* xlat/uring_register_opcodes.in (IORING_REGISTER_EVENTFD_ASYNC): New
	constant introduced by Linux kernel commit v5.6-rc1~123^2~28.
	* io_uring.c (io_uring_register): Handle IORING_REGISTER_EVENTFD_ASYNC
	along with IORING_REGISTER_FILES and IORING_REGISTER_EVENTFD.
	* tests/io_uring_register.c (main): Check it, update expected output.

	xlat: update KVM_* constants.
	* xlat/kvm_cap.in (KVM_CAP_S390_VCPU_RESETS): New constant, introduced
	by Linux kernel commit v5.6-rc1~39^2~3^2~3.

	xlat: add ZONEFS_MAGIC to fsmagic.
	* xlat/fsmagic.in (ZONEFS_MAGIC): New constant, introduced by Linux
	kernel commit v5.6-rc1~2^2~1.

2020-02-26  Alistair Francis  <alistair.francis@wdc.com>

	tests/clock_nanosleep: Skip test if __NR_clock_nanosleep isn't defined.
	Modern (added since Linux kernel 5.1+) 32-bit architectures don't have
	the __NR_clock_nanosleep syscall, if we don't have the syscall let's
	skip the test.


	* tests/clock_nanosleep.c [!__NR_clock_nanosleep]: Skip the test.

2020-02-26  Alistair Francis  <alistair.francis@wdc.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	linux/32: Split 32-bit time_t based syscalls into a separate header.

	Starting with Linux kernel v5.1, new 32-bit architectures
	do not implement old 32-bit time_t based system calls, so
	they should not have the corresponding syscallent records.

	* linux/32/syscallent-time32.h: New file, generated using the following
	command: grep 'timex\?32)' linux/32/syscallent.h
	* Makefile.am (EXTRA_DIST): Add it.
	* linux/32/syscallent.h: Replace entries for 32-bit time_t based
	syscalls with stub comments using the following command:
	sed -i '/timex\?32)/ s/\(^\[[^]]\+\]\)[^"]*"\([^"]\+\)".*/\/\* \1 \2 \*\//'
	[HAVE_ARCH_TIME32_SYSCALLS]: Include "32/syscallent-time32.h".

2020-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: disable seccomp-bpf instead of enabling following forks.
	It is in line with the rest of the checks that disable seccomp-bpf
	usage if it is impossible.

	* strace.c (init) <if (seccomp_filtering)>: Rephrase the error
	if followfork is not set; set seccomp_filtering to false; do not set
	followfork to true.
	* tests/options-syntax.test: Update the expected output.

2020-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: warn about uselessness of -A/--output-separately in absence of -o
	* strace.c (init) <if (!outfname)>: Print warnings if output_separately
	and/or open_append.
	* tests/options-syntax.test: Check this.

	Update NEWS.

	strace: add a long option alias for -t.
	* strace.c (tflag): Remove.
	(tflag_scale, tflag_width, tflag_format): New static variables.
	(printleader): Rewrite time stamp printing to allow custom format
	and precision.
	(printleader) <if (rflag)>: Use tflag_format instead of tflag
	as an indicator for presence of absolute timestamps.
	(parse_ts_arg): New function.
	(init) <tflag_str, ttflag_str, tttflag_str>: New static constants.
	(init) <tflag_long_set, tflag_short>: New variables.
	(init) <enum>: Add GETOPT_TS.
	(init) <longopts>: Add "absolute-timestamps" and "timestamps" long
	options.
	(init) <case 't'>: Increment tflag_short instead of tflag.
	(init) <case GETOPT_TS>: Handle the new option using parse_ts_arg.
	(init): Check if tflag_short is set; if tflag_long_set is set as well,
	then bail out, otherwise call parse_ts_arg with the appropriate
	argument; update the message that mentions -t.
	(usage): Document it.
	* strace.1.in (.SS Output format): Likewise.
	* tests/gen_tests.in (strace--absolute-timestamps,
	strace--absolute-timestamps-format-time,
	strace--absolute-timestamps-format-time-precision-s,
	strace--absolute-timestamps-format-time-precision-ms,
	strace--absolute-timestamps-format-time-precision-us,
	strace--absolute-timestamps-format-time-precision-ns,
	strace--absolute-timestamps-format-unix-precision-s,
	strace--absolute-timestamps-format-unix-precision-ms,
	strace--absolute-timestamps-format-unix-precision-us,
	strace--absolute-timestamps-format-unix-precision-ns,
	strace--relative-timestamps, strace--relative-timestamps-s,
	strace--relative-timestamps-ms, strace--relative-timestamps-us,
	strace--relative-timestamps-ns, strace--timestamps,
	strace--timestamps-time, strace--timestamps-time-s,
	strace--timestamps-time-ms, strace--timestamps-time-us,
	strace--timestamps-time-ns, strace--timestamps-unix-s,
	strace--timestamps-unix-ms, strace--timestamps-unix-us,
	strace--timestamps-unix-ns): New tests.
	* tests/options-syntax.test: Add new checks.
	* tests/strace-t.test: Get the option to check via command-line
	arguments.
	* tests/strace-tt.test: Get the precision and option to check
	via command-line arguments.
	* tests/strace-ttt.test: Get the precision and option to check
	via command-line arguments, generate subsec_re appropriately.

2020-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: establish -qqq as an alias for --quiet=all.
	Addition of thread-execve and path-resolution quiet flags introduced
	discrepancy between the -qq and --quiet=all settings; let's establish
	that -qqq is the ultimate quietness setting and leave the more
	fine-grained control to the -e quiet/--quiet option.

	* strace.c (init) <qqqflag_qual>: New static constant.
	(init) Supply qqqflag_qual to qualify_quiet if qflag_short is set to 3
	or higher.
	(usage): Document it.
	* strace.1.in: Likewise.
	* tests/threads-execve--quiet-thread-execve.c: New file.
	* tests/threads-execve-q.c: Likewise.
	* tests/threads-execve-qq.c: Likewise.
	* tests/threads-execve-qqq.c: Likewise.
	* tests/.gitignore: Add threads-execve--quiet-thread-execve,
	threads-execve-q, threads-execve-qq, threads-execve-qqq.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(threads_execve__quiet_thread_execve_LDADD, threads_execve_q_LDADD,
	threads_execve_qq_LDADD, threads_execve_qqq_LDADD): New variables.
	* tests/gen_tests.in (threads-execve--quiet-thread-execve,
	threads-execve-q, threads-execve-qq, threads-execve-qqq): New tests.
	* tests/threads-execve.c [!PRINT_EXITED] (PRINT_EXITED): New macro.
	[!PRINT_SUPERSEDED] (PRINT_SUPERSEDED): Likewise.
	(thread): Put "superseded by execve in pid"... message printing under
	PRINT_SUPERSEDED.
	(main): Put "+++ exited with 0 +++" message printing under PRINT_EXITED.
	* tests/threads-execve.test: Inject the arguments supplied to the tests
	into the strace's arguments.

2020-02-24  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix require_min_nproc on systems without nproc.
	* tests/init.sh (require_min_nproc): Fix typo in the check for nproc
	that manifests itself in "set -e" mode.

	Fixes: v5.4~59 "tests: skip a few tests on systems with nproc == 1"

2020-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: add a long option alias for -y.
	Provide a new qualifier, decode-fds, and add (hopefully) sensible
	handling for it.

	* defs.h (show_fd_path): Remove declaration.
	(qualify_decode_fd): New declaration.
	* filter_qualify.c (decode_fd_set, decode_fd_set_updated): New
	variables.
	(decode_fd_str_to_uint, qualify_decode_fd): New functions.
	(qual_options): Add "decode-fd" and "decode-fds" that are handled
	by qualify_decode_fd.
	* number_set.h (enum decode_fd_bits): New enumeration.
	(decode_fd_set_updated, decode_fd_set): New declarations.
	* strace.c (show_fd_path): Remove.
	(init) <yflag_qual, yyflag_qual>: New static constants.
	(init) <yflag_short>: New local variable.
	(init) <enum>: Add GETOPT_QUAL_FD.
	(init) <longopts>: Add "decode-fds" long option.
	(init) <case 'y'>: Increment yflag_short instead of show_fd_path.
	(init) <case GETOPT_QUAL_FD>: Call qualify_decode_fd with either optarg
	or yflag_qual is the former is NULL.
	(init): Check if yflag_short is set, if decode_fd_set_updated is set
	as well, bail out, call qualify_decode_fd with the appropriate set
	otherwise; update the message that mentions -y.
	(usage): Document it.
	* strace.1.in (.SS Output format): Likewise.
	* util.c: Include "number_set.h".
	(printfd): Rewrite using appropriate is_number_in_set checks.
	* tests/dev--decode-fds-dev.c: New file.
	* tests/dev--decode-fds-path.c: Likewise.
	* tests/dev--decode-fds-socket.c: Likewise.
	* tests/net--decode-fds-dev-netlink.c: Likewise.
	* tests/net--decode-fds-none-netlink.c: Likewise.
	* tests/net--decode-fds-path-netlink.c: Likewise.
	* tests/net--decode-fds-socket-netlink.c: Likewise.
	* tests/pidfd_open--decode-fd-path.c: Likewise.
	* tests/.gitignore: Add dev--decode-fds-dev, dev--decode-fds-path,
	dev--decode-fds-socket, net--decode-fds-dev-netlink,
	net--decode-fds-none-netlink, net--decode-fds-path-netlink,
	net--decode-fds-socket-netlink, and pidfd_open--decode-fd-path.
	* tests/pure_executables.list: Likewise.
	* tests/dev-yy.c [!PRINT_DEVNUM] (PRINT_DEVNUM): New macro, define to 1.
	(DEV_FMT): New macro.
	(main): Parametrize the output using DEV_FMT in accordance with
	PRINT_DEVNUM value.
	* tests/gen_tests.in (dev--decode-fds-dev, dev--decode-fds-path,
	dev--decode-fds-socket, net--decode-fds-dev-netlink,
	net--decode-fds-none-netlink, net--decode-fds-path-netlink,
	net--decode-fds-socket-netlink, pidfd_open--decode-fd-path): New tests.
	(open_tree-P): Use the long option.
	* tests/net-yy-netlink.c [!PRINT_SOCK] (PRINT_SOCK): New macro, define
	to 2.
	(FMT_UNBOUND, FMT_BOUND, ARG_UNBOUND, ARG_BOUND): New macros, defined
	based on PRINT_SOCK value.
	(main): Parametrize the output using FMT_UNBOUND, FMT_BOUND,
	ARG_UNBOUND, and ARG_BOUND.
	* tests/net-yy-netlink.test: Append options passed to the test instead
	of "-yy".
	* tests/options-syntax.test: Add checks, update expected output.

2020-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: add a long option aliases for -f and -ff.
	Introduce a new option, --output-separately, and make -ff an alias
	for a combination of -f and this new option.

	* defs.h (followfork): Change type to bool.
	(output_separately): New declaration.
	* strace.c (followfork): Change type to bool.
	(output_separately): New variable.
	(outf_perror, printleader, after_successful_attach, droptcb, init,
	print_event_exit, print_syscall_resume): Use output_separately
	instead of followfork check.
	(init) <followfork_short>: New local variable.
	(init) <enum>: Add GETOPT_FOLLOWFORKS and GETOPT_OUTPUT_SEPARATELY.
	(init) <longopts>: Add "follow-forks" and "output-separately" long
	options.
	(init) <case 'f'>: Increase followfork_short instead of followfork.
	(init) <case GETOPT_FOLLOWFORKS>: Set followfork to true.
	(init) <case GETOPT_OUTPUT_SEPARATELY>: Set output_separately to true.
	(init): Fail if either both followfork_short and followfork are set,
	or followfork_short >= 2 and output_separately is set;
	set followfork/output_separately appropriately otherwise;
	update the error messages that mention -f/-ff options with the aliases.
	(init) <if (seccomp_filtering)>: Set followfork to true and not 1.
	(usage): Document it.
	* strace.1.in (.SS Tracing): Likewise.
	* tests/strace--follow-forks-output-separately.expected: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/delay.test: Use --follow-forks instead of -f.
	* tests/gen_tests.in: Add strace--follow-forks-output-separately test.
	* tests/looping_threads.test: Use --follow-forks instead of -f.
	* tests/options-syntax.test: Add --follow-forks-related syntax checks,
	update the expected output.
	* tests/strace-ff.test: Add -efu as the interpreter argument; set the
	arguments to ff_opt variable ("-ff" being the default) and use it
	instead of -ff in the strace call; put set +f before "set -- "$LOG".*".

2020-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/syntax: add suffixes to produced log/exp files.
	In order to enable inspection of them.

	* tests/syntax.sh (log_sfx): New functions.
	(check_exit_status_and_stderr, check_exit_status_and_stderr_using_grep):
	Get suffix from the first argument, append it to LOG/EXP usage instances;
	open-code dump_log_and_fail_with in order to print the file with the
	suffix.
	check_e, check_e_using_grep, check_h): Assign log_sfx result to sfx,
	append it to LOG/EXP usage instances, pass it to
	check_exit_status_and_stderr/check_exit_status_and_stderr_using_grep.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: add arguments to --syscall-times and --relative-timestamps.
	* defs.h (Tflag_scale, Tflag_width): New declarations.
	* strace.c (Tflag_scale, Tflag_width, rflag_scale, rflag_width): New
	variables.
	(printleader): Parametrise relative timestamp printing with rflag_width
	and rflag_scale.
	(init) <longopts>: Change second field of "relative-timestamps" and
	"syscall-times" from no_argument to optional_argument.
	(init) <case 'r', case 'T'>: Handle optarg, fail if the scale variable
	is set to -1.
	(usage): Document it.
	* strace.1.in (.SS Output format): Likewise.
	* syscall.c (syscall_exiting_trace): Parametrise syscall time printing
	* with Tflag_width and Tflag_scale.
	* tests/gen_tests.in (strace--relative-timestamps-s,
	strace--relative-timestamps-ms, strace--relative-timestamps-us,
	strace--relative-timestamps-ns): New tests.
	* tests/options-syntax.test: New checks for --relative-timestamps and
	--syscall-times option syntax.
	* tests/strace--relative-timestamps-ms.expected: New file.
	* tests/strace--relative-timestamps-ns.expected: Likewise.
	* tests/strace--relative-timestamps-s.expected: Likewise.
	* tests/strace--relative-timestamps-us.expected: Likewise.
	* tests/strace--syscall-times-ms.expected: Likewise.
	* tests/strace--syscall-times-ns.expected: Likewise.
	* tests/strace--syscall-times-s.expected: Likewise.
	* tests/strace--syscall-times-us.expected: Likewise.
	* tests/Makefile.am (EXTRA_DIST): Add them.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: factor out time scale parsing.
	In preparation of using elsewhere.

	* defs.h (str2timescale_ex): New declaration.
	(str2timescale_optarg, str2timescale_sfx): New macros.
	* util.c (str2timescale_ex): New function.
	(parse_ts): Remove units, unit, assign str2timescale_sfx result to a new
	variable scale and use it instead of unit->val.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	pathtrace: add a quiet flag for path resolution messages.
	And also quote the paths.

	* number_set.h (enum quiet_bits): Add QUIET_PATH_RESOLVE.
	* filter_qualify.c (quietstr_to_uint) <quiet_strs>: Add a string
	representation for QUIET_PATH_RESOLVE.
	* pathtrace.c (pathtrace_select_set): Put "Requested path"... message
	under QUIET_PATH_RESOLVE flag check; process path and rpath with
	string_quote.
	* strace.c (usage): Document it.
	* strace.1.in (.SS Output format) <-e quiet>: Likewise.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: add a quiet flag for "superseded by execve" messages.
	* filter_qualify.c (quietstr_to_uint) <quiet_strs>: Add
	a string representation for QUIET_THREAD_EXECVE,
	* number_set.h (enum quiet_bits): Add QUIET_THREAD_EXECVE.
	* strace.c (maybe_switch_tcbs): Put message printing under
	QUIET_THREAD_EXECVE flag check.
	(usage): Document it.
	* strace.1.in (.SS Output format) <-e quiet>: Likewise.
	* tests/maybe_switch_current_tcp--quiet-thread-execve.c: New file.
	* tests/.gitignore: Add maybe_switch_current_tcp--quiet-thread-execve.
	* tests/pure_executables.list: Likewise.
	* tests/Makefile.am (maybe_switch_current_tcp__quiet_thread_execve_LDADD):
	New variable.
	* tests/gen_tests.in (maybe_switch_current_tcp--quiet-thread-execve):
	New test.
	* tests/maybe_switch_current_tcp.c [!QUIET_MSG] (QUIET_MSG): New macro.
	(thread): Print "superseded"... message only is QUIET_MSG is 0.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall: print personality switch messages in tcb's output.
	Personality switch is a rather normal event, it's unclear why it has
	been always treated as a diagnostics/error information.  Having it under
	qflag makes even less sense, as it was impossible to get
	this information when the -o option was used.  With this change,
	it is at least possible to get it with something like

	    strace -f -o out --quiet=none PROG

	One caveat, though, is its rather odd format, with square brackets,
	"PID=", and a dot, but it seems that we're stuck with it forever, as it
	traces back for decades, albeit with a prefix change in commit
	v4.11~509 ("Consistently use error_msg instead of fprintf(stderr)").

	* syscall.c (update_personality): Use printleader/tprintf/line_ended
	instead of error_msg.
	* tests/bexecve.test: Add --quiet=personality to strace invocations.
	* tests/strace-ff.test: Likewise.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: respect quietness setting when reporting unknown tracees.
	Since the situations where these processes can appear are relatively
	normal, it makes little sense to print them irrespective of quietness
	setting.

	* strace.c (maybe_allocate_tcb): Put the message about exit of unknown
	process under QUIET_EXIT check; put message about detach of unknown
	process under QUIET_ATTACH check.
	* tests/clone_parent--quiet-exit.c: New file.
	* tests/clone_parent-q.c: Likewise.
	* tests/clone_parent-qq.c: Likewise.
	* tests/clone_ptrace--quiet-attach.c: Likewise.
	* tests/clone_ptrace--quiet-exit.c: Likewise.
	* tests/clone_ptrace-q.c: Likewise.
	* tests/clone_ptrace-qq.c: Likewise.
	* tests/.gitignore: Add clone_parent--quiet-exit, clone_parent-q,
	clone_parent-qq, clone_ptrace--quiet-attach, clone_ptrace--quiet-exit,
	clone_ptrace-q, and clone_ptrace-qq.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	* tests/gen_tests.in: Add clone_parent--quiet-exit, clone_parent-q,
	clone_parent-qq, clone_ptrace--quiet-attach, clone_ptrace--quiet-exit,
	clone_ptrace-q, and clone_ptrace-qq tests.
	* tests/clone_parent.c [!QUIET_MSG] (QUIET_MSG): New macro.
	(main): Print exit messages only if QUIET_MSG set to zero.
	* tests/clone_ptrace.c [!QUIET_ATTACH] (QUIET_ATTACH): New macro.
	[!QUIET_EXIT] (QUIET_EXIT): Likewise.
	(main): Print information about unknown pid detach only if QUIET_ATTACH
	is 0; print information about process exiting only if QUIET_EXIT is 0.
	* tests/clone_ptrace.test: Add the first argument to args, add
	"--quiet=personality" if it is empty.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: add long option aliases for -r, -T, and -O.
	The last trivial ones.

	* strace.c (init) <longopts>: Add "summary-syscall-overhead" as an alias
	for 'O', "relative-timestamps" as an alias for 'r', and "syscall-times"
	as an alias for 'T'.
	(usage): Document it.
	* strace.1.in: Likewise.
	* tests/count.test: Add --summary-syscall-overhead checks.
	* tests/gen_tests.in: Add strace--relative-timestamps and
	strace--syscall-times tests.
	* tests/strace-T.test: Allow passing option to check as the first
	* argument.
	* tests/strace-r.test: Likewise.
	* tests/strace--relative-timestamps.expected: New file.
	* tests/strace--syscall-times.expected: Likewise.
	* tests/Makefile.am (EXTRA_DIST): Add them.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1: document possible quialifier aliases.
	* strace.1.in (.SS General) <-e expr>: Document possible aliases
	for quialifiers.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: add long option aliases for -q.
	Provide a new qualifier, quiet, and add a (hopefully) sensible handling
	for it.

	* defs.h (qflag): Remove declaration.
	(qualify_quiet): New declaration.
	* filter_qualify.c (quiet_set, quiet_set_updated): New variables.
	(quietstr_to_uint, qualify_quiet): New functions.
	(qual_options): Add "quiet", "silence", "silent", "q" that are handled
	by qualify_quiet.
	* number_set.h (enum quiet_bits): New enumeration.
	(quiet_set_updated, quiet_set): New declarations.
	* strace.c (qflag): Remove.
	(detach, attach_tcb, maybe_allocate_tcb): Change qflag check to
	is_number_in_set(QUIET_ATTACH, quiet_set).
	(init) <qflag_qual, qqflag_qual>: New static constants.
	(init) <enum>: Add GETOPT_QUAL_QUIET.
	(init) <longopts>: Add "quiet", "silent", "silence".
	(init) <case 'q'>: Increment qflag_short instead of qflag.
	(init) <case GETOPT_QUAL_QUIET>: Call qualify_quiet with either optarg
	or qflag_qual is the former is NULL.
	(init) <if (outfname && argc)>: Check qflag_short and quiet_set_updated
	instead of qflag for changing the default quietness setting.
	(init): Check if qflag_short is set, if quiet_set_updated is set as well,
	bail out, call qualify_quiet with the appropriate set otherwise.
	(print_exited): Change qflag check to
	is_number_in_set(QUIET_EXIT, quiet_set).
	(usage): Document it.
	* strace.1.in: Likewise.
	* syscall.c (update_personality): Change qflag check to
	is_number_in_set(QUIET_PERSONALITY, quiet_set).
	* tests/clone-flags.test: Use --silence=exits instead of -qq.
	* tests/count-f.test: Use -e silent=attach instead of -q.
	* tests/options-syntax.test: Add checks.
	* tests/strace-D.test: Use -e q=attach instead of -q.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: add long option aliases for -x.
	* defs.h (enum xflag_opts): New enumeration.
	* strace.c (xflag_str): New static variable.
	(init) <xflag_long>: New variable.
	(init) <enum>: Add GETOPT_HEX_STR.
	(init) <longopts>: Add "string-in-hex" long option.
	(init) <case GETOPT_HEX_STR>: Parse the argument using find_arg_val.
	(init): Fail if both xflag_long and xflag are set; copy xflag_long
	to xflag if only the former is set.
	(usage): Document it.
	* strace.1.in: Likewise.
	* tests/gen_tests.in (strace--strings-in-hex,
	strace--strings-in-hex-all, strace--strings-in-hex-non-ascii, strace-x,
	strace-xx): New tests.
	* tests/pure_executables.list: Add them.
	* tests/.gitignore: Likewise.
	* tests/options-syntax.test: Add checks.
	* tests/strace--strings-in-hex-all.c: New file.
	* tests/strace--strings-in-hex-non-ascii.c: Likewise.
	* tests/strace--strings-in-hex.c: Likewise.
	* tests/strace-x.c: Likewise.
	* tests/strace-xx.c: Likewise.

	strace: add long option aliases for -z and -Z.
	* strace.c (init) <longopts>: Add "successful-only" and "failed-only"
	long options for -z and -Z, respectively.
	(init): Update the related error message.
	(usage): Document it.
	* strace.1.in: Likewise.
	* tests/options-syntax.test: Add checks, update expected output.
	* tests/status-failed-long.c: New file.
	* tests/status-failed-status.c: Likewise.
	* tests/status-successful-long.c: Likewise.
	* tests/status-successful-status.c: Likewise.
	* tests/.gitignore: Add them.
	* tests/pure_executables.list: Likewise
	* tests/gen_tests.in (status-failed-long, status-failed-status,
	status-successful-long, status-successful-status): New tests.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: add --daemonize long option alias for -D.
	Don't fail those who provide --daemonise or --daemonized as well.

	Since multiple -D instances change behaviour and with long options
	the last instance wins, it is better just to forbid the simultaneous
	usage of the short and long option variants.

	* strace.c (daemonize_str): New static constant.
	(init) <daemonized_tracer_long>: New variable.
	(init) <enum>: Add GETOPT_DAEMONIZE.
	(init) <longopts>: Add "daemonize" long option variants.
	(init) <case GETOPT_DAEMONIZE>: Use find_arg_val for argument parsing.
	(init): Fail if both daemonized_tracer_long and daemonized_tracer are
	set; copy daemonized_tracer_long to daemonized_tracer if only the former
	is set; update the error messages that mention -D option with the alias.
	(usage): Document it.
	* strace.1.in: Likewise.
	* tests/options-syntax.test: Add checks, update existing ones.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: mention long option aliases in error messages.
	If a user has provided a long option alias, current error messages could
	be confusing otherwise.

	* strace.c (init): Augment error messages with long option aliases where
	appropriate.
	* tests/options-syntax.test: Update expected output.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: print long options in the option error message.
	If a long option alias is used with incorrect argument, it's better show it
	in the error message instead of the short option equivalent.

	* strace.c (error_opt_arg): Add lopt argument, print its name
	if it is non-NULL.
	(init): Add lopt_idx variable, pass it to getopt_long, set loop-local
	lopt variable to an option pointer based on lopt_idx; pass lopt
	in error_opt_arg calls.
	* tests/options-syntax.test: Update expected output.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: add a long option alias for -I.
	And add more human-comprehensible values for it.

	* strace.c (parse_interruptible_arg): New function.
	(init) <longopts>: Add "interruptible" long option alias for 'I'.
	(init) <case 'I'>: Call parse_interruptible_arg.
	(usage): Document new long option alias and values.
	* strace.1.in (parse_interruptible_arg): Likewise.
	* tests/options-syntax.test: Add checks for the new syntax.
	* tests/sigblock.test: Introduce -I syntax variety.
	* tests/sigign.test: Likewise.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	filter_qualify: rewrite statusstr_to_uint using find_xlat_val.
	* filter_qualify.c (*statuses): Move inside statusstr_to_uint, change
	the type to const struct xlat_data[], change the initialisation
	accordingly.
	(statusstr_to_uint): Call find_arg_val instead of open-coding search
	in a string array.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: rewrite parse_ts suffix matching using find_xlat_val.
	A known behavioural change is that suffix can have any case, which
	matches other places of option argument parsing.

	* util.c (parse_ts): Change type of units to struct xlat_data[]; move
	definition of units variable to its first usage, change its type
	to const struct xlat_data *; use find_xlat_val instead of open-coding
	search in units array.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: introduce find_xlat_val and find_arg_val.
	The commonly open-coded snippet throughout the code, especially in the
	argument parsing code, is searching in a string-value pair array of
	string, so let's provide a function (or, more precisely, two functions,
	one generic and another one that targets specifically argument parsing)
	that does precisely that, on top of existing string-value pair
	struct xlat_data type.

	* defs.h (enum find_xlat_flag_bits, enum find_xlat_flags): New
	enumerations.
	(find_xlat_val_ex, find_arg_val_): New declarations.
	(find_xlat_val, find_xlat_val_case, find_arg_val): New macros.
	* util.c (find_xlat_val_ex, find_arg_val_): New functions.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall: handle fd printing regardless of show_fd_path setting.
	As of now, the way the higher 32 bits of the syscall return value
	are printed depends on the show_fd_path (-y) setting: if it is set,
	they are trimmed, which is pretty inconsistent.

	* syscall.c (syscall_exiting_trace) <case RVAL_FD>: Check if tcp->u_rval
	fits in int before passing it to printfd instead of a (redundant) show_fd_path
	check (that is also done inside printfd itself).
	* tests/bpf-success-long-y.c: New file.
	* tests/bpf-success-long-y.test: New test.
	* tests/.gitignore: Add bpf-success-long-y.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add bpf-success-long-y.test.
	* tests/bpf.c [!FD0_PATH] (FD0_PATH): New macro.
	[INJECT_RETVAL] (sys_bpf): Print INJECT_RETVAL as long.
	(BPF_MAP_CREATE_checks, BPF_OBJ_PIN_checks, BPF_OBJ_PIN_checks,
	BPF_PROG_ATTACH_checks, BPF_RAW_TRACEPOINT_OPEN_checks,
	BPF_TASK_FD_QUERY_checks): Append FD0_PATH to places where fd 0
	is printed.
	(print_BPF_PROG_QUERY_attr4, print_BPF_PROG_QUERY_attr5): Do not
	conditionalise part of the strings with INJECT_RETVAL > 0, as we always
	inject positive values so far.

2020-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/io_uring_register: properly handle big endian architectures.
	tests/io_uring_register.c (BE_LE): New macro.
	(main): Use BE_LE to select the address to print based on endianness.

	Fixes: v5.5~41 "io_uring: add support for IORING_REGISTER_FILES_UPDATE"

2020-02-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: typo in usage (s/milliseconds/microseconds/)
	* strace.c (usage): s/milliseconds/microseconds/

	Fixes: v5.5~14 "strace: describe -e options in the help message"

2020-02-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	printrusage: bundle rusage_t definition.
	* printrusage.c (struct kernel_old_timeval, rusage_t): New type
	definitions.
	* configure.ac (AC_CHECK_MEMBERS): Check for __ru_maxrss_word,
	__ru_ixrss_word, __ru_idrss_word, __ru_isrss_word, __ru_minflt_word,
	__ru_majflt_word, __ru_nswap_word, __ru_inblock_word, __ru_oublock_word,
	__ru_msgsnd_word, __ru_msgrcv_word, __ru_nsignals_word, __ru_nvcsw_word,
	and __ru_nivcsw_word members of struct rusage.
	* tests/waitid.c (RU_MAXRSS, RU_IXRSS, RU_IDRSS, RU_ISRSS, RU_MINFLT,
	RU_MAJFLT, RU_NSWAP, RU_INBLOCK, RU_OUBLOCK, RU_MSGSND, RU_MSGRCV,
	RU_NSIGNALS, RU_NVCSW, RU_NIVCSW): New macros.
	(sprint_rusage): Use them instead of the respective ru_* field names.

	Resolves: https://github.com/strace/strace/issues/122

2020-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	tests: fail if patterns file is not readable in match_grep.
	Otherwise, the test will not fail if the patterns file is missing.

	* tests/init.sh (match_grep): Fail in case of non-zero exit status
	of the read loop.

2020-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: turn clone_parent into a generated test.
	clone_parent.tests does nothing, only sources clone_ptrace.

	* tests/clone_parent.test: Remove.
	* tests/Makefile.am (MISC_TESTS): Remove clone_parent.test.
	* tests/gen_tests.in (clone_parent): New entry.

2020-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: support --trace syntax in run_strace_match_{diff,grep}
	* tests/init.sh (run_strace_match_diff, run_strace_match_grep): Do not
	add -e trace option if --trace is provided already.

2020-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace --help: document long option aliases of -w and -X options.
	* strace.c (usage): Document --summary-wall-clock as the long option
	alias of -w option; document --const-print-style as the long option
	alias of -X option.

	Fixes: v5.5~11 "Add long option aliases to some options"

2020-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace --help: add missing newline before "Miscellaneous:"
	* strace (usage): Add newline before "Miscellaneous:".

	Fixes: v5.5~14 "strace: describe -e options in the help message"

2020-02-10  MaJun  <majun258@linux.alibaba.com>

	csky abiv1: fix compilation error.
	struct pt_regs has no member r1, only a1.

	* linux/csky/get_scno.c (arch_get_scno) [!__CSKYABIV2__]: Replace
	csky_regs.r1 with csky_regs.a1.
	* linux/csky/set_scno.c (arch_set_scno) [!__CSKYABIV2__]: Likewise.
	* NEWS: Mention this fix.

	Fixes: v5.1~99 "Add C-SKY architecture support"

2020-02-10  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 5.5-1.
	* strace.spec.in: Likewise.

2020-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 5.5 release.
	* NEWS: Update for 5.5 release.

	Update copyright year number range.
	* COPYING: Update copyright year number range.
	* tests/COPYING: Likewise.
	* debian/copyright: Likewise.

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2020-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	maint/update_copyright_years.sh: fix concurrent execution.
	* maint/update_copyright_years.sh (process_file): Replace "continue"
	with "return".

	Fixes: v4.21~318 "maint/update_copyright_years.sh: implement concurrent execution"

2020-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	maint/update_copyright_years.sh: fix "integer expression expected" error
	* maint/update_copyright_years.sh: Check $copyright_year before use
	in arithmetic operations.

2020-02-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: produce a sensible error if -k option is used but not compiled in
	* strace.c (init) <optstring>: Do not put "k" option under
	ENABLE_STACKTRACE.
	(init) <longopts>: Do not put "stack-traces" option under
	ENABLE_STACKTRACE.
	(init) <case 'k'> [!ENABLE_STACKTRACE]: Print an error message.
	* tests/options-syntax.test: Check that the expected error message
	is printed if -k is not compiled in.

2020-02-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: move getstr/getoption from strace-V.test to init.sh.
	And rename to more generic get_config_str/get_config_option.

	* tests/strace-V.test (getstr, getoption): Rename to get_config_str
	and get_config_option, respectively.  All users updated.
	(get_config_str, get_config_option): Move ...
	* tests/init.sh: ... here.

2020-02-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/syntax: fix incorrect match_diff/macth_grep usage.
	match_diff and match_grep take the error message as the third argument
	and pass it on to fail_, while the calling code expects that they simply
	return non-zero in case of error.

	* tests/syntax.sh (check_exit_status_and_stderr,
	check_exit_status_and_stderr_using_grep): Specify the error message as
	the third argument to match_diff/match grep instead of trying to handle
	the erroneous status code.

2020-02-05  Dmitry V. Levin  <ldv@altlinux.org>

	strace: use qualify_*
	* strace.c (init): Use qualify_trace, qualify_abbrev, qualify_verbose,
	qualify_status, and qualify_signals instead of qualify.

	Complements: v5.4-100-g490bfd465 "Add long options for qualifiers"

2020-02-05  Dmitry V. Levin  <ldv@altlinux.org>

	strace: rename *_OPTION to GETOPT_*
	* strace.c (init) <enum>: Rename *_OPTION to GETOPT_*.  All users
	updated.

2020-02-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add tests for new long options.
	* tests/gen_tests.in (access): Check --trace-path.
	(fstatat64, lstat, lstat64, newfstatat, stat, stat64, statx): Check
	--no-abbrev and --trace-path.
	* tests/options-syntax.test: Check --attach, --detach-on, --output,
	--summary, --summary-only, --summary-wall-clock, --string-limit,
	--const-print-style, --user, and --instruction-pointer.
	* tests/qual_syscall.test: Check --columns.
	* tests/strace-E.test: Check --env.
	* tests/strace-S.test: Check --summary-sort-by.
	* tests/strace-k.test: Check --stack-trace.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add long option aliases to some options.
	* strace.c (init) <longopts>: Add "columns" for "a",
	"detach-on" for "b", "summary-only" for "c", "summary" for "C",
	"env" for "E", "instruction-pointer" for "i", "stack-traces" for "k",
	"output" for "o", "attach" for "p", "trace-path" for "P", "string-limit"
	for "s", "summary-sort-by" for "S", "user" for "u", "no-abbrev" for "v",
	"summary-wall-clock" for "w", and "const-print-style" for "X".
	(usage): Document it.
	* strace.1.in: Likewise.

2020-02-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add tests for new long options.
	* tests/filtering_fd-syntax.test: Check --read and --write.
	* tests/filtering_syscall-syntax.test: Check --trace, --abbrev,
	--verbose, --raw, --inject, and --fault.
	* tests/gen_tests.in: Check --status.
	* tests/options-syntax.test: Check --kvm.
	* tests/qual_signal.test: Check --signal.
	* tests/qual_syscall.test: Check --trace, --abbrev, --raw,
	and --verbose.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add long options for qualifiers.
	Add a long option for each respective -e qualifier.

	* defs.h (qualify_trace, qualify_abbrev, qualify_verbose, qualify_raw,
	qualify_signals, qualify_status, qualify_read, qualify_write,
	qualify_fault, qualify_inject, qualify_kvm): Add declarations.
	* filter_qualify.c (qualify_trace, qualify_abbrev, qualify_verbose,
	qualify_raw, qualify_signals, qualify_status, qualify_read,
	qualify_write, qualify_fault, qualify_inject, qualify_kvm): Remove
	static qualifier.
	* strace.1.in: Document long option aliases.
	* strace.c (usage): Likewise.
	(init) <enum>: Add QUAL_TRACE_OPTION, QUAL_ABBREV_OPTION,
	QUAL_VERBOSE_OPTION, QUAL_RAW_OPTION, QUAL_SIGNAL_OPTION,
	QUAL_STATUS_OPTION, QUAL_READ_OPTION, QUAL_WRITE_OPTION,
	QUAL_FAULT_OPTION, QUAL_INJECT_OPTION, QUAL_KVM_OPTION.
	(init) <longopts>: Add items for qualifiers.
	(init): Handle new *_OPTION options.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: describe -e options in the help message.
	So it is a bit more clear how to use them (especially such elaborate
	ones as -e inject).

	* strace.c (usage): Add -e trace, -e signal, and -e status option
	descriptions to the Filtering section; add -e abbrev, -e verbose,
	-e raw, -e read, -e write, and -e kvm option descriptions to the Output
	format section; add Tampering section with description of -e inject
	and -e fault options.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: document supported constant formats in the usage message.
	* strace.c (usage): Provide the list of supported formats
	for the -X option.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: capitalise placeholders in option declarations in usage.
	It is already capitalised in descriptions (rather inconsistently,
	however), the capitalisation is already used for "PROG" and "ARGS",
	and it allows consistently distinguish placeholders from literals.
	The manual page does not need the same treatment, it seems,
	as the italic script is used there for that purpose.

	Capitalise the "usage:" part, as it is often capitalised in the usage
	messages of some other programs.

	* strace.c (usage): Capitalise "expr", "column", "interruptible",
	"path", "file", "var", "val", "strsize", "pid", "format", "overhead",
	"sortby" placeholders where appropriate. Capitalise the first letter
	in "usage:".

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: sync up help message with the manual page.
	They had discrepancies in section/optoin order for no reason.

	* strace.c (usage): Move -e option in a separate General section,
	put the rest of the sections in Startup, Tracing, Filtering, Output
	format, Statistics, Miscellaneous order, as it is in the manual page;
	add -ttt option description, swap -E var=val and -E var options, put
	-A option description after -o, put --seccomp-bpf option description
	after -h.
	* NEWS: Mention this change.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1: use .UR macro for the link to the mailing list.
	* strace.1.in (.SH REPORTING BUGS): Use .UR for the mailing list link.

	strace.1: s/PERSONALITY/PERSONALITIES/
	* strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Change to...
	(.SH "MULTIPLE PERSONALITIES SUPPORT"): ...this.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1: remove commas between option variants.
	Comma is not historically used in strace.1 to separate option aliases.

	* strace.1.in (.SS Miscellaneous): Remove comma after -d, -h, and -V
	declarations.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1: re-factor -e trace description.
	Moreover, -e features description was incorrect ("?" option
	is applicable only to -e trace)

	* strace.1.in: Re-factor -e trace description.
	* NEWS: Mention this change.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	printrusage: use PRINT_FIELD_U instead of PRINT_RUSAGE_MEMBER.
	As the former is standard.

	* printrusage.c (printrusage, printrusage32): Use PRINT_FIELD_U instead
	of PRINT_RUSAGE_MEMBER.
	(printrusage, printrusage32) <PRINT_RUSAGE_MEMBER>: Remove.

2020-02-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	filter_qualify.c: make statuses definition a bit more explicit.
	Avoid imlicit relying on the same ordering of statuses in the enum
	and in the string array.

	* filter_qualify.c (statuses): Add index designators to initialisers.

2020-02-03  Dmitry V. Levin  <ldv@altlinux.org>

	strace: add --debug alias for -d.
	* strace.1.in (.SH OPTIONS): Document --debug option.
	* strace.c (usage): Likewise.
	(longopts): Add "debug" as an alias to "d".
	* tests/options-syntax.test: Check -d and --debug options.

2020-02-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	io_uring: add support of wq_fd field decoding to io_uring_setup.
	Introduced by Linux commit v5.5-rc7-74-g24369c2e3bb0.

	* configure.ac (AC_CHECK_HEADERS([linux/io_uring.h])): Add
	struct io_uring_params.wq_fd field check.
	* io_uring.c (io_uring_setup): Print wq_fd field.
	* tests/io_uring_setup.c: Update expected output.
	* types/io_uring.h (struct_io_uring_params): Add wq_fd field.
	* xlat/uring_setup_flags.in (IORING_SETUP_ATTACH_WQ): New constant.

2020-02-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add IORING_SETUP_CLAMP to uring_setup_flags.
	* xlat/uring_setup_flags.in (IORING_SETUP_CLAMP): New constant,
	introduced by Linux commit v5.5-rc7-43-g8110c1a6212e.
	* tests/io_uring_setup.c: Update expected output.

	xlat: update uring_setup_features constants.
	* xlat/uring_setup_features.in (IORING_FEAT_RW_CUR_POS): New constant,
	introduced by Linux commit v5.5-rc7-35-gba04291eb66e.
	(IORING_FEAT_CUR_PERSONALITY): New constant, introduced by Linux commit
	v5.5-rc7-72-gcccf0ee83455.

2020-01-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.

2020-01-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide values to ptrace_cmds.
	Use the output of maint/gen_xlat_defs.sh and perform some re-ordering.

	* xlat/ptrace_cmds.in: Provide values to constants.
	(PTRACE_GETREGS, PTRACE_SETREGS, PTRACE_GETFPREGS, PTRACE_SETFPREGS,
	PTRACE_GETFPXREGS, PTRACE_SETFPXREGS, PTRACE_GETHBPREGS,
	PTRACE_SETHBPREGS, PTRACE_GETREGS64, PTRACE_SETREGS64, PTRACE_SYSEMU,
	PTRACE_SYSEMU_SINGLESTEP): Move to arch-specific section.
	(PTRACE_SET_SYSCALL): Move to arm section.
	(PTRACE_GETVRREGS, PTRACE_SETVRREGS): Move to powerpc section.
	(PPC_PTRACE_POKEUSR_3264, PPC_PTRACE_PEEKUSR_3264,
	PPC_PTRACE_POKEDATA_3264, PPC_PTRACE_POKETEXT_3264,
	PPC_PTRACE_PEEKDATA_3264, PPC_PTRACE_PEEKTEXT_3264): Add constants.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2020-01-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	maint: gen_xlat_defs.sh updates.
	Allow whitespace between "#" and "define" and allow passing glob
	expressions to the -a option.

	* maint/gen_xlat_defs.sh: Add "[[:space:]]*" between "#" and "define"
	in regular expressions; match "[^:]*" instead of "$ARCH_DEFS_FILE".

2020-01-28  Dmitry V. Levin  <ldv@altlinux.org>

	.mailmap: add more entries to avoid duplication in CREDITS.

2020-01-27  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v5.5.
	* linux/32/ioctls_inc_align16.h: Update from linux v5.5
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/powerpc/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

	maint: update for linux v5.5.
	* maint/ioctls_sym.sh: Define UL and ULL macros for every processed
	file.  Add a workaround for linux/platform_data/cros_ec_chardev.h file.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	keyctl: implement KEYCTL_CAPABILITIES operation decoding.
	Introduced by Linux kernel commit v5.3-rc1~189^2.

	* xlat/keyctl_caps0.in: New file.
	* xlat/keyctl_caps1.in: Likewise.
	* keyctl.c: Include "xlat/keyctl_caps0.h" and "xlat/keyctl_caps1.h".
	(print_keyctl_caps, keyctl_capabilities): New functions.
	(SYS_FUNC(keyctl)) <case KEYCTL_CAPABILITIES>: Call keyctl_capabilities.
	* tests/keyctl.c: Add checks.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	keyctl: implement KEYCTL_MOVE operation decoding.
	Introduced by Linux kernel commit v5.3-rc1~189^2.

	* xlat/keyctl_move_flags.in: New file.
	* keyctl.c: Include "xlat/keyctl_move_flags.h".
	(keyctl_move): New function.
	(SYS_FUNC(keyctl)) <case KEYCTL_MOVE>: Call it.
	* tests/keyctl.c: Add checks.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	keyctl: implement KEYCTL_PKEY_* operations decoding.
	Introduced by Linux kernel commit v5.0-rc1~453^2~20.

	* configure.ac (AC_CHECK_TYPES): Check for struct keyctl_pkey_params
	and struct keyctl_pkey_query.
	* keyctl.c: Include "xlat/keyctl_pkey_ops.h".
	(struct keyctl_pkey_query, struct keyctl_pkey_params): New type
	definitions.
	(print_pkey_query, keyctl_pkey_query, fetch_print_pkey_params,
	keyctl_pkey_op): New functions.
	(SYS_FUNC(keyctl)) <case KEYCTL_PKEY_QUERY>: Call keyctl_pkey_query.
	(case KEYCTL_PKEY_ENCRYPT, case KEYCTL_PKEY_DECRYPT, case
	KEYCTL_PKEY_SIGN, case KEYCTL_PKEY_VERIFY): Call keyctl_pkey_op.
	* xlat/keyctl_pkey_ops.in: New file.
	* tests/keyctl.c: Add checks.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	keyctl: do not open-code struct keyctl_kdf_params.__spare printing.
	* keyctl.c (keyctl_dh_compute): Replace open-coded printing of
	struct keyctl_kdf_params.__spare with a pair of IS_ARRAY_ZERO and
	PRINT_FIELD_ARRAY calls.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	keyctl: consolidate xlat headers in the beginning of the file.
	This gives a better overview of the xlat usage.

	* keyctl.c: Move "xlat/key_perms.h", "xlat/key_reqkeys.h", and
	"xlat/keyctl_commands.h" includes to the beginning of the file.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_tc: add support for TCA_STATS_PKT64 attribute decoding.
	Introduced by Linux kernel commit v5.5-rc1~174^2~219^2.

	* configure.ac (AC_CHECK_DECLS): Check for TCA_STATS_PKT64.
	* rtnl_tc.c (tca_stats_nla_decoders) <[TCA_STATS_PKT64]>: New array
	item, call decode_nla_u64.
	* xlat/rtnl_tca_stats_attrs.in (TCA_STATS_PKT64): New constant.
	* tests/nlattr_tc_stats.c: Add TCA_STATS_PKT64 attribute decoding check.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_tc_action: add support for TCA_ACT_FLAGS attribute decoding.
	Introduced by Linux kernel commit v5.5-rc1~174^2~265^2~2.

	* xlat/rtnl_tca_act_flags.in: New file.
	* xlat/rtnl_tc_action_attrs.in (TCA_ACT_FLAGS): New constant.
	* configure.ac (AC_CHECK_DECLS): Check for TCA_ACT_PAD, TCA_ACT_COOKIE,
	and TCA_ACT_FLAGS.
	* rtnl_tc_action.c: Include <linux/pkt_cls.h> and
	"xlat/rtnl_tca_act_flags.h".
	(decode_tca_act_flags): New function.
	(tcamsg_nla_decoders) <[TCA_ACT_FLAGS]>: New array element, use
	decode_tca_act_flags as a decoder.
	* tests/nlattr_tcamsg.c: Add checks.

2020-01-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	io_uring: add support for IORING_REGISTER_FILES_UPDATE.
	Introduced by Linux kernel commits v5.5-rc1~204^2~61 and v5.5~1^2~2.

	* io_uring.c (print_io_uring_files_update): New function.
	(SYS_FUNC(io_uring_register)) <case IORING_REGISTER_FILES_UPDATE>: Call
	it.
	* types/io_uring.h (struct_io_uring_files_update): New type definition.
	* xlat/uring_register_opcodes.in (IORING_REGISTER_FILES_UPDATE): New
	constant.
	* tests/io_uring_register.c (main): Update invalid op check.
	[HAVE_STRUCT_IO_URING_FILES_UPDATE]: Add checks.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	io_uring: check struct io_* types automatically.
	Move definitions of struct_io_sqring_offsets, struct_io_cqring_offsets,
	and struct_io_uring_params to a separate types/ header file.

	* configure.ac (AC_CHECK_TYPES): Remove struct io_sqring_offsets,
	struct io_cqring_offsets, and struct io_uring_params.
	(AC_CHECK_MEMBERS): Remove struct io_cqring_offsets.resv.
	* io_uring.c: Include "types/io_uring.h" instead of <linux/io_uring.h>.
	[HAVE_STRUCT_IO_CQRING_OFFSETS]: Remove static_assert checks of
	sizeof(struct io_sqring_offsets).
	(struct_io_sqring_offsets, struct_io_cqring_offsets,
	struct_io_uring_params): Move to ...
	* types/io_uring.h: ... new file.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	evdev: check struct input_* types automatically.
	Move definitions of struct_input_absinfo, struct_input_keymap_entry,
	and struct_input_mask to a separate types/ header file.

	* configure.ac (AC_CHECK_TYPES): Remove struct input_keymap_entry and
	struct input_mask.
	(AC_CHECK_MEMBERS): Remove struct input_absinfo.resolution.
	* evdev.c: Include "types/evdev.h" instead of <linux/input.h>.
	Remove static_assert checks.
	(struct_input_absinfo, struct_input_keymap_entry, struct_input_mask):
	Move to ...
	* types/evdev.h: ... new file.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	rtnl_route: check struct rta_mfc_stats and struct rtvia automatically.
	Move definitions of struct_rta_mfc_stats and struct_rtvia to a separate
	types/ header file.

	* configure.ac (AC_CHECK_TYPES): Remove struct rta_mfc_stats and
	struct rtvia.
	* rtnl_route.c: Include "types/rtnl_route.h" instead of "netlink.h" and
	<linux/rtnetlink.h>.
	[HAVE_STRUCT_RTA_MFC_STATS, HAVE_STRUCT_RTVIA]: Remove static_assert checks.
	(struct_rta_mfc_stats, struct_rtvia): Move to ...
	* types/rtnl_route.h: ... new file.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	rtnl_mdb: check struct br_mdb_entry and struct br_port_msg automatically
	Move definitions of struct_br_mdb_entry and struct_br_port_msg
	to a separate types/ header file.

	* configure.ac (AC_CHECK_TYPES): Remove struct br_mdb_entry and
	struct br_port_msg.
	* rtnl_mdb.c: Include "types/rtnl_mdb.h" instead of <netinet/in.h> and
	<linux/if_bridge.h>.
	[HAVE_STRUCT_BR_PORT_MSG, HAVE_STRUCT_BR_NDB_ENTRY]: Remove static_assert checks.
	(struct_br_mdb_entry, struct_br_port_msg): Move to ...
	* types/rtnl_mdb.h: ... new file.
	* tests/nlattr_mdba_router_port.c: Include <netinet/in.h> before
	<linux/if_bridge.h> to obtain a definition of struct in6_addr needed
	for struct br_mdb_entry.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	rtnl_neightbl: check all struct ndt_* types automatically.
	Move definitions of struct_ndt_* types to a separate types/ header file.

	* configure.ac (AC_CHECK_TYPES): Remove struct ndt_config and
	struct ndt_stats.
	(AC_CHECK_MEMBERS): Remove struct ndt_stats.ndts_table_fulls.
	* rtnl_neightbl.c: Include "types/rtnl_neightbl.h".
	[HAVE_LINUX_NEIGHBOUR_H]: Remove.
	[HAVE_STRUCT_NDT_CONFIG, HAVE_STRUCT_NDT_STATS]: Remove static_assert
	checks.
	(struct_ndt_config, struct_ndt_stats): Move to ...
	* types/rtnl_neightbl.h: ... new file.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	rtnl_link: check all struct rtnl_link_stats* and struct ifla_port_vsi types automatically
	Move definitions of struct_rtnl_link_stats* and struct_ifla_port_vsi
	types to a separate types/ header file.

	* configure.ac (AC_CHECK_TYPES): Remove struct ifla_bridge_id,
	struct ifla_port_vsi and struct rtnl_link_stats64.
	(AC_CHECK_MEMBERS): Remove struct rtnl_link_stats.rx_nohandler and
	struct rtnl_link_stats64.rx_nohandler.
	* rtnl_link.c: Include "types/rtnl_link.h".
	[HAVE_LINUX_IF_LINK_H]: Remove.
	[HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER,
	HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER, HAVE_STRUCT_IFLA_PORT_VSI]:
	Remove static_assert checks.
	(struct_rtnl_link_stats, struct_rtnl_link_stats64,
	struct_ifla_port_vsi): Move to ...
	* types/rtnl_link.h: ... new file.
	(struct_ifla_bridge_id): New typedef.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	netlink_crypto: check all struct crypto_* types automatically.
	Move definitions of struct_crypto_* types to a separate types/ header
	file.

	* configure.ac (AC_CHECK_TYPES): Remove struct crypto_*.
	* netlink_crypto.c: Include "types/cryptouser.h".
	[HAVE_LINUX_CRYPTOUSER_H, !CRYPTO_MAX_NAME]: Remove.
	[HAVE_STRUCT_CRYPTO_USER_ALG, HAVE_STRUCT_CRYPTO_REPORT_HASH,
	HAVE_STRUCT_CRYPTO_REPORT_CIPHER, HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER,
	HAVE_STRUCT_CRYPTO_REPORT_AEAD, HAVE_STRUCT_CRYPTO_REPORT_RNG]: Remove
	static_assert checks.
	(struct_crypto_user_alg, struct_crypto_report_hash,
	struct_crypto_report_cipher, struct_crypto_report_blkcipher,
	struct_crypto_report_aead, struct_crypto_report_rng): Move to ...
	* types/cryptouser.h: ... new file.

2020-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	types: new infrastructure for automatic checking of structure types.
	* types/gen.sh: New file.
	* bootstrap: Invoke it.
	* types/find_last_type_fields.awk: New file.
	* configure.ac: Invoke st_CHECK_TYPES.
	(AM_INIT_AUTOMAKE): Add subdir-objects.
	* Makefile.am: Include types/Makemodule.am.
	(ACLOCAL_AMFLAGS): Add -I types.
	(strace_SOURCES): Add $(TYPES_HEADER_FILES).
	(strace_SOURCES_check): Add $(TYPES_CHECK_FILES).
	(EXTRA_DIST): Add types/find_last_type_fields.awk and types/gen.sh.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add strace-k-p test.
	Add a check of the stack unwinding for attached processes.

	* tests/stack-fcall-attach.c: New file.
	* tests/strace-k-p.expected: Likewise.
	* tests/strace-k-p.test: New test.
	* tests/Makefile.am (EXTRA_DIST): Add strace-k-p.expected and strace-k-p.test.
	(STACKTRACE_TESTS): Add strace-k-p.test
	(check_PROGRAMS): Add stack-fcall-attach.
	(stack_fcall_attach_SOURCES): New variable.
	* tests/stack-fcall.c: Include "tests.h" and <unistd.h>.
	[!ATTACH_MODE] (ATTACH_MODE): Define to 0.
	(main) [ATTACH_MODE]: Wait a bit.
	* tests/strace-k.test: Add attach mode.

	Complements: v5.4-18-g69b2c33 "unwind-libdw: fix initialization of libdwfl cache"

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ci: enable building for x32 and x86 targets with the latest gcc and headers

	xlat: add KEY_PRIVACY_SCREEN_TOGGLE and KEY_KBD_LCD_MENU* to evdev_keycode
	* xlat/evdev_keycode.in (KEY_PRIVACY_SCREEN_TOGGLE): New constant,
	introduced by Linux commit v5.5-rc1~6^2^2~3.
	(KEY_KBD_LCD_MENU1, KEY_KBD_LCD_MENU2, KEY_KBD_LCD_MENU3,
	KEY_KBD_LCD_MENU4, KEY_KBD_LCD_MENU5): New constants, introduced by
	Linux commit v5.5-rc1~6.

	xlat: add STATX_ATTR_VERITY to statx_attrs.
	* xlat/statx_attrs.in (STATX_ATTR_VERITY): New constant, introduced
	by Linux commit v5.5-rc1~192^2~3.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	perf: decode PERF_SAMPLE_AUX flag and aux_sample_size field.
	Introduced by Linux commit v5.5-rc1~152^2~9.

	* configure.ac (AC_CHECK_MEMBERS): Check
	for struct perf_event_attr.__reserved_2
	and struct perf_event_attr.aux_sample_size.
	* perf.c (print_perf_event_attr): Print __reserved_2 field if non-zero;
	print aux_sample_size field.
	* perf_event_struct.h (struct perf_event_attr): Add aux_sample_size
	and __reserved_3 fields.
	* tests/perf_event_open.c: Add checks for nrw struct sizes, fields,
	and PERF_SAMPLE_AUX flag.
	* xlat/perf_attr_size.in (PERF_ATTR_SIZE_VER6): New constant.
	* xlat/perf_event_sample_format.in (PERF_SAMPLE_AUX): Likewise.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add PPC_CMM_MAGIC to fsmagic.
	* xlat/fsmagic.in (PPC_CMM_MAGIC): New constant, introduced by Linux
	commit v5.5-rc1~110^2~59.

	xlat: update sock_sctp_options constants.
	* xlat/sock_sctp_options.in (SCTP_PEER_ADDR_THLDS_V2): New constant,
	introduced by Linux commit v5.5-rc1~174^2~159^2.
	(SCTP_EXPOSE_POTENTIALLY_FAILED_STATE): New constant, introduced
	by Linux commit v5.5-rc1~174^2~159^2~2.

	xlat: add TIPC_NODELAY to sock_tipc_options.
	* xlat/sock_tipc_options.in (TIPC_NODELAY): New constant, introduced
	by Linux commit v5.5-rc1~174^2~274.

	xlat: add IORING_SETUP_CQSIZE to uring_setup_flags.
	* xlat/uring_setup_flags.in (IORING_SETUP_CQSIZE): New constant,
	introduced by Linux commit v5.5-rc1~204^2~60.
	* tests/io_uring_setup.c (main): Update expected output.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	io_uring: implement decoding of struct io_uring_params.features.
	Introduced by Linux commit v5.4-rc1~28^2~17.

	* xlat/uring_setup_features.in: New file.
	* io_uring.c: Include "xlat/uring_setup_features.h".
	(struct_io_uring_params): Add features field, decrease resv field size.
	[HAVE_STRUCT_IO_URING_PARAMS]: Add checks for the
	struct io_uring_params.resv field.
	(SYS_FUNC(io_uring_setup)): Decode struct io_uring_params.features
	field.
	* tests/io_uring_setup.c: Update the expected output.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	io_uring: add support for IORING_REGISTER_EVENTFD and IORING_UNREGISTER_EVENTFD
	Introduced by Linux commit v5.2-rc1~148^2~3.

	* xlat/uring_register_opcodes.in (IORING_REGISTER_EVENTFD,
	IORING_UNREGISTER_EVENTFD): New constants.
	* io_uring.c (SYS_FUNC(io_uring_register)): Wire up
	IORING_REGISTER_EVENTFD.
	* tests/io_uring_register.c (main): Add checks for the new operations.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	io_uring: print io_sqring_offsets and io_cqring_offsets reserved fields.
	* io_uring.c (SYS_FUNC(io_uring_setup)): Print
	struct io_sqring_offsets.resv1, struct io_sqring_offsets.resv2, and
	struct io_cqring_offsets.resv if non-zero.
	* tests/io_uring_setup.c (main): Update expected output.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	io_uring: decode io_uring_params.resv with IS_ARRAY_ZERO and PRINT_FIELD_ARRAY
	That also makes struct io_uring_params.resv printing in line with
	the rest of array printing formatting.

	* io_uring.c (SYS_FUNC(io_uring_setup)): Replace open-coded resv field
	non-zeroeness check/printing with IS_ARRAY_ZERO and PRINT_FIELD_ARRAY
	macro invocations.
	* tests/io_uring_setup.c (main): Use square brackets instead of curly
	braces for enclosing struct io_uring_params.resv elements.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Rework interface for printing local arrays.
	As it should be simpler to get it used.  In order to make the common
	case as simple as possible, split it into print_local_array_ex with all
	the arguments and convert print_local_array to a macro wrapper that gets
	the element count and size from the provided array argument itself,
	along with dropping all the arguments that are not expected to be
	commonly used.

	* defs.h (print_local_array_ex): Rename from print_local_array,
	remove elem_buf argument, add index_xlat and index_dflt arguments.
	(print_local_array): New macro wrapper from print_local_array_ex.
	* evdev.c (decode_bitset): Remove unused elem variable, update the
	print_local_array call.
	* print_fields.h (PRINT_FIELD_ARRAY): New macro wrapper for printing
	array fields.

2020-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	io_uring: de-indent the switch case statements.
	* io_uring.c (SYS_FUNC(io_uring_register)): Decrease indentation for
	switch case labels and the related code.

	io_uring: do not depend on kernel header definitions.
	* configure.ac (AC_CHECK_HEADERS): Remove linux/io_uring.h.
	(AC_CHECK_HEADERS): Add a separate check for linux/io_uring.h header
	that additionally performs AC_CHECK_TYPES on struct io_sqring_offsets,
	struct io_cqring_offsets, and struct io_uring_params, and
	AC_CHECK_MEMBERS on struct io_cqring_offsets.resv, struct
	io_uring_params.features, and struct io_uring_params.resv.
	* io_uring.c [!HAVE_LINUX_IO_URING_H]: Include "print_fields.h".
	(struct_io_sqring_offsets, struct_io_cqring_offsets,
	struct_io_uring_params): New struct type definitions.
	[HAVE_STRUCT_IO_SQRING_OFFSETS]: Check struct_io_sqring_offsets size
	against struct io_sqring_offsets.
	[HAVE_STRUCT_IO_CQRING_OFFSETS]: Check struct_io_cqring_offsets size
	against struct io_cqring_offsets.
	[HAVE_STRUCT_IO_CQRING_OFFSETS][HAVE_STRUCT_IO_CQRING_OFFSETS_RESV]:
	Check struct_io_cqring_offsets.resv offset and size against
	struct io_cqring_offsets.resv.
	[HAVE_STRUCT_IO_CQRING_OFFSETS][!HAVE_STRUCT_IO_CQRING_OFFSETS_RESV]:
	Fail unconditionally.
	[HAVE_STRUCT_IO_URING_PARAMS]: Check struct_io_cqring_offsets size
	against struct io_cqring_offsets.
	(SYS_FUNC(io_uring_setup)): Remove HAVE_LINUX_IO_URING_H guard.
	* tests/io_uring_setup.c: Add a workaround for kernel headers where
	struct io_uring_params.features is defined.

2020-01-21  Chunmei Xu  <xuchunmei@linux.alibaba.com>
	    Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: properly fix printing errno in modify_ldt test.
	The fix in commit v5.4-40-g2939bbd is incorrect, as it leads to errno
	information not being expected by the test:

	    modify_ldt(0, NULL, 0) = -1
	    modify_ldt(-629534633, 0xffffffffffffffff, 16045756814261206767) = -1
	    modify_ldt(-629534633, 0x7f354d38a000, 0) = -1
	    ...

	* tests/modify_ldt.c (printrc): Avoid only errno update in case of rc
	being -1 and not the whole printing routine.

	Complements: v5.4-40-g2939bbd "tests: fix printing errno in modify_ldt test"
	Resolves: https://github.com/strace/strace/issues/118
	Resolves: https://github.com/strace/strace/issues/119

2020-01-17  Dmitry V. Levin  <ldv@altlinux.org>

	Make SysV IPC decoders on 32-bit architectures 64-bit time_t compatible.
	When libc moves to 64-bit time_t on 32-bit architectures, IPC
	definitions provided by sys/ipc.h, sys/msg.h, sys/sem.h, and sys/shm.h
	header files become unsuitable for SysV IPC decoders.

	Prepare for this change by using Linux kernel uapi headers instead of
	libc headers as the preferred source of SysV IPC definitions.

	Fall back to libc headers if Linux kernel uapi headers have known bugs
	in their SysV IPC definitions.

	* configure.ac (AC_CHECK_SIZEOF): Check for struct msqid64_ds in
	<linux/msg.h>.
	* m4/mpers.m4 (st_MPERS): Likewise.
	* ipc_defs.h: Prioritize HAVE_LINUX_IPC_H over HAVE_SYS_IPC_H.
	[HAVE_LINUX_IPC_H && !IN_MPERS]: Undefine HAVE_LINUX_IPC_H if
	ARCH_SIZEOF_STRUCT_MSQID64_DS != SIZEOF_STRUCT_MSQID64_DS.
	[HAVE_LINUX_IPC_H && MPERS_IS_m32]: Undefine HAVE_LINUX_IPC_H if
	ARCH_M32_SIZEOF_STRUCT_MSQID64_DS != M32_SIZEOF_STRUCT_MSQID64_DS.
	[HAVE_LINUX_IPC_H && MPERS_IS_mx32]: Undefine HAVE_LINUX_IPC_H if
	ARCH_MX32_SIZEOF_STRUCT_MSQID64_DS != MX32_SIZEOF_STRUCT_MSQID64_DS.
	* linux/sparc/arch_defs_.h (ARCH_SIZEOF_STRUCT_MSQID64_DS): New macro.
	* linux/sparc64/arch_defs_.h (ARCH_M32_SIZEOF_STRUCT_MSQID64_DS):
	Likewise.
	* linux/x32/arch_defs_.h (ARCH_SIZEOF_STRUCT_MSQID64_DS): Likewise.
	* linux/x86_64/arch_defs_.h (ARCH_MX32_SIZEOF_STRUCT_MSQID64_DS):
	Likewise.

	Reported-by: Khem Raj <raj.khem@gmail.com>
	Reported-by: Rich Felker <dalias@aerifal.cx>
	Resolves: https://github.com/strace/strace/issues/116

2020-01-17  Dmitry V. Levin  <ldv@altlinux.org>

	Consistently choose SysV IPC definitions between libc and uapi providers
	strace decoders should use SysV IPC definitions provided by either libc
	or Linux kernel uapi headers, not a random mix of them.

	* configure.ac (AC_CHECK_HEADERS): Remove linux/msg.h, linux/sem.h,
	linux/shm.h, sys/msg.h, sys/sem.h, and sys/shm.h.
	* ipc_defs.h (MSG_H_PROVIDER, SEM_H_PROVIDER, SHM_H_PROVIDER,
	NAME_OF_STRUCT_MSQID_DS, NAME_OF_STRUCT_SHMID_DS,
	NAME_OF_STRUCT_IPC_PERM_KEY): New macros.
	* ipc_msg.c: Include MSG_H_PROVIDER instead of <sys/msg.h> or
	<linux/msg.h>.
	* ipc_msgctl.c: Likewise.
	(msqid_ds_t): Redefine to struct NAME_OF_STRUCT_MSQID_DS.
	(print_msqid_ds): Replace __key with NAME_OF_STRUCT_IPC_PERM_KEY.
	* ipc_sem.c: Include SEM_H_PROVIDER instead of <sys/sem.h> or
	<linux/sem.h>.
	(print_sembuf): Define unconditionally.
	(tprint_sembuf_array): Use print_sembuf unconditionally.
	* ipc_shm.c: Include SHM_H_PROVIDER instead of <sys/shm.h> or
	<linux/shm.h>.
	* ipc_shmctl.c: Likewise.
	(shmid_ds_t): Redefine to struct NAME_OF_STRUCT_SHMID_DS.
	(print_shmid_ds): Replace __key with NAME_OF_STRUCT_IPC_PERM_KEY.
	* print_msgbuf.c: Include MSG_H_PROVIDER instead of <sys/msg.h>.

2020-01-17  Dmitry V. Levin  <ldv@altlinux.org>

	Consistently use ipc_defs.h.
	Include "ipc_defs.h" in all decoder files that also include
	one of system ipc header files.

	* ipc_shm.c: Include "ipc_defs.h".
	* print_msgbuf.c: Likewise.

2020-01-17  Dmitry V. Levin  <ldv@altlinux.org>

	Consistently use sizeof_field macro.
	* gen_bpf_attr_check.sh (SoM): Remove.
	Replace SoM with sizeof_field.
	* sockaddr.c (SIZEOF_SA_FAMILY): Use sizeof_field macro.
	* socketutils.c (UNIX_PATH_MAX): Likewise.

2020-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	macros.h: introduce sizeof_field macro.
	Handy for field size checks.

	* macros.h (sizeof_field): New macro.
	(offsetofend): Use it.

2020-01-17  Dmitry V. Levin  <ldv@altlinux.org>

	tests: consistently use offsetofend macro.
	* tests/msg_control.c (MIN_SIZE_OF): Remove.
	(test_scm_rights1, test_scm_rights2): Replace MIN_SIZE_OF with
	offsetofend.

2020-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: fix printing errno in modify_ldt test.
	Before this change, the test expected that the syscall always returns
	a value of type int, which is not the case when the Linux kernel
	is built with CONFIG_MODIFY_LDT_SYSCALL disabled.

	* tests/modify_ldt.c (printrc): Do not mangle errno if rc is not in
	the suitable range.

	Resolves: https://github.com/strace/strace/issues/118

2020-01-15  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build with glibc-2.31 and Linux kernel headers < 5.3.
	PTRACE_GET_SYSCALL_INFO support was added in strace since version 4.26
	released in December 2018, in Linux kernel headers since version 5.3
	released in September 2019, and in glibc since version 2.31 released
	in February 2020.  strace is expected to support all reasonable
	combinations of Linux kernel header versions and glibc versions, in
	particular, in cases when PTRACE_GET_SYSCALL_INFO definitions are not
	available in system headers or available only in Linux kernel headers
	or glibc.  Due to the longer release cycle of glibc compared to Linux
	kernel, it's more likely to have PTRACE_GET_SYSCALL_INFO definitions
	provided by <linux/ptrace.h> rather than <sys/ptrace.h>.

	This change fixes build in a less likely environment when
	PTRACE_GET_SYSCALL_INFO definitions are provided by <sys/ptrace.h> only,
	e.g. with glibc >= 2.31 and Linux kernel headers < 5.3.

	* configure.ac (AC_CHECK_TYPES): Check for struct __ptrace_syscall_info
	in <sys/ptrace.h>, check for struct ptrace_syscall_info in
	<linux/ptrace.h>.
	* ptrace.h (struct ptrace_syscall_info): Define only if
	!HAVE_STRUCT_PTRACE_SYSCALL_INFO && !HAVE_STRUCT___PTRACE_SYSCALL_INFO.
	(struct_ptrace_syscall_info): New typedef.
	* get_personality.h: Replace struct ptrace_syscall_info with
	struct_ptrace_syscall_info.
	* linux/aarch64/arch_get_personality.c: Likewise.
	* linux/powerpc64/arch_get_personality.c: Likewise.
	* linux/s390x/arch_get_personality.c: Likewise.
	* linux/sparc64/arch_get_personality.c: Likewise.
	* linux/tile/arch_get_personality.c: Likewise.
	* linux/x86_64/arch_get_personality.c: Likewise.
	* ptrace_syscall_info.c: Likewise.
	* syscall.c: Likewise.
	* tests/ptrace_syscall_info.c: Likewise.
	* NEWS: Mention this fix.

	Reported-by: Vineet Gupta <Vineet.Gupta1@synopsys.com>
	Fixes: v4.26~51 "Add definitions for PTRACE_GET_SYSCALL_INFO API"

2020-01-14  Dmitry V. Levin  <ldv@altlinux.org>

	Update NEWS.

2020-01-14  Dmitry V. Levin  <ldv@altlinux.org>

	ci: re-enable testing with the latest mainline kernel headers.
	There should be no issues with v5.5-rc6.
	This reverts commit 1aa46bd14ec63869aa2c8870bd1c261e0c3a5c65.

	* .gitlab-ci.yml (variables): Remove KBRANCH.
	* .travis.yml (env:global): Likewise.

2020-01-14  Baruch Siach  <baruch@tkos.co.il>

	filter_seccomp: fix no-MMU build.
	Move the declaration of filter_generators out of HAVE_FORK ifdef
	to fix build for no-MMU targets:

	filter_seccomp.c: In function ‘check_seccomp_filter_properties’:
	filter_seccomp.c:608:42: error: ‘filter_generators’ undeclared (first use in this function); did you mean ‘linear_filter_generator’?
	  for (unsigned int i = 0; i < ARRAY_SIZE(filter_generators); ++i) {
	                                          ^~~~~~~~~~~~~~~~~

	* filter_seccomp.c (linear_filter_generator,
	binary_match_filter_generator): Declare unconditionally.
	(filter_generator_t, filter_generators, filters, bpf_prog): Define
	unconditionally.
	* NEWS: Mention this fix.

	Fixes: v5.4~57 "filter_seccomp: list of seccomp filter generation strategies"

2020-01-14  Dmitry V. Levin  <ldv@altlinux.org>

	clone: implement decoding of new fields in struct clone_args.
	* configure.ac (AC_CHECK_TYPES): Remove struct clone_args.
	(AC_CHECK_MEMBERS): Check for struct clone_args.set_tid_size
	in <linux/sched.h>.
	* clone.c (struct strace_clone_args): Add set_tid and set_tid_size
	fields.
	(SYS_FUNC(clone3)): Decode set_tid and set_tid_size fields of struct
	clone_args introduced by Linux kernel commit v5.5-rc1~180^2~5.
	* NEWS: Mention this change.
	* tests/clone3.c: Check HAVE_STRUCT_CLONE_ARGS_SET_TID_SIZE instead of
	HAVE_STRUCT_CLONE_ARGS.
	(struct test_clone_args): Add set_tid and set_tid_size fields.
	(MAX_SET_TID_SIZE): New macro.
	(print_set_tid): New function.
	(print_clone3): Use it.
	(main): Check decoding of set_tid and set_tid_size fields.

2020-01-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

	clone: add support for clone3-specific CLONE_CLEAR_SIGHAND flag decoding
	Introduced by Linux commit v5.5-rc1~180^2~8.

	* xlat/clone3_flags.in: New file.
	* clone.c: Include "xlat/clone3_flags.h".
	(SYS_FUNC(clone3)): Use both clone_flags and clone3_flags for flag field
	decoding.
	* gcc_compat.h [!GNUC_PREREQ(3, 0)] (FAIL_BUILD_ON_ZERO): Stub
	definition.
	* tests/clone3.c: Include "xlat/clone3_flags.h".
	(ERR): New macro.
	(do_clone3_): Accept possible_errors bitmask instead of should_Fail
	flag.
	(main): Add CLONE_CLEAR_SIGHAND-specific checks, update flag-related
	checks.

2020-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests: prepare clone3 test for upcoming changes.
	* tests/clone3.c: Include <stdint.h> and "xlat/clone_flags.h"
	unconditionally.  Do not include <linux/types.h>.
	(struct clone_args): Rename to struct test_clone_args, define
	unconditionally.
	(struct_clone_args): New typedef.
	(do_clone3_, print_clone3, main): Switch all users of
	struct test_clone_args to struct_clone_args.
	(main): Use TAIL_ALLOC_OBJECT_CONST_PTR.  Move printing of "clone3("
	prefix ...
	(print_clone3): ... here to fix errno clobbering.

2020-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	travis: add s390x builds.
	* .travis.yml (matrix): Add s390x builds.

2020-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	s390: workaround Linux kernel bug in syscall_get_nr.
	Apparently, arch/s390/include/asm/syscall.h:syscall_get_nr() returns 0
	for out-of-range syscall numbers.
	This kernel bug is exposed via PTRACE_GET_SYSCALL_INFO interface.
	Workaround it by falling back to get_regs() for the zero syscall number.

	* linux/s390/check_scno.c: New file.
	* linux/s390x/check_scno.c: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* syscall.c (get_scno): Update comment.

2020-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	ci: support Travis CI's ppc64le builds.
	* .travis.yml (matrix): Add ppc64le builds.
	* ci/install-dependencies.sh: Do not attempt to install multilib
	packages on ppc64le.

2020-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip stack tracing tests when /proc/self/maps is invalid.
	Apparently, some container orchestration systems are capable of messing
	up with /proc/self/maps.  For example, one can face with the following
	garbage in Travis CI:

		$ cat /proc/self/maps
		ee72dcc0000-ee72dcd0000 r-xp 00000000 00:43 16 /var/snap/lxd/common/lxd/storage-pools/instances/containers/travis-job-strace-strace-634261782/rootfs/bin/cat
		ee72dcd0000-ee72dce0000 r--p 00000000 00:43 16 /var/snap/lxd/common/lxd/storage-pools/instances/containers/travis-job-strace-strace-634261782/rootfs/bin/cat
		ee72dce0000-ee72dcf0000 rw-p 00010000 00:43 16 /var/snap/lxd/common/lxd/storage-pools/instances/containers/travis-job-strace-strace-634261782/rootfs/bin/cat
		...

	Our stack tracing cannot work properly when /proc/self/maps is damaged
	this way.

	* tests/strace-k.test: Check that the path to executable recorded
	in /proc/self/maps is valid and skip the test if it's not the case.

2020-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	filter_seccomp: fix stack trace caching.
	* filter_seccomp.c (traced_by_seccomp): Trace all syscalls that have
	MEMORY_MAPPING_CHANGE flag set when stack tracing is enabled.
	* NEWS: Mention this fix.

	syscall: do not capture stack trace while the tracee executes strace code
	* syscall.c (syscall_entering_trace) [ENABLE_STACKTRACE]: Do not capture
	stack trace when TCB_CHECK_EXEC_SYSCALL flag is set.

2020-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	clone: simplify signal printing in legacy clone handler a bit.
	printsignal() does the right thing for quite a while (since v4.26~66
	"Stop using SIG_0") so the signal printing code can be simplified.
	This change is covered by a check in clone-flags test.

	* clone.c (SYS_FUNC(clone)): Simplify signal printing in absence
	of flags.

2020-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update KVM_* constants.
	* xlat/kvm_cap.in (KVM_CAP_PPC_GUEST_DEBUG_SSTEP): New constant
	introduced by Linux kernel commit v5.5-rc1~47^2~5^2~14.
	(KVM_CAP_ARM_NISV_TO_USER): New constant introduced by Linux kernel
	commits v5.5-rc1~47^2~16^2~3 and v5.5-rc1~47^2~16.
	(KVM_CAP_ARM_INJECT_EXT_DABT): New constant introduced by Linux kernel
	commits v5.5-rc1~47^2~16^2~2 and v5.5-rc1~47^2~16.
	* xlat/kvm_exit_reason.in (KVM_EXIT_ARM_NISV): New constant introduced
	by Linux kernel commit v5.5-rc1~47^2~16^2~3.

	xlat: add V4L2_CID_UNIT_CELL_SIZE to v4l2_control_ids.
	* xlat/v4l2_control_ids.in (V4L2_CID_UNIT_CELL_SIZE): New constant
	introduced by Linux kernel commit v5.5-rc1~143^2^2~223.

	xlat: add V4L2_CTRL_TYPE_AREA to v4l2_control_types.
	* xlat/v4l2_control_types.in (V4L2_CTRL_TYPE_AREA): New constant
	introduced by Linux kernel commit v5.5-rc1~143^2^2~225.
	* configure.ac (V4L2_CTRL_TYPE_U8, V4L2_CTRL_TYPE_U16,
	V4L2_CTRL_TYPE_U32): Add missing definition checks.
	(V4L2_CTRL_TYPE_AREA): Add corresponding definition check.

	xlat: add KEY_MACRO* definitions to evdev_keycode.
	* xlat/evdev_keycode.in: Add new constants introduced by Linux kernel
	commit v5.5-rc1~92^2~1^2~8.

	xlat: add AUDIT_ANOM_CREAT to nl_audit_types.
	* xlat/nl_audit_types.in (AUDIT_ANOM_CREAT): New constant introduced
	by Linux kernel commit v5.5-rc1~104^2~1.

	prctl: improve arch_prctl decoding.
	* prctl.c (arch_prctl): ARCH_GET_GS and ARCH_GET_FS return 64-bit value
	even on x32; ARCH_GET_CPUID ignores the second argument.

2020-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	NEWS: mention Fedora bug number for the libdwfl cache issue.
	Also, mention the reporter in the git commit message.

	* NEWS: Mention Fedora bug number for the libdwfl cache issue.

	Reported-by: Pavel Zhukov <pzhukov@redhat.com>
	Complements: v5.4-18-g69b2c33 "unwind-libdw: fix initialization of libdwfl cache"

2020-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	unwind-libdw: fix initialization of libdwfl cache.
	This fixes stack trace printing for early syscalls that precede
	the first syscall from memory mapping or execve families.

	* unwind-libdw.c (tcb_init): Set struct ctx.last_proc_updating
	to a value different from mapping_generation so that libdwfl cache
	is properly initialized before the first use.
	* NEWS: Mention this fix.

	Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1788636

2020-01-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: Do not dereference SCM_TIMESTAMP* control messages in-place.
	* tests/sockopt-timestamp.c (print_timestamp_old,
	print_timestampns_old): Do not dereference SCM_TIMESTAMP* control
	messages in-place to avoid potential alignment issues in the future.
	* tests/msg_control.c (test_scm_timestamp_old, test_scm_timestampns_old,
	test_scm_timestamping_old, test_scm_timestamp_new,
	test_scm_timestampns_new, test_scm_timestamping_new): Likewise.
	(main): Use "tail_alloc(1024) + 1024" instead of "tail_alloc(1) + 1"
	for obtaining a tail_alloc'ed page to avoid false -Warray-bounds
	warnings from some versions of gcc.

	print_timespec.h: cleanup PRINT_TIMESPEC_ARRAY_DATA_SIZE.
	* print_timespec.h (PRINT_TIMESPEC_ARRAY_DATA_SIZE): Use loop initial
	declaration.  Do not treat potentially unaligned pointers as pointers
	to TIMESPEC_T.

2020-01-06  Dmitry V. Levin  <ldv@altlinux.org>

	Fix potentially unaligned access in SO_TIMESTAMP*_NEW decoder and tests.
	* print_timespec.h [PRINT_TIMESPEC_DATA_SIZE ||
	PRINT_TIMESPEC_ARRAY_DATA_SIZE] (print_unaligned_timespec_t): New
	function.
	(PRINT_TIMESPEC_DATA_SIZE, PRINT_TIMESPEC_ARRAY_DATA_SIZE): Use it
	instead of print_timespec_t.
	* tests/sockopt-timestamp.c: Include <string.h>.
	(print_timestamp_new, print_timestampns_new): Fix potentially unaligned
	access of CMSG_DATA.
	* NEWS: Mention this fix.

	Fixes: v5.1~21 "Implement decoding of SO_TIMESTAMP*_NEW control messages"

2020-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check %creds.
	* tests/trace_creds.in: New file.
	* tests/Makefile.am (EXTRA_DIST): Add trace_creds.in.
	* tests/getuid.test: Extend to handle *-creds tests.
	* tests/gen_tests.in (getegid-creds, getegid32-creds, geteuid-creds,
	geteuid32-creds, getgid-creds, getgid32-creds, getuid-creds,
	getuid32-creds, trace_creds): New entries.

2019-12-29  Andrey Zax  <andrey.zax@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Implement %creds trace class.
	This patch implements a new trace class (%creds) to trace syscalls
	related to process credentials.

	syscallent headers are updated using the following command:

	sed -i -r '/[gs]et[^p]*([gu]id|groups)|cap[gs]et|\(prctl/ {
			s/(\{ [0-6],\t)([A-Z]+\|[A-Z|]+,)\t/\1TC|\2/;
			s/(\{ [0-6],\t)([A-Z]+,)/\1TC|\2/;
			s/(\{ [0-6],\t)0/\1TC/
		}' linux/*/syscallent*.h

	* basic_filters.c (lookup_class): Add %creds member to syscall_class[].
	* sysent.h (TRACE_CREDS): New macro.
	* sysent_shorthand_defs.h (TC): Likewise.
	* strace.1.in (.SS Filtering): Add a description for `-e trace=%creds`.
	* linux/32/syscallent.h: Add TC flag to credentials syscalls.
	* linux/64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-compat.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* NEWS: Mention this change.

2019-12-29  Dmitry V. Levin  <ldv@altlinux.org>

	tests: increase the child stack size in some tests that invoke clone.
	Increase the child stack size from the half page size to the full page
	size in those few tests that invoke clone syscall.

	The former size appears to be insufficient in some build setups.
	For example, clang 7 on Ubuntu bionic x86_64 makes ioctl_nsfs test fail
	due to child process segfaults.

	* tests/clone_parent.c (child_stack_size, clone): Remove.
	(do_clone): New macro.
	(main): Use it.
	* tests/clone_ptrace.c: Likewise.
	* tests/ioctl_nsfs.c (child_stack_size, clone): Remove.
	(do_clone): New macro.
	(test_user_namespace): Use it.

2019-12-15  Vladimir D. Seleznev  <vseleznv@altlinux.org>

	Fix typos in comments.
	* io.c (tprint_iov_upto): Fix typo in the function header comment.
	* tests/tests.h (f8ill_ptr_to_kulong): Likewise.
	* printsiginfo.c (print_si_info): Fix typo in the comment.
	* stage_output.c (strace_open_memstream): Likewise.
	* tests/prctl-seccomp-strict.c (main): Likewise.
	* tests/seccomp-strict.c (main): Likewise.
	* largefile_wrappers.h: Fix typos in the file header comment.
	* tests/zeroargc.c: Fix typo in the file header comment.

2019-12-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests: insert a delay into bpf-obj_get_info_by_fd tests.
	According to Quentin Monnet [1], there is a delay when the locked memory
	is being reclaimed after a BPF program or map is removed.

	Privileged tools like iproute2 and bpftool workaround this Linux kernel
	limitation by raising RLIMIT_MEMLOCK to infinity prior to creating BPF
	objects.

	Our BPF tests are expected to be invoked without extra privileges
	and therefore do not have this option.

	Instead, we serialize all BPF tests invocations and insert a delay
	long enough to let the locked memory be reclaimed.

	[1] https://lists.strace.io/pipermail/strace-devel/2019-December/009274.html

	* tests/bpf-obj_get_info_by_fd.c (main): Add a comment and a sleep
	invocation.
	* tests/pure_executables.list: Remove bpf-obj_get_info_by_fd,
	bpf-obj_get_info_by_fd-prog, bpf-obj_get_info_by_fd-prog-v,
	and bpf-obj_get_info_by_fd-v because they call sleep function
	that may be implemented on top of clock_nanosleep* syscalls.

	Thanks-to: Quentin Monnet <quentin.monnet@netronome.com>
	References: https://github.com/strace/strace/issues/74

2019-12-10  Paul Chaignon  <paul.chaignon@gmail.com>

	bpf: support new fields for BPF_PROG_LOAD.
	* bpf_attr.h (BPF_PROG_LOAD_struct): New fields introduced in Linux
	commits v5.5-rc1~174^2~310^2~19^2~7 and v5.5-rc1~174^2~49^2~12^2~3.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Decode the new fields.
	* NEWS: Mention this.
	* tests/bpf.c (BPF_PROG_LOAD_checks): Update expected outputs.
	* tests/bpf-obj_get_info_by_fd.c (print_prog_load): Likewise.
	* tests/kernel_version.c (print_bpf_attr): Likewise.

	bpf: update BPF constants.
	* xlat/bpf_attach_type.in (BPF_TRACE_RAW_TP): New constant introduced in
	Linux commit v5.5-rc1~174^2~249^2~4^2~1.
	(BPF_TRACE_FENTRY, BPF_TRACE_FEXIT): New constants introduced in Linux
	commit v5.5-rc1~174^2~49^2~12^2~16.
	* xlat/bpf_map_flags.in (BPF_F_MMAPABLE): New constant introduced in Linux
	commit v5.5-rc1~174^2~49^2~11^2~2.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_TRACING): New constant
	introduced in Linux commit v5.5-rc1~174^2~249^2~4^2~1.
	* NEWS: Mention this.
	* tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks,
	BPF_PROG_QUERY_checks): Update expected outputs.
	* tests/kernel_version.c (print_bpf_attr, main): Likewise.

2019-12-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of NDA_LLADDR netlink neighbour table attribute.
	* tests/nlattr_ndmsg.c (main): Check decoding of NDA_LLADDR.

2019-12-03  Jamal Hadi Salim  <jhs@mojatatu.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	rtnl_neigh: fix NDA_LLADDR netlink neighbour table attribute decoder.

	Before this fix NDA_LLADDR attributes used to be printed
	as inet addresses, not as mac addresses.

	* rtnl_neigh.c (decode_neigh_lladdr): New function.
	(ndmsg_nla_decoders): Use it for NDA_LLADDR decoding.
	* NEWS: Mention this fix.

	Fixes: v4.19~33 "rtnl_neigh: decode ndmsg netlink attributes"

2019-12-03  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.m4: use AC_LANG_PROGRAM instead of AC_LANG_SOURCE.
	AC_LANG_PROGRAM is a convenient wrapper around AC_LANG_SOURCE.

	* m4/mpers.m4 (st_MPERS): Use AC_LANG_PROGRAM instead of AC_LANG_SOURCE.

2019-12-03  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.m4: modify CPPFLAGS and CFLAGS separately.
	* m4/mpers.m4 (st_MPERS): Add $IFLAG to CPPFLAGS, add MPERS_CFLAGS
	to CFLAGS.  This change is not expected to change behaviour.

2019-12-03  Dmitry V. Levin  <ldv@altlinux.org>

	configure.ac: do not copy CFLAGS to CFLAGS_FOR_{M32,MX32}
	As result, CFLAGS is no longer passed to mpers.sh,
	reintroducing the traditional behaviour changed by commit v5.4~32.

	The copying behaviour in it's current form was problematic because some
	of compiler options may break mpers.sh; for example, if CFLAGS includes
	-flto, then mpers.sh breaks, since intermediate *.o files created by
	mpers.sh do not contain any real code.

	* configure.ac [$arch != aarch64]: Initialize CFLAGS_FOR_M32 and
	CFLAGS_FOR_MX32 to empty strings by default.
	* NEWS: Mention this fix.

	Reported-by: Andreas Schwab <schwab@linux-m68k.org>
	Reported-by: Thomas Deutschmann <whissi@gentoo.org>
	Resolves: https://github.com/strace/strace/issues/114
	Fixes: v5.4~32 "Add support for per-mpers compiler settings"

2019-12-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tweak restart_syscall test to workaround nanosleep changes.
	nanosleep function in glibc used to be implemented as a simple syscall
	wrapper around __NR_nanosleep, but starting with glibc commit
	glibc-2.30.9000-234-g3537ecb49c, it is implemented on top of
	__clock_nanosleep function which in turn is implemented on top of
	__clock_nanosleep_time64 function.

	These functions do not forward the last argument written by the kernel
	when the underlying syscall succeeds, breaking the expected output.
	Besides that, these proxy functions pass garbage in the upper 32-bits
	of tv_nsec on 32-bit architectures .

	Rather than changing restart_syscall test to use __NR_nanosleep syscall
	directly, relax the expected output with regards to the remaining time
	written by the kernel as this not what is being tested by
	restart_syscall test.

	* tests/restart_syscall.c: Stop including <assert.h>.
	(main): Do not use assert.  Change the initial value of rem variable.
	Use regexps instead of specific values of rem.tv_sec and rem.tv_nsec
	in the expected output.
	* NEWS: Mention this change.

2019-12-01  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 5.4-1.
	* strace.spec.in: Likewise.

2019-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 5.4 release.
	* NEWS: Update for 5.4 release.

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2019-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	Fix preprocessor indentation.
	Indent the C preprocessor directives to reflect their nesting
	using the following script:

	$ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do
		cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
	done

2019-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tweak restart_syscall test to break in a more obvious way in case of faulty libc
	If libc implements nanosleep on top of clock_nanosleep, there is
	a chance of struct timespec translation bugs in libc breaking this test.
	Tweak the test to make this breakage more obvious.

	* tests/restart_syscall.c (main): Initialize rem variable with invalid
	timespec data.

2019-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix restart_syscall test on systems with emulated nanosleep.
	When libc emulates nanosleep on top of clock_nanosleep, the address
	of the structure passed to the kernel is not the same as the address
	of the structure passed to nanosleep.

	* tests/restart_syscall.c (main): Update expected output.

2019-11-27  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Update NEWS.

2019-11-27  Dmitry V. Levin  <ldv@altlinux.org>

	ci: use kernel headers from Linux v5.4.
	There is too much noise when using unreleased kernel uapi.

	* .gitlab-ci.yml (variables): Add KBRANCH.
	* .travis.yml (env:global): Likewise.

2019-11-27  Dmitry V. Levin  <ldv@altlinux.org>

	Use an LFS version of fcntl function when available.
	glibc-2.28 introduced fcntl64 as an LFS version of fcntl function,
	use this new function when available.

	* configure.ac (AC_CHECK_FUNCS): Add fcntl64.
	* largefile_wrappers.h (fcntl_fd): New macro.
	* strace.c (set_cloexec_flag): Use it instead of fcntl.

2019-11-27  Paul Chaignon  <paul.chaignon@gmail.com>

	bpf: update BPF constants.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_SOCK_ADDR): New constant
	introduced by Linux commit v4.17-rc1~148^2~19^2^2~6.
	(BPF_PROG_TYPE_LWT_SEG6LOCAL, BPF_PROG_TYPE_LIRC_MODE2,
	BPF_PROG_TYPE_LIRC_MODE2, BPF_PROG_TYPE_FLOW_DISSECTOR,
	BPF_PROG_TYPE_CGROUP_SYSCTL, BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE,
	BPF_PROG_TYPE_CGROUP_SOCKOPT): Update constant values following missing
	entry in enum.
	* tests/bpf.c (BPF_PROG_LOAD_checks): Update expected outputs and add test.
	* tests/kernel_version.c (print_bpf_attr, main): Likewise.

	Fixes: v4.24~49 "xlat: update bpf(2)-related constants"
	Fixes: v4.25~58 "xlat: add BPF_PROG_TYPE_SK_REUSEPORT to bpf_prog_types.in"
	Fixes: v4.26~12 "xlat: add flow dissector bpf program type constants"
	Fixes: v5.2~38 "xlat: update BPF_* constants"
	Fixes: v5.3~60 "xlat: update BPF_* constants"

2019-11-27  Paul Chaignon  <paul.chaignon@gmail.com>

	bpf: support new field in BPF_MAP_LOOKUP_ELEM.
	* bpf_attr.h (BPF_MAP_LOOKUP_ELEM_struct): New field introduced by Linux
	commit v5.1-rc1~178^2~375^2~4^2~3.
	* xlat/bpf_map_lookup_elem_flags.in: New file.
	* bpf.c: Include "xlat/bpf_map_lookup_elem_flags.h".
	(BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_ELEM)): Decode the new field.
	* tests/bpf.c (BPF_MAP_LOOKUP_ELEM_checks): Update expected outputs.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: provide fallback definitions for IPC_* and SHM_* constants.
	* xlat/shm_flags.in: Provide fallback definitions for constants.
	* xlat/shm_resource_flags.in: Likewise.

	xlat: update MSG_* constants.
	* xlat/ipc_msg_flags.in: Provide fallback definitions for constants.
	(MSG_COPY): New constant introduced by Linux kernel commit
	v3.8-rc3~16^2~30.
	* NEWS: Mention this.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change status-unfinished-threads test to use __NR_nanosleep.
	Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
	nanosleep function in glibc is implemented on top of clock_nanosleep,
	which makes it unsuitable for this test that is based on nanosleep
	syscall.

	* tests/status-unfinished-threads.c: Skip the test if __NR_nanosleep
	is not defined, include "kernel_old_timespec.h".
	(thread, main): Change the type of ts variable to kernel_old_timespec_t,
	invoke nanosleep syscall using __NR_nanosleep.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change threads-execve test to use __NR_nanosleep.
	Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
	nanosleep function in glibc is implemented on top of clock_nanosleep,
	which makes it unsuitable for this test that uses both nanosleep
	and clock_nanosleep syscalls for different purposes.

	* tests/threads-execve.c: Skip the test if __NR_nanosleep is not defined.
	Include "kernel_old_timespec.h".
	(thread, main): Invoke nanosleep syscall using __NR_nanosleep.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify umoven-illptr test against undefined __NR_nanosleep.
	* tests/umoven-illptr.c: Skip the test if __NR_nanosleep is not defined.
	Include "kernel_old_timespec.h" instead of <time.h>, use
	kernel_old_timespec_t instead of struct timespec.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change sleep helper to use __NR_nanosleep.
	Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
	nanosleep function in glibc is implemented on top of clock_nanosleep,
	which makes it unsuitable for the sleep helper that is expected to
	invoke nanosleep syscall.

	* tests/sleep.c: Skip the test if __NR_nanosleep is not defined.
	Include "kernel_old_timespec.h" instead of <time.h>.
	(main): Change the type of ts variable to kernel_old_timespec_t,
	invoke nanosleep syscall using __NR_nanosleep.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: consistently check before use that sleep executable works.
	Add the required check to those few tests that miss it.

	* tests/status-detached.test: Invoke "run_prog ../sleep 0".
	* tests/strace-DD.test: Likewise.
	* tests/strace-ff.test: Likewise.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change restart_syscall test not to assume nanosleep syscall.
	Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
	nanosleep function in glibc is implemented on top of clock_nanosleep,
	which makes any code relying on the old behaviour fragile.

	Resolve this issue by allowing other syscalls from the nanosleep family.

	* tests/restart_syscall.c (NANOSLEEP_NAME_RE, NANOSLEEP_CALL_RE): New
	macros.
	(main): Use them to extend regular expressions to allow clock_nanosleep
	and clock_nanosleep_time64 syscalls.
	* tests/restart_syscall.test: Replace nanosleep with /nanosleep in the
	list of matched syscalls.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change nanosleep test to use __NR_nanosleep.
	Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
	nanosleep function in glibc is implemented on top of clock_nanosleep,
	which makes it unsuitable for the test of nanosleep decoder.

	* tests/nanosleep.c: Skip the test if __NR_nanosleep is not defined.
	Include "kernel_old_timespec.h" instead of <time.h>.
	(k_nanosleep): New function.
	(main): Change the type of ts variable to kernel_old_timespec_t,
	use k_nanosleep to invoke nanosleep syscall using __NR_nanosleep.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: introduce kernel_old_timespec.h.
	This header file defines kernel_old_timespec_t type that is going to be
	used to define objects passed to such system calls as nanosleep.

	* tests/kernel_old_timespec.h: New file.
	* tests/Makefile.am (EXTRA_DIST): Add kernel_old_timespec.h.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change adjtimex test to use __NR_adjtimex.
	Starting with glibc commit glibc-2.30.9000-215-gc81aa64e81,
	adjtimex function in glibc is implemented on top of clock_adjtime,
	which makes it unsuitable for the test of adjtimex decoder.

	* configure.ac (AC_CHECK_MEMBERS): Remove struct timex.tai.
	* tests/adjtimex.c: Skip the test if __NR_adjtimex is not defined.
	Include "kernel_old_timex.h".
	(k_adjtimex): New function.
	(main): Change the type of tx pointer to kernel_old_timex_t,
	use k_adjtimex to invoke adjtimex syscall.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: introduce kernel_old_timex.h.
	This header file defines kernel_old_timex_t type that is going to be
	used to define objects passed to such system calls as adjtimex.

	* tests/kernel_old_timex.h: New file.
	* tests/Makefile.am (EXTRA_DIST): Add kernel_old_timex.h.

2019-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite semop test.
	Starting with glibc commit glibc-2.30.9000-169-g765cdd0bff,
	semop function in glibc is implemented on top of semtimedop,
	which makes it unsuitable for the test of semop decoder.

	Resolve this issue by creating two tests: one that checks decoding
	of __NR_semop, and another that checks decoding of __NR_ipc SEMOP.

	* tests/semop-common.c: New file.
	* tests/Makefile.am (EXTRA_DIST): Add semop-common.c.
	* tests/semop-indirect.c: New file.
	* tests/semop.c: Rewrite using __NR_semop.
	* tests/pure_executables.list: Add semop-indirect.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (semop): Update.
	(semop-indirect): New entry.

2019-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a separate semtimedop test.
	The semop test is going to be changed soon, so create a separate
	semtimedop test based on the test we have.

	* tests/semtimedop.c: New file.
	* tests/pure_executables.list: Add semtimedop.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (semtimedop): New entry.

2019-11-17  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update PTP_* constants.
	* xlat/ptp_extts_flags.in (PTP_STRICT_FLAGS): New constant introduced
	by Linux kernel commit v5.4-rc8~8^2~9^2~5.

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	travis: switch from gcc-8 to gcc-9.
	* .travis.yml (matrix): Switch all gcc-8 builds except arm64 ones
	to gcc-9.  gcc-8 arm64 builds have to remain until gcc-9 arm64 builds
	are fixed, currently they error out because of missing
	gcc-9-multilib-arm-linux-gnueabihf package.

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	travis: switch some stack trace enabled builds from libunwind to libdw.
	Switch to Bionic allows to use libdw instead of libunwind.

	* .travis.yml (matrix): Change STACKTRACE from libunwind to libdw
	in most of Bionic-based builds.

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	travis: switch from Trusty to Bionic.
	Ideally, all builds have to be switched, but coverage build,
	unfortunately, errors out by Travis CI with a build timeout,
	musl-gcc x86 build fails with
	"undefined reference to `__stack_chk_fail_local'" error, and gcc-8 arm64
	builds error out because of missing gcc-8-multilib-arm-linux-gnueabihf
	package.

	* .travis.yml (dist): Change to bionic.
	(matrix): Add "dist: trusty" to coverage, musl-gcc x86, and gcc-8 arm64
	builds.

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	ci: enable mpers in aarch64 builds.
	* ci/install-dependencies.sh (aarch64): Install libc6-dev-armhf-cross
	and linux-libc-dev-armhf-cross packages.
	* ci/run-build-and-tests.sh (aarch64): Enable strict mpers check
	by removing --enable-mpers=check configure option.

2019-11-15  Paul Chaignon  <paul.chaignon@gmail.com>

	ci: support Travis CI's aarch64 builds.
	Travis CI now supports aarch64 builds, launched with the new "arch: arm64"
	tag.  These builds are running inside LXD only for the moment.

	The aarch64 builds tend to be a lot slower than their x86_64 counterparts,
	so several timeout values need to be increased.

	Some tests occasionally take more than 10 minutes, hitting Travis CI's
	timeout on output inactivity.  Using "travis_wait 40" disables that
	timeout; it delays the start time for the output inactivity timeout by 40
	minutes, bringing it to the maximum build timeout of 50 minutes.

	* .travis.yml (matrix): Add aarch64 builds and mark previous builds as
	amd64.
	* ci/install-dependencies.sh: Install packages for aarch64 builds.
	* ci/run-build-and-tests.sh: Check mpers for aarch64.

2019-11-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	debian/control: add build dependencies for aarch64 mpers.
	* debian/control (Build-Depends): Add gcc-arm-linux-gnueabi,
	libc6-dev-armel-cross, linux-libc-dev-armel-cross as additional
	dependencies on arm64 in order to build proper mpers support.

2019-11-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	configure.ac: use a separate compiler for ARM EABI on AArch64.
	As gcc on AArch64 doesn't support compat ABI target, we have to find
	and use a separate compiler in order to get proper compat personality
	support on AArch64.

	* configure.ac (arch == aarch64): Try to find a compiler for ARM EABI
	based on known names for it in various distributions.

2019-11-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add support for per-mpers compiler settings.
	As some very special architectures require a separate compiler
	in order to compile binaries for additional supported personalities,
	we have to introduce such support.

	* Makefile.am (mpers_CPPFLAGS): Move $(strace_CPPFLAGS) ...
	(mpers_sh_opts): ... here.
	(mpers-m%.stamp:): Use $(mpers_CC) instead of $(CC) for compiler,
	pass $(mpers_CC_FLAGS) in quotes as it might be empty or contain spaces.
	($(mpers_m32_targets)): Add @CFLAGS_FOR_M32@ to mpers_CC_FLAGS, set
	mpers_CPPFLAGS and mpers_CC.
	($(mpers_mx32_targets)): Add @CFLAGS_FOR_MX32@ to mpers_CC_FLAGS, set
	mpers_CPPFLAGS and mpers_CC.
	* bootstrap (m_upper): Derive uppercase personality name.
	Set CC for mpers Makefile.am, add @CFLAGS_FOR_{M32,MX32}@ to
	MPERS_CC_FLAGS definition.
	* configure.ac: Derive default values for
	{CC,CPP,CFLAGS,CPPFLAGS}_FOR_{M32,MX32} from the respective CC, CPP,
	CFLAGS, and CPPFLAGS values.
	* m4/mpers.m4 (AC_DEFUN([st_MPERS])): Use
	{CC,CPP,CFLAGS,CPPFLAGS}_FOR_<$1> as CC, CPP, CFLAGS, and CPPFLAGS,
	respectively.  Enclose MPERS_CFLAGS in quotes in mpers.sh call.  Provide
	information about compiler in the AC_CACHE_CHECK message.
	* tests/Makefile.am (CC): New variable.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	ci: enable symbols demangling in stack trace enabled builds.
	* ci/install-dependencies.sh: Install libiberty-dev when STACKTRACE
	is specified.

	tests: lower expected performance gain in filter_seccomp-perf.test.
	* tests/filter_seccomp-perf.test (min_ratio): Change from 8 to 6,
	the former expectation was too optimistic for such slow architectures
	as parisc.

	tests: fix invalid copyright years range in a few tests.
	* maint/update_copyright_years.sh (process_file): When updating
	copyright years, if there is existing notice and its starting year is
	earlier than the year of the first commit, the former takes precedence.
	* tests/filter_seccomp-flag.c: Fix copyright years range.
	* tests/filter_seccomp-perf.c: Likewise.
	* tests/filter_seccomp-perf.test: Likewise.
	* tests/filter_seccomp.sh: Likewise.
	* tests/status-none-f.c: Likewise.

	ptp: add support of new PTP_*2 ioctls.
	* ptp.c [!PTP_CLOCK_GETCAPS2] (PTP_CLOCK_GETCAPS2): Define.
	[!PTP_EXTTS_REQUEST2] (PTP_EXTTS_REQUEST2): Likewise.
	[!PTP_PEROUT_REQUEST2] (PTP_PEROUT_REQUEST2): Likewise.
	[!PTP_ENABLE_PPS2] (PTP_ENABLE_PPS2): Likewise.
	[!PTP_SYS_OFFSET2] (PTP_SYS_OFFSET2): Likewise.
	(ptp_ioctl): Handle PTP_CLOCK_GETCAPS2, PTP_EXTTS_REQUEST2,
	PTP_PEROUT_REQUEST2, PTP_ENABLE_PPS2, and PTP_SYS_OFFSET2.
	* tests/ioctl_ptp.c: Check decoding of PTP_*2 ioctls.

	tests: rewrite ioctl_ptp test using sprintrc.
	* tests/ioctl_ptp.c: Do not include <errno.h>.
	(main): Use sprintrc.

	ptp: prepare for support of new PTP_*2 ioctls.
	* xlat/ptp_flags_options.in: Rename to ...
	* xlat/ptp_extts_flags.in: ... new file, add fallback definitions
	for constants.
	* xlat/ptp_perout_flags.in: New file.
	* ptp.c: Include "xlat/ptp_extts_flags.h" and "xlat/ptp_perout_flags.h"
	instead of "xlat/ptp_flags_options.h".
	(ptp_ioctl): Use ptp_extts_flags and ptp_perout_flags instead of
	ptp_flags_options.
	* tests/ioctl_ptp.c: Include "xlat/ptp_extts_flags.h" and
	"xlat/ptp_perout_flags.h" instead of "xlat/ptp_flags_options.h".
	(test_no_device): Use ptp_extts_flags and ptp_perout_flags instead of
	ptp_flags_options.

	prctl: implement decoding of PR_[GS]ET_TAGGED_ADDR_CTRL.
	* xlat/prctl_options.in (PR_SET_TAGGED_ADDR_CTRL,
	PR_GET_TAGGED_ADDR_CTRL): New constants introduced by Linux kernel commit
	v5.4-rc1~100^2~6^9~8.
	* prctl.c (SYS_FUNC(prctl)): Handle them.
	* NEWS: Mention this.
	* tests/prctl-no-args.c: Check PR_GET_TAGGED_ADDR_CTRL decoding.

	xlat: update KVM_CAP_* constants.
	* xlat/kvm_cap.in (KVM_CAP_ARM_IRQ_LINE_LAYOUT_2): New constant
	introduced by Linux kernel commit v5.4-rc1~138^2~20^2.
	(KVM_CAP_HYPERV_DIRECT_TLBFLUSH): New constant introduced by Linux
	kernel commit v5.4-rc1~26^2~53.
	* NEWS: Mention this.

	xlat: update KEXEC_* constants.
	* xlat/kexec_arch_values.in (KEXEC_ARCH_PARISC): New constant introduced
	by Linux kernel commit v5.4-rc1~188^2~4.
	* NEWS: Mention this.

	xlat: update CAN_* constants.
	* xlat/can_protocols.in (CAN_J1939): New constant introduced by Linux
	kernel commit v5.4-rc1~131^2~78^2~2.
	* NEWS: Mention this.

2019-11-14  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: implement decoding of BPF_BTF_GET_NEXT_ID command.
	* xlat/bpf_commands.in (BPF_BTF_GET_NEXT_ID): New constant introduced
	by Linux kernel commit v5.4-rc1~131^2~62^2~28^2~4.
	* bpf_attr.h (BPF_BTF_GET_NEXT_ID_struct,
	BPF_BTF_GET_NEXT_ID_struct_size): New macros.
	* bpf.c (decode_BPF_BTF_GET_NEXT_ID): Likewise.
	(bpf_cmd_decoders): Add BPF_CMD_ENTRY(BPF_BTF_GET_NEXT_ID).
	* NEWS: Mention this change.
	* tests/bpf.c (BPF_BTF_GET_NEXT_ID_checks): New macro.
	(checks): Add CHK(BPF_BTF_GET_NEXT_ID).

2019-11-13  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update MADV_* constants.
	* xlat/madvise_cmds.in (MADV_COLD): New constant introduced by Linux
	kernel commit v5.4-rc1~46^2~13.
	(MADV_PAGEOUT): New constant introduced by Linux kernel commit
	v5.4-rc1~46^2~11.
	* NEWS: Mention this.

2019-11-13  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v5.4.
	* linux/32/ioctls_inc_align16.h: Update from linux v5.4-rc7
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/riscv64/ioctls_arch0.h: Likewise.
	* linux/s390/ioctls_arch0.h: Likewise.
	* linux/s390x/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

2019-11-09  Paul Chaignon  <paul.chaignon@gmail.com>

	filter_seccomp: fix jump offset overflow in binary match generator.
	binary_match_filter_generator() is missing a check for jump offset
	overflows which might result in incorrect behavior if the binary match
	strategy is selected and overflows.

	I have only been able to reproduce the bug on mips after forcing strace to
	use the binary match generator.  Due to the large number of syscalls on
	mips, the binary match algorithm is suboptimal and the linear one is
	selected.  This bug could however be triggered inadvertently if tracing a
	very large set of syscalls not grouped together; in that case, the linear
	strategy might have a jump offset overflow itself and strace would
	fallback to the binary match one.

	* filter_seccomp (binary_match_filter_generator): Check for jump offset
	overflows.

2019-11-08  Paul Chaignon  <paul.chaignon@gmail.com>

	tests: fix potentially missing SHM_NORESERVE for mips.
	* tests/ipc_shm.c [!SHM_NORESERVE] (SHM_NORESERVE): Define.

2019-11-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tolerate zero process group ID and session ID in strace-DDD.test.
	Paul Chaignon reported [1] that in some of Travis CI build environments
	process group ID and session ID may be equal to zero.

	Change the affected strace-DDD.test to tolerate these odd values as long
	as they don't interfere with the purpose of the test.

	[1] https://travis-ci.community/t/unexpected-zero-values-in-proc-pid-stat/5774

	* tests/strace-DDD.test: Tolerate zero process group ID and session ID.

	Reported-by: Paul Chaignon <paul.chaignon@gmail.com>

2019-11-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix -a argument in ipc_msgbuf-Xraw test.
	* tests/gen_tests.in (ipc_msgbuf-Xraw): Change -a argument from 20 to 19.

2019-11-07  Paul Chaignon  <paul.chaignon@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify umount2.test against filtered umount2 syscall.
	Do not assume that umount2 syscall invoked with invalid arguments always
	fail with EINVAL as in some environments it can be filtered out e.g.
	using seccomp-bpf.

	* tests/umount2.c (main): Use sprintrc() to prepare expected output.

2019-11-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance termination signal forwarding check.
	Check that termination signal forwarding works properly when strace
	is invoked with the corresponding termination signal blocked.

	* tests/block_reset_run.c: New file.
	* tests/Makefile.am (check_PROGRAMS): Add block_reset_run.
	* tests/.gitignore: Likewise.
	* tests/termsig.test: Extend the check to cover the case when
	strace is invoked with the termination signal blocked.

2019-11-02  Dmitry V. Levin  <ldv@altlinux.org>

	Use __gcov_dump declaration from <gcov.h> if available.
	The function declaration provided by <gcov.h> is fine,
	use it when <gcov.h> is available.

	* configure.ac (AC_CHECK_HEADERS): Add gcov.h.
	* defs.h [ENABLE_COVERAGE_GCOV && HAVE_GCOV_H]: Include <gcov.h>.

2019-11-02  Dmitry V. Levin  <ldv@altlinux.org>

	Use __gcov_dump instead of __gcov_flush to dump profile information.
	__gcov_flush is essentially __gcov_dump followed by __gcov_reset.
	The way we use __gcov_flush so far does not need any __gcov_reset,
	so use __gcov_dump instead.

	* defs.h [ENABLE_COVERAGE_GCOV] (__gcov_flush): Replace with
	__gcov_dump.
	(GCOV_FLUSH): Replace with GCOV_DUMP.
	* filter_seccomp.c (check_seccomp_order_do_child): Replace GCOV_FLUSH
	with GCOV_DUMP.
	* strace.c (terminate): Likewise.

2019-11-02  Dmitry V. Levin  <ldv@altlinux.org>

	Reduce ENABLE_COVERAGE_GCOV ifdefery.
	Introduce a new macro GCOV_FLUSH and use it instead of __gcov_flush.

	* defs.h (GCOV_FLUSH): New macro.
	[ENABLE_COVERAGE_GCOV] (__gcov_flush): New prototype.
	* filter_seccomp.c (__gcov_flush): Remove.
	(check_seccomp_order_do_child): Call GCOV_FLUSH instead of __gcov_flush.
	* strace.c (__gcov_flush): Remove.
	(terminate): Call GCOV_FLUSH instead of __gcov_flush.

2019-10-31  Dmitry V. Levin  <ldv@altlinux.org>

	filter_seccomp: simplify check_seccomp_filter_properties.
	* filter_seccomp.c (check_seccomp_filter_properties): Simplify slightly
	by removing a redundant "if" expression.

2019-10-31  Paul Chaignon  <paul.chaignon@gmail.com>

	filter_seccomp: binary match generation strategy.
	This commit introduces a new BPF program generation strategy.  Traced
	syscalls are encoded in 32-bit bit arrays in the BPF program.  Syscalls
	are then matched against bit arrays at runtime with two ALU operations:
	a division to select the appropriate bit array to compare with,
	and a shift to select the appropriate bit in the bit array.

	Since there is no way to implement a jump table in BPF (jumps have fixed
	offsets), we have to iterate over all bit arrays to select the appropriate
	bit array.  The division and modulo are also converted into a shift and
	a bitwise AND, to improve performance and because seccomp-bpf disallows
	modulos in BPF.

	Compared to the linear generation strategy, this strategy generates
	programs of near constant size.  There is a single optimization that
	depends on traced syscalls: if a bit array is all-0 or all-1, we don't
	need to do a jset against it, we can simply jump to either RET_ALLOW
	or RET_TRACE.

	* filter_seccomp.c (JMP_PLACEHOLDER_ALLOW): New constant.
	(binary_match_filter_generator): New prototype.
	(filter_generators): Add binary_match_filter_generator.
	(replace_jmp_placeholders): Handle JMP_PLACEHOLDER_ALLOW case.
	(linear_filter_generator): New argument for replace_jmp_placeholders.
	(bpf_syscalls_match, binary_match_filter_generator): New functions.
	(dump_seccomp_bpf): Handle ldwimm, jset, rsh, lsh, and, tax, and txa
	instructions.

2019-10-31  Paul Chaignon  <paul.chaignon@gmail.com>

	filter_seccomp: list of seccomp filter generation strategies.
	Iterate over a list of BPF program generators, to select the shortest
	program.  This commit doesn't introduce new generation strategies.

	* filter_seccomp.c (filter_generator_t): New typedef.
	(linear_filter_generator): New prototype.
	(filter_generators, filters): New variables.
	(seccomp_filter): Remove.
	(init_sock_filter): Rename to linear_filter_generator, signal overflow
	via function argument instead of erroring out.
	(check_seccomp_filter): Find the shortest program generated by all
	generation strategies, error in case of overflow in all generated
	programs.

2019-10-28  Dmitry V. Levin  <ldv@altlinux.org>

	ci: install rsync for headers_install.
	Starting with Linux commit v5.3-rc1~111^2~40, "make headers_install"
	needs rsync.

	* ci/install-dependencies.sh: Install rsync before invoking
	"make headers_install".

2019-10-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip a few tests on systems with nproc == 1.
	Several tests require some concurrency between threads,
	skip these tests if nproc reports 1.

	* tests/init.sh (require_min_nproc): New function.
	* tests/status-none-threads.test: Use it.
	* tests/threads-execve.test: Likewise.

2019-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update v4l2_sliced_flags.
	* xlat/v4l2_sliced_flags.in (V4L2_SLICED_TELETEXT_B, V4L2_SLICED_VPS,
	V4L2_SLICED_CAPTION_525, V4L2_SLICED_WSS_625): Add fallback definitions.
	(V4L2_SLICED_VBI_525): Comment out as it has the same value as
	V4L2_SLICED_CAPTION_525.
	(V4L2_SLICED_VBI_625): Add fallback definition, move up.

2019-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update v4l2_vbi_flags.
	For some reason, it also used to include V4L2_VBI_ITU_[56]25_F[12]_START
	constants that are definitely unrelated to V4L2_VBI_* flags.

	* xlat/v4l2_vbi_flags.in (V4L2_VBI_UNSYNC, V4L2_VBI_INTERLACED): Add
	fallback definitions.
	(V4L2_VBI_ITU_525_F1_START, V4L2_VBI_ITU_525_F2_START,
	V4L2_VBI_ITU_625_F1_START, V4L2_VBI_ITU_625_F2_START): Remove.

2019-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for V4L2_TUNER_* constants.
	Also, since V4L2_TUNER_*_SAP have the same values as V4L2_TUNER_*_LANG2,
	comment out the former.

	* xlat/v4l2_tuner_audmodes.in: Add fallback definitions for constants,
	add #value_indexed.
	(V4L2_TUNER_MODE_SAP): Comment out.
	* xlat/v4l2_tuner_capabilities.in: Add fallback definitions for
	constants.
	(V4L2_TUNER_CAP_SAP): Comment out.
	* xlat/v4l2_tuner_rxsubchanses.in: Add fallback definitions for
	constants.
	(V4L2_TUNER_SUB_SAP): Comment out.

2019-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for some V4L2_* constants.
	* xlat/v4l2_capture_modes.in: Add fallback definitions for constants.
	* xlat/v4l2_control_flags.in: Likewise.
	* xlat/v4l2_streaming_capabilities.in: Likewise.
	* xlat/v4l2_frameinterval_types.in: Add fallback definitions for
	constants, add #value_indexed.
	* xlat/v4l2_framesize_types.in: Likewise.
	* xlat/v4l2_input_types.in: Likewise.
	* xlat/v4l2_memories.in: Likewise.
	* xlat/v4l2_tuner_types.in: Likewise.

2019-10-25  Dmitry V. Levin  <ldv@altlinux.org>

	ci: consistently parallelize make jobs.
	* ci/run-build-and-tests.sh: Use "nproc" instead of
	"getconf _NPROCESSORS_ONLN".
	* ci/install-dependencies.sh: Use "nproc" to parallelize make jobs.

2019-10-25  Dmitry V. Levin  <ldv@altlinux.org>

	tests: workaround clang oddness.
	When a structure is initialized using designated initializers,
	clang >= 7, apparently, does not initialize trailing padding
	of the structure.

	* tests/bpf-obj_get_info_by_fd.c [CHECK_OBJ_PROG]
	(bpf_prog_load_attr_sizes): Replace the size of struct
	BPF_PROG_LOAD_struct with BPF_PROG_LOAD_struct_size.

2019-10-25  Paul Chaignon  <paul.chaignon@gmail.com>

	filter_seccomp: use init_sock_filter to check the number of BPF instructions
	With this commit, the number of instructions in the seccomp BPF program
	is checked by directly constructing the program.  The BPF program is
	therefore created during the check for seccomp availability instead of
	when seccomp filtering is initialized.  The BPF program is saved
	as a global variable between the two operations.

	* filter_seccomp.c (seccomp_filter, bpf_prog): New variables.
	(init_sock_filter): Disable seccomp-filter in case of overflow, move dump
	of BPF program in debug mode...
	(init_seccomp_filter): ...here.
	(check_bpf_program_size): Remove.
	(dump_seccomp_bpf): Remove arguments as they are now global variables.

2019-10-23  Dmitry V. Levin  <ldv@altlinux.org>

	Remove XLAT_END.
	* xlat.h (XLAT_END): Remove.
	* process.c (struct_user_offsets_data): Replace XLAT_END with a zero
	xlat_data entry.

	Complements: v5.3~105 "Add xlat description structure"

2019-10-23  Dmitry V. Levin  <ldv@altlinux.org>

	bfin, csky, m68k, sh: fix build regression.
	* xlat/cacheflush_flags.in: New file.
	* cacheflush.c [M68K || BFIN || CSKY || SH] (cacheflush_flags): Remove,
	include "xlat/cacheflush_flags.h" instead.

	Fixes: v5.3~105 "Add xlat description structure"

2019-10-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.spec.in: add support for old distros that cannot handle .tar.xz.

	xlat: update V4L2_CTRL_TYPE_* constants.
	* xlat/v4l2_control_types.in: Add fallback definitions for constants,
	and #sorted.
	* configure.ac (AC_CHECK_MEMBERS): Check for struct
	v4l2_ext_control.string field.
	* v4l2.c (print_v4l2_ext_control): Change guard macro
	to HAVE_STRUCT_V4L2_EXT_CONTROL_STRING.

	xlat: update V4L2_COLORSPACE_* constants.
	* xlat/v4l2_colorspaces.in: Add #value_indexed.
	(V4L2_COLORSPACE_DEFAULT): New constant introduced by Linux commit
	v4.2-rc1~107^2~184.
	(V4L2_COLORSPACE_ADOBERGB): Rename to V4L2_COLORSPACE_OPRGB, per Linux
	commit v4.20-rc1~69^2~122.
	(V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_SMPTE240M,
	V4L2_COLORSPACE_REC709, V4L2_COLORSPACE_BT878,
	V4L2_COLORSPACE_470_SYSTEM_M, V4L2_COLORSPACE_470_SYSTEM_BG,
	V4L2_COLORSPACE_JPEG, V4L2_COLORSPACE_SRGB, V4L2_COLORSPACE_OPRGB,
	V4L2_COLORSPACE_BT2020, V4L2_COLORSPACE_RAW, V4L2_COLORSPACE_DCI_P3):
	Add fallback definitions.

	xlat: Provide fallback definitions for V4L2_FIELD_* constants.
	* xlat/v4l2_fields.in: Add fallback definitions for constants.

	xlat: update V4L2_BUF_TYPE_* constants.
	* xlat/v4l2_buf_types.in: Add fallback definitions for constants,
	mention V4L2_BUF_TYPE_PRIVATE in comment, add #value_indexed.
	* configure.ac (AC_CHECK_MEMBERS): Add checks for
	struct v4l2_format.fmt.pix_mp, struct v4l2_format.fmt.sdr, and
	struct v4l2_format.fmt.sliced.
	* v4l2.c (print_v4l2_format_fmt): Use the relevant HAVE_STRUCT_* macros
	instead of HAVE_DECL_V4L2_BUF_TYPE_*.

	xlat: provide fallback definitions for V4L2_CAP_* constants.
	* xlat/v4l2_device_capabilities_flags.in: Sort, add fallback definitions
	for constants.
	* configure.ac (AC_CHECK_MEMBERS): Check for struct
	v4l2_capability.device_caps.
	* v4l2.c (print_v4l2_capability): Change V4L2_CAP_DEVICE_CAPS guard
	to HAVE_STRUCT_V4L2_CAPABILITY_DEVICE_CAPS.

2019-10-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	evdev: decode struct input_absinfo regardless of in-kernel definitions.
	* evdev.c (struct_input_absinfo): New typedef.
	(abs_ioctl): Add code argument. Add orig_sz, res_sz, sz, read_sz local
	variables. Decode resolution field regardless of
	HAVE_STRUCT_INPUT_ABSINFO_RESOLUTION.
	(evdev_read_ioctl, evdev_write_ioctl): Pass code to abs_ioctl.
	* tests/ioctl_evdev-success.c (print_input_absinfo): Update expected
	output.
	(main): Add absinfo_sz, absinfo_24, absinfo_32 local variables; add
	additional checks for struct input_absinfo.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	evdev: do not rely on EVIOC* constants provided in <linux/input.h>
	* xlat/evdev_ioctl_cmds.in: New file.
	* configure.ac (AC_CHECK_HEADERS([linux/input.h])): Check for struct
	input_keymap_entry and struct input_mask.
	* evdev.c [!INPUT_PROP_MAX] (INPUT_PROP_MAX): New macro definition.
	(struct_input_keymap_entry, struct_input_mask): New typedefs.
	[HAVE_STRUCT_INPUT_KEYMAP_ENTRY]: Add a static_assert to check
	that sizeof(struct input_keymap_entry) has the expected value.
	[HAVE_STRUCT_INPUT_MASK]: Add a static_assert to check
	that sizeof(struct input_mask) has the expected value.
	[!EVIOCGPROP] (EVIOCGPROP): New macro definition.
	[!EVIOCGMTSLOTS] (EVIOCGMTSLOTS): Likewise.
	[!EVIOCGSW] (EVIOCGSW): Likewise.
	[!EVIOCGKEYCODE_V2] (keycode_V2_ioctl): Remove guard.
	(keycode_V2_ioctl): Change type of ike to struct_input_keymap_entry.
	[!EVIOCGMTSLOTS] (mtslots_ioctl): Remove guard.
	[!EVIOCGREP || EVIOCSREP] (repeat_ioctl): Likewise.
	(evdev_read_ioctl) [!EVIOCGREP] <case EVIOCGREP>: Likewise.
	(evdev_read_ioctl) [!EVIOCGKEYCODE_V2] <case EVIOCGKEYCODE_V2>:
	Likewise.
	(evdev_read_ioctl) [!EVIOCGMTSLOTS] <case EVIOCGMTSLOTS>: Likewise.
	(evdev_read_ioctl) [!EVIOCGPROP] <case EVIOCGPROP>: Likewise.
	(evdev_read_ioctl) [!EVIOCGSW] <case EVIOCGSW>: Likewise.
	(evdev_write_ioctl) [!EVIOCSREP] <case EVIOCSREP>: Likewise.
	(evdev_write_ioctl) [!EVIOCSKEYCODE_V2] <case EVIOCSKEYCODE_V2>: Likewise.
	(evdev_write_ioctl) [!EVIOCREVOKE] <case EVIOCREVOKE>: Likewise.
	(evdev_write_ioctl) [!EVIOCSCLOCKID] <case EVIOCSCLOCKID>: Likewise.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests/nsyscalls.c: remove redundant definition of SYSCALL_BIT.
	Starting with commit v5.3~111, tests/nsyscalls.c includes "scno.h"
	which already defines SYSCALL_BIT where appropriate.

	* tests/nsyscalls.c (SYSCALL_BIT): Remove.

2019-10-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: replace "sed -E" with "sed -r"
	because the latter is more portable.

	* tests/strace-D.test: Replace "sed -E" with "sed -r".

2019-10-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add BPF_MAP_TYPE_DEVMAP_HASH to bpf_map_types.
	* xlat/bpf_map_types.in (BPF_MAP_TYPE_DEVMAP_HASH): New constant,
	introduced by Linux commit v5.4-rc1~131^2~248^2~16^2~3.
	* tests/bpf.c: Update expected output.

	xlat: add BPF_F_CLONE to bpf_map_flags.
	* xlat/bpf_map_flags.in (BPF_F_CLONE): New flag, introduced by Linux
	commit v5.4-rc1~131^2~62^2~34^2~2.
	* tests/bpf.c: Update expected output.

	xlat: add BPF_F_TEST_STATE_FREQ to bpf_prog_flags.
	* xlat/bpf_prog_flags.in (BPF_F_TEST_STATE_FREQ): New constant,
	introduced by Linux commit v5.4-rc1~131^2~62^2~17^2~3.
	* tests/bpf.c: Update expected output.

	xlat: update waitid_types.
	* xlat/waitid_types.in (P_PIDFD): New constant, introduced by Linux
	commit v5.4-rc1~203^2~4.
	(P_ALL, P_PID, P_PGID): Add fallback values.
	(P_PPID, P_SID, P_CID, P_UID, P_GID, P_LWPID): Remove.

	xlat: update v4l2_format_description_flags.
	* xlat/v4l2_format_description_flags.in (V4L2_FMT_FLAG_COMPRESSED,
	V4L2_FMT_FLAG_EMULATED): Add fallback definitions.
	(V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM): New constant, introduced by Linux
	commit v5.4-rc1~145^2~69.
	(V4L2_FMT_FLAG_DYN_RESOLUTION): New constant, introduced by Linux commit
	v5.4-rc1~145^2~68.

	xlat: update sock_sctp_options.
	* xlat/sock_sctp_options.in (SCTP_ASCONF_SUPPORTED): New constant,
	introduced by Linux commit v5.4-rc1~131^2~204^2~4.
	(SCTP_AUTH_SUPPORTED): New constant, introduced by Linux commit
	v5.4-rc1~131^2~204^2~1.
	(SCTP_ECN_SUPPORTED): New constant, introduced by Linux commit
	v5.4-rc1~131^2~140^2.

	xlat: add EROFS_SUPER_MAGIC_V1 to fsmagic.
	* xlat/fsmagic.in (EROFS_SUPER_MAGIC_V1): New constant, introduced
	by Linux commit v5.4-rc1~134^2~105.

2019-10-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_route: decode struct rta_mfc_stats and struct rtvia unconditionally
	* rtnl_route.c (struct_rta_mfc_stats, struct_rtvia): New typedefs.
	[HAVE_STRUCT_RTA_MFC_STATS]: Add a static_assert to check
	that sizeof(struct rta_mfc_stats) has the expected value.
	[HAVE_STRUCT_RTVIA]: Add a static_assert to check that sizeof(struct
	rtvia) has the expected value.
	(decode_rta_mfc_stats) [HAVE_STRUCT_RTA_MFC_STATS]: Remove guard.
	(decode_rta_mfc_stats): Change the type of mfcs variable to
	struct_rta_mfc_stats.
	(decode_rtvia): Change the type of via variable to struct_rtvia.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_neightbl: always decode struct ndt_config and struct ndt_stats.
	* rtnl_neightbl.c (struct_ndt_config, struct_ndt_stats): New typedefs.
	[HAVE_STRUCT_NDT_CONFIG]: New static_assert to check
	that sizeof(struct ndt_config) has the expected value.
	[HAVE_STRUCT_NDT_STATS]: New static_assert to check
	that sizeof(struct ndt_stats) has the expected value.
	(decode_ndt_config) [HAVE_STRUCT_NDT_CONFIG]: Remove guard.
	(decode_ndt_config): Change the type of ndtc variable
	to struct_ndt_config.
	(decode_ndt_stats) [HAVE_STRUCT_NDT_STATS]: Remove guard.
	(decode_ndt_stats): Change the type of ndtst variable
	to struct_ndt_stats.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_mdb: decode messages regardless of availability of kernel headers.
	* netlink_route.c [!HAVE_STRUCT_BR_PORT_MSG]: Do not skip decoding of
	RTM_DELMDB, RTM_GETMDB, and RTM_NEWMDB messages.
	* rtnl_mdb.c: Remove #ifdef HAVE_STRUCT_BR_PORT_MSG guard.
	(struct_br_port_msg, struct_br_mdb_entry): New typedefs.
	[HAVE_STRUCT_BR_PORT_MSG]: Static assert check for struct br_port_msg
	size.
	[HAVE_STRUCT_BR_NDB_ENTRY]: Static assert check for strucr br_mdb_entry
	size.
	(decode_mdba_mdb_entry_info) [!HAVE_STRUCT_BR_MDB_ENTRY]: Remove.
	(decode_mdba_mdb_entry_info): Change entry type to struct_br_mdb_entry.
	(decode_mdba_mdb_entry_info) [HAVE_STRUCT_BR_MDB_ENTRY_FLAGS,
	HAVE_STRUCT_BR_MDB_ENTRY_VID]: Remove guards.
	(decode_br_port_msg): Change bpm type to struct_br_port_msg.
	* tests/nlattr_ifinfomsg.c: Use TEST_NLATTR_OBJECT_MINSZ to test
	struct rtnl_link_stats printing.
	* tests/nlattr_mdba_mdb_entry.c: Update expected output.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: print pad field in the struct ifla_port_vsi decoder.
	And steamline the flow a bit.

	* rtnl_link.c (decode_ifla_port_vsi): Factor the printing code out of
	the conditional statement, add pad field printing.
	* tests/nlattr_ifla_port.c: Add check for the pad field printing.

2019-10-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: use internal rtnl_link_stats* and ifla_port_vsi definitions.
	Define substitutes for struct rtnl_link_stats, struct
	rtnl_link_stats64, and struct ifla_port_vsi internally.
	Add a static_assert that informs about future growth of the structures
	provided by the kernel headers.

	* rtnl_link.c (struct_rtnl_link_stats, struct_rtnl_link_stats64,
	struct_ifla_port_vsi): New typedefs.
	[HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER]: Add a static_assert to check
	that sizeof(struct rtnl_link_stats) has the expected value.
	[HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER]: Add a static_assert
	to check that sizeof(struct rtnl_link_stats) has the expected value.
	[HAVE_STRUCT_IFLA_PORT_VSI]: Add a static_assert to check
	that sizeof(struct ifla_port_vsi) has the expected value.
	(decode_rtnl_link_stats) [HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER]:
	Remove guard.
	(decode_rtnl_link_stats): Change the type of st variable to
	struct_rtnl_link_stats; use struct_rtnl_link_stats in offsetofend
	statement for min_size definition.
	(decode_rtnl_link_stats64) [HAVE_STRUCT_RTNL_LINK_STATS64,
	HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER]: Remove guards.
	(decode_rtnl_link_stats64): Change the type of st variable
	to struct_rtnl_link_stats64.
	(decode_ifla_port_vsi) [HAVE_STRUCT_IFLA_PORT_VSI]: Remove guard.
	(decode_ifla_port_vsi): Change the type of vsi variable
	to struct_ifla_port_vsi.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Enable building of netlink_crypto decoder without linux/cryptouser.h.
	* xlat/crypto_msgs.in: New file.
	* configure.ac (AC_CHECK_TYPES): Check for struct crypto_user_alg.
	* netlink.c: Include "xlat/crypto_msgs.h" with XLAT_MACROS_ONLY defined.
	(netlink_decoders[]): Remove HAVE_LINUX_CRYPTOUSER_H guard around
	[NETLINK_CRYPTO] item.
	* netlink_crypto.c: Remove HAVE_LINUX_CRYPTOUSER_H guard; include
	<linux/cryptouser.h> under HAVE_LINUX_CRYPTOUSER_H; include
	"xlat/crypto_msgs.h" with XLAT_MACROS_ONLY defined.
	[!CRYPTO_MAX_NAME] (CRYPTO_MAX_NAME): New macro.
	(struct_crypto_user_alg, struct_crypto_report_hash,
	struct_crypto_report_cipher, struct_crypto_report_blkcipher,
	struct_crypto_report_aead, struct_crypto_report_rng): New typedefs.
	[HAVE_STRUCT_CRYPTO_USER_ALG]: New static_assert to check
	that sizeof(struct crypto_user_alg) has the expected value.
	[HAVE_STRUCT_CRYPTO_REPORT_HASH]: New static_assert to check
	that sizeof(struct crypto_report_hash) has the expected value.
	[HAVE_STRUCT_CRYPTO_REPORT_CIPHER]: New static_assert to check
	that sizeof(struct crypto_report_cipher) has the expected value.
	[HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER]: New static_assert to check
	that sizeof(struct crypto_report_blkcipher) has the expected value.
	[HAVE_STRUCT_CRYPTO_REPORT_AEAD]: New static_assert to check
	that sizeof(struct crypto_report_aead) has the expected value.
	[HAVE_STRUCT_CRYPTO_REPORT_RNG]: New static_assert to check
	that sizeof(struct crypto_report_rng) has the expected value.
	(decode_crypto_report_hash) [!HAVE_STRUCT_CRYPTO_REPORT_HASH]: Remove.
	(decode_crypto_report_hash): Change type of rhash to
	struct_crypto_report_hash.
	(decode_crypto_report_blkcipher) [!HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER]:
	Remove.
	(decode_crypto_report_blkcipher): Change type of rblkcipher to
	struct_crypto_report_blkcipher.
	(decode_crypto_report_aead) [!HAVE_STRUCT_CRYPTO_REPORT_AEAD]: Remove.
	(decode_crypto_report_aead): Change type of raead to
	struct_crypto_report_aead.
	(decode_crypto_report_rng) [!HAVE_STRUCT_CRYPTO_REPORT_RNG]: Remove.
	(decode_crypto_report_rng): Change type of rrng to
	struct_crypto_report_rng.
	(decode_crypto_report_cipher) [!HAVE_STRUCT_CRYPTO_REPORT_CIPHER]:
	Remove.
	(decode_crypto_report_cipher): Change type of rcipher to
	struct_crypto_report_cipher.
	(decode_crypto_user_alg): Change type of alg to struct_crypto_user_alg.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

	macros.h: include <stddef.h>
	Since offsetofend macro definition relies on presence of offsetof
	declaration.

	* macros.h: Include <stddef.h>.

2019-10-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

	evdev: remove additional indentation level for switch case labels.
	And while we are here, factor out evdev_write_ioctl_mpers call
	out of the switch statement.

	* evdev.c (bit_ioctl, evdev_read_ioctl, evdev_ioctl): Remove
	one indentation level inside the switch statements.
	(evedev_write_ioctl): Remove one indentation level inside the switch
	statement; move default branch out of the switch statement.

2019-10-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: introduce TEST_NLATTR_OBJECT_MINSZ.
	It is useful in cases where a structure grows over time and we support
	decoding of only part of it.

	* tests/test_nlattr.h (TEST_NLATTR_OBJECT_EX_, TEST_NLATTR_OBJECT_EX):
	Add minsz_ parameter, use it instead of sizeof(obj_).
	(TEST_NLATTR_OBJECT): Pass sizeof(obj_) as minsz_.
	(TEST_NLATTR_OBJECT_MINSZ): New macro.
	* tests/nlattr_crypto_user_alg.c (main): Add proper minsz_ argument to
	TEST_NLATTR_OBJECT_EX instances.

2019-10-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for ABS_MT_* constants.
	* xlat/evdev_mtslots.in: Add fallback definitions.  Add #sorted.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs.h: compact struct tcb a bit by moving currpers field.
	As reported by pahole, struct tcb has size of 328 bytes and 8 bytes
	of holes on x86_64; by moving currpers after qual_flg, both holes are
	leminated and the structure fits into 8 cache lines now.  This should
	also benefit other 64-bit architectures.

	* defs.h [SUPPORTED_PERSONALITIES > 1] (struct tcb): Move currpers field
	after qual_flg field.

2019-10-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: use unsgined type for mount_flags fallback values.
	Reported by cppcheck:

	    strace/xlat/mount_flags.h:256: error[shiftTooManyBitsSigned]:
	    Shifting signed 32-bit value by 31 bits is undefined behaviour
	    #  254|    XLAT(MS_BORN),
	    #  255|    XLAT(MS_ACTIVE),
	    #  256|->  XLAT(MS_NOUSER),
	    #  257|    XLAT_END
	    #  258|   };

	* xlat/mount_flags.in: Use 1U instead of 1 as a bit shifting operand.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1747524

2019-10-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_rule: decode fib_rule_uid_range without use of <linux/fib_rules.h>
	* rtnl_rule.c (decode_fib_rule_uid_range): Define struct type for
	fib_rule_uid_range explicitly.
	(decode_fib_rule_uid_range) [!HAVE_STRUCT_FIB_RULE_UID_RANGE]: Remove.
	* xlat/fib_rule_flags.in: Add fallback definitions.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update MDB_FLAGS_* constants.
	Also, provide fallback definitions for constants.

	* xlat/mdb_flags.in (MDB_FLAGS_OFFLOAD): Add fallback definition.
	(MDB_FLAGS_FAST_LEAVE): New constant, introduced by Linux commit
	v5.4-rc1~131^2~321.

2019-10-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for XDP_FLAGS_* constants.
	* xlat/xdp_flags.in: Add fallback definitions.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for netlink_ack_flags constants.
	* xlat/netlink_ack_flags.in: Add fallback definitions.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for UFFD_FEATURE_* constants.
	* xlat/uffd_api_features.in: Add fallback definitions.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	riscv64: remove dead code left after riscv64 mpers removal.
	Since there is no compat on RISCV64 so far, its dead remains are only
	confusing.

	* linux/riscv64/arch_get_personality.c: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.

	Reported-by: Elvira Khabirova <lineprinter0@gmail.com>
	Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
	Complements: v5.3~18 "riscv64: remove mpers support"

2019-10-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: try to avoid false positives in times sanity check.
	Checking clock_gettime(CLOCK_PROCESS_CPUTIME_ID) starting from the
	second iteration may produce false positives sometimes, try to spend
	more iterations before starting checking it.

	* tests/times.c (NUM_USER_ITERS_SQRT): New enum entity.
	(NUM_USER_ITERS): Define via NUM_USER_ITERS_SQRT.
	(main): Check i against NUM_USER_ITERS_SQRT first before checking
	the returned CPU time for sanity.

2019-10-09  Dmitry V. Levin  <ldv@altlinux.org>

	filter_seccomp: fix build on antique systems.
	Fixed build on systems that do not provide necessary definitions
	of AUDIT_ARCH_* constants.

	* filter_seccomp.c [PERSONALITY0_AUDIT_ARCH]: Include
	"xlat/elf_em.h" and "xlat/audit_arch.h" under XLAT_MACROS_ONLY.
	* tests/filter_seccomp-flag.c: Likewise.
	* NEWS: Mention this fix.

	Fixes: v5.3~7 "Introduce seccomp-assisted syscall filtering"

2019-10-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check -DD and -DDD options.
	* tests/strace-D.test: Check -DD and -DDD.
	* tests/strace-DD.test: New test.
	* tests/strace-DDD.test: Likewise.
	* tests/strace-DD.expected: New file.
	* tests/strace-DDD.expected: Likewise.
	* tests/tracer_ppid_pgid_sid.c: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add tracer_ppid_pgid_sid.
	(MISC_TESTS): Add strace-DD.test and strace-DDD.test.
	(EXTRA_DIST): Add strace-DD.expected and strace-DDD.expected.

2019-10-07  Fanda Uchytil  <strace.t8xuewpmde@h4x.cz>
	    Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	strace: expand -D option.
	As of now, despite of being stated that -D option runs strace as a "detached"
	grandchild (and the option name being named after "daemon"), strace
	still runs in the same process group and session, thus not being
	"detached" in a common sense and being subjected to process group kill
	and session termination kill. Quoting[1]:

	    I stumble upon unexpected behavior: if strace is used with option '-D'
	    (tracer as a detached grandchild) and process (leader) kills whole
	    process group, it will kill strace too.

	    It can be easily reproduced by `timeout` from "coreutils":

	      # timeout -s KILL 2 strace -D -o ./strace-inside.log /bin/sleep 10 &

	    Here we can see, that `strace` didn't finished its output (because it
	    was killed):

	      # tail -n 1 ./strace-inside.log
	      nanosleep({tv_sec=10, tv_nsec=0},

	    If `timeout` is not run in '--foreground' mode, it changes process group
	    and after "timeout" it sends two kills:

	      setpgid(0, 0)                           = 0
	      kill(37337, SIGKILL)                    = 0
	      kill(0, SIGKILL)                        = ?

	    The first kill is for the `sleep` and the second one is for the process
	    group (which is `strace` part of). PIDs and their relations are:

	      timeout  pid=30595   [ppid=476   bash   ]     pgrp=30595
	      sleep    pid=37337   [ppid=30595 timeout]     pgrp=30595
	      strace   pid=30603   [ppid=1     systemd]     pgrp=30595

	    Here is "strace log" of `strace` inside `timeout`:

	      strace: Process 30603 attached
	      wait4(-1,  <unfinished ...>)            = ?
	      +++ killed by SIGKILL +++

	    I think that detached `strace` should not be killed like that -- it
	    should not be part of former grandparents' "job pipeline".

	While this behaviour is not exactly intuitive, it is implemented this
	way for quite some time, so it might be relied upon by some of strace
	users.  In order to address this issue, two new levels of
	"daemonisation" are added, that put strace in a separate process group
	and session, respectively.

	[1] https://lists.strace.io/pipermail/strace-devel/2019-October/009160.html

	* strace.1.in (.SH SYNOPSIS): Update.
	(.SS Tracing): Document -DD and -DDD.
	* strace.c (DAEMONIZE_NONE, DAEMONIZE_GRANDCHILD, DAEMONIZE_NEW_PGROUP,
	* DAEMONIZE_NEW_SESSION, DAEMONIZE_OPTS_GUARD__, MAX_DAEMONIZE_OPTS):
	* New enumeration entities.
	(daemonized_tracer): Change type to unsigned int.
	(usage): Document -DD and -DDD.
	(startup_attach) <daemonized_tracer == DAEMONIZE_NEW_PGROUP>: Call
	setpgid.
	<daemonized_tracer == DAEMONIZE_NEW_SESSION>: Call setsid.
	(init) <case 'D'>: Increase daemonized_tracer instead of setting to 1.
	(init): Bail out if too many -D's are given.
	* NEWS: Mention this improvement.
	* tests/options-syntax.test: Add checks for -D option usage.

2019-10-04  Dmitry V. Levin  <ldv@altlinux.org>

	Fix -b execve when --seccomp-bpf option is specified.
	As --seccomp-bpf does not support detaching, explicitly turn off
	this option when -b execve is specified.

	* strace.c (init): Turn off --seccomp-bpf when -b execve is specified.
	* NEWS: Mention this fix.
	* tests/bexecve.test: Check it.

	Fixes: v5.3~7 "Introduce seccomp-assisted syscall filtering"

2019-10-04  Dmitry V. Levin  <ldv@altlinux.org>

	filter_seccomp: fix build for no-MMU targets.
	Avoid unsupported fork() call on no-MMU Linux systems to fix
	the following link error:

	ld: strace-filter_seccomp.o: in function `check_seccomp_filter':
	filter_seccomp.c:(.text+0x39a): undefined reference to `fork'
	collect2: error: ld returned 1 exit status

	* filter_seccomp.c (__gcov_flush, check_seccomp_order_do_child,
	check_seccomp_order_tracer): Move under HAVE_FORK guard.
	(check_seccomp_order): Move fork code under HAVE_FORK guard.
	(check_seccomp_filter_properties): Do not check for NOMMU_SYSTEM.
	* NEWS: Mention this fix.

	Reported-and-tested-by: Baruch Siach <baruch@tkos.co.il>
	Fixes: v5.3~7 "Introduce seccomp-assisted syscall filtering"

2019-10-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check -D option.
	* tests/strace-D.test: New test.
	* tests/strace-D.expected: New file.
	* tests/Makefile.am (MISC_TESTS): Add strace-D.test.
	(EXTRA_DIST): Add strace-D.expected.

	tests: check -F and -zZ options.
	* tests/options-syntax.test: Check error diagnostics of -F and -zZ
	options.

	tests: extend checks of --seccomp-bpf diagnostics.
	* tests/options-syntax.test: Add --seccomp-bpf checks.

	tests: add support of multi-line diagnostics to check_h.
	* tests/syntax.sh (check_h): Add support of multi-line diagnostics.

2019-10-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Move FLAG_ macro from defs.h to macros.h.
	Rename it to FLAG and implement via newly added BIT helper macro,
	in preparation for general use

	* defs.h: Use FLAG instead of FLAG_.
	(FLAG_): Move it...
	* macros.h (FLAG): Here, implement using BIT macro.
	[!BIT] (BIT): New macro.

2019-10-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ioctl: sort entries in ioctl_decode switch statement.
	* ioctl.c (ioctl_decode): Sort case branches in the switch statement.

2019-10-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: avoid double printing of ellipsis in print_array.
	When PAF_ARRAY_TRUNCATED flag is provided to print_array_ex.

	* util.c (print_array_ex): Add truncated flag, set it when the output
	is truncated, avoid explicit ellipsis printing when it is set.

	Fixes: v5.3~14 "Add PAF_ARRAY_TRUNCATED flag for print_array_ex"

2019-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add ioctl_evdev-success* test binaries to .gitignore.
	* tests/.gitignore: Add ioctl_evdev-success-Xabbrev,
	ioctl_evdev-success-Xraw, ioctl_evdev-success-Xverbose,
	ioctl_evdev-success-v-Xabbrev, ioctl_evdev-success-v-Xraw,
	and ioctl_evdev-success-v-Xverbose.

	Fixes: v5.3~9 "Handle xlat verbosity in evdev bitset printing"

2019-10-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests/sigaction: workaround odd libcs on alpha and mips.
	Apparently, some libcs define SA_RESTORER on alpha and mips
	despite of the absence of sa_restorer field.  Workaround this
	to match the logic implemented in decode_old_sigaction().

	* tests/sigaction.c (main) [ALPHA || MIPS]: Do not check decoding
	of sa_restorer field.

2019-10-02  Dmitry V. Levin  <ldv@altlinux.org>

	Distribute copyright-year-gen, file-date-gen, and git-version-gen.
	These scripts have to be distributed along with configure.ac since
	the latter uses them.

	* Makefile.am (EXTRA_DIST): Add copyright-year-gen, file-date-gen,
	and git-version-gen.

2019-10-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix -a argument in stat and lstat tests.
	* tests/trace_lstat.in (lstat): Change -a argument from 32 to 31.
	* tests/trace_stat.in (stat): Change -a argument from 32 to 30.
	* tests/gen_tests.in (lstat): Change -a argument from 32 to 31.
	(stat): Change -a argument from 32 to 30.

	This fixes Debian bug #929715.

2019-10-01  Dmitry V. Levin  <ldv@altlinux.org>

	Prefer https URLs where possible.
	* maint/README-release: Use https URL instead of http.
	* xlat/elf_em.in: Likewise.

	Update debian/watch.
	* debian/watch: Sync with Debian strace-4.26-0.2 package.

	Update ax_prog_cc_for_build.m4.
	* m4/ax_prog_cc_for_build.m4: Update from autoconf-archive.

	Update auxiliary maintainer mode build tools.
	* git-set-file-times: Update from rsync.
	* git-version-gen: Update from gnulib.
	* gitlog-to-changelog: Likewise.

2019-09-27  Andreas Schwab  <schwab@linux-m68k.org>

	Remove traces of riscv64 mpers.
	* tests/options-syntax.test: Remove riscv64.
	* tests/qualify_personality.sh: Likewise.
	* tests/strace-V.test: Likewise.

	Fixes: v5.3~18 "riscv64: remove mpers support"

2019-09-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: move --seccomp-bpf description down.
	Option descriptions generally maintain lexicographical order.

	* strace.1.in (.SS Miscellaneous): Move --seccomp-bpf option description
	down in order to maintain lexicographical option description order.

2019-09-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: mention seccomp(2) in --seccomp-bpf option description.
	And format ptrace(2) properly as well.

	* strace.1.in (.SS Miscellaneous): Mention seccomp(2), format ptrace(2)
	mention.

2019-09-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: describe time format specification.
	Commits v5.3~74 and v5.3~73 have introduced an extended syntax
	for time interval sizes specification, but the relevant descriotion
	was lacking.  Fix it by adding the relevant section to the man page
	and reference to it in the descriptions of the respective options.

	* strace.1.in (.SH OPTIONS): Rewrite descriptions of -O,
	-e inject=delay_enter, and -e inject=delay_exit values, refer to section
	"Time specification format description".
	(.SS "Time specification format description"): New section.

	Complements: v5.3~74 "delay: use parse_ts for parsing delay value"
	Complements: v5.3~73 "count: use parse_ts for parsing overhead value"

2019-09-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: add a missing comma before "but"
	* strace.1.in (.SH DESCRIPTION): Add a missing comma.

	strace.1.in: eliminate empty lines.
	Replace them with .IP or just remove.

2019-09-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: properly indent -e inject description.
	As inject option description is moved to a separate section, its
	.TP macro now requires an argument.

	* strace.1.in (.SS Tampering): Add indent size argument to the first
	.TP macro instance.

	Fixes: v5.3~99 "strace.1.in: reorder options"

2019-09-25  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 5.3-1.
	* strace.spec.in: Likewise.

	Prepare for 5.3 release.
	* NEWS: Update for 5.3 release.

	tests: workaround systemd-nspawn habit of disabling unimplemented syscalls
	* tests/clone3.c (do_clone3_): Do not assume that unimplemented
	syscalls always fail with ENOSYS.

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2019-09-25  Dmitry V. Levin  <ldv@altlinux.org>

	Fix preprocessor indentation.
	Indent the C preprocessor directives to reflect their nesting
	using the following script:

	$ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do
		cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
	done

2019-09-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.

2019-09-25  Chen Jingpiao  <chenjingpiao@gmail.com>
	    Paul Chaignon  <paul.chaignon@gmail.com>

	tests: check seccomp-assisted syscall filtering.
	Test filter_seccomp-perf checks whether seccomp-filter is actually
	enabled by comparing the number of syscalls performed in a time interval
	when seccomp-filter is enabled vs. disabled.  The number of syscalls
	should be at least one order of magnitude higher when seccomp-filter
	is enabled.

	Test filter_seccomp-flag ensures the audit_arch_vec[].flag constants do
	not conflict with syscall numbers.  If this test fails, then the number
	of syscalls grew high enough that the code for seccomp-filter needs to
	be updated.

	* tests/init.sh (test_prog_set): New function.
	* tests/status-none-f.c: New file.
	* tests/filter_seccomp.in: Likewise.
	* tests/filter_seccomp.sh: Likewise.
	* tests/filter_seccomp-perf.c: Likewise.
	* tests/filter_seccomp-flag.c: Likewise.
	* tests/filter_seccomp-perf.test: New test.
	* tests/Makefile.am (EXTRA_DIST): Add filter_seccomp.in and
	filter_seccomp.sh.
	(MISC_TESTS): Add filter_seccomp-perf.test.
	(check_PROGRAMS): Add filter_seccomp-perf and filter_seccomp-flag.
	* tests/pure_executables.list: Add status-none-f.
	* tests/.gitignore: Add status-none-f, filter_seccomp-perf, and
	filter_seccomp-flag.
	* tests/gen_tests.in (filter_seccomp, filter_seccomp-flag): New entries.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-09-25  Paul Chaignon  <paul.chaignon@gmail.com>

	filter_seccomp: skip seccomp setup when there's nothing to filter.
	If the trace_set set is complete (no syscalls are filtered), seccomp
	filtering is disabled.  This patch adds a new is_complete_set_array
	function to check whether all sets of a set array are complete.

	* number_set.c (is_complete_set_array): New function.
	* number_set.h (is_complete_set_array): New prototype.
	* filter_seccomp.c (check_seccomp_filter): Skip seccomp setup if there is
	nothing to filter.

2019-09-25  Chen Jingpiao  <chenjingpiao@gmail.com>
	    Paul Chaignon  <paul.chaignon@gmail.com>

	Introduce seccomp-assisted syscall filtering.
	With this patch, strace can rely on seccomp to only be stopped at syscalls
	of interest, instead of stopping at all syscalls.  The seccomp filtering
	of syscalls is opt-in only; it must be enabled with the --seccomp-bpf
	option.  Kernel support is first checked with check_seccomp_filter(),
	which also ensures the BPF program derived from the syscalls to filter
	is not larger than the kernel's limit.

	The --seccomp-bpf option implies -f, but a warning is emitted if -f is not
	explicitly specified.  Since a task's children inherit its seccomp
	filters, we want to ensure all children are also traced to avoid their
	syscalls failing with ENOSYS (cf. SECCOMP_RET_TRACE in seccomp man page).

	Fork/vfork/clone children of traced processes are marked as not having a
	seccomp filter until we receive a first seccomp-stop.  They are therefore
	stopped at every syscall entries and exits until that first seccomp-stop.

	The current BPF program implements a simple linear match of the syscall
	numbers.  Contiguous sequences of syscall numbers are however matched as
	an interval, with two instructions only.  The algorithm can be improved
	or replaced in the future without impacting user-observed behavior.

	The behavior of SECCOMP_RET_TRACE changed between Linux 4.7 and 4.8
	(cf. PTRACE_EVENT_SECCOMP in ptrace man page).  This patch supports both
	behaviors by checking the kernel's actual behavior before installing the
	seccomp filter.

	* filter_seccomp.c: New file.
	* filter_seccomp.h: New file.
	* Makefile.am (strace_SOURCES): Add filter_seccomp.c and
	filter_seccomp.h.
	* linux/aarch64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
	PERSONALITY1_AUDIT_ARCH): Define for aarch64.
	* linux/powerpc64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
	PERSONALITY1_AUDIT_ARCH): Likewise for powerpc64.
	* linux/s390x/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
	* linux/sparc64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
	PERSONALITY1_AUDIT_ARCH): Likewise for sparc64.
	PERSONALITY1_AUDIT_ARCH): Likewise for s390x.
	* linux/tile/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
	PERSONALITY1_AUDIT_ARCH): Likewise for tile.
	* linux/x32/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
	PERSONALITY1_AUDIT_ARCH): Likewise for x32.
	* linux/x86_64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
	PERSONALITY1_AUDIT_ARCH, PERSONALITY2_AUDIT_ARCH): Likewise for x86_64.
	* linux/ia64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise for IA64.
	* strace.c (usage): Document --seccomp-bpf option.
	(startup_child): Mark process has having seccomp filter.
	(exec_or_die): Initialize seccomp filtering if requested.
	(init): Handle --seccomp-bpf option and check that seccomp can be
	enabled.
	(print_debug_info): Handle PTRACE_EVENT_SECCOMP.
	(next_event): Capture PTRACE_EVENT_SECCOMP event.
	(dispatch_event): Handle PTRACE_EVENT_SECCOMP event.
	* trace_event.h (trace_event): New enumeration entity.
	* strace.1.in: Document new --seccomp-bpf option.
	* NEWS: Mention this change.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-09-25  Dmitry V. Levin  <ldv@altlinux.org>

	Add support for long options.
	Recognize --help and --version options as aliases to -h and -V options,
	respectively.

	* strace.c: Include <getopt.h>.
	(init): Move short options to optstring, add longopts array, use
	getopt_long instead of getopt.
	(usage): Document --help and --version options.
	* strace.1.in: Likewise.
	* tests/strace-V.test: Check that "strace --version" output is the same
	as "strace -V" output.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Handle xlat verbosity in evdev bitset printing.
	* defs.h (print_xint32_array_member, print_xint64_array_member): New
	function declarations.
	(print_xlong_array_member): New static inline function.
	* util.c (print_xint32_array_member, print_xint64_array_member): New
	functions.
	* evdev.c (decode_bitset): Handle xlat verbosity option.
	* tests/ioctl_evdev-Xabbrev.c: New file.
	* tests/ioctl_evdev-Xraw.c: Likewise.
	* tests/ioctl_evdev-Xverbose.c: Likewise.
	* tests/ioctl_evdev-success-Xabbrev.c: Likewise.
	* tests/ioctl_evdev-success-Xraw.c: Likewise.
	* tests/ioctl_evdev-success-Xverbose.c: Likewise.
	* tests/ioctl_evdev-success-v-Xabbrev.c: Likewise.
	* tests/ioctl_evdev-success-v-Xraw.c: Likewise.
	* tests/ioctl_evdev-success-v-Xverbose.c: Likewise.
	* tests/ioctl_evdev-v-Xabbrev.c: Likewise.
	* tests/ioctl_evdev-v-Xraw.c: Likewise.
	* tests/ioctl_evdev-v-Xverbose.c: Likewise.
	* tests/ioctl_evdev-success.c (test_evdev, print_getbit, main): Update
	expected output.
	* tests/ioctl_evdev.c (UNK_CMD): New macro.
	(print_ffe_common, main): Update expected output.
	* tests/Makefile.am (check_PROGRAMS): Add ioctl_evdev-success-Xabbrev,
	ioctl_evdev-success-Xraw, ioctl_evdev-success-Xverbose,
	ioctl_evdev-success-v-Xabbrev, ioctl_evdev-success-v-Xraw, and
	ioctl_evdev-success-v-Xverbose.
	* tests/gen_tests.in (ioctl_evdev-Xabbrev, ioctl_evdev-Xraw,
	ioctl_evdev-Xverbose, ioctl_evdev-v-Xabbrev, ioctl_evdev-v-Xraw,
	ioctl_evdev-v-Xverbose, ioctl_evdev-success-Xabbrev,
	ioctl_evdev-success-Xraw, ioctl_evdev-success-Xverbose,
	ioctl_evdev-success-v-Xabbrev, ioctl_evdev-success-v-Xraw,
	ioctl_evdev-success-v-Xverbose tests): New entries.
	(ioctl_evdev, ioctl_evdev-v): Add alignment option.
	* tests/pure_executables.list: Add ioctl_evdev-Xabbrev,
	ioctl_evdev-Xraw, ioctl_evdev-Xverbose, ioctl_evdev-v-Xabbrev,
	ioctl_evdev-v-Xraw, ioctl_evdev-v-Xverbose.
	* tests/.gitignore: Likewise.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ioctl: do not print comments twice in -Xverbose.
	Figure out whether the ioctl code is decoded inside a comment and adjust
	printflags/printxval calls accordingly.

	* ioctl.c (ioctl_print_code, evdev_decode_number): Add abbrev variable,
	set it to true if xlat style is not XLAT_STYLE_VERBOSE, do not provide
	dflt and set xlat style to XLAT_STYLE_ABBREV in printflags/printxval
	calls (that are now changed to printflags_ex/printxval_ex to accomodate
	the change).

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/ioctl_evdev-success: rewrite ABS_MT check.
	Use null-terminating array instead of providing array size in the first
	element.

	* tests/ioctl_evdev-success.c (print_mtslots, main): Update
	mtslots_str/invalid_mtslot_str array usage.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add xlat verbosity support to printxval.
	* tests/Makefile.am (libtests_a_SOURCES): Remove printxval.c, add
	printxval-Xabbrev.c, printxval-Xraw.c, and printxval-Xverbose.c.
	(EXTRA_DIST): Add printxval.c.
	* tests/printxval.c [!XLAT_RAW] (lookup_xlat): New function.
	(printxval): Wrap in XLAT_NAME.
	(sprintxlat, sprintxval): New functions.
	* tests/printxval-Xabbrev.c: New file.
	* tests/printxval-Xraw.c: Likewise.
	* tests/printxval-Xverbose.c: Likewise.
	* tests/tests.h (printxval): Remove declaration.
	(printxval_abbrev, printxval_raw, printxval_verbose, sprintxlat_abbrev,
	sprintxlat_raw, sprintxlat_verbose, sprintxval_abbrev, sprintxval_raw,
	sprintxval_verbose): New declarations.
	(printxval, sprintxlat, sprintxval): New macros, defined based on values
	of XLAT_RAW amd XLAT_VERBOSE macros.
	* tests/ioprio.c: Simplify the printing code since printxval now has
	xlat verbosity support.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/tests.h: add XLAT_STR macro.
	XLAT_STR allows describing expected output succintly in some simple
	cases.

	* tests/tests.h (XLAT_STR): New macro.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add PAF_ARRAY_TRUNCATED flag for print_array_ex.
	PAF_ARRAY_TRUNCATED allows enforcing the fact that an array
	is truncated, which is useful for arrays in local memory that are known
	as being truncated.

	* defs.h (xlat_style_private_flag_bits): Add PAF_ARRAY_TRUNCATED_BIT.
	(xlat_style_private_flags): Add PAF_ARRAY_TRUNCATED.
	* util.c (print_array_ex): Handle PAF_ARRAY_TRUNCATED in flags.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add support for printing local arrays to print_array.
	* defs.h (print_array_ex): Describe parameters.
	(print_local_array): A wrapper for printing arrays in local memory
	via print_array_ex.
	* util.c (print_array_ex): Handle case of NULL tfetch_mem_func by
	printing elements of array in local memory pointed by start_addr
	parameter.

	tests: move ioctl_evdev-v binary to pure_executables.list.
	* tests/Makefile.am (check_PROGRAMS): Move ioctl_evdev-v ...
	* tests/pure_executables.list: ... here.

	tests: implement ioctl_evdev-success-v.test via ioctl_evdev-success.test
	* tests/ioctl_evdev-success-v.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove ioctl_evdev-success-v.test.
	* tests/gen_tests.in: Add ioctl_evdev-success-v as a wrapper for
	ioctl_evdev-success.test.
	* tests/ioctl_evdev-success.test: Save "$args" to $prog, increase -a
	parameter value to 26 columns, inject "$@" into run_strace arguments,
	call $prog instead of axplicit program name.

2019-09-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	riscv64: remove mpers support.
	There is no riscv32 Linux support in Linux mainline,
	and no compat support in riscv64 as well.

	* linux/riscv64/arch_defs_.h: Remove.
	* linux/riscv64/ioctls_arch1.h: Likewise.
	* linux/riscv64/ioctls_inc1.h: Likewise.
	* linux/riscv64/syscallent1.h: Likewise.
	* Makefile.am (EXTRA_DIST): Remove them.
	* configure.ac (st_MPERS([m32])): Remove riscv64.
	* strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Remove RISC-V
	from the list.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-09-23  Dmitry V. Levin  <ldv@altlinux.org>

	riscv: rename to riscv64.
	The only currently supported RISC-V architecture is the 64-bit RISC-V.
	As the generic name we use causes confusion [1], rename it to riscv64.

	[1] https://lists.strace.io/pipermail/strace-devel/2019-August/009057.html

	* Makefile.am (EXTRA_DIST): Rename linux/riscv to linux/riscv64.
	* configure.ac: Rename riscv to riscv64, RISCV to RISCV64.
	* linux/riscv: Rename to linux/riscv64.
	* riscv.c: Rename RISCV to RISCV64.
	* tests/options-syntax.test: Rename riscv to riscv64.
	* tests/qualify_personality.sh: Likewise.
	* tests/strace-V.test: Likewise.

2019-09-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	clone: implement clone3 syscall decoding.
	* configure.ac (AC_CHECK_HEADERS): Check for linux/sched.h presence.
	(AC_CHECK_TYPES): Check for struct clone_args in <linux/sched.h>.
	* clone.c: Include "print_fields.h".
	(struct strace_clone_args): New type.
	(print_nonzero_bytes): New function.
	(SYS_FUNC(clone3)): New decoder.
	* linux/syscallent-common.h ([BASE_NR + 435]): Wire up clone3.
	* NEWS: Mention this change.
	* tests/clone3.c: New file.
	* tests/clone3-Xabbrev.c: Likewise.
	* tests/clone3-Xraw.c: Likewise.
	* tests/clone3-Xverbose.c: Likewise.
	* tests/clone3-success.c: Likewise.
	* tests/clone3-success-Xabbrev.c: Likewise.
	* tests/clone3-success-Xraw.c: Likewise.
	* tests/clone3-success-Xverbose.c: Likewise.
	* tests/clone3-success.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add clone3-success,
	clone3-success-Xabbrev, clone3-success-Xraw, and
	clone3-success-Xverbose.
	(DECODER_TESTS): Add clone3-success.test.
	* tests/gen_tests.in (clone3, clone3-Xabbrev, clone3-Xraw,
	clone3-Xverbose, clone3-success-Xabbrev, clone3-success-Xraw,
	clone3-success-Xverbose): New entries.
	* tests/pure_executables.list: Add clone3, clone3-Xabbrev, clone3-Xraw,
	and clone3-Xverbose.
	* tests/.gitignore: Add clone3, clone3-Xabbrev, clone3-Xraw,
	clone3-Xverbose, clone3-success, clone3-success-Xabbrev,
	clone3-success-Xraw, and clone3-success-Xverbose.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-09-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/tests.h: add XLAT_KNOWN and XLAT_UNKNOWN macros.
	XLAT_KNOWN allows describing expected output succintly in some simple
	cases.

	* tests/tests.h (XLAT_KNOWN, XLAT_UNKNOWN): New macros, define based
	on values of XLAT_RAW and XLAT_VERBOSE macros.

2019-09-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix umovestr_cached.test when process_vm_readv is not implemented
	* tests/umovestr_cached.test: Run strace with -z option to filter out
	failing process_vm_readv invocations.

2019-09-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: disable umovestr_cached.test on ia64.
	ia64 invokes extra process_vm_readv syscalls to obtain syscall
	arguments, see linux/ia64/get_syscall_args.c for details.

	* tests/umovestr_cached.test [ $STRACE_ARCH == ia64 ]: Skip.

2019-09-15  Paul Chaignon  <paul.chaignon@gmail.com>

	tests: fix format warnings on x32.
	The type of __X32_SYSCALL_BIT changed from int to unsigned long by Linux
	kernel commit v5.3-rc1-1-g45e29d119e9923ff14dfb840e3482bef1667bbfb.
	Consequently, __NR_* macros are now defined to values of an unsigned long
	integer type on x32.

	tests/prctl-seccomp-filter-v.c (PRINT_ALLOW_SYSCALL, PRINT_DENY_SYSCALL):
	Fix format warning.
	tests/seccomp-filter-v.c (PRINT_ALLOW_SYSCALL, PRINT_DENY_SYSCALL):
	Likewise.

2019-09-15  Dmitry V. Levin  <ldv@altlinux.org>

	Implement memory caching for umove* functions.
	When the data to be fetched by vm_read_mem resides in a single memory
	page, fetch the whole page and cache it.  This implementation caches
	up to two memory pages.

	* defs.h (invalidate_umove_cache): New prototype.
	* strace.c (next_event): Call invalidate_umove_cache.
	* ucopy.c (cached_idx, cached_raddr): New static variables.
	(process_read_mem): New function.
	(vm_read_mem): Use them.  Implement fetched page caching.
	* tests/umovestr_cached.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add umovestr_cached.test.
	* tests/umovestr_cached.c: New file.
	* tests/pure_executables.list: Add umovestr_cached.
	* tests/.gitignore: Likewise.

2019-09-10  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v5.3.
	* linux/32/ioctls_inc_align16.h: Update from linux v5.3-rc8
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/i386/ioctls_arch0.h: Likewise.
	* linux/s390/ioctls_arch0.h: Likewise.
	* linux/s390x/ioctls_arch0.h: Likewise.
	* linux/x86_64/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

	maint: update for linux v5.3-rc8.
	* maint/ioctls_sym.sh (x86_list): Add KVM_SET_PMU_EVENT_FILTER.

2019-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Rewrite printnum_{slong,ulong,ptr,kptr} using dispatch_{word,klong}size.
	* defs.h (printnum_long_int, printnum_addr_long_int, printnum_addr_klong_int):
	Remove declaration.
	(printnum_slong, printnum_ulong): Implement unconditionally using
	dispatch_wordsize and opt_wordsize for the last argument.
	(printnum_ptr): Implement unconditionally using dispatch_wordsize.
	(printnum_kptr): Implement unconditionally using dispatch_klongsize.
	* util.c (printnum_long_int, printnum_addr_long_int, printnum_addr_klong_int):
	Remove.

	defs.h: introduce {opt,dispatch}_{word,klong}size.
	* defs.h (set_personality, current_personality, current_wordsize,
	current_klongsize, max_addr, max_kaddr): Move upwards.
	(opt_wordsize): New macro, calls the first or the second argument
	depending on the word size.
	(dispatch_wordsize): New macro, calls the first or the second function
	with the rest of macro parameters as arguments depending on the word
	size.
	(opt_klongsize): New macro, calls the first or the second argument
	depending on the kernel long size.
	(dispatch_klongsize): New macro, calls the first or the second function
	with the rest of macro parameters as arguments depending on the kernel
	long size.

2019-09-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	s390: fix PRINT_UNKNOWN_TAIL_EX.
	In the conversion of PRINT_UNKNOWN_TAIL into PRINT_UNKNOWN_TAIL_EX
	the usage of sizeof(*(hdr_)) hasn't been replaced to (hdr_size_)
	in all places.  Offset calculation also had to be changed.

	* s390.c (PRINT_UNKNOWN_TAIL_EX): Fix addr and len arguments
	in is_filled and print_quoted_string calls.

	Fixes: v5.2-97-g210593c "s390: update sthyi decoder"
	Reported-by: Dan Horák <dan@danny.cz>
	Resolves: https://github.com/strace/strace/issues/108

2019-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add comment about CLONE_DETACHED to clone_flags.in.
	It's ignored by kernel, but present in the UAPI header.

	* xlat/clone_flags.in: Add a comment about CLONE_DETACHED.

2019-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	clone: fix print_tls_arg on x86.
	When strace is built for (32-bit) x86, it has HAVE_STRUCT_USER_DESC
	and SUPPORTED_PERSONALITIES == 1, which led to execution of the both
	branches.  Simplify the logic by including the SUPPORTED_PERSONALITIES
	into the condition.

	* clone.c (print_tls_arg): Include SUPPORTED_PERSONALITIES into the "if"
	condition.

2019-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	s390: update sthyi decoder.
	Sync up with the description[1].

	[1] https://www.ibm.com/support/knowledgecenter/SSB27U_6.4.0/com.ibm.zvm.v640.hcpb4/hcpb4sth.htm

	* s390.c (struct sthyi_machine): Add fields reserved_1__, infmplnm;
	update comment for the infmval1 field; update the related static_assert.
	(struct sthyi_partition): Update infpflg1 comment; update infpval1
	comment; add infpplnm field; update the related static_assert.
	(struct sthyi_hypervisor): Update infyflg1 field comment; add
	infyinsf and infyautf fields; update the related static_assert.
	(CHECK_SIZE_EX): Rename from CHECK_SIZE; add min_size_ argument, check size_
	against it.
	(CHECK_SIZE): New macro, a wrapper for CHECK_SIZE_EX.
	(PRINT_UNKNOWN_TAIL_EX): Rename from PRINT_UNKNOWN_TAIL, add hdr_size_
	argument.
	(PRINT_UNKNOWN_TAIL): New macro, a wrapper for PRINT_UNKNOWN_TAIL_EX.
	(print_sthyi_machine): New local variable last_decoded; use
	CHECK_SIZE_EX instead of CHECK_SIZE to check against the initial value
	of last_decoded; decode reserved_1__ and infmplnm fields if the returned
	size indicates that they are present; use PRINT_UNKNOWN_TAIL_EX for
	printing structure's tail.
	(print_sthyi_partition): New local variable last_decoded; use
	CHECK_SIZE_EX instead of CHECK_SIZE to check against the initial value
	of last_decoded; decode infpplnm field if the returned size indicates
	that it is present; use PRINT_UNKNOWN_TAIL_EX for printing structure's
	tail.
	(print_funcs): New function.
	(print_sthyi_hypervisor): New local variable last_decoded; use
	CHECK_SIZE_EX instead of CHECK_SIZE to check against the initial value
	of last_decoded; update infyflg1 field decoding; decode infyinsf
	and infyautf fields if the returned size indicates that they
	are present; use PRINT_UNKNOWN_TAIL_EX for printing structure's tail.
	(s390_sthyi): Update specification URL.
	* tests/s390_sthyi.c: Update expected output.

2019-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	s390: replace structure size comments with static_assert's.
	* s390.c: Add static_assert statements for compile-time check of
	struct sthyi_hdr, struct sthyi_machine, struct sthyi_partition,
	struct sthyi_hypervisor, and struct sthyi_guest sizes.

2019-08-31  Dmitry V. Levin  <ldv@altlinux.org>

	tests: convert ksysent.test into a generated test.
	* tests/ksysent.test: Remove.
	* tests/Makefile.am (MISC_TESTS): Remove ksysent.test.
	* tests/gen_tests.in (ksysent): New entry.
	* ci/run-build-and-tests.sh: Replace ksysent.log with ksysent.gen.log.
	* strace.spec.in: Likewise.

2019-08-31  Paul Chaignon  <paul.chaignon@gmail.com>

	Add seccomp filter syscall flag.
	This commit adds a new syscall flag for syscall that are traced by default
	under seccomp filter.

	The syscallent changes can be reproduced with the following script:

	  git grep -l 'SEN(\(execv\|ipc\|socketcall\|ipc\)' |
	  xargs -r sed -i -e '/SEN(execv/ s/TP|/&TSD|/' \
	  -e '/SEN(ipc)/ s/TI/&|TSD/' -e '/SEN(socketcall)/ s/TD/&|TSD/' \
	  -e '/SEN(syscall)/ s/0,/TSD,/'

	* sysent.h (TRACE_SECCOMP_DEFAULT): Define new flag.
	* sysent_shorthand_defs.h (TSD): Define new flag shorthand.
	* linux/32/syscallent.h: Add TSD flag.
	* linux/64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

2019-08-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.spec: lower CentOS version requirement for pkgconfig(bluez)
	bluez-libs-devel provides pkgconfig(bluez) and the actual headers both
	in RHEL 6 and RHEL 7, so the version condition for enablement
	of pkgconfig(bluez) in spec file can be lowered.  However, the package
	in question is in the "optional" repository in RHEL, and there seems to be
	no easy way to enable it in OBS (where this spec file is mainly used)
	so only %centos check is actually changed for now.

	* strace.spec.in: Change "0%{?centos} >= 8" to "0%{?centos} >= 6"
	for "BuildRequires: pkgconfig(bluez)" enablement.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1746885

2019-08-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sockaddr: properly decode sockaddr_hci addresses without hci_channel.
	Before Linux commit v2.6.38-rc1~476^2~14^2~3^2~43^2~9,
	struct sockaddr_hci did not contain hci_channel field.

	* configure.ac (AC_CHECK_HEADERS([bluetooth/bluetooth.h])): Add check
	for struct sockaddr_hci.hci_channel.
	* sockaddr.c (print_sockaddr_data_bt): Decode struct sockaddr_hci
	without hci_channel field.
	* tests/net-sockaddr.c (check_hci): Add check for struct sockaddr_hci
	decoding without hci_channel field; guard hci_channel with #ifdef
	HAVE_STRUCT_SOCKADDR_HCI_HCI_CHANNEL.
	(check_raw): Remove "len++", as 4-byte AF_BLUETOOTH socket addresses are
	interpreted as struct sockaddr_hci without hci_channel field.

2019-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: try to be more clear with -e trace=class deprecation notice
	It was reported that the current way of labelling of the percent-less
	-e trace=class syntax variant may be confusing, as it can be read
	as deprecation of the whole option and not specific syntax; try to be
	more clear by moving the deprecation notices into the option
	descriptions.

	* strace.1.in (.SS Filtering): Move the deprecation notice
	of -e trace={file,process,network,signal,ipc,desc,memory} syntax
	to the descriptions of the respective options.

	Reported-by: Alexey Gladkov <gladkov.alexey@gmail.com>

2019-08-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: normalise fsmagic formatting.
	For historical reasons, it was this way as there was no support for
	explicitly defined xlat values, which is no longer the case.

	The following command was used:

	    sed -ri \
	        -e 's/^\{ ([^]*),[[:space:]]*"([^"]*)"([[:space:]]*)\},$/\2\3\1/' \
	        -e 's/^([^\t]{14,15}\t)/\1\t/' \
	        xlat/fsmagic.in

	* xlat/fsmagic.in: Normalise the formatting.

2019-08-23  Rasmus Villemoes  <rasmus.villemoes@prevas.dk>

	Add support for /dev/watchdog ioctls.
	* watchdog_ioctl.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (DECL_IOCTL): Add watchdog.
	* ioctl.c (ioctl_decode): Add 'W' case.
	* xlat/watchdog_ioctl_cmds.in: New file.
	* tests/ioctl_watchdog.c: New file.
	* tests/.gitignore: Add ioctl_watchdog.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (ioctl_watchdog): New entry.

2019-08-16  Dmitry V. Levin  <ldv@altlinux.org>

	umoven: use error_func_msg instead of error_msg.
	* ucopy.c (umoven): Use error_func_msg instead of error_msg.

2019-08-15  Dmitry V. Levin  <ldv@altlinux.org>

	Use perror_func_msg instead of perror_msg where appropriate.
	* linux/aarch64/set_scno.c (arch_set_scno): Use perror_func_msg
	instead of perror_msg.
	* ucopy.c (umoven_peekdata, umoven, umovestr_peekdata, umovestr):
	Likewise.
	* upeek.c (upeek): Likewise.
	* upoke.c (upoke): Likewise.

2019-08-15  Dmitry V. Levin  <ldv@altlinux.org>

	Fix syscall tampering when PTRACE_GET_SYSCALL_INFO is in use on some architectures
	When PTRACE_GET_SYSCALL_INFO is in use on those architectures
	that invoke set_regs in arch_set_scno, get_regs is not called,
	so it has to be invoked explicitly before tampering.

	* linux/arc/set_scno.c (arch_set_scno): Explicitly call get_regs
	when PTRACE_GET_SYSCALL_INFO is in use.
	* linux/avr32/set_scno.c: Likewise.
	* linux/csky/set_scno.c: Likewise.
	* linux/ia64/set_scno.c: Likewise.
	* linux/m68k/set_scno.c: Likewise.
	* linux/metag/set_scno.c: Likewise.
	* linux/mips/set_scno.c: Likewise.
	* linux/nios2/set_scno.c: Likewise.
	* linux/or1k/set_scno.c: Likewise.
	* linux/riscv/set_scno.c: Likewise.
	* linux/s390/set_scno.c: Likewise.
	* linux/sparc/set_scno.c: Likewise.
	* linux/tile/set_scno.c: Likewise.
	* NEWS: Mention this fix.

	Thanks-to: Anatoly Pugachev <matorola@gmail.com>
	Fixes: v5.2~27 "sparc, sparc64: fix syscall tampering when PTRACE_GET_SYSCALL_INFO is in use"

2019-08-15  Dmitry V. Levin  <ldv@altlinux.org>

	sparc, sparc64: fix redundant get_regs invocation.
	An explicit get_regs invocation was added to arch_set_error and
	arch_set_success on sparc/sparc64 by commit v5.2~27 in attempt to fix
	syscall tampering on these architectures when PTRACE_GET_SYSCALL_INFO
	is in use.

	That change, however, did not fix the bug because set_error and
	set_success already invoke get_regs on all architectures where
	ptrace_setregset_or_setregs is defined, this includes sparc and sparc64.

	* linux/sparc/set_error.c (sparc_set_o0_psr): Do not invoke get_regs.
	* linux/sparc64/set_error.c (sparc64_set_o0_tstate): Likewise.
	* NEWS (5.2): Remove the statement about syscall tampering fix
	on sparc and sparc64 when PTRACE_GET_SYSCALL_INFO is in use.

2019-08-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: avoid shifting left a signed number by 31 bit.
	cppcheck warns about it with the following diagnostics:

	    error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is
	    undefined behaviour

	* v4l2.c [!v4l2_fourcc_be] (v4l2_fourcc_be): Shift left 1U and not 1 in
	order to get 0x80000000.

2019-08-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.spec.in: use SPDX shortname format in License: tag.
	Otherwise some rpm lintians complain about it:

	    strace.src: W: invalid-license LGPL-2.1-or-later
	    strace.src: W: invalid-license GPL-2.0-or-later

	* strace.spec.in (License): Change license description from
	"LGPL-2.1-or-later and GPL-2.0-or-later" to "LGPL-2.1+ and GPL-2.0+".

2019-08-15  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of pidfd_open syscall.
	... introduced by Linux kernel commits v5.3-rc1~142^2~2
	and v5.3-rc1~142^2~1.

	* pidfd_open.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* pathtrace.c (pathtrace_match_set): Add SEN_pidfd_open.
	* linux/syscallent-common.h [BASE_NR + 434]: Wire up pidfd_open.
	* NEWS: Mention this change.
	* tests/pidfd_open.c: New file.
	* tests/pidfd_open-P.c: Likewise.
	* tests/pidfd_open-y.c: Likewise.
	* tests/gen_tests.in (pidfd_open, pidfd_open-P, pidfd_open-y): New
	entries.
	* tests/pure_executables.list: Add pidfd_open, pidfd_open-P, and
	pidfd_open-y.
	* tests/.gitignore: Likewise.

2019-08-14  Dmitry V. Levin  <ldv@altlinux.org>

	xlat/gen.sh: remove #stop support.
	There are no users of #stop directive anymore.

	* xlat/gen.sh (gen_header): Remove '#stop' support.

2019-08-14  Dmitry V. Levin  <ldv@altlinux.org>

	xlat/skf_off: use XLAT_MACROS_ONLY instead of #stop.
	* xlat/skf_off.in: Remove #stop.
	* bpf_sock_filter.c: Wrap "xlat/skf_off.h" inclusion in XLAT_MACROS_ONLY.

	xlat/scsi_sg_commands: use XLAT_MACROS_ONLY instead of #stop.
	* xlat/scsi_sg_commands.in: Remove #stop.
	* scsi.c: Wrap "xlat/scsi_sg_commands.h" inclusion in XLAT_MACROS_ONLY.
	* tests/ioctl_scsi.c: Likewise.
	* tests/ioctl_sg_io_v4.c: Likewise.

2019-08-14  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: mark as value indexed those files that meet certain criteria.
	Automatically prepend #value_indexed using the following script:

	for f in xlat/*.in; do
		awk -n 'BEGINFILE {if (FILENAME ~ /flag/) exit 1; nr=0}
			(nr == 0 && $1 ~ /^#/) {exit 1}
			$1 !~ /^[A-Z_0-9]/ {next}
			NF < 2 || $2 !~ /^[0-9]/ || ($2 - nr != 0 && $2 - nr != 1) {exit 1}
			{nr++}
			ENDFILE {if (nr < 2) exit 1}' "$f" &&
		sed -i '1i#value_indexed' "$f"
	done

	* xlat/blkpg_ops.in: Prepend #value_indexed.
	* xlat/btrfs_balance_ctl_cmds.in: Likewise.
	* xlat/btrfs_compress_types.in: Likewise.
	* xlat/btrfs_cont_reading_from_srcdev_mode.in: Likewise.
	* xlat/crypto_nl_attrs.in: Likewise.
	* xlat/dcb_commands.in: Likewise.
	* xlat/epollctls.in: Likewise.
	* xlat/f_owner_types.in: Likewise.
	* xlat/fib_rule_actions.in: Likewise.
	* xlat/futexwakecmps.in: Likewise.
	* xlat/futexwakeops.in: Likewise.
	* xlat/ioprio_class.in: Likewise.
	* xlat/ioprio_who.in: Likewise.
	* xlat/kcmp_types.in: Likewise.
	* xlat/keyctl_commands.in: Likewise.
	* xlat/lwtunnel_encap_types.in: Likewise.
	* xlat/mpol_modes.in: Likewise.
	* xlat/multicast_router_types.in: Likewise.
	* xlat/netfilter_versions.in: Likewise.
	* xlat/netlink_protocols.in: Likewise.
	* xlat/netlink_types.in: Likewise.
	* xlat/nf_acct_msg_types.in: Likewise.
	* xlat/nf_cthelper_msg_types.in: Likewise.
	* xlat/nf_ctnetlink_exp_msg_types.in: Likewise.
	* xlat/nf_ctnetlink_msg_types.in: Likewise.
	* xlat/nf_cttimeout_msg_types.in: Likewise.
	* xlat/nf_ipset_msg_types.in: Likewise.
	* xlat/nf_nftables_msg_types.in: Likewise.
	* xlat/nf_osf_msg_types.in: Likewise.
	* xlat/nf_queue_msg_types.in: Likewise.
	* xlat/nf_ulog_msg_types.in: Likewise.
	* xlat/nl_netfilter_subsys_ids.in: Likewise.
	* xlat/nlmsgerr_attrs.in: Likewise.
	* xlat/pr_cap_ambient.in: Likewise.
	* xlat/pr_dumpable.in: Likewise.
	* xlat/pr_mce_kill.in: Likewise.
	* xlat/pr_mce_kill_policy.in: Likewise.
	* xlat/pr_set_mm.in: Likewise.
	* xlat/pr_tsc.in: Likewise.
	* xlat/quota_formats.in: Likewise.
	* xlat/quotatypes.in: Likewise.
	* xlat/routing_types.in: Likewise.
	* xlat/rtnl_addr_attrs.in: Likewise.
	* xlat/rtnl_addrlabel_attrs.in: Likewise.
	* xlat/rtnl_dcb_attrs.in: Likewise.
	* xlat/rtnl_ifla_brport_attrs.in: Likewise.
	* xlat/rtnl_ifla_events.in: Likewise.
	* xlat/rtnl_ifla_info_attrs.in: Likewise.
	* xlat/rtnl_ifla_port_attrs.in: Likewise.
	* xlat/rtnl_ifla_vf_port_attrs.in: Likewise.
	* xlat/rtnl_ifla_xdp_attrs.in: Likewise.
	* xlat/rtnl_link_attrs.in: Likewise.
	* xlat/rtnl_mdb_attrs.in: Likewise.
	* xlat/rtnl_mdba_mdb_attrs.in: Likewise.
	* xlat/rtnl_mdba_mdb_eattr_attrs.in: Likewise.
	* xlat/rtnl_mdba_mdb_entry_attrs.in: Likewise.
	* xlat/rtnl_mdba_router_attrs.in: Likewise.
	* xlat/rtnl_mdba_router_pattr_attrs.in: Likewise.
	* xlat/rtnl_neigh_attrs.in: Likewise.
	* xlat/rtnl_neightbl_attrs.in: Likewise.
	* xlat/rtnl_neightbl_parms_attrs.in: Likewise.
	* xlat/rtnl_netconf_attrs.in: Likewise.
	* xlat/rtnl_route_attrs.in: Likewise.
	* xlat/rtnl_rta_metrics_attrs.in: Likewise.
	* xlat/rtnl_rule_attrs.in: Likewise.
	* xlat/rtnl_tc_action_attrs.in: Likewise.
	* xlat/rtnl_tc_attrs.in: Likewise.
	* xlat/rtnl_tca_stab_attrs.in: Likewise.
	* xlat/rtnl_tca_stats_attrs.in: Likewise.
	* xlat/s390_guarded_storage_commands.in: Likewise.
	* xlat/s390_runtime_instr_commands.in: Likewise.
	* xlat/seccomp_mode.in: Likewise.
	* xlat/seccomp_ops.in: Likewise.
	* xlat/shutdown_modes.in: Likewise.
	* xlat/sigchld_codes.in: Likewise.
	* xlat/sigev_value.in: Likewise.
	* xlat/sigpoll_codes.in: Likewise.
	* xlat/smc_link_group_roles.in: Likewise.
	* xlat/sock_netlink_options.in: Likewise.
	* xlat/sock_pnp_options.in: Likewise.
	* xlat/sock_tls_options.in: Likewise.
	* xlat/socketcalls.in: Likewise.
	* xlat/tcp_states.in: Likewise.
	* xlat/uring_register_opcodes.in: Likewise.
	* tests/socketcall.c (main): Update assertion.

2019-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Replace direct usage of err_name/errnoent with print_err.
	Introduce print_err function that prints error number respecting current
	xlat verbosity settings, and switch err_name/errnoent callers to use
	this new function instead.

	* defs.h (err_name): Remove.
	(print_err): New declaration.
	* print_fields.h (PRINT_FIELD_ERR_D, PRINT_FIELD_ERR_U): New macros.
	* syscall.c (err_name): Add static qualifier, change argument type
	to uint64_t.
	(print_err): New function.
	* keyctl.c (keyctl_reject_key): Use print_err for printing error
	argument.
	* net.c (print_get_error): Use print_err for printing err.
	* numa.c (print_status): Use print_err for printing errno.
	* netlink.c: Include "print_fields.h".
	(decode_nlmsgerr): Use PRINT_FIELD_ERR_D for printing errno field.
	* printsiginfo.c: Include "print_fields.h".
	(print_si_info): Use PRINT_FIELD_ERR_U for printing si_errno field.
	* ptrace_syscall_info.c (print_ptrace_syscall_info): Use
	PRINT_FIELD_ERR_D for printing info.exit.rval.
	* tests/pidfd_send_signal.c (main): Update expected output.
	* tests/ptrace.c (main): Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-13  Dmitry V. Levin  <ldv@altlinux.org>

	netlink_unix_diag: implement UDIAG_SHOW_UID/UNIX_DIAG_UID decoding.
	... introduced by Linux kernel commit v5.3-rc1~140^2~467.

	* linux/unix_diag.h (UDIAG_SHOW_UID, UNIX_DIAG_FIRST_UNUSED): New macro
	constants.
	(UNIX_DIAG_UID): New enum constant.
	* xlat/unix_diag_attrs.in: Add UNIX_DIAG_UID.
	* xlat/unix_diag_show.in: Add UDIAG_SHOW_UID.
	* netlink_unix_diag.c (unix_diag_msg_nla_decoders): Handle
	UNIX_DIAG_UID.
	* NEWS: Mention this.
	* tests/nlattr.c (test_nlattr, test_nla_type): Replace
	UNIX_DIAG_SHUTDOWN + 1 with UNIX_DIAG_FIRST_UNUSED.

2019-08-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	netlink_route: implement RTM_{NEW,DEL,GET}CHAIN decoding.
	* xlat/nl_route_types.in (RTM_NEWCHAIN, RTM_DELCHAIN, RTM_GETCHAIN): New
	constants introduced by Linux kernel commit v4.19-rc1~140^2~279^2~9.
	* netlink_route.c (route_decoders) <[RTM_NEWCHAIN - RTM_BASE],
	[RTM_DELCHAIN - RTM_BASE], [RTM_GETCHAIN - RTM_BASE]>: Invoke
	decode_tcmsg.
	* NEWS: Mention this.

2019-08-13  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update TCP_* constants.
	* xlat/sock_tcp_options.in (TCP_TX_DELAY): New constant introduced
	by Linux kernel commit v5.3-rc1~140^2~269.
	* NEWS: Mention this.

	xlat: update *_MAGIC constants.
	* xlat/fsmagic.in (Z3FOLD_MAGIC): New constant introduced
	by Linux kernel commit v5.3-rc1~31^2~30.
	(DMA_BUF_MAGIC): New constant introduced by Linux kernel commit
	v5.3-rc1~22^2~20^2~42.
	* NEWS: Mention this.

	xlat: update KVM_CAP_* constants.
	* xlat/kvm_cap.in (KVM_CAP_PMU_EVENT_FILTER): New constant introduced
	by Linux kernel commit v5.3-rc1~115^2~5.
	* NEWS: Mention this.

	xlat: update KEYCTL_* constants.
	* xlat/keyctl_commands.in (KEYCTL_PKEY_QUERY, KEYCTL_PKEY_ENCRYPT,
	KEYCTL_PKEY_DECRYPT, KEYCTL_PKEY_SIGN, KEYCTL_PKEY_VERIFY): New
	constants introduced by Linux kernel commit v4.20-rc1~29^2~20.
	(KEYCTL_MOVE): New constant introduced by Linux kernel commit
	v5.3-rc1~189^2~3.
	(KEYCTL_CAPABILITIES): New constant introduced by Linux kernel commit
	v5.3-rc1~189^2.
	* NEWS: Mention this.

	xlat: update BPF_* constants.
	* xlat/bpf_attach_type.in (BPF_CGROUP_GETSOCKOPT,
	BPF_CGROUP_SETSOCKOPT): New constants introduced by Linux kernel commit
	v5.3-rc1~140^2~65^2~8^2~8.
	* xlat/bpf_prog_flags.in (BPF_F_TEST_RND_HI32): New constant
	introduced by Linux kernel commit v5.3-rc1~140^2~371^2~28^2~12.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_SOCKOPT): New constant
	introduced by Linux kernel commit v5.3-rc1~140^2~65^2~8^2~8.
	* NEWS: Mention this.
	* tests/bpf.c (print_BPF_PROG_LOAD_attr3, print_BPF_PROG_LOAD_attr4,
	BPF_PROG_LOAD_checks, BPF_PROG_QUERY_checks): Update expected output.
	* tests/kernel_version.c (print_bpf_attr, main): Likewise.

	xlat: update XDP_* constants.
	* xlat/sock_xdp_options.in (XDP_OPTIONS): New constant introduced
	by Linux kernel commit v5.3-rc1~140^2~65^2~9^2~13.

	xlat: update ETH_* constants.
	* xlat/ethernet_protocols.in (ETH_P_LLDP): New constant introduced
	by Linux kernel commit v5.3-rc1~140^2~329^2~6.

2019-08-11  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update SO_* constants.
	* xlat/sock_options.in (SO_BINDTOIFINDEX): New constant introduced
	by Linux commit v5.1-rc1~178^2~508.
	(SO_RCVTIMEO_NEW, SO_SNDTIMEO_NEW): New constants introduced by Linux
	commit v5.1-rc1~178^2~363^2.
	(SO_DETACH_REUSEPORT_BPF): New constant introduced by Linux commit
	v5.3-rc1~140^2~179^2~12.

	* xlat/setsock_options.in: Regenerate using maint/gen_xlat_defs.sh.

2019-08-11  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: provide fallback definition for MAP_UNINITIALIZED.
	Linux commit v5.3-rc1~65^2~86 fixed the definition of MAP_UNINITIALIZED
	flag that used to depend on CONFIG_MMAP_ALLOW_UNINITIALIZED.

	* xlat/mmap_flags.in (MAP_UNINITIALIZED): Add fallback definition.

2019-08-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count: add ability to sort on errors field.
	For completeness.

	* count.c (error_cmp): New function.
	(set_sortby): Add sort keys for errors field.
	* strace.1.in (.SH OPTIONS) <-S>: Document it.
	* strace.c (usage): Likewise.
	* tests/strace-S.test: Check it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count: provide alternative names for sorting options.
	as some might be easier to remember than others.

	* count.c (set_sortby): Add aliases for the existing sorting options.
	* strace.1.in (.SH OPTIONS) <-S>: Document new aliases.
	* tests/strace-S.test: Check new sort keys.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count: rewrite sort function selection using a table.
	* count.c (set_sortby): Replace nested if's with iteration over a table.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend -S option check.
	* tests/strace-S.test: Check default sorting method and "-S time".

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall: track syscall system time a bit more explicitly.
	Before, it relied on implicit assumptions that syscall-exit event is
	right the next one after syscall-enter.  Also, there's some additional
	debugging output that might help someone someday.

	* count.c (count_syscall): Calculate system time as difference of tcp's
	stime and ltime.
	* defs.h (struct tcb): Add ltime, atime fields, remove dtime.
	* strace.c (droptcb): Print total system time spent by a tcb.
	(startup_tcb): Store initial system time in atime.
	(next_event): Update stime directly.
	* syscall.c (syscall_entering_finish): Store current system time in
	tcb's ltime field.
	(syscall_exiting_finish): Likewise.

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count: substract overhead per call.
	* count.c (zero_ts): New variable.
	(count_syscall): Calculate the spent time in the wts variable, then add
	it to cc->time.
	(call_summary_pers): Do not perform overhead correction.

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: add ts_min and ts_max.
	* defs.h (ts_min, ts_max): New declarations.
	* util.c (ts_min, ts_max): New functions.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count: use parse_ts for parsing overhead value.
	* count.c (set_overhead): Change argument type to const char *, call
	parse_ts to parse it and set to overhead.
	* defs.h (set_overhead): Update declaration.
	* strace.c: (init) <case 'O'>: do not parse argument, pass optarg to
	set_overhead call.
	* tests/count.test (GENERIC, WALLCLOCK, WALLCLOCK1, HALFCLOCK): New
	variables with expected patterns.
	Add checks for the new -O syntax.

	delay: use parse_ts for parsing delay value.
	* delay.c (fill_delay_data): Change intval argument to struct timespec
	*val, assign val to ts.
	* delay.h (fill_delay_data): Update function declaration.
	* filter_qualify.c (parse_delay_token): Parse input with parse_ts,
	supply the resulting struct timespec to fill_delay_data.
	* tests/delay.c (check_): New function for providing diagnostic in case
	of check failure.
	(check_delay): Use it.
	* tests/delay.test: Check new delay syntax.

	util.c: add parse_ts.
	* defs.h (parse_ts): New declaration.
	* util.c (parse_ts): New function.

2019-08-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count: fix types in sorting comparison callbacks.
	* count.c (time_cmp. syscall_cmp): Change arguments type
	to "const void *", change indices cast type to "unsigned int *".
	(count cmp): Likewise.  Change count variables type to unsigned int.
	(sortfun): Specify types of arguments.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: improve control ID printing.
	Control ID space is hierarchical, so, higher bits provide information
	about control class.

	* v4l2.c (print_v4l2_cid): New function.
	(print_v4l2_control): Use print_v4l2_cid for printing control ID field.
	* tests/ioctl_v4l2.c: Add checks for control ID printing.

2019-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add syslog-success test.
	* tests/.gitignore: Add syslog-success
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add syslog-success.test.
	* tests/syslog-success.c: New file.
	* tests/syslog-success.test: New test.
	* tests/syslog.c: Add support for running under syscall retval
	injection, add checks.

	syslog: decode log level in SYSLOG_ACTION_CONSOLE_LEVEL command.
	* xlat/syslog_console_levels.in: New file.
	* syslog.c: Include "xlat/syslog_console_levels.h".
	(SYS_FUNC(syslog)): Add SYSLOG_ACTION_CONSOLE_LEVEL case.
	* tests/syslog.c: Add checks.

	syslog: fix argument printing.
	* syslog.c (SYS_FUNC(syslog)): Store conversion to int of tcp->u_arg[2]
	in len; print address using printaddr64 (as syslog doesn't use compat
	for x32), and third argument as int (as it has this type in the syscall
	handler).
	* tests/syslog.c: Add checks.

	syslog: do not print bufp and len for commands that ignore them.
	* syslog.c (SYS_FUNC(syslog)): Defer printing of comma after the first
	argument to the specific command handlers, return RVAL_DECODED without
	additional printing for SYSLOG_ACTION_CLOSE, SYSLOG_ACTION_OPEN,
	SYSLOG_ACTION_CLEAR, SYSLOG_ACTION_CONSOLE_OFF,
	SYSLOG_ACTION_CONSOLE_ON, SYSLOG_ACTION_SIZE_UNREAD,
	SYSLOG_ACTION_SIZE_BUFFER.
	* tests/syslog.c: Add checks.

	syslog: fix switch statement indentation.
	* syslog.c (SYS_FUNC(syslog)): Decrease indentation level of case
	clauses in the switch statement.

	syslog: print syslog command with verbose style, as it is not in UAPI.
	* syslog.c (SYS_FUNC(syslog)): Print syslog_action_type using
	XLAT_STYLE_VERBOSE.
	* tests/syslog.c: Update expected output.

2019-08-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: update hppa workaround in remap_file_pages test.
	... to cater for the change of MAP_TYPE on hppa introduced
	by Linux kernel commit v4.17-rc1~146^2~9.

	* tests/remap_file_pages.c (main) [__hppa__ && MAP_TYPE != 0x03]
	(MAP_TYPE_str): Define to "0x2b /* MAP_??? */".

2019-08-05  Dmitry V. Levin  <ldv@altlinux.org>

	Remove AUDIT_ARCH_* fallback definitions from arch_get_personality.c files
	Since xlat/audit_arch.h provides definitions for all AUDIT_ARCH_*
	constants, remove their fallback definitions from other files.

	* get_personality.c [SUPPORTED_PERSONALITIES > 1]: Include
	"xlat/elf_em.h" and "xlat/audit_arch.h" under XLAT_MACROS_ONLY.
	* linux/aarch64/arch_get_personality.c (AUDIT_ARCH_ARM): Remove.
	* linux/powerpc64/arch_get_personality.c (AUDIT_ARCH_PPC): Remove.
	* linux/riscv/arch_get_personality.c (AUDIT_ARCH_RISCV32): Remove.
	* linux/s390x/arch_get_personality.c (AUDIT_ARCH_S390): Remove.
	* linux/sparc64/arch_get_personality.c (AUDIT_ARCH_SPARC): Remove.
	* linux/tile/arch_get_personality.c (AUDIT_ARCH_TILEGX32,
	AUDIT_ARCH_TILEPRO): Remove.
	* linux/x86_64/arch_get_personality.c (AUDIT_ARCH_I386): Remove.

2019-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update audit_arch.in.
	* xlat/audit_arch.in: Add fallback definitions.
	(__AUDIT_ARCH_CONVENTION_MIPS64_N32, __AUDIT_ARCH_64BIT,
	__AUDIT_ARCH_LE): New macros.
	(AUDIT_ARCH_V850): New constant.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add elf_em.in.
	For now, it's a source of fallback values for AUDIT_ARCH_* constants.

	* xlat/elf_em.in: New file.
	* xlat/audit_arch.in (AUDIT_ARCH_ARM, AUDIT_ARCH_ARMEB, AUDIT_ARCH_FRV,
	AUDIT_ARCH_MICROBLAZE, AUDIT_ARCH_OPENRISC): Define unconditionally.
	* printsiginfo.c: Include "xlat/elf_em.h".
	* tests/ptrace_syscall_info.c: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.c: sync up strace -h message with the man page.
	Especially synopsis.

	* strace.c (usage): copy synopsis over from the man page; add "-A"
	and "-qq" options description.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: add missing options to synopsis.
	* strace.1.in (.SH SYNOPSIS): add second "-q", "-w", second "-y", "-z",
	and "-Z" to normal call variant; add "-w", "-z" and "-Z" to syscall
	statistics call variant.

	strace.c: split lines in strace -h output to fit into 80 columns.
	* strace.c (usage): split "-yy", "-c", "-e" options descriptions to fit
	into 80 columns width.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.c: move -v to Output format section in strace -h message.
	And also reword it into a more general and concise form in order to fit
	into 80-columnt width.

	* strace.c (usage): Move "-v" option to the "Output format" option of
	the help message, reword its description.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.c: add "-k" to strace -h list of options.
	It is mentioned in the "Output format" section below, but not in the
	usage section.

	* strace.c (usage): Define K_OPT macro with a value that depends
	on ENABLE_STACKTRACE macro presence, use it in the help output, undefine
	it.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: rewrite supported -e status options in a more compact form.
	* strace.1.in (.SS Filtering): Rewrite -e status value options in a
	sublist.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: reformat mpers support matrix table.
	In order to make it much less wider.

	* strace.1.in (.SH MULTIPLE PERSONALITY SUPPORT): Move additional text
	in x86_64 line to notes under the table, clarify PowerPC specifics.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: compact small named lists.
	And also rewrite nested .RS/.RE abomination.

	* strace.1.in (.SS Output format): compact -X option values variants
	using ".TQ".
	(.SS Tampering): Rewrite -e inject=:when= expression variants using
	".TP"/".TQ".
	(.SH MULTIPLE PERSONALITY SUPPORT): compact optional features list using
	".TQ".

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: rewrite conditional parts.
	The current implementation doesn't work as intended since in case the
	condition is false, .ig has no effect and it results in "warning: macro
	'end_unwind_opt' not defined".  Rewrite it into something more dumb and
	verbose, but hopefully correct.

	* strace.1.in (.SH SYNOPSYS, .SS Output format): Prepend each
	conditional line with respective ".if" instead of trying to wrap
	it in ".ig".

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: add AUTHORS section.
	* strace.1.in: Add .SH AUTHORS, refer to the CREDITS file.

	strace.1.in: add a link to the current project's home page.
	* strace.1.in (.SH SEE ALSO): Add a link to strace's home page.

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: reorder options.
	In an attempt to make the order more sensible.

	* strace.1.in (.SH OPTIONS): Insert ".SS General" at the beginning of
	the section; move ".SS Startup" after ".SS General"; move ".SS Tracing"
	after ".SS Startup"; move ".SS Filtering" after ".SS Startup"; insert
	".SS Tampering" after ".SS Statistics"; move "-e expr" from ".SS
	Filtering" to ".SS General"; move "-e abbrev", "-e verbose", "-e raw",
	"-e read", "-e write", "-e kvm=vcpu" and "-v" from ".SS Filtering"
	to ".SS Output format"; move "-e inject" and "-e fault" from
	".SS Filtering" to ".SS Tampering".

2019-08-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Treat PowerPC 64 LE as a separate architecture.
	That seems to be the easiest way to properly handle the fact that
	PPC64LE does not have a meaningful m32 personality.

	* configure.ac: Move AC_C_BIGENDIAN before arch detection; determine
	powerpc64/powerpc64le arch based on $ac_cv_c_bigendian value.
	* linux/dummy.h [POWERPC64LE] (sys_oldselect): Redirect to printargs.
	* linux/powerpc64le/arch_defs_.h: New file.
	* linux/powerpc64le/arch_regs.c: Likewise.
	* linux/powerpc64le/arch_rt_sigframe.c: Likewise.
	* linux/powerpc64le/errnoent.h: Likewise.
	* linux/powerpc64le/get_error.c: Likewise.
	* linux/powerpc64le/get_scno.c: Likewise.
	* linux/powerpc64le/get_syscall_args.c: Likewise.
	* linux/powerpc64le/ioctls_arch0.h: Likewise.
	* linux/powerpc64le/ioctls_inc0.h: Likewise.
	* linux/powerpc64le/raw_syscall.h: Likewise.
	* linux/powerpc64le/rt_sigframe.h: Likewise.
	* linux/powerpc64le/set_error.c: Likewise.
	* linux/powerpc64le/set_scno.c: Likewise.
	* linux/powerpc64le/syscallent.h: Likewise.
	* linux/powerpc64le/userent.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* tests/ipc_msg.c: Check for POWERPC64LE definition in addition to
	POWERPC64.
	* util.c (getllval): Add check for POWERPC64LE definition in addition to
	POWERPC64.
	* strace.1.in (.SH MULTIPLE PERSONALITY SUPPORT): Mention that only big
	endian PowerPC 64 has mpers support.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-08-04  Pierre Marsais  <pierre.marsais@lse.epita.fr>

	Fix invalid free in trace_close_memstream.
	In maybe_switch_tcbs we exchange the pointers to the memstream's buffers
	between 2 tcb, however the libc doesn't know and keeps updating the
	tcb->memfptr as if the exchange didn't happen.  This leads to
	unsynchronized tcb->memfptr and tcb->outf and invalid frees.
	Adding a new indirection fixes the problem.

	* stage_output.c (struct staged_output_data): New struct.
	(strace_open_memstream, strace_close_memstream): Use it.
	* defs.h (struct tcb): Replace real_outf, memfptr, and memfloc
	with a pointer to struct staged_output_data.
	* strace.c (maybe_switch_tcbs): Use it.
	* syscall.c (print_syscall_resume): Ditto.

2019-08-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix expected output for some ipc tests.
	* tests/gen_tests.in (ipc_msgbuf-Xraw, ipc_shm, ipc_shm-Xabbrev,
	ipc_shm-Xverbose): Adjust -a argument.

2019-08-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check the latest MSG_TRUNC decoding fix.
	* tests/recv-MSG_TRUNC.c: New file.
	* tests/recvfrom-MSG_TRUNC.c: Likewise.
	* tests/gen_tests.in (recv-MSG_TRUNC, recvfrom-MSG_TRUNC): New entries.
	* tests/pure_executables.list: Add recv-MSG_TRUNC and
	recvfrom-MSG_TRUNC.
	* tests/.gitignore: Likewise.

2019-08-02  Jeremy Kerr  <jk@ozlabs.org>

	net: Fix access beyond tracee buffer for MSG_TRUNC receives.
	The recv(), recvfrom() and recvmsg() calls allow a MSG_TRUNC flag, which
	indicates that the kernel should return the available size of an
	incoming message, rather than the received size.

	When strace-ing a truncated recv(), strace will try to access a
	return-value size area of the tracee's buffer, which may be larger than
	the actual buffer:

	  $ obj/strace -e trace=recvfrom ~/tmp/recv-test
	  recvfrom(3, "\1\2\3\4\0\0\0\0", 4, MSG_TRUNC, NULL, NULL) = 8

	If I add a non-readable guard page after the tracee's recv buffer, we
	see strace failing to read the vm area:

	  $ obj/strace -e trace=recvfrom ~/tmp/recv-test+guard
	  recvfrom(3, obj/strace: umoven: short read (4 < 8) @0x7f0b0d7ddffc
	  0x7f0b0d7ddffc, 4, MSG_TRUNC, NULL, NULL) = 8

	This change restricts the maximum read size to the size of the tracee's
	actual buffer.

	The recvmsg() handler will do the right thing by using the .iov_len
	data, so no change is required there.

	* net.c (sys_recv, sys_recvfrom): Clamp maximum sockbuf size.

2019-07-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add xlat description structure.
	Rename struct xlat to struct xlat_data and make struct xlat an xlat
	descriptor that contains various information about xlat.
	So far it's the type and the number of items.

	As a result, xlookup/printxval now have enough information for handling
	xlat depending on its type, so *index/*_search API is not needed any
	longer.

	* xlat.h (struct xlat_data): Rename from struct xlat.
	(struct xlat): New type definition.
	* xlat.c (xlat_search, printxval_sized, printxval_searchn_ex, xlat_idx,
	printxval_indexn_ex, printxval_dispatch_ex): Remove.
	(xlookup): Handle xlat_data based on xlat type.
	(xlat_search_eq_or_less, xlookup_le): New functions.
	(sprintflags_ex, printflags_ex): Update.
	* xlat/gen.sh (gen_header): Add handling for #sorted, generate new
	struct xlat descriptor.
	* defs.h (arp_hardware_types_size, ethernet_protocols_size,
	inet_protocols_size, evdev_abs_size, xlat_search, xlat_idx,
	printxval_searchn_ex, printxval_searchn, printxval_search,
	printxval_search_ex, printxval_indexn_ex, printxval_indexn,
	printxval_index, printxval_index_ex, printxval_dispatch_ex,
	printxval_dispatch): Remove.
	(enum xlat_style_private_flag_bits): Remove PAF_INDEX_XLAT_SORTED_BIT
	and PAF_INDEX_XLAT_VALUE_INDEXED_BIT.
	(enum xlat_style_private_flag): Remove PAF_INDEX_XLAT_SORTED and
	PAF_INDEX_XLAT_VALUE_INDEXED.
	(print_array_ex): Remove index_xlat_size argument.
	(xlookup_le): New declaration.
	(printxval_ex): New macro.
	* dyxlat.c (struct dyxlat): Remove used field (use xlat.size instead),
	embed struct xlat, add pointer to struct xlat_data.
	(MARK_END): Remove.
	(dyxlat_alloc, dyxlat_free, dyxlat_get, dyxlat_add_pair): Update in
	accordance with the structure changes.
	* evdev.c (evdev_abs_size): Remove.
	(keycode_ioctl): Use printxval instead of printxval_index.
	(decode_bitset): Remove.
	(decode_bitset_): Rename to decode_bitset, remove decode_nr_size and xt
	arguments, call printxval instead of printxval_dispatch.
	(bit_ioctl, evdev_read_ioctl): Do not pass xlat type to decode_bitset.
	* fsconfig.c (SYS_FUNC(fsconfig)): Use printxval instead of
	printxval_index.
	* print_fields.h (PRINT_FIELD_XVAL_SORTED_SIZED,
	PRINT_FIELD_XVAL_INDEX): Remove.
	* nlattr.h (struct decode_nla_xlat_opts): Remove xlat_size and xt
	fields.
	* nlattr.c (decode_nla_meminfo): Do not pass
	PAF_INDEX_XLAT_VALUE_INDEXED flag and netlink_sk_meminfo_indices size
	in a print_array_ex call.
	(decode_nla_xval): Call printxval_ex instead of printxval_dispatch_ex.
	(decode_nla_ether_proto, decode_nla_ip_proto): Do not pass xlat_size and
	xt fields in opts.
	(decode_nla_flags): Remove XT_INDEXED unsupported warning.
	* process.c (struct_user_offsets_data): Rename from struct_user_offsets,
	change type to struct xlat_data[].
	(struct_user_offsets): New xlat description.
	(print_user_offset_addr): Rewrite using xlookup_le.
	* util.c (print_array_ex): Remove index_xlat_size argument, simply call
	printxval_ex for index printing.
	* aio.c (tprint_lio_opcode): Use printxval_ex instead of
	printxval_indexn_ex.
	* bpf.c: Use printxval instead of printxval_index; use PRINT_FIELD_XVAL
	instead of PRINT_FIELD_XVAL_INDEX.
	* bpf_filter.c (print_bpf_filter_code): Use printxval instead of
	printxval_index.
	* ioctl.c (evdev_decode_number): Use printxval instead of
	printxval_indexn.
	* kvm.c (kvm_ioctl_decode_check_extension): Use printxval64 instead of
	printxval_index.
	(kvm_ioctl_run_attach_auxstr): Use xlookup instead of xlat_idx.
	* net.c: Use printxval instead of printxval_search/printxval_index, use
	printxval_ex instead of printxval_searchn_ex.
	* netlink.c (get_fd_nl_family): Rewrite using xlat descriptor structure.
	* netlink_packet_diag.c (decode_packet_diag_msg): Use PRINT_FIELD_XVAL
	instead of PRINT_FIELD_XVAL_SORTED_SIZED.
	* netlink_smc_diag.c (decode_smc_diag_shutdown): Remove ARRSZ_PAIR
	wrapper.
	(decode_smc_diag_fallback): Use printxval_ex instead of
	printxval_search_ex.
	(decode_smc_diag_msg): Use PRINT_FIELD_XVAL instead of
	PRINT_FIELD_XVAL_INDEX.
	* print_statfs.c (print_statfs_type): Use printxval instead of
	printxval_search.
	* ptrace_syscall_info.c (print_ptrace_syscall_info): Use
	PRINT_FIELD_XVAL instead of PRINT_FIELD_XVAL_INDEX.
	* rtnl_link.c (decode_ifla_inet6_flags, decode_ifla_inet6_agm):
	Likewise.
	(decode_nla_tun_type, decode_ifla_xdp_attached): Remove xlat_size,
	xt fields.
	(decode_ifla_inet_conf, decode_ifla_inet6_conf, decode_ifla_inet6_stats,
	decode_ifla_inet6_icmp6_stats): Remove PAF_INDEX_XLAT_VALUE_INDEXED flag
	and ARRSZ_PAIR wrapper in print_array_ex calls.
	(decode_ifinfomsg): Use PRINT_FIELD_XVAL instead of
	PRINT_FIELD_XVAL_SORTED_SIZED.
	* rtnl_route.c (decode_nla_rt_proto): Use printxval instead of
	printxval_search.
	* sock.c (print_ifreq): Use PRINT_FIELD_XVAL instead of
	PRINT_FIELD_XVAL_SORTED_SIZED.
	* sockaddr.c (print_sockaddr_data_ll, print_sockaddr_data_bt,
	print_sockaddr): Use printxval instead of printxval_search and
	printxval_index.
	* time.c (getitimer, osf_getitimer, setitimer, osf_setitimer,
	printclockname): Use printxval instead of printxval_index.
	(do_adjtimex): Use xlookup instead of xlat_idx.
	* tests/btrfs.c: Update xlat handling, use struct xlat_data instead of
	struct xlat for XLAT() arrays.
	* tests/ioctl_block.c: Likewise.
	* tests/ioctl_rtc.c: Likewise.
	* tests/printflags.c: Likewise.
	* tests/printxval.c: Likewise.
	* tests/prlimit64.c: Likewise.
	* tests/setrlimit.c: Likewise.
	* tests/socketcall.c: Likewise.
	* tests/xgetrlimit.c: Likewise.
	* tests/xstatfsx.c: Likewise.
	* xlat/af_packet_versions.in: Add #value_indexed.
	* xlat/arp_hardware_types.in: Add #sorted.
	* xlat/ax25_protocols.in: Likewise.
	* xlat/bluetooth_l2_cid.in: Likewise.
	* xlat/bluetooth_l2_psm.in: Likewise.
	* xlat/ethernet_protocols.in: Likewise.
	* xlat/evdev_ff_types.in: Likewise.
	* xlat/fsmagic.in: Likewise.
	* xlat/hw_breakpoint_type.in: Likewise.
	* xlat/iffflags.in: Likewise.
	* xlat/inet6_if_flags.in: Likewise.
	* xlat/inet_protocols.in: Likewise.
	* xlat/msgctl_flags.in: Likewise.
	* xlat/perf_hw_cache_id.in: Likewise.
	* xlat/perf_hw_cache_op_id.in: Likewise.
	* xlat/perf_hw_cache_op_result_id.in: Likewise.
	* xlat/perf_hw_id.in: Likewise.
	* xlat/perf_sw_ids.in: Likewise.
	* xlat/perf_type_id.in: Likewise.
	* xlat/routing_protocols.in: Likewise.
	* xlat/semctl_flags.in: Likewise.
	* xlat/shmctl_flags.in: Likewise.
	* xlat/smc_decl_codes.in: Likewise.
	* xlat/sock_ax25_options.in: Likewise.
	* xlat/sock_bluetooth_options.in: Likewise.
	* xlat/sock_dccp_options.in: Likewise.
	* xlat/sock_tipc_options.in: Likewise.
	* xlat/socketlayers.in: Likewise.
	* xlat/v4l2_control_classes.in: Likewise.
	* xlat/v4l2_pix_fmts.in: Likewise.
	* xlat/v4l2_sdr_fmts.in: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-07-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	NEWS: retroactively mention that -z/-Z fix addresses Debian bug #176376.

	xlat/v4l2_pix_fmts.in: work around V4L2_PIX_FMT_BGRA444 value change.
	* xlat/v4l2_pix_fmts.in: Undefine V4L2_PIX_FMT_BGRA444 as it has changed
	its value in Linux commit v5.2-rc5-403-g22be8233b34f.

2019-07-18  Anatoly Pugachev  <matorola@gmail.com>

	README-configure: recommend 'make -k check' instead of 'make check'
	* maint/install.texi: Replace 'make check' with 'make -k check'.
	* README-configure: Regenerate.

2019-07-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Generalise hardware address printing.
	* defs.h [!MAX_ADDR_LEN] (MAX_ADDR_LEN): New macro.
	(sprint_hwaddr): New declaration.
	(print_hwaddr): New inline function, a wrapper for sprint_hwaddr.
	* print_fields.h (PRINT_FIELD_HWADDR_SZ): New macro.
	* print_mac.c: Include "xlat/arp_hardware_types.h" under
	XLAT_MACROS_ONLY.
	[!MAX_ADDR_LEN] (MAX_ADDR_LEN): Remove.
	(sprint_hwaddr): New function.
	* sock.c (print_ifreq) <SIOCSIFHWADDR, SIOCGIFHWADDR>: Print hardware
	address using PRINT_FIELD_HWADDR_SZ.

	open: implement sprint_open_modes using sprintflags_ex.
	* defs.h (sprintflags_ex): Add "sep" argument.
	(sprintflags): Pass '\0' in "sep" argument.
	* open.c (sprint_open_modes): Use sprintflags_ex for printing
	open_mode_flags.
	* xlat.c (sprintflags_ex): Add "sep" argument, use it as initial
	separator (if not nul).

2019-07-16  Dmitry V. Levin  <ldv@altlinux.org>

	Consistently define __NR_* constants.
	Include <asm/unistd.h> from "scno.h", include "scno.h" instead of
	<asm/unistd.h>, do not include <asm/unistd.h> where "scno.h" is already
	included.

	* scno.head: Include <asm/unistd.h>.
	* clone.c: Include "scno.h" instead of <asm/unistd.h>.
	* syscall.c: Likewise.
	* tests/_newselect.c: Likewise.
	* tests/accept.c: Likewise.
	* tests/accept_compat.h: Likewise.
	* tests/access.c: Likewise.
	* tests/acct.c: Likewise.
	* tests/aio.c: Likewise.
	* tests/alarm.c: Likewise.
	* tests/answer.c: Likewise.
	* tests/attach-f-p.c: Likewise.
	* tests/brk.c: Likewise.
	* tests/chmod.c: Likewise.
	* tests/chown.c: Likewise.
	* tests/chown32.c: Likewise.
	* tests/chroot.c: Likewise.
	* tests/clock_adjtime.c: Likewise.
	* tests/clock_nanosleep.c: Likewise.
	* tests/clock_xettime.c: Likewise.
	* tests/creat.c: Likewise.
	* tests/delay.c: Likewise.
	* tests/delete_module.c: Likewise.
	* tests/dev-yy.c: Likewise.
	* tests/dup2.c: Likewise.
	* tests/dup3.c: Likewise.
	* tests/epoll_create.c: Likewise.
	* tests/epoll_create1.c: Likewise.
	* tests/epoll_ctl.c: Likewise.
	* tests/epoll_pwait.c: Likewise.
	* tests/epoll_wait.c: Likewise.
	* tests/eventfd.c: Likewise.
	* tests/faccessat.c: Likewise.
	* tests/fadvise64.c: Likewise.
	* tests/fadvise64_64.c: Likewise.
	* tests/fallocate.c: Likewise.
	* tests/fanotify_init.c: Likewise.
	* tests/fanotify_mark.c: Likewise.
	* tests/fchdir.c: Likewise.
	* tests/fchmod.c: Likewise.
	* tests/fchmodat.c: Likewise.
	* tests/fchown.c: Likewise.
	* tests/fchown32.c: Likewise.
	* tests/fchownat.c: Likewise.
	* tests/fcntl.c: Likewise.
	* tests/fcntl64.c: Likewise.
	* tests/fdatasync.c: Likewise.
	* tests/file_handle.c: Likewise.
	* tests/flock.c: Likewise.
	* tests/fstat.c: Likewise.
	* tests/fstat64.c: Likewise.
	* tests/fstatat64.c: Likewise.
	* tests/fstatfs.c: Likewise.
	* tests/fstatfs64.c: Likewise.
	* tests/fsync.c: Likewise.
	* tests/ftruncate.c: Likewise.
	* tests/ftruncate64.c: Likewise.
	* tests/futex.c: Likewise.
	* tests/futimesat.c: Likewise.
	* tests/get_mempolicy.c: Likewise.
	* tests/get_sigset_size.c: Likewise.
	* tests/getcpu.c: Likewise.
	* tests/getcwd.c: Likewise.
	* tests/getdents.c: Likewise.
	* tests/getdents64.c: Likewise.
	* tests/getegid32.c: Likewise.
	* tests/geteuid32.c: Likewise.
	* tests/getgid.c: Likewise.
	* tests/getgid32.c: Likewise.
	* tests/getgroups.c: Likewise.
	* tests/getgroups32.c: Likewise.
	* tests/getpgrp.c: Likewise.
	* tests/getpid.c: Likewise.
	* tests/getrandom.c: Likewise.
	* tests/getresgid.c: Likewise.
	* tests/getresgid32.c: Likewise.
	* tests/getresuid.c: Likewise.
	* tests/getresuid32.c: Likewise.
	* tests/getrlimit.c: Likewise.
	* tests/getrusage.c: Likewise.
	* tests/gettid.c: Likewise.
	* tests/getuid.c: Likewise.
	* tests/getuid32.c: Likewise.
	* tests/getxxid.c: Likewise.
	* tests/init_module.c: Likewise.
	* tests/inject-nf.c: Likewise.
	* tests/inotify.c: Likewise.
	* tests/inotify_init1.c: Likewise.
	* tests/ioctl_inotify.c: Likewise.
	* tests/ioctl_loop.c: Likewise.
	* tests/ioctl_perf.c: Likewise.
	* tests/ioctl_uffdio.c: Likewise.
	* tests/ioperm.c: Likewise.
	* tests/iopl.c: Likewise.
	* tests/ioprio.c: Likewise.
	* tests/ipc.c: Likewise.
	* tests/ipc_msgbuf.c: Likewise.
	* tests/kexec_load.c: Likewise.
	* tests/keyctl.c: Likewise.
	* tests/kill.c: Likewise.
	* tests/ksysent.c: Likewise.
	* tests/lchown.c: Likewise.
	* tests/lchown32.c: Likewise.
	* tests/libmmsg.c: Likewise.
	* tests/libsocketcall.c: Likewise.
	* tests/link.c: Likewise.
	* tests/linkat.c: Likewise.
	* tests/llseek.c: Likewise.
	* tests/localtime.c: Likewise.
	* tests/lookup_dcookie.c: Likewise.
	* tests/lseek.c: Likewise.
	* tests/lstat.c: Likewise.
	* tests/lstat64.c: Likewise.
	* tests/madvise.c: Likewise.
	* tests/migrate_pages.c: Likewise.
	* tests/mkdir.c: Likewise.
	* tests/mkdirat.c: Likewise.
	* tests/mknod.c: Likewise.
	* tests/mknodat.c: Likewise.
	* tests/mlock.c: Likewise.
	* tests/modify_ldt.c: Likewise.
	* tests/move_pages.c: Likewise.
	* tests/mq_sendrecv.c: Likewise.
	* tests/newfstatat.c: Likewise.
	* tests/nsyscalls.c: Likewise.
	* tests/old_mmap.c: Likewise.
	* tests/oldfstat.c: Likewise.
	* tests/oldlstat.c: Likewise.
	* tests/oldselect-efault.c: Likewise.
	* tests/oldselect.c: Likewise.
	* tests/oldstat.c: Likewise.
	* tests/open.c: Likewise.
	* tests/openat.c: Likewise.
	* tests/osf_utimes.c: Likewise.
	* tests/pause.c: Likewise.
	* tests/perf_event_open.c: Likewise.
	* tests/perf_event_open_nonverbose.c: Likewise.
	* tests/pipe.c: Likewise.
	* tests/pipe2.c: Likewise.
	* tests/poll.c: Likewise.
	* tests/ppoll.c: Likewise.
	* tests/prctl-arg2-intptr.c: Likewise.
	* tests/prctl-dumpable.c: Likewise.
	* tests/prctl-no-args.c: Likewise.
	* tests/prctl-pdeathsig.c: Likewise.
	* tests/prctl-seccomp-filter-v.c: Likewise.
	* tests/prctl-seccomp-strict.c: Likewise.
	* tests/prctl-securebits.c: Likewise.
	* tests/prctl-spec-inject.c: Likewise.
	* tests/prctl-tid_address.c: Likewise.
	* tests/prctl-tsc.c: Likewise.
	* tests/prlimit64.c: Likewise.
	* tests/process_vm_readv.c: Likewise.
	* tests/process_vm_writev.c: Likewise.
	* tests/pselect6.c: Likewise.
	* tests/ptrace.c: Likewise.
	* tests/qual_inject-error-signal.c: Likewise.
	* tests/qual_inject-retval.c: Likewise.
	* tests/qual_inject-signal.c: Likewise.
	* tests/quotactl-xfs.c: Likewise.
	* tests/quotactl.c: Likewise.
	* tests/read-write.c: Likewise.
	* tests/readahead.c: Likewise.
	* tests/readdir.c: Likewise.
	* tests/readlink.c: Likewise.
	* tests/readlinkat.c: Likewise.
	* tests/reboot.c: Likewise.
	* tests/rename.c: Likewise.
	* tests/renameat.c: Likewise.
	* tests/request_key.c: Likewise.
	* tests/rmdir.c: Likewise.
	* tests/rt_sigpending.c: Likewise.
	* tests/rt_sigprocmask.c: Likewise.
	* tests/rt_sigsuspend.c: Likewise.
	* tests/rt_sigtimedwait.c: Likewise.
	* tests/rt_tgsigqueueinfo.c: Likewise.
	* tests/s390_guarded_storage.c: Likewise.
	* tests/s390_pci_mmio_read_write.c: Likewise.
	* tests/s390_runtime_instr.c: Likewise.
	* tests/s390_sthyi.c: Likewise.
	* tests/sched_get_priority_mxx.c: Likewise.
	* tests/sched_rr_get_interval.c: Likewise.
	* tests/sched_xetaffinity.c: Likewise.
	* tests/sched_xetattr.c: Likewise.
	* tests/sched_xetparam.c: Likewise.
	* tests/sched_xetscheduler.c: Likewise.
	* tests/sched_yield.c: Likewise.
	* tests/seccomp-filter-v.c: Likewise.
	* tests/seccomp-filter.c: Likewise.
	* tests/seccomp-strict.c: Likewise.
	* tests/seccomp_get_action_avail.c: Likewise.
	* tests/select.c: Likewise.
	* tests/sendfile.c: Likewise.
	* tests/sendfile64.c: Likewise.
	* tests/setdomainname.c: Likewise.
	* tests/setfsgid.c: Likewise.
	* tests/setfsgid32.c: Likewise.
	* tests/setfsuid.c: Likewise.
	* tests/setfsuid32.c: Likewise.
	* tests/setgid.c: Likewise.
	* tests/setgid32.c: Likewise.
	* tests/setgroups.c: Likewise.
	* tests/setgroups32.c: Likewise.
	* tests/sethostname.c: Likewise.
	* tests/setns.c: Likewise.
	* tests/setregid.c: Likewise.
	* tests/setregid32.c: Likewise.
	* tests/setresgid.c: Likewise.
	* tests/setresgid32.c: Likewise.
	* tests/setresuid.c: Likewise.
	* tests/setresuid32.c: Likewise.
	* tests/setreuid.c: Likewise.
	* tests/setreuid32.c: Likewise.
	* tests/setrlimit.c: Likewise.
	* tests/setuid.c: Likewise.
	* tests/setuid32.c: Likewise.
	* tests/sigaction.c: Likewise.
	* tests/signal.c: Likewise.
	* tests/signalfd4.c: Likewise.
	* tests/sigpending.c: Likewise.
	* tests/sigprocmask.c: Likewise.
	* tests/sigreturn.c: Likewise.
	* tests/sigsuspend.c: Likewise.
	* tests/socketcall.c: Likewise.
	* tests/splice.c: Likewise.
	* tests/stack-fcall-3.c: Likewise.
	* tests/stat.c: Likewise.
	* tests/stat64.c: Likewise.
	* tests/statfs.c: Likewise.
	* tests/statfs64.c: Likewise.
	* tests/status-none-threads.c: Likewise.
	* tests/status-unfinished-threads.c: Likewise.
	* tests/statx.c: Likewise.
	* tests/swap.c: Likewise.
	* tests/sxetmask.c: Likewise.
	* tests/symlink.c: Likewise.
	* tests/symlinkat.c: Likewise.
	* tests/sync.c: Likewise.
	* tests/sync_file_range.c: Likewise.
	* tests/sync_file_range2.c: Likewise.
	* tests/syslog.c: Likewise.
	* tests/tee.c: Likewise.
	* tests/threads-execve.c: Likewise.
	* tests/time.c: Likewise.
	* tests/timer_create.c: Likewise.
	* tests/timer_xettime.c: Likewise.
	* tests/timerfd_xettime.c: Likewise.
	* tests/times-fail.c: Likewise.
	* tests/times.c: Likewise.
	* tests/truncate.c: Likewise.
	* tests/truncate64.c: Likewise.
	* tests/ugetrlimit.c: Likewise.
	* tests/umount.c: Likewise.
	* tests/umount2.c: Likewise.
	* tests/umoven-illptr.c: Likewise.
	* tests/umovestr-illptr.c: Likewise.
	* tests/uname.c: Likewise.
	* tests/unix-pair-send-recv.c: Likewise.
	* tests/unlink.c: Likewise.
	* tests/unlinkat.c: Likewise.
	* tests/unshare.c: Likewise.
	* tests/ustat.c: Likewise.
	* tests/utime.c: Likewise.
	* tests/utimensat.c: Likewise.
	* tests/utimes.c: Likewise.
	* tests/vhangup.c: Likewise.
	* tests/vmsplice.c: Likewise.
	* tests/waitid.c: Likewise.
	* tests/waitpid.c: Likewise.
	* tests/xet_robust_list.c: Likewise.
	* tests/xet_thread_area_x86.c: Likewise.
	* tests/xetitimer.c: Likewise.
	* tests/xetpgid.c: Likewise.
	* tests/xetpriority.c: Likewise.
	* tests/xettimeofday.c: Likewise.
	* strace.c: Do not include <asm/unistd.h>.
	* ucopy.c: Likewise.
	* tests/add_key.c: Likewise.
	* tests/aio_pgetevents.c: Likewise.
	* tests/bpf-obj_get_info_by_fd.c: Likewise.
	* tests/bpf.c: Likewise.
	* tests/copy_file_range.c: Likewise.
	* tests/execveat.c: Likewise.
	* tests/finit_module.c: Likewise.
	* tests/fsconfig.c: Likewise.
	* tests/fsmount.c: Likewise.
	* tests/fsopen.c: Likewise.
	* tests/fspick.c: Likewise.
	* tests/getegid.c: Likewise.
	* tests/geteuid.c: Likewise.
	* tests/getppid.c: Likewise.
	* tests/inotify_init.c: Likewise.
	* tests/io_uring_enter.c: Likewise.
	* tests/io_uring_register.c: Likewise.
	* tests/io_uring_setup.c: Likewise.
	* tests/kcmp.c: Likewise.
	* tests/kern_features.c: Likewise.
	* tests/kernel_version.c: Likewise.
	* tests/kexec_file_load.c: Likewise.
	* tests/maybe_switch_current_tcp.c: Likewise.
	* tests/mbind.c: Likewise.
	* tests/membarrier.c: Likewise.
	* tests/memfd_create.c: Likewise.
	* tests/mlock2.c: Likewise.
	* tests/move_mount.c: Likewise.
	* tests/open_tree.c: Likewise.
	* tests/pidfd_send_signal.c: Likewise.
	* tests/pkey_alloc.c: Likewise.
	* tests/pkey_free.c: Likewise.
	* tests/pkey_mprotect.c: Likewise.
	* tests/preadv2-pwritev2.c: Likewise.
	* tests/ptrace_syscall_info.c: Likewise.
	* tests/remap_file_pages.c: Likewise.
	* tests/renameat2.c: Likewise.
	* tests/riscv_flush_icache.c: Likewise.
	* tests/set_mempolicy.c: Likewise.
	* tests/test_printstrn.c: Likewise.
	* tests/test_ucopy.c: Likewise.
	* tests/userfaultfd.c: Likewise.

2019-07-16  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64: remove syscall numbers range [1024...1079] from syscallent.h.
	Remove support for decoding syscalls in range [1024...1079] on aarch64
	as this range has never been implemented in mainline kernel releases.

	* linux/aarch64/syscallent.h [1024...1079]: Remove.
	* NEWS: Mention this change.

2019-07-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip socketcall test on arm eabi.
	arm eabi has no socketcall even if __NR_socketcall is defined.

	* tests/socketcall.c: Conditionalize on !__ARM_EABI__ along with
	__NR_socketcall.

2019-07-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify statx test.
	Do not assume that <linux/stat.h> defines struct statx.

	* configure.ac (AC_CHECK_TYPES): Check for struct statx in
	<linux/stat.h>.
	* tests/statx.c: Conditionalize on HAVE_STRUCT_STATX along with
	__NR_statx.

2019-07-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify old_mmap test.
	Do not assume that old mmap syscall is implemented in the kernel
	when __NR_mmap is defined.

	* tests/alarm.c (main): Print mmap return code using sprintrc,
	do not invoke mprotect if mmap is not implemented.

2019-07-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify alarm test.
	Do not assume that alarm syscall always succeeds.

	* tests/alarm.c (main): Use sprintrc.

2019-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs.h: add ability to pass style to printxval_index_ex macro.
	So it matches its name.

	* defs.h (printxval_index_ex): Add style__ macro, pass it as the 5th
	argument to the printxval_indexn_ex call.

2019-07-16  Bharath Vedartham  <linux.bhar@gmail.com>

	tests: extend coverage of syslog tests.
	The current syslog test covers only those cases where the type parameter
	is one of SYSLOG_ACTION_READ, SYSLOG_ACTION_READ_ALL,
	SYSLOG_ACTION_READ_CLEAR as per codecov.

	Add test case to cover the default case.

	* tests/syslog.c (SYSLOG_ACTION_SIZE_BUFFER): New macro.
	(main): Check SYSLOG_ACTION_SIZE_BUFFER decoding.

	Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2019-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	aio: assorted iocb decoder updates.
	* xlat/aio_iocb_flags.in: New file.
	* defs.h (pollflags, rwf_flags): New declarations.
	* configure.ac (AC_CHECK_MEMBERS): Check for aio_flags and aio_rw_flags
	fields of struct iocb.
	* aio.c [HAVE_STRUCT_IOCB_AIO_FLAGS]: Include "xlat/aio_iocb_flags.h".
	(AIO_RW_FLAGS_FIELD): New macro definition, defined based on the
	presence of HAVE_STRUCT_IOCB_AIO_RW_FLAGS macro.
	(iocb_sub): Add SUB_POLL.
	(tprint_lio_opcode): Change IOCB_CMD_POLL subtype to SUB_POLL.
	(print_common_flags): Conditionalize on HAVE_STRUCT_IOCB_AIO_FLAGS
	instead of IOCB_FLAG_RESFD.  Print aio_flags using aio_iocb_flags xlat.
	(print_iocb_header): Always print aio_data.  Print aio_rw_flags if it
	is non-zero.  Print aio_reqprio based on the presence of
	IOCB_FLAG_IOPRIO flag in aio_flags (use print_ioprio if it set and print
	as a signed integer otherwise).
	(print_iocb): Decode SUB_POLL subtype.
	* tests/aio.c: Update expected output.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-07-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ioprio: add print_ioprio function.
	That respects xlat style settings.

	* ioprio.c (print_ioprio): New function.
	* defs.h (print_ioprio): New declaration.

2019-07-15  Dmitry V. Levin  <ldv@altlinux.org>

	tests: serialize bpf-obj_get_info_by_fd based executables.
	Concurrent execution of many bpf-obj_get_info_by_fd based tests may
	lead to a temporary resource shortage that causes them to fail with
	the following error diagnostics:

		BPF_MAP_CREATE failed: Operation not permitted

	Avoid this issue by serializing execution of all relevant tests.

	* tests/lock_file.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add lock_file.c
	* tests/tests.h (lock_file_by_dirname): New prototype.
	* tests/bpf-obj_get_info_by_fd.c (main): Call lock_file_by_dirname
	to obtain an exclusive lock on bpf-obj_get_info_by_fd executable.

	References: https://github.com/strace/strace/issues/74
	References: https://github.com/strace/strace/issues/105

2019-07-15  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix build and run on alpha with fresh kernel headers.
	Fix tests on alpha with Linux kernel headers containing commits
	v5.1-rc1~160^2~3^2~12 and v5.1-rc1~160^2~3^2~1.

	* tests/getegid.c: Include "scno.h".
	(main): Use sprintrc.
	* tests/geteuid.c: Likewise.
	* tests/getppid.c: Likewise.
	* tests/getgid.c [__NR_getgid == __NR_getxgid]: Skip.
	* tests/getuid.c [__NR_getuid == __NR_getxuid]: Skip.
	* tests/getpid.c [__NR_getpid == __NR_getxpid]: Skip.
	* tests/umount2.c (__NR_umount2): Remove.
	(TEST_SYSCALL_NR): New macro.
	(main): Use it instead of __NR_umount2.
	* tests/ksysent.sed: Remove new __NR_get[gup]id aliases to traditional
	__NR_getx[gup]id names (on alpha).
	Prioritize __NR_umount over __NR_umount2, __NR_osf_shmat over __NR_shmat.
	* NEWS: Mention these fixes.

2019-07-15  Dmitry V. Levin  <ldv@altlinux.org>

	copyright-year-gen, file-date-gen: enhance error diagnostics.
	* copyright-year-gen: Prefix error message with the script name.
	* file-date-gen: Likewise.  Bail out in case of invalid date.

2019-07-15  Dmitry V. Levin  <ldv@altlinux.org>

	configure.ac: honor exit status of commands run by m4_esyscmd.
	If the command run by m4_esyscmd exits with non-zero exit status,
	autom4te shall terminate.

	* m4/st_esyscmd_s.m4: New file.
	* configure.ac: Replace m4_esyscmd with st_esyscmd_s.

	References: https://github.com/strace/strace/issues/105

2019-07-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: test evdev bitset decoding more thoroughly.
	* tests/ioctl_evdev-success-v.test: Inject various values.
	* tests/ioctl_evdev-success.test: Likewise.
	* tests/ioctl_evdev-success.c (NUM_WORDS): New macro.
	(struct evdev_check): Constify arg_ptr and print_arg args.
	(invoke_test_syscall, test_evdev, print_input_absinfo, print_input_id,
	print_mtslots): Add const qualifiers.
	(print_getbit): Add const qualifiers, rewrite to expect trailing NULL
	in the string array instead of leading string count.
	(main): Set size for ev_more, ev_less, ev_zero arrays; replace leading
	count element in ev_more_str, ev_less_str, ev_zero_str with trailing
	NULL; replace ev_more_str and ev_less_str with ev_more_str_2/ev_less_str_2
	and ev_more_str_3/ev_less_str_3 that differ by presence of flags that reside
	beyond first two bytes; add static and const qualifiers where possible;
	add key/key_sts_8/key_str_16 values; update a to provide either ev_more_str_2
	or ev_more_str_3 and either key_str_8 or key_str_16 depending on inject_retval
	value.

2019-07-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	evdev: fix array size calculation in decode_bitset_
	max_nr is in bits (as it is a number of flags), result is in bytes, and
	the array allocation has to be in personality words.

	There's still an open question, however, what to do on big-endian
	architectures when a non-divisible-by-4 value is returned.

	* evdev.c (decode_bitset_): Declare size_bits, initialise it and use it
	later instead of size; round up size by personality's word boundary.

2019-07-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	evdev: avoid bit vector decoding on non-successful and 0 return codes.
	Reported by Clang.

	    strace/evdev.c:157:3: note: The value 0 is assigned to 'size'
	    #                size = tcp->u_rval * 8;
	    #                ^~~~~~~~~~~~~~~~~~~~~~
	    strace/evdev.c:158:2: warning: Declared variable-length array (VLA)
	    has zero size
	    #        char decoded_arg[size];
	    #        ^

	* evdev.c (decode_bitset_): Bail out before decoded_arg VLA definition.

2019-07-13  Chen Jingpiao  <chenjingpiao@gmail.com>

	filter_qualify: export trace_set set.
	In preparation for seccomp-assisted syscall filtering, export
	trace_set set, which will be used to derive the BPF program.

	* filter_qualify.c (trace_set): Remove static qualifier.
	* number_set.h (trace_set): New declaration.

2019-07-13  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 5.2-1.
	* strace.spec.in: Likewise.

2019-07-12  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 5.2 release.
	* NEWS: Update for 5.2 release.

	Update .mailmap.
	* .mailmap: Add both email addresses of Zhibin Li to avoid duplication
	in CREDITS file.

2019-07-11  Dmitry V. Levin  <ldv@altlinux.org>

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2019-07-11  Dmitry V. Levin  <ldv@altlinux.org>

	maint/update_copyright_years.sh: take all commits into account.
	This helps to avoid accidental shrinking of copyright years range.

	* maint/update_copyright_years.sh: Take all commits into account
	to find copyright years of the earliest and the latest commit.

2019-07-11  Dmitry V. Levin  <ldv@altlinux.org>

	Fix preprocessor indentation.
	Indent the C preprocessor directives to reflect their nesting
	using the following script:

	$ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do
		cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
	done

2019-07-10  Paul Chaignon  <paul.chaignon@gmail.com>

	tests: check status qualifier.
	This change adds 8 test cases for -e status with unfinished, failed,
	none, successful, detached, and the whole set.  The test cases for
	failed, successful, and the whole set use chdir(2).  Threaded test cases
	for unfinished and none rely on a child thread execve'ing the lead
	thread.  There are additional single-threaded tests for status=none and
	status=unfinished.  The test case for detached interrupts strace while
	attached to a sleeping process.

	* tests/status.c: New file.
	* tests/status-all.c: Likewise.
	* tests/status-failed.c: Likewise.
	* tests/status-detached.expected: Likewise.
	* tests/status-none.c: Likewise.
	* tests/status-none-threads.c: Likewise.
	* tests/status-successful.c: Likewise.
	* tests/status-unfinished-threads.c: Likewise.
	* tests/status-unfinished.c: Likewise.
	* tests/status-detached.test: New test.
	* tests/status-none-threads.test: Likewise.
	* tests/status-unfinished-threads.test: Likewise.
	* tests/tests.h (test_status_chdir): New prototype.
	* tests/.gitignore: Add status-all, status-failed, status-none,
	status-none-threads, status-successful, status-unfinished,
	and status-unfinished-threads.
	* tests/gen_tests.in: Add status-all, status-failed, status-successful,
	status-none, and status-unfinished.
	* tests/pure_executables.list: Likewise.
	* tests/Makefile.am (libtests_a_SOURCES): Add status.c.
	(check_PROGRAMS): Add status-none-threads and status-unfinished-threads.
	(status_none_threads_LDADD, status_unfinished_threads_LDADD): New
	variables.
	(MISC_TESTS): Add status-detached.test, status-none-threads.test, and
	status-unfinished-threads.test.
	(EXTRA_DIST): Add status-detached.expected.

	Co-Authored-by: Burkhard Kohl <burkhard.kohl@intel.com>
	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-07-10  Paul Chaignon  <paul.chaignon@gmail.com>

	Implement -e status=set option.
	The status qualifier enables filtering based on the return status of
	syscalls.  -z and -Z become aliases for -e status=successful and -e
	status=failed.  Staged output is only enabled when at least one status
	is filtered, that is, when the set is incomplete.

	* signal.c (popcount32): Move ...
	* defs.h (popcount32): ... here.
	(not_failing_only, failing_only): Remove.
	* filter_qualify.c (status_set): New number_set variable.
	(statuses): New variable for names of statuses.
	(statusstr_to_uint, qualify_status): New functions.
	(qual_options): Handle status qualifier.
	* number_set.c (get_number_setbit, is_complete_set): New functions.
	* number_set.h (is_complete_set): New prototype.
	(status_t): New enumeration for statuses.
	(status_set): New prototype.
	* strace.1.in: Document new status qualifier.
	* strace.c (not_failing_only, failing_only): Remove.
	(droptcb): Handle status=detached option.
	(init): Handle new status qualifier, set status_set variable on -z and -Z
	options, warn on -zZ and -Zz, use is_complete_set.
	(maybe_switch_tcbs): Reopen memstream after tcb switch.
	(print_event_exit): Handle status=unfinished option.
	* syscall.c (syscall_entering_trace): Use is_complete_set.
	(syscall_exiting_trace): Use is_complete_set, handle status=unavailable
	option.
	* NEWS: Mention this change.

2019-07-10  Paul Chaignon  <paul.chaignon@gmail.com>

	Stage output for -z and -Z options.
	-z and -Z options print only successful and failing syscalls respectively.
	However, failure of syscall is only known after syscall return.  Thus, we
	end up with something like this on, e.g., ENOENT:

	  open("does_not_exist", O_RDONLY <unfinished ...>

	whereas the intended result is that the open(...) line is not shown at all.

	This change fixes this issue using open_memstream.  When either the -z or
	the -Z option is used, the output is staged in memory (using
	open_memstream) until we know the syscall return status.  If the
	open_memstream function is not available, these new options error out.

	Document -z and -Z options as new features since they have never worked
	properly before and were undocumented since commit v4.4.95~21.

	* stage_output.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* configure.ac (AC_CHECK_FUNCS): Add open_memstream.
	* defs.h (struct tcb): Add real_outf, memfptr, and memfloc fields for
	memstream.
	(strace_open_memstream, strace_close_memstream): New prototypes.
	* strace.1.in: Document -z and -Z options.
	* strace.c (usage): Mention -z and -Z options.
	(init): Error on -z and -Z options if open_memstream if unavailable.
	(maybe_switch_tcbs): Handle switch of memstream between tcbs.
	(printleader): Avoid marking staged syscalls as unfinished.
	* syscall.c (syscall_entering_trace): Open memstream.
	(syscall_exiting_trace): Filter failed syscalls if failing_only is set,
	handle raw(tcp) case.
	(print_syscall_resume): Avoid marking staged syscalls as resumed.
	* NEWS: Mention this change.

	Resolves: https://github.com/strace/strace/issues/49
	Resolves: https://github.com/strace/strace/issues/50
	Co-Authored-by: Burkhard Kohl <burkhard.kohl@intel.com>

2019-07-10  Paul Chaignon  <paul.chaignon@gmail.com>

	Add -Z option to print only failing syscalls.
	Existing -z option prints only successful syscalls.
	This change adds a -Z option to print only failing syscalls.

	Both options will start to behave properly with the subsequent commit.

	* strace.c (init): Handle new -Z option.
	* defs.h (failing_only): New prototype.
	* syscall.c (failing_only): New variable.
	(syscall_exiting_trace): Ignore failed syscalls if failing_only is set.

	References: https://github.com/strace/strace/issues/50
	Co-Authored-by: Burkhard Kohl <burkhard.kohl@intel.com>

2019-07-10  Dmitry V. Levin  <ldv@altlinux.org>

	syscall.c: rename ptrace_get_syscall_info to strace_get_syscall_info.
	... to avoid potential conflict with future glibc versions.

	* syscall.c (ptrace_get_syscall_info): Rename to
	strace_get_syscall_info.  All callers updated.

2019-07-10  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix build with cutting-edge glibc.
	Fix the following compilation error:

	In file included from statx.c:44:
	xstatx.c:47:16: error: ‘struct libc_statx’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

	* tests/xstatx.c (struct statx): New forward declaration.

2019-07-10  Dmitry V. Levin  <ldv@altlinux.org>

	Fix misleading stray PTRACE_EVENT_EXEC diagnostics.
	If current_tcp is to be switched, entering(current_tcp) is irrelevant.

	* strace.c (maybe_switch_tcbs): Update comment.
	(dispatch_event) <case TE_STOP_BEFORE_EXECVE>: Invoke
	maybe_switch_current_tcp early, skip the check for a stray
	PTRACE_EVENT_EXEC if current_tcp was switched.
	* tests/maybe_switch_current_tcp.c: New file.
	* tests/pure_executables.list: Add maybe_switch_current_tcp.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (maybe_switch_current_tcp): New entry.
	* tests/Makefile.am (maybe_switch_current_tcp_LDADD): New variable.

2019-07-10  Dmitry V. Levin  <ldv@altlinux.org>

	Refactor maybe_switch_tcbs.
	Change maybe_switch_tcbs to return NULL when no switching is necessary.
	Introduce maybe_switch_current_tcp as a thing wrapper around
	maybe_switch_tcbs.

	* strace.c (maybe_switch_current_tcp): New function.
	(dispatch_event): Use it instead of maybe_switch_tcbs, move comments
	and the os_release check before maybe_switch_tcbs invocation ...
	(maybe_switch_tcbs): ... here.  Change return value to NULL
	if no switching was performed.

2019-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify strace -k tests against link-time optimizer.
	Some distributions enable by default a link-time optimizer that
	mangles stack_fcall sample executables in a way that renders them
	unusable for test purposes.

	Robustify tests to defeat link-time optimizer.

	* tests/stack-fcall.h (f0, f1, f2, f3): Add second parameter.
	* tests/stack-fcall.c (main): Pass main as the second parameter to f0.
	* tests/stack-fcall-0.c (f0): Add second parameter f, pass the xor of it
	and f0 to f1.
	* tests/stack-fcall-1.c (f1): Add second parameter f, pass the xor of it
	and f1 to f2.
	* tests/stack-fcall-2.c (f2): Add second parameter f, pass the xor of it
	and f2 to f3.
	* tests/stack-fcall-3.c: Include <asm/unistd.h>.
	(f3): Add second parameter f, invoke __NR_gettid syscall with the xor
	of f and f3 as its argument.

2019-07-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ia64: optimize syscallent table.
	Use shuffle_scno since all valid syscall numbers start from 1024.

	* linux/syscallent_base_nr.h: New file.
	* linux/ia64/syscallent_base_nr.h: Likewise.
	* linux/ia64/shuffle_scno.c: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* linux/ia64/syscallent.h [SYSCALLENT_BASE_NR] (BASE_NR): Define to 0.
	* syscall.c: Include "syscallent_base_nr.h".
	* clone.c [IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Use
	shuffle_scno.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-07-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	inotify: decode file descriptor returned by inotify_init.
	* inotify.c (SYS_FUNC(inotify_init)): New function.
	* linux/dummy.h (sys_inotify_init): Remove macro definition.
	* tests/inotify_init.c: New file.
	* tests/inotify_init-y.c: Likewise.
	* tests/inotify_init1-y.c: Likewise.
	* tests/inotify_init1.c [PRINT_PATHS]: Print inotify fd path.
	* tests/inotify_init-y.test: New test.
	* tests/.gitignore: Add inotify_init, inotify_init-y, inotify_init1-y.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (inotify_init, inotify_init1-y): New tests.
	* tests/Makefile.am (DECODER_TESTS): Add inotify_init-y.test.

2019-07-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_addr: decode IFA_RT_PRIORITY and IFA_TARGET_NETNSID.
	* rtnl_addr.c (ifaddrmsg_nla_decoders): Decode IFA_RT_PRIORITY as u32,
	decode IFA_TARGET_NETNSID as s32.

2019-07-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mips o32: print an error message when fetching of syscall arguments fails
	... instead of failing silently.

	* linux/mips/get_syscall_args.c (get_syscall_args): Print an error message
	when umoven fails.

2019-07-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	linux/smc_diag.h: update struct smc_diag_req definition.
	In accordance with Linux commit v4.19-rc8~22^2~17^2.

	* linux/smc_diag.h (struct smc_diag_req): Use an anonymous union
	for diag_fallback/diag_mode fields.

2019-07-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	kvm: avoid bogus vcpu_info assignment in vcpu_register.
	Also reformat code a bit to make nesting a bit clearer.

	Reported by Clang.

	* kvm.c (vcpu_register): Do not assign vcpu_alloc result to vcpu_info
	as this value is not used afterwards in the function.

2019-07-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sync_file_range2: remove unneeded argn assignment.
	clang complains about it:

	         argn = printllval(tcp, "%lld", argn);
	         ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	    sync_file_range2.c:43:2: note: Value stored to 'argn' is never read

	* sync_file_range2.c (SYS_FUNC(sync_file_range2)): Do not assign
	printllval result to argn for the second time.

2019-07-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall.c: avoid infinite loop in subcalls parsing.
	clang complains about it, so it might be a good reason to refactor it
	into something more linear.

	* syscall.c (syscall_entering_decode): Put syscall subcall decoding
	before ipc/socket subcall decoding, remove the loop.

2019-07-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of mode argument of mbind and set_mempolicy syscalls
	* tests/mbind.c: Include "scno.h".
	(errstr): New variable.
	(k_mbind): New function.
	(out_str): New macro.
	(mpol_modes): New array.
	(main): Use it and k_mbind.
	* tests/set_mempolicy.c: Include "scno.h", do not include <errno.h>,
	"xlat.h" and "xlat/mpol_modes.h".
	(errstr): New variable.
	(k_set_mempolicy): New function.
	(out_str): New macro.
	(mpol_modes): New array.
	(print_nodes): Use it and k_set_mempolicy.
	(main): Likewise.
	* tests/mbind-Xabbrev.c: New file.
	* tests/mbind-Xraw.c: Likewise.
	* tests/mbind-Xverbose.c: Likewise.
	* tests/set_mempolicy-Xabbrev.c: Likewise.
	* tests/set_mempolicy-Xraw.c: Likewise.
	* tests/set_mempolicy-Xverbose.c: Likewise.
	* tests/gen_tests.in (mbind-Xabbrev, mbind-Xraw, mbind-Xverbose,
	set_mempolicy-Xabbrev, set_mempolicy-Xraw, set_mempolicy-Xverbose):
	New entries.
	* tests/pure_executables.list: Add mbind-Xabbrev, mbind-Xraw,
	mbind-Xverbose, set_mempolicy-Xabbrev, set_mempolicy-Xraw,
	and set_mempolicy-Xverbose.
	* tests/.gitignore: Likewise.

2019-07-05  Dmitry V. Levin  <ldv@altlinux.org>

	numa: enhance decoding of mode argument of mbind and set_mempolicy syscalls
	Implement decoding of memory policy mode flags introduced by Linux
	kernel commits v2.6.26-rc1~990 and v2.6.26-rc1~988.

	* xlat/mpol_mode_flags.in: New file.
	* numa.c: Include "xlat/mpol_mode_flags.h".
	(print_mode): Print MPOL_MODE_FLAGS part of mode argument as flags.
	* NEWS: Mention this.

2019-07-05  Dmitry V. Levin  <ldv@altlinux.org>

	numa: factor out printing of mode argument of mbind and set_mempolicy syscalls
	This printing is going to be extended by subsequent changes.

	* numa.c (print_mode): New function.
	(SYS_FUNC(mbind), SYS_FUNC(set_mempolicy)): Use it.

2019-07-04  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v5.2.
	* linux/32/ioctls_inc_align16.h: Update from linux v5.2-rc7
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/aarch64/ioctls_arch0.h: Likewise.
	* linux/arm/ioctls_arch0.h: Likewise.
	* linux/mips/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

2019-07-04  Dmitry V. Levin  <ldv@altlinux.org>

	sparc, sparc64: refactor arch_set_error and arch_set_success.
	* linux/sparc/set_error.c (sparc_set_o0_psr): New function.
	(arch_set_error, arch_set_success): Use it.
	* linux/sparc64/set_error.c (sparc64_set_o0_tstate): New function.
	(arch_set_error, arch_set_success): Use it.

2019-07-04  Dmitry V. Levin  <ldv@altlinux.org>

	sparc, sparc64: fix syscall tampering when PTRACE_GET_SYSCALL_INFO is in use
	When PTRACE_GET_SYSCALL_INFO is in use on sparc, psr is not loaded,
	so it has to be loaded explicitly before tampering.
	Likewise, when PTRACE_GET_SYSCALL_INFO is in use on sparc64, tstate
	is not loaded, so it has to be loaded explicitly before tampering.

	* linux/sparc/set_error.c (arch_set_error, arch_set_success): Explicitly
	call get_regs before changing psr when PTRACE_GET_SYSCALL_INFO is in use.
	* linux/sparc64/set_error.c (arch_set_error, arch_set_success):
	Explicitly call get_regs before changing tstate when
	PTRACE_GET_SYSCALL_INFO is in use.
	* NEWS: Mention this fix.

2019-07-04  Dmitry V. Levin  <ldv@altlinux.org>

	powerpc: skip poking CCR if it is unchanged.
	* linux/powerpc/set_error.c (arch_set_r3_ccr): New function.
	(arch_set_error, arch_set_success): Use it.

2019-07-04  Dmitry V. Levin  <ldv@altlinux.org>

	powerpc: fix syscall tampering when PTRACE_GET_SYSCALL_INFO is in use.
	When PTRACE_GET_SYSCALL_INFO is in use, CCR is not loaded, so it has
	to be loaded explicitly before tampering.

	* linux/powerpc/set_error.c (arch_set_error, arch_set_success):
	Explicitly load CCR before changing it when PTRACE_GET_SYSCALL_INFO
	is in use.
	* NEWS: Mention this fix.

2019-07-03  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: rename mbindflags to mbind_flags.
	The former name was not consistent with others.

	* xlat/mbindflags.in: Rename to xlat/mbind_flags.in; all users updated.

2019-07-03  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update MPOL_F_* get_mempolicy flags.
	* xlat/get_mempolicy_flags.in (MPOL_F_MEMS_ALLOWED): New constant
	introduced by Linux kernel v2.6.24-rc1~1212.
	* NEWS: Mention this.
	* tests/get_mempolicy.c (main): Update expected output.

2019-07-03  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: rename mempolicyflags to get_mempolicy_flags.
	The former name was ambiguous.

	* xlat/mempolicyflags.in: Rename to xlat/get_mempolicy_flags.in;
	all users updated.

2019-07-03  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: rename policies to mpol_modes.
	The former name was too vague.

	* xlat/policies.in: Rename to xlat/mpol_modes.in; all users updated.

2019-07-03  Michal Sekletar  <msekleta@redhat.com>

	xlat: add MPOL_LOCAL constant.
	* xlat/policies.in (MPOL_LOCAL): New constant introduced by Linux kernel
	commit v3.8-rc1~92^2~33.

	Resolves: https://github.com/strace/strace/pull/102

2019-07-03  Zhibin Li  <haoyouab@gmail.com>

	ioctl: remove redundant _IOC_NR.
	* ioctl.c (evdev_decode_number): Replace _IOC_NR(nr) with nr
	as the latter is defined to _IOC_NR(code).

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-07-02  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: add support for new fields in BPF_PROG_TEST_RUN.
	* bpf_attr.h (struct BPF_PROG_TEST_RUN_struct): Add ctx_size_in,
	ctx_size_out, ctx_in, and ctx_out fields.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_TEST_RUN)): Decode these fields
	introduced by Linux kernel commit v5.2-rc1~133^2~193^2~6.
	* tests/bpf.c (BPF_PROG_TEST_RUN_checks): Check it.

2019-07-02  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: implement decoding of BPF_MAP_FREEZE command.
	BPF_MAP_FREEZE command was introduced by Linux commit
	v5.2-rc1~133^2~193^2~12^2~12.

	* bpf_attr.h (struct BPF_MAP_FREEZE_struct): New type.
	(BPF_MAP_FREEZE_struct_size, expected_BPF_MAP_FREEZE_struct_size): New
	macros.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_FREEZE)): New bpf command
	decoder.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Add BPF_CMD_ENTRY(BPF_MAP_FREEZE).
	* NEWS: Mention this.
	* tests/bpf.c (union bpf_attr_data): Add
	BPF_ATTR_DATA_FIELD(BPF_MAP_FREEZE).
	(BPF_MAP_FREEZE_checks): New checks array.
	(main) <checks>: Add CHK(BPF_MAP_FREEZE).

2019-07-01  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update BPF_* constants.
	* xlat/bpf_attach_type.in (BPF_CGROUP_SYSCTL): New constant introduced
	by Linux kernel commit v5.2-rc1~133^2~132^2~39^2~19.
	(BPF_CGROUP_UDP4_RECVMSG, BPF_CGROUP_UDP6_RECVMSG): New constants
	introduced by Linux kernel commit v5.2-rc6~33^2~44^2^2~5.
	* xlat/bpf_commands.in (BPF_MAP_FREEZE): New constant introduced
	by Linux kernel commit v5.2-rc1~133^2~193^2~12^2~12.
	* xlat/bpf_map_flags.in (BPF_F_RDONLY_PROG, BPF_F_WRONLY_PROG): New
	constants introduced by Linux kernel commit
	v5.2-rc1~133^2~193^2~12^2~13.
	* xlat/bpf_map_types.in (BPF_MAP_TYPE_SK_STORAGE): New constant
	introduced by Linux kernel commit v5.2-rc1~133^2~80^2^2~6.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_SYSCTL): New constant
	introduced by Linux kernel commit v5.2-rc1~133^2~132^2~39^2~19.
	(BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE): New constant introduced
	by Linux kernel commit v5.2-rc1~133^2~80^2~1^2~4.
	* NEWS: Mention this.
	* tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks,
	BPF_PROG_QUERY_checks): Update.
	* tests/kernel_version.c (print_bpf_attr): Update.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of fspick syscall.
	... introduced by Linux kernel commits v5.2-rc1~141^2~1,
	v5.2-rc1~20^2~1, and v5.2-rc1~20^2.

	* fspick.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* pathtrace.c (pathtrace_match_set): Add SEN_fspick.
	* xlat/fspick_flags.in: New file.
	* linux/syscallent-common.h [BASE_NR + 433]: Wire up fspick.
	* NEWS: Mention this change.
	* tests/fspick.c: New file.
	* tests/fspick-P.c: Likewise.
	* tests/gen_tests.in (fspick, fspick-P): New entries.
	* tests/pure_executables.list: Add fspick and fspick-P.
	* tests/.gitignore: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of fsmount syscall.
	... introduced by Linux kernel commits v5.2-rc1~141^2~2,
	v5.2-rc1~20^2~1, and v5.2-rc1~20^2.

	* fsmount.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* pathtrace.c (pathtrace_match_set): Add SEN_fsmount.
	* xlat/fsmount_cmds.in: New file.
	* xlat/mount_attr_atime.in: Likewise.
	* xlat/mount_attr_flags.in: Likewise.
	* linux/syscallent-common.h [BASE_NR + 432]: Wire up fsmount.
	* NEWS: Mention this change.
	* tests/fsmount.c: New file.
	* tests/gen_tests.in (fsmount): New entry.
	* tests/pure_executables.list: Add fsmount.
	* tests/.gitignore: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of fsconfig syscall.
	... introduced by Linux kernel commits v5.2-rc1~141^2~3,
	v5.2-rc1~20^2~1, and v5.2-rc1~20^2.

	* fsconfig.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* pathtrace.c (pathtrace_match_set): Add SEN_fsconfig.
	* xlat/fsconfig_cmds.in: New file.
	* linux/syscallent-common.h [BASE_NR + 431]: Wire up fsconfig.
	* NEWS: Mention this change.
	* tests/fsconfig.c: New file.
	* tests/fsconfig-P.c: Likewise.
	* tests/gen_tests.in (fsconfig, fsconfig-P): New entries.
	* tests/pure_executables.list: Add fsconfig and fsconfig-P.
	* tests/.gitignore: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

	print_dirfd: do not print trailing comma.
	It was fine to print trailing comma in print_dirfd until introduction
	of a syscall with the last argument being a dirfd.
	Now it's time to change print_dirfd.

	* open.c (print_dirfd): Do not print comma.
	(SYS_FUNC(open)): Print comma after print_dirfd() invocation.
	* access.c (SYS_FUNC(faccessat)): Likewise.
	* chmod.c (SYS_FUNC(fchmodat)): Likewise.
	* execve.c (SYS_FUNC(execveat)): Likewise.
	* fanotify.c (SYS_FUNC(fanotify_mark)): Likewise.
	* fchownat.c (SYS_FUNC(fchownat)): Likewise.
	* file_handle.c (SYS_FUNC(name_to_handle_at)): Likewise.
	* link.c (SYS_FUNC(linkat), SYS_FUNC(unlinkat), SYS_FUNC(symlinkat)):
	Likewise.
	* mknod.c (SYS_FUNC(mknodat)): Likewise.
	* move_mount.c (SYS_FUNC(move_mount)): Likewise.
	* open_tree.c (SYS_FUNC(open_tree)): Likewise.
	* readlink.c (SYS_FUNC(readlinkat)): Likewise.
	* renameat.c (decode_renameat): Likewise.
	* stat.c (SYS_FUNC(newfstatat)): Likewise.
	* stat64.c (SYS_FUNC(fstatat64)): Likewise.
	* statx.c (SYS_FUNC(statx)): Likewise.
	* utimes.c (SYS_FUNC(futimesat), do_utimensat): Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of fsopen syscall.
	... introduced by Linux kernel commits v5.2-rc1~141^2~5,
	v5.2-rc1~20^2~1, and v5.2-rc1~20^2.

	* fsopen.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* pathtrace.c (pathtrace_match_set): Add SEN_fsopen.
	* xlat/fsopen_flags.in: New file.
	* linux/syscallent-common.h [BASE_NR + 430]: Wire up fsopen.
	* NEWS: Mention this change.
	* tests/fsopen.c: New file.
	* tests/gen_tests.in (fsopen): New entry.
	* tests/pure_executables.list: Add fsopen.
	* tests/.gitignore: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of move_mount syscall.
	... introduced by Linux kernel commits v5.2-rc1~141^2~8,
	v5.2-rc1~20^2~1, and v5.2-rc1~20^2.

	* move_mount.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* pathtrace.c (pathtrace_match_set): Add SEN_move_mount.
	* xlat/move_mount_flags.in: New file.
	* linux/syscallent-common.h [BASE_NR + 429]: Wire up move_mount.
	* NEWS: Mention this change.
	* tests/move_mount.c: New file.
	* tests/move_mount-P.c: Likewise.
	* tests/gen_tests.in (move_mount, move_mount-P): New entries.
	* tests/pure_executables.list: Add move_mount and move_mount-P.
	* tests/.gitignore: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of open_tree syscall.
	... introduced by Linux kernel commits v5.2-rc1~141^2~9,
	v5.2-rc1~20^2~1, and v5.2-rc1~20^2.

	* configure.ac (AC_CHECK_HEADERS): Add linux/mount.h.
	* open_tree.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* pathtrace.c (pathtrace_match_set): Add SEN_open_tree.
	* xlat/open_tree_flags.in: New file.
	* linux/syscallent-common.h [BASE_NR + 428]: Wire up open_tree.
	* NEWS: Mention this change.
	* tests/open_tree.c: New file.
	* tests/open_tree-P.c: Likewise.
	* tests/gen_tests.in (open_tree, open_tree-P): New entries.
	* tests/pure_executables.list: Add open_tree and open_tree-P.
	* tests/.gitignore: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce linux/syscallent-common.h and linux/syscallent-common-32.h.
	These files are going to be used to define syscall entries for common
	syscalls added in Linux kernel 5.1+.

	* linux/syscallent-common.h: New file.
	* linux/syscallent-common-32.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	(syscallent_names): Add syscallent-common.h and syscallent-common-32.h.
	* linux/mips/.gitignore: Add syscallent-common-32-stub.h
	and syscallent-common-stub.h.
	* linux/mips/genstub.sh: Parametrize source directory.  Change syscall
	name prefix to SYSCALL_NAME_PREFIX.
	* configure.ac [MIPS]: Generate stubs for linux/syscallent-common.h
	and linux/syscallent-common-32.h files.
	* linux/mips/syscallent-n32.h [LINUX_MIPSN32]
	[BASE_NR + 403..BASE_NR + 427]: Remove, include "syscallent-common-32.h"
	and "syscallent-common.h" instead.
	[!LINUX_MIPSN32] (SYSCALL_NAME_PREFIX): Define.
	[!LINUX_MIPSN32]: Include "syscallent-common-32-sub.h"
	and "syscallent-common-stub.h".
	* linux/mips/syscallent-o32.h [LINUX_MIPSO32]
	[BASE_NR + 403..BASE_NR + 427]: Remove, include "syscallent-common-32.h"
	and "syscallent-common.h" instead.
	[!LINUX_MIPSO32] (SYSCALL_NAME_PREFIX): Define.
	[!LINUX_MIPSO32]: Include "syscallent-common-32-sub.h"
	* linux/32/syscallent.h [403..427]: Remove, include
	"syscallent-common-32.h" and "syscallent-common.h" instead.
	* linux/arm/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* linux/alpha/syscallent.h (BASE_NR): Define.
	[534..537]: Remove, include "syscallent-common.h" instead.
	* linux/ia64/syscallent.h [BASE_NR + 424..BASE_NR + 427]: Remove,
	include "syscallent-common.h" instead.
	* linux/mips/syscallent-n64.h [LINUX_MIPSN64]: Likewise.
	[!LINUX_MIPSN64] (SYSCALL_NAME_PREFIX): Define.
	[!LINUX_MIPSN64]: Include "syscallent-common-stub.h".
	* linux/64/syscallent.h [424..427]: Remove, include
	"syscallent-common.h" instead.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: introduce BASE_NR to syscallent initializers.
	* linux/ia64/syscallent.h (BASE_NR): New macro.  Use it instead of 1024.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

	mips: refactor syscallent initializers.
	Change format of designated initializers to BASE_NR + offset.

	* linux/mips/syscallent-n32.h (BASE_NR): New macro.  Use it in designated
	initializers.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.

2019-06-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update AT_* constants.
	* xlat/at_flags.in (AT_RECURSIVE): New constant introduced
	by Linux kernel commit v5.2-rc1~141^2~9.
	* NEWS: Mention this.
	* tests/linkat.c: Update expected output.
	* tests/unlinkat.c: Update expected output.
	* tests/utimensat.c: Update expected output.
	* tests/xstatx.c: Update expected output.

2019-06-28  Paul Chaignon  <paul.chaignon@gmail.com>

	travis: Move fastest test configuration first.
	I use Travis CI to check each patch before sending my patchsets.  Most
	failures are simple and make all test configurations fail.  However, since
	Travis CI runs test configurations in order and given that the first three
	configurations are the slowest ones, it takes about twenty minutes to see
	the failure.  Moving the fastest test configuration first would allow to
	fail earlier.  It would become about 3x faster to fail in case of simple
	mistakes.

	* .travis.yml (CC=gcc, STACKTRACE=no): Move to first position.

2019-06-22  Dmitry V. Levin  <ldv@altlinux.org>

	get_os_release: tolerate malformed kernel release strings.
	* strace.c (get_os_release): Handle malformed kernel release strings
	gracefully.

	Resolves: https://github.com/strace/strace/issues/101

2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of CLONE_PIDFD flag of clone syscall.
	* clone.c (SYS_FUNC(clone)): Print pidfd returned by the kernel
	when CLONE_PIDFD flag is set.
	* tests/clone-flags.c (main): Check it.

2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce printnum_fd.
	This is going to be used to implement decoding of CLONE_PIDFD flag
	of clone syscall.

	* defs.h (printnum_fd): New prototype.
	* util.c (printnum_fd): New function.

2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance decoding of CLONE_PARENT_SETTID flag of clone syscall.
	* clone.c (SYS_FUNC(clone)): Print the parent_tid returned by the kernel
	instead of its address when CLONE_PARENT_SETTID flag is set.
	* tests/clone-flags.c (main): Check it.

	clone: fix printing of zero clone flags.
	* clone.c (SYS_FUNC(clone)): Fix printing of zero clone flags.
	* tests/clone-flags.c (main): Check it.

	clone: print read-only arguments on entering syscall.
	* clone.c (SYS_FUNC(clone)): Print child_stack, stack_size, and flags
	arguments on entering syscall.
	* NEWS: Mention this change.

	tests: check decoding of clone flags.
	* tests/clone-flags.c: New file.
	* tests/pure_executables.list: Add clone-flags.
	* tests/.gitignore: Likewise.
	* tests/clone-flags.test: New test.
	* tests/Makefile.am (DECODER_TESTS): Add clone-flags.test.

2019-06-18  Dmitry V. Levin  <ldv@altlinux.org>

	clone: cleanup.
	* clone.c (print_tls_arg): Use addr argument.

2019-06-18  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update CLONE_* constants.
	* xlat/clone_flags.in (CLONE_IDLETASK): Remove unused flag conflicting
	with CLONE_PIDFD.

	Fixes: v5.1-8-gb43f44bca "xlat: update CLONE_* constants"

2019-06-14  Paul Chaignon  <paul.chaignon@gmail.com>

	Use debug_msg macro where possible.
	* linux/alpha/get_scno.c (arch_get_scno): Use debug_msg instead of
	open-coding it.
	* linux/mips/get_scno.c: Likewise.
	* linux/sh/get_scno.c: Likewise.

2019-05-27  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update ETH_* constants.
	* xlat/ethernet_protocols.in (ETH_P_DSA_8021Q): New constant introduced
	by Linux kernel commit v5.2-rc1~133^2~58^2~7.
	* NEWS: Mention this.

	xlat: update KBD_* constants.
	* xlat/evdev_keycode.in (KEY_KBD_LAYOUT_NEXT): New constant
	introduced by Linux kernel commit v5.2-rc1~79^2^2~7.
	* NEWS: Mention this.

	xlat: update TIPC_* constants.
	* xlat/sock_tipc_options.in (TIPC_SOCK_RECVQ_USED): New constant
	introduced by Linux kernel commit v5.2-rc1~133^2~143.
	* NEWS: Mention this.

	xlat: update KVM_CAP_* constants.
	* xlat/clone_flags.in (KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2): New
	constant introduced by Linux kernel commit v5.2-rc1~17^2~11.
	(KVM_CAP_PPC_IRQ_XIVE): New constant introduced by Linux kernel commits
	v5.2-rc1~17^2~2^2~19 and v5.2-rc1~17^2~2.
	(KVM_CAP_ARM_SVE): New constant introduced by Linux kernel commit
	v5.2-rc1~17^2~1^2~31.
	(KVM_CAP_ARM_PTRAUTH_ADDRESS, KVM_CAP_ARM_PTRAUTH_GENERIC): New
	constants introduced by Linux kernel commits v5.2-rc1~17^2~1^2~10
	and v5.2-rc1~17^2~1.
	* NEWS: Mention this.

	xlat: update CLONE_* constants.
	* xlat/clone_flags.in (CLONE_PIDFD): New constant introduced by Linux
	kernel commit v5.2-rc1~158^2~2.
	* NEWS: Mention this.

2019-05-26  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update V4L2_PIX_* constants.
	* xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_FWHT_STATELESS): New constant
	introduced by Linux kernel commit v5.2-rc1~33^2~132.
	(V4L2_PIX_FMT_BGRA32, V4L2_PIX_FMT_BGRX32, V4L2_PIX_FMT_RGBA32,
	V4L2_PIX_FMT_RGBX32): New constants introduced by Linux kernel commit
	v5.2-rc1~33^2~25.
	(V4L2_PIX_FMT_RGBA444, V4L2_PIX_FMT_RGBX444, V4L2_PIX_FMT_ABGR444,
	V4L2_PIX_FMT_XBGR444, V4L2_PIX_FMT_XBGR444, V4L2_PIX_FMT_BGRX444): New
	constants introduced by Linux kernel commit v5.2-rc1~33^2~24.
	(V4L2_PIX_FMT_RGBA555, V4L2_PIX_FMT_RGBX555, V4L2_PIX_FMT_ABGR555,
	V4L2_PIX_FMT_XBGR555, V4L2_PIX_FMT_BGRA555, V4L2_PIX_FMT_BGRX555): New
	constants introduced by Linux kernel commit v5.2-rc1~33^2~23.

	xlat: fix v4l2_pix_fmts sorting order.
	* xlat/v4l2_pix_fmts.in: Fix sorting order.

	xlat: update V4L2_CID_* constants.
	* xlat/v4l2_control_ids.in (V4L2_CID_FWHT_I_FRAME_QP,
	V4L2_CID_FWHT_P_FRAME_QP): New constants introduced by Linux kernel
	commit v5.2-rc1~33^2~132.
	(V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MIN_QP,
	V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MAX_QP,
	V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MIN_QP,
	V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MAX_QP): New constants introduced by
	Linux kernel commit v5.2-rc1~33^2~95.
	* NEWS: Mention this.

2019-05-25  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update AUDIT_* constants.
	* xlat/nl_audit_types.in (AUDIT_FANOTIFY): New constant introduced by
	Linux kernel commit v4.15-rc1~130^2^2~11.
	(AUDIT_TIME_INJOFFSET): New constant introduced by Linux kernel commit
	v5.2-rc1~144^2~2.
	(AUDIT_TIME_ADJNTPVAL): New constant introduced by Linux kernel commit
	v5.2-rc1~144^2~1.

2019-05-24  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update AUDIT_ARCH_* constants.
	* xlat/audit_arch.in (AUDIT_ARCH_ARCOMPACT, AUDIT_ARCH_ARCOMPACTBE,
	AUDIT_ARCH_ARCV2, AUDIT_ARCH_ARCV2BE): New constants introduced by Linux
	kernel commit v5.2-rc1~144^2~16.
	(AUDIT_ARCH_C6X, AUDIT_ARCH_C6XBE): New constants introduced by Linux
	kernel commit v5.2-rc1~144^2~15.
	(AUDIT_ARCH_CSKY): New constant introduced by Linux kernel commit
	v5.0-rc1~37^2~15.
	(AUDIT_ARCH_H8300): New constant introduced by Linux kernel commit
	v5.2-rc1~144^2~14.
	(AUDIT_ARCH_HEXAGON): New constant introduced by Linux kernel commit
	v5.2-rc1~144^2~12.
	(AUDIT_ARCH_NDS32, AUDIT_ARCH_NDS32BE): New constants introduced by
	Linux kernel commit v5.2-rc1~144^2~9.
	(AUDIT_ARCH_NIOS2): New constant introduced by Linux kernel commit
	v5.2-rc1~144^2~8.
	(AUDIT_ARCH_RISCV32, AUDIT_ARCH_RISCV64): New constants introduced by
	Linux kernel commit v5.0-rc2~23^2~1^2~5.
	(AUDIT_ARCH_TILEGX, AUDIT_ARCH_TILEGX32, AUDIT_ARCH_TILEPRO): New
	constants introduced by Linux kernel commit v4.3-rc1~83^2~3.
	(AUDIT_ARCH_UNICORE): New constant introduced by Linux kernel commit
	v5.2-rc1~144^2~6.
	(AUDIT_ARCH_XTENSA): New constant introduced by Linux kernel commit
	v5.0-rc1~92^2~8.
	* NEWS: Mention this.

2019-05-23  Masatake YAMATO  <yamato@redhat.com>

	tests: print the reason of failure in ioctl_kvm_run tests.
	* tests/ioctl_kvm_run_common.c (run_kvm): Print
	hardware_entry_failure_reason field of kvm_run
	when KVM_RUN is failed with KVM_EXIT_FAIL_ENTRY.

2019-05-23  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 5.1-1.
	* strace.spec.in: Likewise.

2019-05-22  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 5.1 release.
	* NEWS: Update for 5.1 release.

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2019-05-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Use xzalloc(sz) instead of xcalloc(1, sz)
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)): Use xzalloc
	instead of xcalloc of one-item-sized array.
	* kvm.c (vcpu_alloc): Likewise.
	* perf.c (fetch_perf_event_attr): Likewise.
	* syscall.c (ptrace_get_scno): Likewise.

2019-05-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xmalloc: introduce xzalloc.
	* xmalloc.h (xmalloc, xcalloc, xreallocarray): Document.
	(xzalloc): New function, a thin wrapper around xcalloc with xmalloc
	interface.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-05-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Rename the stat struct used internally by strace to strace_stat_t.
	* largefile_wrappers.h (struct_stat): Rename to strace_stat_t.
	* strace.c (startup_child): Rename struct_stat to strace_stat_t.
	* util.c (printdev): Likewise.

	Move open_file to largefile_wrappers.h.
	* util.c (open_file): Move it ...
	* largefile_wrappers.h: ... here.

2019-05-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify bpf-obj_get_info_by_fd test against future kernels.
	* tests/bpf-obj_get_info_by_fd.c (print_prog_load, main): Change
	log_level from 42 to 7, to placate Linux kernels containing commit
	v5.2-rc1~133^2~193^2~18^2~9.

	bpf: add support for new fields in struct bpf_prog_info.
	* bpf_attr.h (struct bpf_prog_info_struct): Add run_time_ns and run_cnt
	fields.
	* bpf.c (print_bpf_prog_info): Decode run_time_ns and run_cnt fields
	introduced by Linux kernel commit v5.1-rc1~178^2~17^2~15^2~2.
	* NEWS: Mention it.
	* tests/bpf-obj_get_info_by_fd.c (main): Update expected output.

	xlat: update FAN_* constants.
	* xlat/fan_mark_flags.in (FAN_MARK_FILESYSTEM): New constant
	introduced by Linux kernel commit v4.20-rc1~75^2~10.
	* tests/fanotify_mark.c (main): Update expected output.

	xlat: update IPV6_* constants.
	* xlat/sock_ipv6_options.in (IPV6_MULTICAST_ALL): New constant
	introduced by Linux kernel commit v4.20-rc1~14^2~384.
	(IPV6_ROUTER_ALERT_ISOLATE): New constant introduced
	by Linux kernel commit v5.1-rc1~178^2~22.
	* NEWS: Mention this.

	xlat: update F_SEAL_* constants.
	* xlat/f_seals.in (F_SEAL_FUTURE_WRITE): New constant introduced
	by Linux kernel commit v5.1-rc1~152^2~49.
	* NEWS: Mention this.

2019-05-21  Dmitry V. Levin  <ldv@altlinux.org>

	btrfs: implement decoding of BTRFS_IOC_FORGET_DEV argument.
	... introduced by Linux kernel commit v5.1-rc1~47^2~47.

	* btrfs.c (btrfs_ioctl) [BTRFS_IOC_FORGET_DEV]: Handle
	BTRFS_IOC_FORGET_DEV.
	* tests/btrfs.c (btrfs_test_device_ioctls) [BTRFS_IOC_FORGET_DEV]:
	Check it.

2019-05-21  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v5.1.
	* linux/32/ioctls_inc_align16.h: Update from linux v5.1
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* NEWS: Mention this.
	* tests/ioctl_random.c (main): Update expected output.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-05-20  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update FAN_* constants.
	* xlat/fan_init_flags.in (FAN_REPORT_FID): New constant introduced
	by Linux kernel commit v5.1-rc1~139^2~18.
	* xlat/fan_event_flags.in (FAN_ATTRIB, FAN_MOVED_FROM, FAN_MOVED_TO,
	FAN_CREATE, FAN_DELETE, FAN_DELETE_SELF, FAN_MOVE_SELF): New constants
	introduced by Linux kernel commit v5.1-rc1~139^2~9.
	* NEWS: Mention this.
	* tests/fanotify_init.c (main): Update expected output.
	* tests/fanotify_mark.c (main): Likewise.

	xlat: update PR_SPEC_* constants.
	* xlat/pr_spec_get_store_bypass_flags.in (PR_SPEC_DISABLE_NOEXEC):
	New constant introduced by Linux kernel commit v5.1-rc1~168^2.
	* xlat/pr_spec_set_store_bypass_flags.in: Likewise.
	* NEWS: Mention this.
	* tests/prctl-spec-inject.c (get_strs, set_strs): Update.

	xlat: update BPF_* constants.
	* xlat/ebpf_class.in (BPF_JMP32): New constant introduced
	by Linux kernel commit v5.1-rc1~178^2~404^2~4^2~15.
	* xlat/bpf_map_update_elem_flags.in (BPF_F_LOCK): New constant
	introduced by Linux kernel commit v5.1-rc1~178^2~375^2~4^2~3.
	* NEWS: Mention this.

	xlat: update V4L2_* constants.
	* xlat/v4l2_control_ids.in
	(V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION): New constant
	introduced by Linux kernel commit v5.1-rc1~88^2~261.
	(V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET): New constant
	introduced by Linux kernel commit v5.1-rc1~88^2~260.
	* xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_AYUV32, V4L2_PIX_FMT_XYUV32,
	V4L2_PIX_FMT_VUYA32, V4L2_PIX_FMT_VUYX32): New constants
	introduced by Linux kernel commit v5.1-rc1~88^2~90.
	* NEWS: Mention this.

	xlat: update NT_* constants.
	* xlat/nt_descriptor_types.in (NT_ARM_PACA_KEYS, NT_ARM_PACG_KEYS): New
	constants introduced by Linux kernel commit v5.1-rc1~82^2~44.
	* NEWS: Mention this.

2019-05-19  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of io_uring_* syscalls.
	... introduced by Linux kernel commits v5.1-rc1~99^2~14,
	v5.1-rc1~99^2~7, and v5.1-rc7~24^2.

	* configure.ac (AC_CHECK_HEADERS): Add linux/io_uring.h.
	* io_uring.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* pathtrace.c (pathtrace_match_set): Add SEN_io_uring_enter,
	SEN_io_uring_register, and SEN_io_uring_setup.
	* xlat/uring_enter_flags.in: New file.
	* xlat/uring_register_opcodes.in: Likewise.
	* linux/32/syscallent.h [425, 426, 427]: Wire up io_uring_setup,
	io_uring_enter, and io_uring_register.
	* linux/64/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* linux/alpha/syscallent.h [535, 536, 537]: Likewise.
	* linux/ia64/syscallent.h [1024 + 425, 1024 + 426, 1024 + 427]: Likewise.
	* linux/mips/syscallent-n32.h [6425, 6426, 6427]: Likewise.
	* linux/mips/syscallent-n64.h [5425, 5426, 5427]: Likewise.
	* linux/mips/syscallent-o32.h [4425, 4426, 4427]: Likewise.
	* NEWS: Mention this change.
	* tests/io_uring_enter.c: New file.
	* tests/io_uring_register.c: Likewise.
	* tests/io_uring_setup.c: Likewise.
	* tests/gen_tests.in (io_uring_enter, io_uring_register,
	io_uring_setup): New entries.
	* tests/pure_executables.list: Add io_uring_enter, io_uring_register,
	and io_uring_setup.
	* tests/.gitignore: Likewise.

2019-05-18  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of pidfd_send_signal syscall.
	... introduced by Linux kernel commit v5.1-rc1~6^2~1.

	* signal.c (SYS_FUNC(pidfd_send_signal)): New function.
	* linux/32/syscallent.h [424]: Wire up pidfd_send_signal.
	* linux/64/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* linux/alpha/syscallent.h [534]: Likewise.
	* linux/ia64/syscallent.h [1024 + 424]: Likewise.
	* linux/mips/syscallent-n32.h [6424]: Likewise.
	* linux/mips/syscallent-n64.h [5424]: Likewise.
	* linux/mips/syscallent-o32.h [4424]: Likewise.
	* NEWS: Mention this change.
	* tests/pidfd_send_signal.c: New file.
	* tests/gen_tests.in (pidfd_send_signal): New entry.
	* tests/pure_executables.list: Add pidfd_send_signal.
	* tests/.gitignore: Likewise.

2019-05-17  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of SO_TIMESTAMP*_NEW control messages.
	* configure.ac (AC_CHECK_TYPES): Check for struct __kernel_timespec
	and struct __kernel_sock_timeval.
	* tests/msg_control.c [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL ||
	HAVE_STRUCT___KERNEL_TIMESPEC]: Include <linux/time_types.h>.
	(test_scm_timestamp): Rename to test_scm_timestamp_old.
	(test_scm_timestampns): Rename to test_scm_timestampns_old.
	(test_scm_timestamping): Rename to test_scm_timestamping_old.
	[HAVE_STRUCT___KERNEL_SOCK_TIMEVAL] (test_scm_timestamp_new): New
	function.
	[HAVE_STRUCT___KERNEL_TIMESPEC] (test_scm_timestampns_new,
	test_scm_timestamping_new): New functions.
	(test_sol_socket): Use them.
	* tests/sockopt-timestamp.c [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL ||
	HAVE_STRUCT___KERNEL_TIMESPEC]: Include <linux/time_types.h>.
	Include "xlat/sock_options.h" in XLAT_MACROS_ONLY mode.
	(print_timestampns_old): Define unconditionally.
	[HAVE_STRUCT___KERNEL_SOCK_TIMEVAL] (print_timestamp_new): New function.
	[HAVE_STRUCT___KERNEL_TIMESPEC] (print_timestampns_new): Likewise.
	(main): Test SO_TIMESTAMPNS_OLD unconditionally.
	[HAVE_STRUCT___KERNEL_SOCK_TIMEVAL]: Test SO_TIMESTAMP_NEW.
	[HAVE_STRUCT___KERNEL_TIMESPEC]: Test SO_TIMESTAMPNS_NEW.

	Implement decoding of SO_TIMESTAMP*_NEW control messages.
	* print_timeval64.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (print_timeval64_data_size): New prototype.
	* msghdr.c (print_scm_timestamp_new, print_scm_timestampns_new,
	print_scm_timestamping_new): New functions.
	(cmsg_socket_printers): Add SO_TIMESTAMP_NEW, SO_TIMESTAMPNS_NEW,
	and SO_TIMESTAMPING_NEW.
	* NEWS: Mention this change.

2019-05-17  Dmitry V. Levin  <ldv@altlinux.org>

	print_timespec.h: parametrize TIMESPEC_T.tv_nsec.
	This is going to be used to implement a parser of SO_TIMESTAMP_NEW
	control message.

	* print_timespec.h [!TIMESPEC_NSEC] (TIMESPEC_NSEC): Define to tv_sec.
	(TIMESPEC_TO_SEC_NSEC, timespec_fmt, print_timespec_t_utime): Use
	TIMESPEC_NSEC instead of tv_sec.

2019-05-17  Dmitry V. Levin  <ldv@altlinux.org>

	print_timespec.h: conditionalize printers.
	This allows to implement a parser of SO_TIMESTAMP_NEW control message
	without implementing extra unused printers.

	* print_timespec.h (PRINT_TIMESPEC_DATA_SIZE,
	PRINT_TIMESPEC_ARRAY_DATA_SIZE, PRINT_TIMESPEC, SPRINT_TIMESPEC,
	PRINT_TIMESPEC_UTIME_PAIR, PRINT_ITIMERSPEC): Conditionalize.

2019-05-17  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: add SO_TIMESTAMP*_NEW constants.
	* xlat/sock_options.in (SO_TIMESTAMP_NEW, SO_TIMESTAMPNS_NEW,
	SO_TIMESTAMPING_NEW): New constants introduced by Linux commits
	v5.1-rc1~178^2~363^2~4 and v5.1-rc1~178^2~363^2~3.
	* xlat/scmvals.in: Likewise.

2019-05-16  Dmitry V. Levin  <ldv@altlinux.org>

	Use kernel_timeval64_t in definition of kernel_timex64_t.
	* kernel_timex.h: Include "kernel_timeval.h".
	(kernel_timex64_t): Change the type of "time" field from a locally
	defined structure to its equivalent kernel_timeval64_t.

2019-05-16  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce kernel_timeval64_t type.
	This type is going to be used to implement parsers of SO_TIMESTAMP*_NEW
	control messages.

	* kernel_timeval.h: New file.
	* Makefile.am (strace_SOURCES): Add it.

2019-05-15  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: add _OLD suffixes to SO_RCVTIMEO and SO_SNDTIMEO.
	Follow the Linux kernel commit v5.1-rc1~178^2~363^2~1 and rename
	these constants.

	* xlat/sock_options.in (SO_RCVTIMEO): Rename to SO_RCVTIMEO_OLD.
	(SO_SNDTIMEO): Rename to SO_SNDTIMEO_OLD.

2019-05-15  Dmitry V. Levin  <ldv@altlinux.org>

	Rename SO_TIMESTAMP* to SO_TIMESTAMP*_OLD.
	Follow the Linux kernel commit v5.1-rc1~178^2~363^2~8 and rename
	these constants everywhere.

	* xlat/scmvals.in (SO_TIMESTAMP): Rename to SO_TIMESTAMP_OLD.
	(SO_TIMESTAMPNS): Rename to SO_TIMESTAMPNS_OLD.
	(SO_TIMESTAMPING): Rename to SO_TIMESTAMPING_OLD.
	* xlat/sock_options.in: Likewise.
	* xlat/sock_rds_options.in: Likewise.
	* msghdr.c (cmsg_socket_printers): Likewise.
	(print_scm_timestamp): Rename to print_scm_timestamp_old.
	(print_scm_timestampns): Rename to print_scm_timestampns_old.
	(print_scm_timestamping): Rename to print_scm_timestamping_old.
	* tests/msg_control.c (test_scm_timestamp): Rename SO_TIMESTAMP
	to SO_TIMESTAMP_OLD.
	(test_scm_timestampns): Rename SO_TIMESTAMPNS to SO_TIMESTAMPNS_OLD.
	(test_scm_timestamping): Rename SO_TIMESTAMPING to SO_TIMESTAMPING_OLD.
	* tests/sockopt-timestamp.c (main): Rename SO_TIMESTAMP and
	SO_TIMESTAMPNS to SO_TIMESTAMP_OLD and SO_TIMESTAMPNS_OLD, respectively.

2019-05-15  Dmitry V. Levin  <ldv@altlinux.org>

	Replace SCM_TIMESTAMP* constants with SO_TIMESTAMP*
	Besides the fact that SO_TIMESTAMP* constants appear to be more
	standardized than SCM_TIMESTAMP*, new SO_TIMESTAMP*_OLD and
	SO_TIMESTAMP*_NEW constants introduced in Linux 5.1 have no
	SCM_TIMESTAMP*_OLD and SCM_TIMESTAMP*_NEW analogues.

	* xlat/scmvals.in: Replace SCM_WIFI_STATUS, SCM_TXTIME, SCM_TIMESTAMP,
	SCM_TIMESTAMPNS, and SCM_TIMESTAMPING with SO_WIFI_STATUS, SO_TXTIME,
	SO_TIMESTAMP, SO_TIMESTAMPNS, and SO_TIMESTAMPING, respectively.
	* msghdr.c: Include "xlat/sock_options.h" in XLAT_MACROS_ONLY mode.
	(cmsg_socket_printers): Replace SCM_TIMESTAMP, SCM_TIMESTAMPNS, and
	SCM_TIMESTAMPING with SO_TIMESTAMP, SO_TIMESTAMPNS, and SO_TIMESTAMPING,
	respectively.
	* tests/msg_control.c: Include "xlat/sock_options.h" in XLAT_MACROS_ONLY
	mode.
	(test_scm_timestamp): Replace SCM_TIMESTAMP with SO_TIMESTAMP.
	(test_scm_timestampns): Replace SCM_TIMESTAMPNS with SO_TIMESTAMPNS.
	(test_scm_timestamping): Replace SCM_TIMESTAMPING with SO_TIMESTAMPING.
	* tests/sockopt-timestamp.c (main): Replace SCM_TIMESTAMP and
	SCM_TIMESTAMPNS with SO_TIMESTAMP and SO_TIMESTAMPNS, respectively.

2019-05-15  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add another test of SO_TIMESTAMP and SO_TIMESTAMPNS decoding.
	Unlike msg_control test, this new test makes the kernel generate
	SO_TIMESTAMP and SO_TIMESTAMPNS messages.

	* tests/sockopt-timestamp.c: New file.
	* tests/gen_tests.in (sockopt-timestamp): New entry.
	* tests/pure_executables.list: Add sockopt-timestamp.
	* tests/.gitignore: Likewise.

2019-05-12  Dmitry V. Levin  <ldv@altlinux.org>

	print_timespec.c: remove unused printers.
	* print_timespec.c (PRINT_TIMESPEC, SPRINT_TIMESPEC,
	PRINT_TIMESPEC_UTIME_PAIR, PRINT_ITIMERSPEC): Remove.
	(print_timespec, sprint_timespec, print_timespec_utime_pair,
	print_itimerspec): Remove.

	Implement and use new parsers of utimensat syscall.
	* utimes.c (SYS_FUNC(utimensat)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(utimensat_time32)): New function.
	* pathtrace.c (pathtrace_match_set): Replace SEN_utimensat with
	SEN_utimensat_time32.
	* linux/64/syscallent.h: Replace SEN(utimensat) with
	SEN(utimensat_time64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(utimensat) with
	SEN(utimensat_time32).
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of timerfd_gettime and timerfd_settime syscalls
	* time.c (SYS_FUNC(timerfd_gettime), SYS_FUNC(timerfd_settime)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(timerfd_gettime32),
	SYS_FUNC(timerfd_settime32)): New functions.
	* pathtrace.c (pathtrace_match_set): Replace SEN_timerfd_gettime and
	SEN_timerfd_settime with SEN_timerfd_gettime32 and
	SEN_timerfd_settime32, respectively.
	* linux/64/syscallent.h: Replace SEN(timerfd_gettime) and
	SEN(timerfd_settime) with SEN(timerfd_gettime64) and
	SEN(timerfd_settime64), respectively.
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(timerfd_gettime) and
	SEN(timerfd_settime) with SEN(timerfd_gettime32) and
	SEN(timerfd_settime32), respectively.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of timer_gettime and timer_settime syscalls
	* time.c (SYS_FUNC(timer_gettime), SYS_FUNC(timer_settime)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(timer_gettime32),
	SYS_FUNC(timer_settime32)): New functions.
	* linux/64/syscallent.h: Replace SEN(timer_gettime) and
	SEN(timer_settime) with SEN(timer_gettime64) and SEN(timer_settime64),
	respectively.
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(timer_gettime) and
	SEN(timer_settime) with SEN(timer_gettime32) and SEN(timer_settime32),
	respectively.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of nanosleep syscall.
	* time.c (SYS_FUNC(nanosleep)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS]
	(do_nanosleep): New function.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(nanosleep_time32)): Likewise.
	[HAVE_ARCH_OLD_TIME64_SYSCALLS] (SYS_FUNC(nanosleep_time64)): Likewise.
	* linux/64/syscallent.h: Replace SEN(nanosleep) with
	SEN(nanosleep_time64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(nanosleep) with
	SEN(nanosleep_time32).
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of clock_nanosleep syscall.
	* time.c (SYS_FUNC(clock_nanosleep)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(clock_nanosleep_time32)): New
	function.
	* linux/64/syscallent.h: Replace SEN(clock_nanosleep) with
	SEN(clock_nanosleep_time64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(clock_nanosleep) with
	SEN(clock_nanosleep_time32).
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of clock_gettime and clock_settime syscalls
	* time.c (SYS_FUNC(clock_gettime), SYS_FUNC(clock_settime)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(clock_gettime32),
	SYS_FUNC(clock_settime32)): New functions.
	* linux/dummy.h (sys_clock_getres): Remove.
	(sys_clock_getres_time32): Redirect to sys_clock_gettime32.
	* linux/64/syscallent.h: Replace SEN(clock_gettime), SEN(clock_settime),
	and SEN(clock_getres) with SEN(clock_gettime64), SEN(clock_settime64),
	and SEN(clock_getres_time64), respectively.
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(clock_gettime), SEN(clock_settime),
	and SEN(clock_getres) with SEN(clock_gettime32), SEN(clock_settime32),
	and SEN(clock_getres_time32), respectively.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of mq_timedsend and mq_timedreceive syscalls
	* mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(mq_timedsend_time32),
	SYS_FUNC(mq_timedreceive_time32)): New functions.
	* pathtrace.c (pathtrace_match_set): Replace SEN_mq_timedsend and
	SEN_mq_timedreceive with SEN_mq_timedsend_time32 and
	SEN_mq_timedreceive_time32, respectively.
	* syscall.c (dumpio): Likewise.
	* linux/64/syscallent.h: Replace SEN(mq_timedsend) and
	SEN(mq_timedreceive) with SEN(mq_timedsend_time64) and
	SEN(mq_timedreceive_time64), respectively.
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(mq_timedsend) and
	SEN(mq_timedreceive) with SEN(mq_timedsend_time32) and
	SEN(mq_timedreceive_time32), respectively.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of rt_sigtimedwait syscall.
	* signal.c (SYS_FUNC(rt_sigtimedwait)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(rt_sigtimedwait_time32)): New
	function.
	* linux/64/syscallent.h: Replace SEN(rt_sigtimedwait) with
	SEN(ppoll_time64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(rt_sigtimedwait) with
	SEN(ppoll_time32).
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of sched_rr_get_interval syscall.
	* sched.c (SYS_FUNC(sched_rr_get_interval)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(sched_rr_get_interval_time32)):
	New function.
	* linux/64/syscallent.h: Replace SEN(sched_rr_get_interval) with
	SEN(sched_rr_get_interval_time64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(sched_rr_get_interval) with
	SEN(sched_rr_get_interval_time32).
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of poll syscall.
	* poll.c (SYS_FUNC(poll)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS] (do_poll):
	New function.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(poll_time32)): Likewise.
	[HAVE_ARCH_OLD_TIME64_SYSCALLS] (SYS_FUNC(poll_time64)): Likewise.
	* pathtrace.c (pathtrace_match_set): Replace SEN_poll with
	SEN_poll_time32 and SEN_poll_time64.
	* linux/aarch64/syscallent.h: Replace SEN(poll) with SEN(poll_time64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Replace SEN(poll) with SEN(poll_time32).
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of ppoll syscall.
	* poll.c (SYS_FUNC(ppoll)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(ppoll_time32)): New function.
	* pathtrace.c (pathtrace_match_set): Replace SEN_ppoll with
	SEN_ppoll_time32.
	* linux/64/syscallent.h: Replace SEN(ppoll) with SEN(ppoll_time64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(ppoll) with SEN(ppoll_time32).
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of recvmmsg syscall.
	* mmsghdr.c (SYS_FUNC(recvmmsg)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(recvmmsg_time32)): New function.
	* syscall.c (dumpio): Handle SEN_recvmmsg_time32.
	* linux/subcall32.h (sys_recvmmsg): Redirect to sys_recvmmsg_time32.
	* linux/subcall64.h (sys_recvmmsg): Redirect to sys_recvmmsg_time64.
	* linux/64/syscallent.h: Replace SEN(recvmmsg) with SEN(recvmmsg_time64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(recvmmsg) with SEN(recvmmsg_time32).
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of semtimedop syscall.
	* ipc_sem.c (SYS_FUNC(semtimedop)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(semtimedop_time32)): New function.
	* linux/subcall32.h (sys_semtimedop): Redirect to sys_semtimedop_time32.
	* linux/subcall64.h (sys_semtimedop): Redirect to sys_semtimedop_time64.
	* linux/64/syscallent.h: Replace SEN(semtimedop) with
	SEN(semtimedop_time64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(semtimedop) with
	SEN(semtimedop_time32).
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

2019-05-12  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce subcall32.h and subcall64.h wrappers.
	They are going to be used to implement new parsers for indirect
	time-related syscalls.

	* linux/subcall32.h: New file.
	* linux/subcall64.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* linux/arm/syscallent.h: Replace "subcall.h" with "subcall32.h".
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Replace "subcall.h" with "subcall64.h".
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.

2019-05-12  Dmitry V. Levin  <ldv@altlinux.org>

	Implement and use new parsers of futex syscall.
	* futex.c (SYS_FUNC(futex)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(futex_time32)): New function.
	* linux/64/syscallent.h: Replace SEN(futex) with SEN(futex_time64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(futex) with SEN(futex_time32).
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of pselect6 syscall.
	* desc.c (SYS_FUNC(pselect6)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(pselect6_time32)): New function.
	* pathtrace.c (pathtrace_match_set): Replace SEN_pselect6 with
	SEN_pselect6_time32.
	* linux/64/syscallent.h: Replace SEN(pselect6) with
	SEN(pselect6_time64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(pselect6) with
	SEN(pselect6_time32).
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of io_pgetevents syscall.
	* aio.c (SYS_FUNC(io_pgetevents)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(io_pgetevents_time32)): New
	function.
	* linux/64/syscallent.h: Replace SEN(io_pgetevents) with
	SEN(io_pgetevents_time64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(io_pgetevents) with
	SEN(io_pgetevents_time32).
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Implement and use new parsers of io_getevents syscall.
	* aio.c (SYS_FUNC(io_getevents)): Remove.
	[HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(io_getevents_time32)): New
	function.
	[HAVE_ARCH_OLD_TIME64_SYSCALLS] (SYS_FUNC(io_getevents_time64)):
	Likewise.
	* linux/64/syscallent.h: Replace SEN(io_getevents) with
	SEN(io_getevents_time64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/32/syscallent.h: Replace SEN(io_getevents) with
	SEN(io_getevents_time32).
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

2019-05-11  Dmitry V. Levin  <ldv@altlinux.org>

	Wire up *time64 system calls.
	* linux/32/syscallent.h [403...423]: Wire up clock_gettime64,
	clock_settime64, clock_adjtime64, clock_getres_time64,
	clock_nanosleep_time64, timer_gettime64, timer_settime64,
	timerfd_gettime64, timerfd_settime64, utimensat_time64, pselect6_time64,
	ppoll_time64, io_pgetevents_time64, recvmmsg_time64,
	mq_timedsend_time64, mq_timedreceive_time64, semtimedop_time64,
	rt_sigtimedwait_time64, futex_time64, and sched_rr_get_interval_time64
	introduced by linux commit v5.1-rc1~160^2~2^2.
	* linux/arm/syscallent.h [403...423]: Likewise.
	* linux/hppa/syscallent.h [403...423]: Likewise.
	* linux/i386/syscallent.h [403...423]: Likewise.
	* linux/m68k/syscallent.h [403...423]: Likewise.
	* linux/microblaze/syscallent.h [403...423]: Likewise.
	* linux/mips/syscallent-n32.h [6403...6423]: Likewise.
	* linux/mips/syscallent-o32.h [4403...4423]: Likewise.
	* linux/powerpc/syscallent.h [403...423]: Likewise.
	* linux/s390/syscallent.h [403...423]: Likewise.
	* linux/sh/syscallent.h [403...423]: Likewise.
	* linux/sparc/syscallent.h [403...423]: Likewise.
	* linux/xtensa/syscallent.h [403...423]: Likewise.
	* linux/64/syscallent.h: Add a comment about syscall numbers
	reserved to sync up with other architectures.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* pathtrace.c (pathtrace_match_set): Handle SEN_utimensat_time64,
	SEN_pselect6_time64, SEN_ppoll_time64, SEN_mq_timedreceive_time64,
	SEN_mq_timedsend_time64, SEN_timerfd_gettime64, and
	SEN_timerfd_settime64.
	* syscall.c (dumpio): Handle SEN_mq_timedsend_time64,
	SEN_mq_timedreceive_time64, and SEN_recvmmsg_time64.
	* NEWS: Mention this.

	Implement parsers of new *time64 system calls.
	* aio.c (SYS_FUNC(io_pgetevents_time64)): New function.
	* desc.c (SYS_FUNC(pselect6_time64)): Likewise.
	* futex.c (SYS_FUNC(futex_time64)): Likewise.
	* ipc_sem.c (SYS_FUNC(semtimedop_time64)): Likewise.
	* mmsghdr.c (SYS_FUNC(recvmmsg_time64)): Likewise.
	* mq.c (SYS_FUNC(mq_timedsend_time64),
	SYS_FUNC(mq_timedreceive_time64)): Likewise.
	* poll.c (SYS_FUNC(ppoll_time64)): Likewise.
	* sched.c (SYS_FUNC(sched_rr_get_interval_time64)): Likewise.
	* signal.c (SYS_FUNC(rt_sigtimedwait_time64)): Likewise.
	* time.c (SYS_FUNC(clock_settime64), SYS_FUNC(clock_gettime64),
	SYS_FUNC(clock_nanosleep_time64), SYS_FUNC(timer_settime64),
	SYS_FUNC(timer_gettime64), SYS_FUNC(timerfd_settime64),
	SYS_FUNC(timerfd_gettime64)): Likewise.
	* utimes.c (SYS_FUNC(utimensat_time64)): Likewise.
	* linux/dummy.h (sys_clock_getres_time64): Redirect
	to sys_clock_gettime64.

	Use new parsers of adjtimex and clock_adjtime syscalls.
	* print_timex.c (struct_timex, print_timex): Remove.
	* time.c (SYS_FUNC(adjtimex), SYS_FUNC(clock_adjtime)): Remove.
	* linux/alpha/syscallent.h [303]: Replace SEN(adjtimex)
	with SEN(adjtimex32).
	[366]: Replace SEN(adjtimex) with SEN(adjtimex64).
	[499]: Replace SEN(clock_adjtime) with SEN(clock_adjtime64).
	* linux/32/syscallent.h: Replace SEN(adjtimex) and SEN(clock_adjtime)
	with SEN(adjtimex32) and SEN(clock_adjtime32), respectively.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* linux/64/syscallent.h: Replace SEN(adjtimex) and SEN(clock_adjtime)
	with SEN(adjtimex64) and SEN(clock_adjtime64), respectively.
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* tests/adjtimex.c: Include <stddef.h>.
	(main): Print struct timex.tai unconditionally.

	Implement parsers of 64-bit adjtimex and clock_adjtime syscalls.
	* time.c (SYS_FUNC(clock_adjtime64)): New function.
	[SPARC64] (SYS_FUNC(clock_sparc64_adjtime)): Likewise.
	[HAVE_ARCH_OLD_TIME64_SYSCALLS] (SYS_FUNC(adjtimex64)): Likewise.

	Implement parsers of 32-bit adjtimex and clock_adjtime syscalls.
	* time.c [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(adjtimex32),
	SYS_FUNC(clock_adjtime32)): New functions.

2019-05-10  Dmitry V. Levin  <ldv@altlinux.org>

	sparc64: implement printer for sparc64-specific struct timex.
	According to Linux kernel commit v5.1-rc1~160^2~2^2~8, sparc64 is the
	only architecture on Linux that has a 'timeval' definition with a 32-bit
	tv_usec but a 64-bit tv_sec.

	* defs.h [SPARC64] (print_sparc64_timex): New prototype.
	* kernel_timex.h [SPARC64] (kernel_sparc64_timex_t): New type.
	* print_timex.c [SPARC64] (print_sparc64_timex): New function.

2019-05-10  Dmitry V. Levin  <ldv@altlinux.org>

	Implement printer for kernel_timex64_t.
	This is going to be used to implement clock_adjtime64 parser.

	* defs.h (kernel_timex64_t): New prototype.
	* print_timex.c (print_timex64): New function.

2019-05-10  Dmitry V. Levin  <ldv@altlinux.org>

	Implement printer for kernel_timex32_t.
	This is going to be used to re-implement parsers of syscalls that deal
	with 32-bit struct timex.

	* print_timex.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (print_timex32): New prototype.
	* print_timex.c: Include "kernel_timex.h".
	[HAVE_ARCH_TIME32_SYSCALLS] (print_timex32): New function.

2019-05-10  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce kernel_timex64_t.
	This is going to be used to implement clock_adjtime64 parser.

	* kernel_timex.h (kernel_timex64_t): New type.

2019-05-10  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce kernel_timex32_t.
	Currently existing parsers of syscalls that deal with 32-bit timex
	rely upon struct timex being defined in libc and match the definition
	used by the kernel.  Given the upcoming y2038 changes in glibc,
	this new type is going to be used instead.

	* kernel_timex.h: New file.
	* Makefile.am (strace_SOURCES): Add it.

2019-05-09  Dmitry V. Levin  <ldv@altlinux.org>

	Re-implement mpersified timespec printers using timespec32/timespec64 printers
	* print_timespec.c (UTIME_NOW, UTIME_OMIT, TIMESPEC_TO_SEC_NSEC,
	timespec_fmt, print_sec_nsec, print_timespec_t, print_timespec_t_utime):
	Remove.
	(TIMESPEC_IS_32BIT, PRINT_TIMESPEC_DATA_SIZE,
	PRINT_TIMESPEC_ARRAY_DATA_SIZE, PRINT_TIMESPEC, SPRINT_TIMESPEC,
	PRINT_TIMESPEC_UTIME_PAIR,PRINT_ITIMERSPEC): New macros.
	(print_struct_timespec_data_size): Invoke PRINT_TIMESPEC_DATA_SIZE.
	(print_struct_timespec_array_data_size): Invoke
	PRINT_TIMESPEC_ARRAY_DATA_SIZE.
	(print_timespec): Invoke PRINT_TIMESPEC.
	(sprint_timespec): Invoke SPRINT_TIMESPEC.
	(print_timespec_utime_pair): Invoke PRINT_TIMESPEC_UTIME_PAIR.
	(print_itimerspec): Invoke PRINT_ITIMERSPEC.

2019-05-09  Dmitry V. Levin  <ldv@altlinux.org>

	Implement printers for kernel_timespec64_t.
	They are going to be used to re-implement parsers of syscalls that deal
	with 64-bit timespec, and to implement parsers of new *time64 syscalls.

	* defs.h (print_timespec64_data_size, print_timespec64_array_data_size,
	print_timespec64, sprint_timespec64, print_timespec64_utime_pair,
	print_itimerspec64): New prototypes.
	* print_timespec64.c: New file.
	* Makefile.am (strace_SOURCES): Add it.

2019-05-09  Dmitry V. Levin  <ldv@altlinux.org>

	Implement printers for kernel_timespec32_t.
	They are going to be used to re-implement parsers of syscalls that deal
	with 32-bit timespec.

	* defs.h (print_timespec32_data_size, print_timespec32_array_data_size,
	print_timespec32, sprint_timespec32, print_timespec32_utime_pair,
	print_itimerspec32): New prototypes.
	* print_timespec.h: New file based on print_timespec.c.
	* print_timespec32.c: New file.
	* Makefile.am (strace_SOURCES): Add them.

2019-05-09  Dmitry V. Levin  <ldv@altlinux.org>

	print_timespec.c: introduce helper macros and functions.
	They are going to be used to implement printers of other timespec
	flavours, e.g. kernel_timespec32_t and kernel_timespec64_t.

	* print_timespec.c (TIMESPEC_TO_SEC_NSEC): New macro.
	(print_timespec_t_utime, sprint_timespec): Use it.
	(print_sec_nsec): New function.
	(print_timespec_t): Use it.

2019-05-05  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce kernel_timespec64_t type.
	This type ais going to be used to implement parsers of syscalls
	that deal with 64-bit timespec.

	* kernel_timespec.h (kernel_timespec64_t): New type.

2019-05-05  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce kernel_timespec32_t type.
	Currently existing parsers of syscalls that deal with 32-bit timespec
	rely upon struct timespec being defined in libc and match the definition
	used by the kernel.  Given the upcoming y2038 changes in glibc,
	this new type is going to be used instead.

	* kernel_timespec.h: New file.
	* Makefile.am (strace_SOURCES): Add it.

2019-05-05  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce ARCH_TIMESIZE.
	This is going to be used to implement new timespec parsers.

	* linux/arch_defs_.h [!ARCH_TIMESIZE] (ARCH_TIMESIZE): Define
	to SIZEOF_LONG.
	* linux/x32/arch_defs_.h (ARCH_TIMESIZE): Define to 8.

2019-05-05  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce HAVE_ARCH_TIME32_SYSCALLS and HAVE_ARCH_OLD_TIME64_SYSCALLS.
	These are going to control whether to compile parsers of 32-bit and
	old 64-bit time syscalls.

	* linux/arch_defs_.h [!MIN_WORDSIZE] (MIN_WORDSIZE): Define.
	[!HAVE_ARCH_TIME32_SYSCALLS] (HAVE_ARCH_TIME32_SYSCALLS): Define.
	[!HAVE_ARCH_OLD_TIME64_SYSCALLS] (HAVE_ARCH_OLD_TIME64_SYSCALLS):
	Define.
	* linux/alpha/arch_defs_.h (HAVE_ARCH_TIME32_SYSCALLS): Define.
	* linux/x32/arch_defs_.h (HAVE_ARCH_OLD_TIME64_SYSCALLS): Define.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	time.c: introduce do_timerfd_gettime and do_timerfd_settime.
	These are going to be used to implement parsers of timerfd_gettime64
	and timerfd_settime64 syscalls.

	* time.c (do_timerfd_settime, do_timerfd_gettime): New functions.
	((SYS_FUNC(timerfd_settime)): Turn into a thin wrapper around
	do_timerfd_settime.
	((SYS_FUNC(timerfd_gettime)): Turn into a thin wrapper around
	do_timerfd_gettime.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	time.c: introduce do_timer_gettime and do_timer_settime.
	These are going to be used to implement parsers of timer_gettime64 and
	timer_settime64 syscalls.

	* time.c (do_timer_settime, do_timer_gettime): New functions.
	((SYS_FUNC(timer_settime)): Turn into a thin wrapper around
	do_timer_settime.
	((SYS_FUNC(timer_gettime)): Turn into a thin wrapper around
	do_timer_gettime.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	time.c: introduce do_clock_gettime, do_clock_settime, and do_clock_nanosleep
	These are going to be used to implement parsers of clock_gettime64,
	clock_settime64, and clock_nanosleep_time64 syscalls.

	* time.c (do_clock_settime, do_clock_gettime, do_clock_nanosleep): New
	functions.
	((SYS_FUNC(clock_settime)): Turn into a thin wrapper around
	do_clock_settime.
	((SYS_FUNC(clock_gettime)): Turn into a thin wrapper around
	do_clock_gettime.
	((SYS_FUNC(clock_nanosleep)): Turn into a thin wrapper around
	do_clock_nanosleep.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	time.c: introduce do_clock_adjtime.
	This is going to be used to implement a parser of clock_adjtime64
	syscall.

	* time.c (do_clock_adjtime): New function.
	((SYS_FUNC(clock_adjtime)): Turn into a thin wrapper around
	do_clock_adjtime.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	do_adjtimex: parametrize print_timex.
	This is going to be used to implement a parser of clock_adjtime64
	syscall.

	* time.c (do_adjtimex): Add print_tx argument, invoke it
	instead of print_timex.
	(SYS_FUNC(adjtimex), SYS_FUNC(clock_adjtime)): Pass print_timex
	to do_adjtimex.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	utimes.c: introduce do_utimensat.
	This is going to be used to implement a parser of utimensat_time64
	syscall.

	* utimes.c (do_utimensat): New function.
	(SYS_FUNC(utimensat)): Turn into a thin wrapper around do_utimensat.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	signal.c: introduce do_rt_sigtimedwait.
	This is going to be used to implement a parser of rt_sigtimedwait_time64
	syscall.

	* signal.c (do_rt_sigtimedwait): New function.
	(SYS_FUNC(rt_sigtimedwait)): Turn into a thin wrapper around
	do_rt_sigtimedwait.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	sched.c: introduce do_sched_rr_get_interval.
	This is going to be used to implement a parser of
	sched_rr_get_interval_time64 syscall.

	* sched.c (do_sched_rr_get_interval): New function.
	(SYS_FUNC(sched_rr_get_interval)): Turn into a thin wrapper around
	do_sched_rr_get_interval.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	poll.c: introduce do_ppoll.
	This is going to be used to implement a parser of ppoll_time64 syscall.

	* poll.c (decode_poll_exiting): Add sprint_ts argument.
	(SYS_FUNC(poll)): Pass sprint_timespec to decode_poll_exiting.
	(do_ppoll): New function.
	(SYS_FUNC(ppoll)): Turn into a thin wrapper around do_ppoll.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	mq.c: introduce do_mq_timedsend and do_mq_timedreceive.
	These are going to be used to implement parsers of mq_timedsend_time64
	and mq_timedreceive_time64 syscalls.

	* mq.c (do_mq_timedsend, do_mq_timedreceive): New functions.
	(SYS_FUNC(mq_timedsend)): Turn into a thin wrapper around
	do_mq_timedsend.
	(SYS_FUNC(mq_timedreceive)): Turn into a thin wrapper around
	do_mq_timedreceive.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	mmsghdr.c: introduce do_recvmmsg.
	This is going to be used to implement a parser of recvmmsg_time64
	syscall.

	* mmsghdr.c (do_recvmmsg): New function.
	(SYS_FUNC(recvmmsg)): Turn into a thin wrapper around do_recvmmsg.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	ipc_sem.c: introduce do_semtimedop.
	This is going to be used to implement a parser of semtimedop_time64
	syscall.

	* ipc_sem.c (do_semtimedop): New function.
	(SYS_FUNC(semtimedop)): Turn into a thin wrapper around do_semtimedop.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	futex.c: introduce do_futex.
	This is going to be used to implement a parser of futex_time64 syscall.

	* futex.c (do_futex): New function.
	(SYS_FUNC(futex)): Turn into a thin wrapper around do_futex.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	desc.c: introduce do_pselect6.
	This is going to be used to implement a parser of pselect6_time64
	syscall.

	* dec.c (do_pselect6): New function.
	(SYS_FUNC(pselect6)): Turn into a thin wrapper around do_pselect6.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	print_io_getevents: parametrize print_timespec.
	This is going to be used to implement a parser of io_pgetevents_time64
	syscall.

	* aio.c (print_io_getevents): Add print_ts argument, invoke it
	instead of print_timespec.
	(SYS_FUNC(io_getevents), SYS_FUNC(io_pgetevents)): Pass print_timespec
	to print_io_getevents.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce print_obj_by_addr_fn and sprint_obj_by_addr_fn.
	These types are going to be used in signatures of functions that take
	print_*time* functions as parameters.

	* defs.h (print_obj_by_addr_fn, sprint_obj_by_addr_fn): New types.
	* desc.c (decode_select): Use them.

2019-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	Change signatures of print_*time* functions to match print_timex.
	Make all these functions that print time by address return -1 when
	umove_or_printaddr() returns non-zero.

	This helps to use these functions as parameters to other functions.

	* defs.h [ALPHA] (print_timeval32, print_timeval32_utimes,
	print_itimerval32): Change return type to int.
	* desc.c (decode_select): Change return type of print_tv_ts to int.
	* print_timespec.c (print_timespec, print_timespec_utime_pair,
	print_itimerspec): Change return type to int, return -1 when
	umove_or_printaddr() returns non-zero.
	* print_timeval.c (print_timeval, print_timeval_utimes,
	print_itimerval): Likewise.
	[ALPHA] (print_timeval32, print_timeval32_utimes, print_itimerval32):
	Likewise.

2019-04-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify umount and umount2 tests against future kernel changes.
	Prepare for the rename of umount syscall to umount2 introduced by linux
	kernel commits v5.1-rc1~160^2~3^2~12 and v5.1-rc1~160^2~3^2~16 on alpha
	and ia64 architectures, respectively.

	* tests/umount.c: Check for __NR_umount == __NR_umount2.
	* tests/umount2.c: Likewise.

2019-04-15  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: wire up getegid, geteuid, and getppid syscalls.
	* linux/alpha/syscallent.h [530..532]: Wire up getegid, geteuid,
	and getppid syscalls introduced on this architecture by linux commit
	v5.1-rc1~160^2~3^2~1.
	* NEWS: Mention this.

	alpha: wire up statfs64 and fstatfs64 syscalls.
	* linux/alpha/syscallent.h [528..529]: Wire up statfs64 and fstatfs64
	syscalls introduced on this architecture by linux commit
	v5.1-rc1~160^2~3^2~2.
	* NEWS: Mention this.

	Wire up pkey_* and rseq syscalls on remaining architectures.
	* linux/alpha/syscallent.h [524..527]: Wire up pkey_mprotect,
	pkey_alloc, pkey_free, and rseq syscalls introduced on this architecture
	by linux commit v5.1-rc1~160^2~3^2~3.
	* linux/hppa/syscallent.h [351..354]: Likewise.
	* linux/ia64/syscallent.h [1024 + 330..333]: Likewise.
	* linux/m68k/syscallent.h [381..384]: Likewise.
	* linux/sh/syscallent.h [384..387]: Likewise.
	* linux/sparc/syscallent.h [362..365]: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h [384..386]: Wire up pkey_mprotect,
	pkey_alloc, and pkey_free syscalls introduced on this architecture
	by linux commit v5.1-rc1~160^2~3^2~3.
	* linux/s390x/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h [352]: Wire up rseq syscall introduced
	on this architecture by linux commit v5.1-rc1~160^2~3^2~3.
	* NEWS: Mention this.

	Wire up direct ipc syscalls on m68k, mips, powerpc*, s390*, sh, sparc*, x86
	* linux/i386/syscallent.h [393..402]: Wire up semget, semctl, shmget,
	shmctl, shmat, shmdt, msgget, msgsnd, msgrcv, and msgctl syscalls
	introduced on this architecture by linux commit v5.1-rc1~160^2~3^2~4.
	* linux/m68k/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/mips/syscallent-o32.h [4393..4402]: Wire up semget, semctl,
	shmget, shmctl, shmat, shmdt, msgget, msgsnd, msgrcv, and msgctl syscalls
	introduced on this architecture by linux commit v5.1-rc1~160^2~3^2~4.
	* linux/powerpc64/syscallent.h [392..402]: Wire up semtimedop, semget,
	semctl, shmget, shmctl, shmat, shmdt, msgget, msgsnd, msgrcv, and msgctl
	syscalls introduced on this architecture by linux commit
	v5.1-rc1~160^2~3^2~4.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* NEWS: Mention this.

	powerpc, powerpc64: remove direct ipc syscall entries.
	* linux/powerpc/syscallent.h [366..377]: Remove entries reserved for
	direct ipc syscalls, they were added by linux kernel commit
	v4.4-rc1~98^2~32 and removed by linux kernel commit v4.4-rc6~5^2~2.
	* linux/powerpc64/syscallent.h: Likewise.

	sh: wire up statx syscall.
	* linux/sh/syscallent.h [380]: Wire up statx syscall
	introduced on sh by linux commit v5.1-rc1~160^2~3^2~7.
	* NEWS: Mention this.

	m68k: wire up seccomp syscall.
	* linux/m68k/syscallent.h [380]: Wire up seccomp syscall
	introduced on m68k by linux commit v5.1-rc1~160^2~3^2~9.
	* NEWS: Mention this.

	arm: wire up kexec_file_load syscall.
	* linux/arm/syscallent.h [401]: Wire up kexec_file_load syscall
	introduced on arm by linux commit v5.1-rc1~160^2~3^2~10.
	* NEWS: Mention this.

	arm: wire up migrate_pages syscall.
	* linux/arm/syscallent.h [400]: Wire up migrate_pages syscall
	introduced on arm by linux commit v5.1-rc1~160^2~3^2~11.
	* NEWS: Mention this.

	alpha: wire up io_pgetevents syscall.
	* linux/alpha/syscallent.h [523]: Wire up io_pgetevents syscall
	introduced on alpha by linux commit v5.1-rc1~160^2~3^2~13.
	* NEWS: Mention this.

	ia64: wire up perf_event_open and seccomp syscalls.
	* linux/ia64/syscallent.h [1024 + 327..328]: Wire up perf_event_open
	and seccomp syscalls introduced on ia64 by linux commit
	v5.1-rc1~160^2~3^2~14.
	* NEWS: Mention this.

	ia64: wire up statx and io_pgetevents syscalls.
	* linux/ia64/syscallent.h [1024 + 326..327]: Wire up statx and
	io_pgetevents syscalls introduced on ia64 by linux commit
	v5.1-rc1~160^2~3^2~15.
	* NEWS: Mention this.

	ia64: make syscall entry table numbers more readable.
	* linux/ia64/syscallent.h: Format syscall numbers using base+offset form.
	* scno.am (SCNO_SED): Update to handle this format.

2019-03-24  Guo Ren  <ren_guo@c-sky.com>

	Add C-SKY architecture support.
	This is port of C-SKY architecture for strace.  There is a little
	difference between abiv1 and abiv2, we use __CSKYABIV2__ from GCC-csky
	to distinguish.

	Reviewed-By: Dmitry V. Levin <ldv@altlinux.org>

	* cacheflush.c [CSKY] (cacheflush_flags, SYS_FUNC(cacheflush)): Define.
	* clone.c [CSKY] (ARG_*): Define.
	* configure.ac [$host_cpu == csky*]: Define CSKY.
	* linux/csky/arch_regs.c: New file.
	* linux/csky/get_error.c: Likewise.
	* linux/csky/get_scno.c: Likewise.
	* linux/csky/get_syscall_args.c: Likewise.
	* linux/csky/ioctls_arch0.h: Likewise.
	* linux/csky/ioctls_inc0.h: Likewise.
	* linux/csky/raw_syscall.h: Likewise.
	* linux/csky/set_error.c: Likewise.
	* linux/csky/set_scno.c: Likewise.
	* linux/csky/syscallent.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* NEWS: Mention this change.

2019-03-24  Guo Ren  <ren_guo@c-sky.com>

	riscv: Fixup wrong clone's arguments define.
	In linux kernel riscv select CLONE_BACKWARDS in
	linux/arch/riscv/Kconfig, and in linux/kernel/fork.c:

	ifdef CONFIG_CLONE_BACKWARDS
	SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
			 int __user *, parent_tidptr,
			 unsigned long, tls,
			 int __user *, child_tidptr)
	elif ...

	So we must make the riscv clone-arguments' sequence to be:
	  define ARG_FLAGS	0
	  define ARG_STACK	1
	  define ARG_PTID	2
	  define ARG_TLS	3
	  define ARG_CTID	4

	Reviewed-By: Dmitry V. Levin <ldv@altlinux.org>

	* clone.c [RISCV]: Use default definitions for ARG_* macros.
	* NEWS: Mention this fix.

2019-03-20  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 5.0-1.
	* strace.spec.in: Likewise.

2019-03-19  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 5.0 release.
	* NEWS: Update for 5.0 release.

	.mailmap: add more entries to avoid duplication in CREDITS.

2019-03-18  Dmitry V. Levin  <ldv@altlinux.org>

	strace.spec.in: do not define Group tag for modern distros.
	* strace.spec.in (Group): Conditionalize on distro version.

	References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag

2019-03-18  Dmitry V. Levin  <ldv@altlinux.org>

	strace-log-merge: enhance pid formatting.
	* strace-log-merge (max_suffix_length): New variable.
	(iterate_logfiles, process_suffix, process_logfile): New functions.
	Use them to choose the optimum width for pid column.
	* NEWS: Mention this enhancement.
	* tests/strace-log-merge-suffix.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.

2019-03-18  Dmitry V. Levin  <ldv@altlinux.org>

	strace-log-merge: fix error diagnostics.
	* strace-log-merge: Print error diagnostics and exit with a non-zero
	status in case of no strace output.
	* NEWS: Mention this fix.
	* tests/strace-log-merge-error.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.

	Fixes: v4.21~287 "strace-log-merge: work around corner cases of strace -ttt parsing"

2019-03-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.

2019-03-18  Dmitry V. Levin  <ldv@altlinux.org>

	Update copyright year number range.
	* COPYING: Update copyright year number range.
	* tests/COPYING: Likewise.
	* debian/copyright: Likewise.

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2019-03-18  Dmitry V. Levin  <ldv@altlinux.org>

	Fix preprocessor indentation.
	Indent the C preprocessor directives to reflect their nesting
	using the following script:

	$ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do
		cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
	done

2019-03-17  Shankara Pailoor  <shankarapailoor@gmail.com>

	Honor xlat styles when decoding mac addresses.
	* defs.h (print_mac_addr): Add xlat_style support, move ...
	* print_mac.c: ... here.
	* tests/sockaddr_xlat.c [HAVE_BLUETOOTH_BLUETOOTH_H]: Include
	<bluetooth/bluetooth.h>, <bluetooth/hci.h>, <bluetooth/l2cap.h>
	<bluetooth/rfcomm.h>, and <bluetooth/sco.h>.
	[HAVE_BLUETOOTH_BLUETOOTH_H] (check_sco, check_rc): New functions.
	(main) [HAVE_BLUETOOTH_BLUETOOTH_H]: Call them to verify
	new xlat_style support in print_mac_addr().
	* tests/net-packet_mreq.c: Handle XLAT_RAW, XLAT_ABBREV,
	and XLAT_VERBOSE macros.
	* tests/net-packet_mreq-Xabbrev.c: New test.
	* tests/net-packet_mreq-Xraw.c: Likewise.
	* tests/net-packet_mreq-Xverbose.c: Likewise.
	* tests/gen_tests.in (net-packet_mreq-Xabbrev, net-packet_mreq-Xraw,
	net-packet_mreq-Xverbose): New tests.
	* tests/pure_executables.list: Add net-packet_mreq-Xabbrev,
	net-packet_mreq-Xraw, and et-packet_mreq-Xverbose.
	* tests/.gitignore: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-03-17  Shankara Pailoor  <shankarapailoor@gmail.com>

	net: print mac address consistently.
	* net.c (print_packet_mreq): Call PRINT_FIELD_MAC_SZ instead of custom
	print.
	* tests/net-packet_mreq.c (test_packet_mreq): Update expected output.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-03-17  Dmitry V. Levin  <ldv@altlinux.org>

	Change -D option to imply -I4.
	* strace.c (init) [daemonized_tracer && !opt_intr]: Set opt_intr
	to INTR_BLOCK_TSTP_TOO.
	* strace.1.in: Document this.
	* NEWS: Mention this change.

	Resolves: https://github.com/strace/strace/issues/96

2019-03-15  Tuan Hoang  <tmhoang@linux.ibm.com>

	s390: fix SIGNAL_FRAMESIZE macro.
	Since __SIGNAL_FRAMESIZE is in private name space, it is better not to
	use it directly. This macro has been stable on s390/s390x so it is safe
	to use the integer value.

	* linux/s390/arch_sigreturn.c [!SIGNAL_FRAMESIZE] (SIGNAL_FRAMESIZE):
	Define to 96.
	* linux/s390x/arch_sigreturn.c (arch_sigreturn == s390_arch_sigreturn):
	Remove S390_SIGNAL_FRAMESIZE and SIGNAL_FRAMESIZE.
	(arch_sigreturn == s390x_arch_sigreturn): Define SIGNAL_FRAMESIZE.
	* linux/s390/rt_sigframe.h (SIGNAL_FRAMESIZE): Define.
	(struct_rt_sigframe): Replace __SIGNAL_FRAMESIZE with SIGNAL_FRAMESIZE.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-03-14  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: add support for new seven fields in BPF_PROG_LOAD.
	* bpf_attr.h (struct BPF_PROG_LOAD_struct): Add prog_btf_fd,
	func_info_rec_size, func_info, func_info_cnt, line_info_rec_size,
	line_info, and line_info_cnt fields.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Decode these fields
	introduced by Linux commits v5.0-rc1~129^2~209^2~16^2~8 and
	v5.0-rc1~129^2~114^2~5^2~6.
	* tests/bpf.c (BPF_PROG_LOAD_checks): Check it.
	* tests/kernel_version.c (print_bpf_attr): Update expected output.
	* tests/bpf-obj_get_info_by_fd.c (print_prog_load): Likewise.

2019-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: implement decoding of BPF_TASK_FD_QUERY command.
	BPF_TASK_FD_QUERY command was introduced by Linux commit
	v4.18-rc1~114^2~148^2~1^2~5.

	* bpf_attr.h (struct BPF_TASK_FD_QUERY_struct): New type.
	(BPF_TASK_FD_QUERY_struct_size,
	expected_BPF_TASK_FD_QUERY_struct_size): New macros.
	* bpf.c: Include "xlat/bpf_task_fd_type.h".
	(BEGIN_BPF_CMD_DECODER(BPF_TASK_FD_QUERY)): New bpf command decoder.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Add
	BPF_CMD_ENTRY(BPF_TASK_FD_QUERY).
	* xlat/bpf_task_fd_type.in: New file.
	* tests/bpf.c (union bpf_attr_data): Add
	BPF_ATTR_DATA_FIELD(BPF_TASK_FD_QUERY).
	(BPF_TASK_FD_QUERY_checks): New checks array.
	(main) <checks>: Add CHK(BPF_TASK_FD_QUERY).

2019-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: implement decoding of BPF_MAP_LOOKUP_AND_DELETE_ELEM command.
	BPF_MAP_LOOKUP_AND_DELETE_ELEM command was introduced by Linux commit
	v4.20-rc1~151^2~32^2~11^2~2.

	* bpf.c (decode_BPF_MAP_LOOKUP_AND_DELETE_ELEM): Alias
	to decode_BPF_MAP_LOOKUP_ELEM.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Add
	BPF_CMD_ENTRY(BPF_MAP_LOOKUP_AND_DELETE_ELEM).
	* tests/bpf.c (BPF_MAP_LOOKUP_AND_DELETE_ELEM_checks): Alias
	to BPF_MAP_LOOKUP_ELEM_checks.
	(main) <checks>: Add CHK(BPF_MAP_LOOKUP_AND_DELETE_ELEM).

2019-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: implement decoding of BPF_BTF_GET_FD_BY_ID command.
	BPF_BTF_GET_FD_BY_ID command was introduced by Linux commit
	v4.18-rc1~114^2~223^2~21^2~4.

	* bpf_attr.h (struct BPF_BTF_GET_FD_BY_ID_struct): New type.
	(BPF_BTF_GET_FD_BY_ID_struct_size,
	expected_BPF_BTF_GET_FD_BY_ID_struct_size): New macros.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_BTF_GET_FD_BY_ID)): New bpf command
	decoder.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Add
	BPF_CMD_ENTRY(BPF_BTF_GET_FD_BY_ID).
	* tests/bpf.c (union bpf_attr_data): Add
	BPF_ATTR_DATA_FIELD(BPF_BTF_GET_FD_BY_ID).
	(BPF_BTF_GET_FD_BY_ID_checks): New checks array.
	(main) <checks>: Add CHK(BPF_BTF_GET_FD_BY_ID).

2019-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: implement decoding of BPF_BTF_LOAD command.
	BPF_BTF_LOAD command was introduced by Linux commit
	v4.18-rc1~114^2~417^2~1^2~5.

	* bpf_attr.h (struct BPF_BTF_LOAD_struct): New type.
	(BPF_BTF_LOAD_struct_size, expected_BPF_BTF_LOAD_struct_size): New
	macros.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_BTF_LOAD)): New bpf command decoder.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Add BPF_CMD_ENTRY(BPF_BTF_LOAD).
	* tests/bpf.c (union bpf_attr_data): Add
	BPF_ATTR_DATA_FIELD(BPF_BTF_LOAD).
	(init_BPF_BTF_LOAD_attr): New function.
	(BPF_BTF_LOAD_checks): New checks array.
	(main) <checks>: Add CHK(BPF_BTF_LOAD).

2019-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: make decoders of BPF_*_GET_FD_BY_ID commands return RVAL_FD.
	These bpf commands return file descriptors.

	* bpf.c (BPF_PROG_GET_FD_BY_ID, BPF_MAP_GET_FD_BY_ID): Add RVAL_FD
	to END_BPF_CMD_DECODER.

2019-03-12  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: add support for new twelve fields in struct bpf_prog_info.
	* bpf_attr.h (struct bpf_prog_info_struct): Add btf_id,
	func_info_rec_size, func_info, nr_func_info, nr_line_info, line_info,
	jited_line_info, nr_jited_line_info, line_info_rec_size,
	jited_line_info_rec_size, nr_prog_tags, and prog_tags fields.
	* bpf.c (struct obj_get_info_saved): Add func_info_rec_size,
	nr_func_info, nr_line_info, jited_line_info, nr_jited_line_info,
	line_info_rec_size, jited_line_info_rec_size, and nr_prog_tags fields.
	(print_bpf_prog_info): Decode the twelve fields introduced by Linux
	commits v5.0-rc1~129^2~209^2~16^2~8, v5.0-rc1~129^2~114^2~5^2~6,
	v5.0-rc1~129^2~114^2^2~2, and v5.0-rc1~129^2~15^2~22.
	* NEWS: Mention the latest bpf decoding enhancements.
	* tests/bpf-obj_get_info_by_fd.c (main): Update expected output.

	Resolves: https://github.com/strace/strace/issues/94

2019-03-12  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: add support for *jited_ksyms and *jited_func_lens fields in struct bpf_prog_info
	* bpf_attr.h (struct bpf_prog_info_struct): Add nr_jited_ksyms,
	nr_jited_func_lens, jited_ksyms, and jited_func_lens fields.
	* bpf.c (struct obj_get_info_saved): Likewise.
	(print_bpf_prog_info): Decode these fields introduced by Linux commits
	v4.18-rc1~114^2~148^2~3^2~6 and v4.18-rc1~114^2~148^2~3^2~2.
	* tests/bpf-obj_get_info_by_fd.c (main): Update expected output.

	bpf: add support for btf_* fields in struct bpf_map_info.
	* bpf_attr.h (struct bpf_map_info_struct): Add btf_fd, btf_key_type_id,
	and btf_value_type_id fields.
	* bpf.c (print_bpf_map_info): Decode btf_fd, btf_key_type_id,
	and btf_value_type_id fields introduced by Linux commits
	v4.18-rc1~114^2~223^2~21^2~4 and v4.18-rc1~114^2~148^2~7^2~2.
	* tests/bpf-obj_get_info_by_fd.c (main): Update expected output.

	bpf: add support for btf_* fields in BPF_MAP_CREATE.
	* bpf_attr.h (struct BPF_MAP_CREATE_struct): Add btf_fd,
	btf_key_type_id, and btf_value_type_id fields.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Decode btf_fd,
	btf_key_type_id, and btf_value_type_id fields introduced by Linux
	commits v4.18-rc1~114^2~417^2~1^2~3 and v4.18-rc1~114^2~148^2~7^2~2.
	* tests/bpf.c (BPF_MAP_CREATE_checks): Check it.
	* tests/bpf-obj_get_info_by_fd.c (print_map_create): Update expected
	output.

2019-03-12  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: print struct bpf_prog_info.gpl_compatible.
	This bit field was added by Linux commit v4.18-rc1~114^2~376^2~6.

	* bpf_attr.h (struct bpf_prog_info_struct): Add gpl_compatible field.
	* bpf.c (print_bpf_prog_info): Print gpl_compatible field.
	* tests/bpf-obj_get_info_by_fd.c (main): Update expected output.

2019-03-12  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: exclude bit fields from the check.
	Currently we have no instruments to check the size and offsets
	of bit fields.

	* gen_bpf_attr_check.sh: Do not print bit fields.
	* m4/gen_bpf_attr_m4.awk: Likewise.

2019-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement queueing of threads before dispatching them.
	It is possible that some tracees call a lot of cheap syscalls too fast,
	and that can stress the tracer to the point some tracees are not served
	for indefinite amount of time.  In order to avoid that unfairness, try
	to collect all the pending tracees first along with the relevant
	information and only then dispatch the events.

	* defs.h: Include "list.h".
	(struct tcb): Add wait_data_idx, delayed_wait_data, and wait_list
	fields.
	* strace.c (struct tcb_wait_data): Add "msg" field.
	(tcb_wait_tab, tcb_wait_tab_size): New static variables.
	(alloctcb): Initialize wait_list.
	(droptcb): Remove tcp from wait_list.
	(maybe_switch_tcbs): Get old pid from
	tcb_wait_tab[tcp->wait_data_idx].msg instead of calling
	ptrace(PTRACE_GETEVENTMSG).
	(trace_wait_data_size, init_trace_wait_data, copy_trace_wait_data,
	free_trace_wait_data, tcb_wait_tab_check_size): New functions, in order
	to allow the code outside next_event to operate with wait_data as with
	an opaque object (needed for dispatch_event and restart_delayed_tcb).
	(next_event): Add pending_tcps, extra_tcp, wait_nohang, elem, and
	wait_tab_pos variables; check for elements in pending_tcps and skip
	waiting if the list is not empty; check for extra_tcp and skip waiting
	along with swapping wait_data_idx with wait_extra_data_idx;
	after the initial wait4(), call wait4() in loop with WNOHANG flag set;
	fetch siginfo on signal and eventmsg on PTRACE_EVENT_EXEC;
	return the first tcp in pending_tcps list.
	(dispatch_event): Store a pointer to a copy of tcb_wait_data in
	tcp->delayed_wait_data if tcp's restart has to be delayed.
	(restart_delayed_tcb): Use tcp->delayed_wait_data, create a stub
	tcb_wait_data if it is NULL, free temporary trace_wait_data.
	* tests/Makefile.am (XFAIL_TEST): Remove looping_threads.test.

	Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=478419
	Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=526740
	Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=851457
	Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1609318
	Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1610774
	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
	Co-Authored-by: Denys Vlasenko <dvlasenk@redhat.com>
	Co-Authored-by: Andreas Schwab <aschwab@redhat.com>
	Co-Authored-by: Jeff Law <law@redhat.com>
	Co-Authored-by: DJ Delorie <dj@redhat.com>

2019-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add a generic list implementation.
	Similar to the one used in the Linux kernel.

	* macros.h (cast_ptr, containerof): New macros.
	* list.h: New file.
	* Makefile.am (strace_SOURCES): Add it.

2019-03-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check tracing of looping threads.
	* test/many_looping_threads.c: Remove.
	* test/.gitignore: Remove many_looping_threads.
	* test/Makefile (PROGS): Likewise.
	(many_looping_threads): Remove.
	* tests/looping_threads.c: New file.
	* tests/looping_threads.test: New test.
	* tests/.gitignore: Add looping_threads.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(looping_threads_LDADD): New variable.
	(MISC_TESTS, XFAIL_TESTS): Add looping_threads.test.

2019-03-06  Dmitry V. Levin  <ldv@altlinux.org>

	Bump SYS_socket_subcall from 400 to 500.
	Make room for syscalls that are going to be introduced in Linux 5.1.

	* linux/i386/syscallent.h (SYS_socket_subcall): Raise from 400 to 500.
	* linux/m68k/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/mips/syscallent-o32.h (SYS_socket_subcall): Raise from 4400
	to 4500.
	* linux/mips/syscallent-n64.h (SYS_socket_subcall): Raise from 5400
	to 5500.
	* linux/mips/syscallent-n32.h (SYS_socket_subcall): Raise from 6400
	to 6500.

2019-03-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check tracing of orphaned process group.
	* tests/orphaned_process_group.c: New file.
	* tests/.gitignore: Add orphaned_process_group.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	* tests/gen_tests.in (orphaned_process_group): New test.

2019-03-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: move PTRACE_SEIZE check to a separate file.
	The check is going to be used by another test soon.

	* tests/PTRACE_SEIZE.sh: New file.
	* tests/detach-stopped.test: Use it.
	* tests/Makefile.am (EXTRA_DIST): Add PTRACE_SEIZE.sh.

2019-02-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.c: fix up formatting after commit v4.24~48.
	The commit v4.24~48 "Implement -e kvm= option on all architectures",
	while removing #ifdef, left formatting of the help message string a bit
	inconsistent.

	* strace.c (usage): Move "\n\" bit after "kvm", remove double quotes.

	Complements: v4.24~48 "Implement -e kvm= option on all architectures"

2019-02-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: fix xgetrlimit output when syscall returns an error.
	* tests/xgetrlimit.c (main): Expect pointer to rlimit as the second
	argument when syscall returns an error.  Use sprintrc().

	strace.c: pass signal number to cleanup()
	* strace.c (die): Pass 0 as an argument to cleanup().
	(cleanup): Add fatal_sig parameter, remove the local variable
	of the same name, do not use interrupted.
	(terminate): Initialise a new local variable "sig" with "interrupted",
	pass it to cleanup() and use it instead of "interrupted" for exit_code
	initialisation.

2019-02-25  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v5.0.
	* linux/32/ioctls_inc_align16.h: Update from linux v5.0-rc8
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/aarch64/ioctls_arch0.h: Likewise.
	* linux/arm/ioctls_arch0.h: Likewise.
	* linux/mips/ioctls_arch0.h: Likewise.
	* linux/powerpc/ioctls_arch0.h: Likewise.
	* linux/s390/ioctls_arch0.h: Likewise.
	* linux/s390x/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

	maint: update for linux 5.0-rc8.
	* maint/ioctls_sym.sh (x86_list): Add KVM_GET_SUPPORTED_HV_CPUID.

2019-02-24  Dmitry V. Levin  <ldv@altlinux.org>

	xlat/gen.sh: disable file name globbing by default.
	As the script uses file name globbing only in one place,
	disable it by default and enable it when necessary.

	* xlat/gen.sh: Add -f to shebang.
	(main): Enable file name globbing to generate the list of input files.

2019-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat/gen.sh: speedup, part 5.
	* xlat/gen.sh (gen_header): Process xlat line with sed only when "/*"
	substring is present in it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat/gen.sh: speedup, part 4.
	* xlat/gen.sh (cond_xlat): Use read instead of sed for xlat entry
	parsing.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat/gen.sh: speedup, part 3.
	* xlat/gen.sh (cond_def): Use parameter substitution instead of sed
	for xlat line parsing.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat/gen.sh: speedup, part 2.
	* xlat/gen.sh (gen_header): Use "grep -q" instead of "grep > /dev/null".

	xlat/gen.sh: speedup, part 1.
	* xlat/gen.sh (cond_def, cond_xlat): Use printf builtin instead of cat.

	xlat/gen.sh: cleanup.
	* xlat/gen.sh: Export LC_ALL=C so it could be omitted from individual
	invocations.
	(cond_def): Remove LC_ALL=C from sed invocation.
	(gen_header): Remove LC_COLLATE=C.

2019-02-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Makefile.am: pass D variable to shell scripts' environment.
	And set -x if D is set to 1, so the commands called by various shell scripts
	are easier to see during debugging.

	* Makefile.am (bpf_attr_check.c, sen.h, mpers-m%.stamp, $(srcdir)/CREDITS): Pass
	D variable in the environment to the shell script call.
	* gen_bpf_attr_check.sh: Set -x if D is set to 1.
	* generate_mpers_am.sh: Likewise.
	* generate_sen.sh: Likewise.
	* maint/gen-contributors-list.sh: Likewise.
	* mpers.sh: Likewise.
	* mpers_test.sh: Likewise.

2019-02-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add checks for dumpstr output into read-write test.
	util.c:dumpstr() now aligns offsets in accordance with the total length
	of the dump and also may perform only partial dump, so let's add checks
	for these cases.

	* tests/fill_memory.c (fill_memory_ex): Change the type of the period
	argument from unsigned char to unsigned int.
	* tests/tests.h (fill_memory_ex): Likewise.
	* tests/read-write.c (dump_str_ex): Rename from dump_str, add idx_w
	argument, support len greater than 240 bytes.
	(dump_str): New function, wrapper for dump_str_ex with the default index
	width.
	(print_hex): Add checks for dumpstr output, close fd 1 later.

2019-02-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: update dumpstr.
	Use a buffer of a limited size, use proper type for dump amount, avoid
	hard-coding of byte counts, calculate output buffer size more accurately
	and minimise its rewriting, pad offset with zeros in accordance
	with expected output amount.

	* defs.h (dumpstr): Change the type of len argument from int to
	kernel_ulong_t.
	* macros.h (ROUNDUP_DIV): New macro.
	(ROUNDUP): Rewrite using ROUNDUP_DIV.
	* util.c (ILOG2_ITER_): New macro.
	(ilog2_64, ilog2_32): New functions.
	(ilog2_klong): New macro, wrapper around ilog2_32/ilog2_64, so (potentially
	more expensive) ilog2_64 is not used for ilog2 calculation
	of a kernel_ulong_t-typed variable on architectures with 32-bit kernel long.
	(dumpstr): Update.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-02-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Generalise UUID printing.
	It was open-coded (using yet another open-coded hexadecimal character
	printing) in btrfs.c and can be used in other places (like dm.c or
	rtnl_link.c).

	* defs.h (print_uuid): New declaration.
	* print_fields.h (PRINT_FIELD_UUID): New macro.
	* util.c (print_uuid): New function.
	* btrfs.c (prnibble, UUID_STRING_SIZE, btrfs_unparse_uuid): Remove.
	(btrfs_ioctl): Use PRINT_FIELD_UUID for UUID printing.

2019-02-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Generalise some printing primitives.
	Character class checks and hexadecimal number formatting are open-coded
	all over the place, let's try to de-duplicate them a bit.

	* print_utils.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* util.c: Include "print_utils.h".
	(string_quote, dumpstr): Use sprint_byte_hex and is_print.
	* v4l2.c: Include "print_utils.h".
	(print_pixelformat): Use is_print and BYTE_HEX_CHARS_PRINTF_QUOTED,
	add a note that the routine is rather generic.

2019-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Move call_summary() from cleanup() to terminate()
	cleanup() has exactly two call sites, die() and terminate(), and the
	first one resets cflag in order to prevent call_summary() invocation.
	Move the call to terminate() in order to avoid bogus cflag reset.

	* strace.c (die): Remove cflag reset.
	(cleanup): Move call_summary() call ...
	(terminate): ... here.

2019-02-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs.h: define stack_trace_enabled to 0 is stack tracing is not enabled.
	This allows avoiding ifdefs sometimes.

	* defs.h [!ENABLE_STACKTRACE] (stack_trace_enabled): Define as 0.
	* strace.c (init): Remove #ifdef ENABLE_STACKTRACE around -c/-k check.

2019-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	build: fix --with-libiberty.
	* m4/st_demangle.m4 (st_DEMANGLE): Move the check for cplus_demangle
	out of AC_CHECK_HEADERS because the latter checks for demangle.h in two
	different places and an absence of demangle.h in one of these places
	would cause a build error in --with-libiberty=yes mode.
	* NEWS: Mention this fix.

	Resolves: https://github.com/strace/strace/issues/92

2019-02-18  Shankara Pailoor  <shankarapailoor@gmail.com>

	Honor xlat styles when decoding ioprio_get and ioprio_set.
	* ioprio.c (SYS_FUNC(ioprio_get), SYS_FUNC(ioprio_set)): Add xlat_style
	support.
	* tests/ioprio-Xabbrev.c: New file.
	* tests/ioprio-Xraw.c: Likewise.
	* tests/ioprio-Xverbose.c: Likewise.
	* tests/ioprio.c: Handle XLAT_RAW, XLAT_ABBREV, and XLAT_VERBOSE macros.
	* tests/gen_tests.in (ioprio-Xabbrev, ioprio-Xraw, ioprio-Xverbose): New
	tests.
	* tests/pure_executables.list: Add ioprio-Xabbrev, ioprio-Xraw, and
	ioprio-Xverbose.
	* tests/.gitignore: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-02-18  Shankara Pailoor  <shankarapailoor@gmail.com>

	move_pages: honor xlat styles.
	* numa.c (print_status): Add xlat_style support for status argument.
	* tests/move_pages-Xabbrev.c: New file.
	* tests/move_pages-Xraw.c: Likewise.
	* tests/move_pages-Xverbose.c: Likewise.
	* tests/move_pages.c: Handle XLAT_RAW, XLAT_ABBREV, and XLAT_VERBOSE
	macros.
	* tests/gen_tests.in (move_pages-Xabbrev, move_pages-Xraw,
	move_pages-Xverbose): New tests.
	* tests/pure_executables.list: Add move_pages-Xabbrev, move_pages-Xraw,
	and move_pages-Xverbose.
	* tests/.gitignore: Likewise.

2019-02-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify threads-execve test against the odds.
	Give threads-execve.test more chances to succeed.

	* tests/threads-execve.test: Retry the test until run out of time.

2019-02-17  Shankara Pailoor  <shankarapailoor@gmail.com>

	Honor xlat styles when decoding resource limits.
	* resource.c (sprint_rlim64, sprint_rlim32): Remove.
	(print_rlim64_t, print_rlim32_t): New functions.
	(print_rlimit64, print_rlimit32): Use them.
	* tests/setrlimit-Xabbrev.c: New file.
	* tests/setrlimit-Xraw.c: Likewise.
	* tests/setrlimit-Xverbose.c: Likewise.
	* tests/setrlimit.c (main): Handle XLAT_ABBREV, XLAT_RAW,
	and XLAT_VERBOSE macros.
	* tests/xgetrlimit.c (sprint_rlim): Likewise.
	* tests/gen_tests.in (setrlimit-Xabbrev, setrlimit-Xraw,
	setrlimit-Xverbose): New tests.
	* tests/pure_executables.list: Add setrlimit-Xabbrev, setrlimit-Xraw,
	and setrlimit-Xverbose.
	* tests/.gitignore: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-02-17  Dmitry V. Levin  <ldv@altlinux.org>

	hppa: workaround kernel bug in syscall number tampering.
	Linux kernel commit v4.6-rc2~20^2 introduced a regression:
	when tracer changes syscall number to -1, the kernel fails
	to initialize %r28 with -ENOSYS and subsequently fails
	to return the error code of the failed syscall to userspace.
	Workaround this by initializing %r28 ourselves.

	* linux/arch_defs_.h (ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING): Define
	to 0.
	* linux/hppa/arch_defs_.h (ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING):
	Define to 1.
	* syscall.c (tamper_with_syscall_entering)
	[ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING]: When changing syscall number
	to -1, set the return value as well.

2019-02-16  Dmitry V. Levin  <ldv@altlinux.org>

	hppa: define PT_* constants as offsets inside struct pt_regs.
	Define constants passed to upeek and upoke using a method that works
	with different wordsize values.

	* linux/hppa/arch_regs.c (PT_GR26, PT_GR30, PT_IAOQ0, PT_IAOQ1): Remove.
	(PT_GR20, PT_GR28, ARCH_PC_PEEK_ADDR, ARCH_SP_PEEK_ADDR): Redefine using
	offsets inside struct pt_regs.
	* linux/hppa/get_syscall_args.c (arch_get_syscall_args): Replace PT_GR26
	with offsets inside struct pt_regs.

2019-02-16  Dmitry V. Levin  <ldv@altlinux.org>

	hppa: enhance decoding of PTRACE_PEEKUSER and PTRACE_POKEUSER.
	Print symbolic constants corresponding to numeric arguments
	of PTRACE_PEEKUSER and PTRACE_POKEUSER requests.

	* linux/hppa/userent.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* NEWS: Mention this.

2019-02-15  Dmitry V. Levin  <ldv@altlinux.org>

	mips o32: fix 7th syscall argument with PTRACE_GET_SYSCALL_INFO API.
	As PTRACE_GET_SYSCALL_INFO API supports 6 syscall arguments,
	all architectures that have syscalls with more than 6 arguments
	(i.e. mips o32) have to fetch extra arguments manually when using
	PTRACE_GET_SYSCALL_INFO API.

	* linux/mips/get_syscall_args.c [LINUX_MIPSO32]
	(arch_get_syscall_args_extra): New function.
	* syscall.c (get_syscall_args) [MAX_ARGS > 6]: Use it.

	Fixes: v4.26~49 "Introduce PTRACE_GET_SYSCALL_INFO support"

2019-02-15  Dmitry V. Levin  <ldv@altlinux.org>

	mips: update comment.
	* linux/mips/get_syscall_args.c (decode_syscall_subcall): Update comment.

	Complements: v4.26-27-g2c8b6de91 "mips o32: fix build"

2019-02-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add kill_child test.
	This tests repeatedly creates and kills children, so some corner
	cases in handling of not-quite-existing processes can be observed.

	Previously, strace was crashing in the following situation:

	    13994 ????( <unfinished ...>
	    ...
	    13994 <... ???? resumed>) = ?

	as tcp->s_ent wasn't initialised on syscall entering and
	strace.c:print_event_exit segfaulted when tried to access
	tcp->s_ent->sys_name.

	* tests/kill_child.c: New file.
	* tests/kill_child.test: New test.
	* tests/.gitignore: Add kill_child.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add kill_child.test.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-02-11  Dmitry V. Levin  <ldv@altlinux.org>

	Wire up kexec_file_load syscall on architectures that use generic unistd.h
	* linux/32/syscallent.h [294]: Wire up kexec_file_load syscall
	introduced by linux commit v5.0-rc1~35^2~41^2~15.
	* linux/64/syscallent.h [294]: Likewise.
	* NEWS: Mention this.

	Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1676045

2019-02-11  Dmitry V. Levin  <ldv@altlinux.org>

	Wire up rseq syscall on architectures that use generic unistd.h.
	* linux/32/syscallent.h [293]: Wire up rseq syscall introduced by linux
	commit v4.19-rc1~109^2~47.
	* linux/64/syscallent.h [293]: Likewise.
	* NEWS: Mention this.

2019-02-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify preadv2-pwritev2 test against odd kernels.
	The test used to assume that either both preadv2 and pwritev2 syscalls
	are implemented or both are not implemented, but, apparently, there are
	kernels in the wild that implement just preadv2 syscall without
	pwritev2.

	* tests/preadv2-pwritev2.c (main): Skip the dumpio part of the test
	if either preadv2 or pwritev2 syscall is not implemented.

	Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1668750

2019-02-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ptrace_restart: do not print diagnostics when ptrace returns ESRCH.
	After some discussion, it was decided that the situation
	when the tracee is gone does not worth reporting.

	* strace.c (ptrace_restart): Return early if ptrace returned ESRCH.

	Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1662936

2019-02-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ptrace_restart: use xlat-based approach for printing ptrace requests.
	* defs.h (ptrace_cmds): New prototype.
	* strace.c (ptrace_op_str): New function.
	(ptrace_restart): Use it.

2019-02-10  Dmitry V. Levin  <ldv@altlinux.org>

	Fix whitespace issues.
	* Makefile.am (strace_SOURCES, EXTRA_DIST): Replace SPACE symbol followed
	by TAB symbol with TAB symbol.
	* kvm.c (is_map_for_file): Likewise.
	* tests/gen_tests.in (ioctl_ptp, printsignal-Xverbose): Likewise.
	* xlat/skf_ad.in: Likewise.

2019-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Make inline message on failed restart attempt more verbose.
	Hopefully, now it is less confusing.

	* strace.c (ptrace_restart): Provide intent and pid in the inline error
	message.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1662936

2019-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall.c: set MEMORY_MAPPING_CHANGE in stub sysent.
	As unknown syscalls may incur unknown side effects.

	* syscall.c (stub_sysent): Set sys_flags to MEMORY_MAPPING_CHANGE.

2019-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Use accessors for tcp->s_ent, return a stub struct if it is NULL.
	Since code paths are non-trivial, it's an attempt to future-proof
	and prevent improper access of tcp->s_ent fields.

	* defs.h (struct tcb): Update the description of s_ent field.
	(stub_sysent): New declaration.
	(tcp_sysent, n_args): New macro functions.
	(indirect_ipccall): Use tcp_sysent() instead of tcp->s_ent.
	* ipc.c (SYS_FUNC(ipc)): Use n_args() instead of tcp->s_ent->nargs.
	* linux/alpha/get_syscall_args.c (get_syscall_args): Likewise.
	* linux/bfin/get_syscall_args.c (get_syscall_args): Likewise.
	* linux/hppa/get_syscall_args.c (get_syscall_args): Likewise.
	* linux/ia64/get_syscall_args.c (get_syscall_args): Likewise.
	* linux/microblaze/get_syscall_args.c (get_syscall_args): Likewise.
	* linux/mips/get_syscall_args.c (get_syscall_args): Likewise.
	* linux/sh/get_syscall_args.c (get_syscall_args): Likewise.
	* linux/sh64/get_syscall_args.c (get_syscall_args): Likewise.
	* linux/x86_64/get_syscall_args.c (get_syscall_args): Likewise.
	* linux/xtensa/get_syscall_args.c (get_syscall_args): Likewise.
	* prctl.c (print_prctl_args): Likewise.
	* signal.c (SYS_FUNC(sgetmask)): Likewise.
	* util.c (printargs, printargs_u, printargs_d): Likewise.
	* syscall.c (decode_ipc_subcall, decode_syscall_subcall: Likewise.
	(dumpio, tamper_with_syscall_exiting, syscall_entering_decode,
	syscall_entering_decode, syscall_entering_trace, syscall_entering_trace,
	syscall_exiting_decode, print_syscall_resume, syscall_exiting_trace,
	get_syscall_result): Use tcp_sysent() instead of tcp->s_ent.
	(stub_sysent): New stub sysent.
	(get_scno): Reset scno, s_ent, qual_flg; initialise s->ent from
	stub_sysent.
	* pathtrace.c (pathtrace_match_set): Use tcp_sysent() instead of
	tcp->s_ent.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall.c: remove arch check for SEN_execv usage.
	SEN_* declarations are always present and can be used regardless
	of architecture.

	* syscall.c (syscall_entering_trace): Remove "#if defined SPARC ||
	defined SPARC64" guard.

2019-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Merge "<... resumed>" printing.
	Apparently, it was slightly different with no apparent reason.
	Use a single routine to print this message now.

	* defs.h (print_syscall_resume): New function declaration.
	* strace.c (print_event_exit): Replace open-coding of "<... resumed>"
	message printing with a print_syscall_resume() call.
	* syscall.c (syscall_exiting_trace): Likewise.
	(print_syscall_resume): New function.
	* tests/threads-execve.c: Update expected output.

2019-01-09  Shankara Pailoor  <shankarapailoor@gmail.com>

	sockaddr: print sin6_flowinfo field before sin6_addr.
	The sin6_flowinfo field comes before sin6_addr in the sockaddr_in6
	defintion, but for some reason we switch the order when decoding.
	This patch fixes the order of decoding.

	* sockaddr.c (print_sockaddr_data_in6): Print sin6_flowinfo field
	before sin6_addr.
	* NEWS: Mention this fix.
	* tests/group_req.c (main): Update expected output.
	* tests/net-sockaddr.c (check_in6_linklocal, check_in6): Likewise.
	* tests/net-yy-inet6.c (INADDR_STR, SA_FIELDS): Likewise.
	* tests/sockaddr_xlat.c (validate_in6): Likewise.

2019-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	mips o32: fix build.
	Commit 917c2ccf3a67 "Refactor stack pointers" moved mips_REG_* macros
	from linux/mips/arch_regs.h to linux/mips/arch_regs.c because these
	macros are no longer used outside syscall.c or files included by
	syscall.c, but this caused a build regression on mips o32 because
	decode_syscall_subcall() uses mips_REG_SP prior to its definition.

	* syscall.c (decode_syscall_subcall): Move ...
	* linux/mips/get_syscall_args.c: ... here.
	* NEWS: Mention this fix.

	Reported-by: Baruch Siach <baruch@tkos.co.il>
	Fixes: v4.26~61 "Refactor stack pointers"

2019-01-08  Baruch Siach  <baruch@tkos.co.il>

	Fix build for no-MMU targets.
	Commit 7488ce9e23f1 "Check whether PTRACE_GET_SYSCALL_INFO is supported
	by the kernel" added a fork() call in test_ptrace_get_syscall_info()
	which is included in the main strace executable code.  Although the
	test_ptrace_get_syscall_info() routine is not called on no-MMU targets,
	the compiler can't optimize it out because it is a global symbol.
	So build for no-MMU targets currently fails:

	strace-ptrace_syscall_info.o: In function `test_ptrace_get_syscall_info':
	ptrace_syscall_info.c:(.text+0x1c): undefined reference to `fork'

	* ptrace_syscall_info.c (test_ptrace_get_syscall_info): Make
	the definition depend on HAVE_FORK.
	* strace.c (init): Call test_ptrace_get_syscall_info unconditionally.
	* NEWS: Mention this fix.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
	Fixes: v4.26~50 "Check whether PTRACE_GET_SYSCALL_INFO is supported by the kernel"

2019-01-08  Baruch Siach  <baruch@tkos.co.il>

	linux/mips/.gitignore: drop copyright header.
	The '/*' in the first line of the copyright header matches all files in
	that directory.  No other .gitignore file has this header.  Drop it.

	* linux/mips/.gitignore: Remove copyright header.

	Fixes: v4.26~23 "Add copyright headers to some files that lack them"

2019-01-08  Shankara Pailoor  <shankarapailoor@gmail.com>

	Honor xlat styles when decoding sockaddr_in, sockaddr_in6, and sockaddr_ll
	* print_fields.h (PRINT_FIELD_NET_PORT): Handle xlat styles.
	* sockaddr.c (print_sll_protocol): New function.
	(print_sockaddr_data_ll, print_inet_addr, print_sockaddr_data_in6):
	Handle xlat styles.
	* NEWS: Mention this.
	* tests/sockaddr_xlat.c: New file.
	* tests/sockaddr_xlat-Xabbrev.c: Likewise.
	* tests/sockaddr_xlat-Xraw.c: Likewise.
	* tests/sockaddr_xlat-Xverbose.c: Likewise.
	* tests/Makefile.am (EXTRA_DIST): Add sockaddr_xlat.c.
	* tests/gen_tests.in (sockaddr_xlat-Xabbrev, sockaddr_xlat-Xraw,
	sockaddr_xlat-Xverbose): New tests.
	* tests/pure_executables.list: Add sockaddr_xlat-Xabbrev,
	sockaddr_xlat-Xraw, and sockaddr_xlat-Xverbose.
	* tests/.gitignore: Likewise.

2019-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	Remove PRINT_FIELD_INET4_ADDR.
	Reduce code duplication by removing PRINT_FIELD_INET4_ADDR
	and using PRINT_FIELD_INET_ADDR instead.

	* print_fields.h (PRINT_FIELD_INET4_ADDR): Remove.
	* msghdr.c (print_cmsg_ip_pktinfo): Use PRINT_FIELD_INET_ADDR
	instead of PRINT_FIELD_INET4_ADDR.
	* net.c (print_mreq): Likewise.
	* sockaddr.c (print_sockaddr_data_in): Likewise.

2019-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update REL_* constants.
	* xlat/evdev_relative_axes.in (REL_HWHEEL_HI_RES): New constant
	introduced by Linux kernel commit v5.0-rc1~18^2^7~7.
	* NEWS: Mention this.

	xlat: update UDP_* constants.
	* xlat/sock_udp_options.in (UDP_GRO): New constant introduced
	by Linux kernel commit v5.0-rc1~129^2~379^2~8.
	* NEWS: Mention this.

	xlat: update FAN_* constants.
	* xlat/fan_event_flags.in (FAN_OPEN_EXEC, FAN_OPEN_EXEC_PERM): New
	constants introduced by Linux kernel commits v5.0-rc1~124^2~5
	and v5.0-rc1~124^2~3, respectively.
	* NEWS: Mention this.
	* tests/fanotify_mark.c (main): Update expected output.

	xlat: update SCTP_* constants.
	* xlat/sock_sctp_options.in (SCTP_EVENT): New constant introduced
	by Linux kernel commit v5.0-rc1~129^2~255^2.
	* NEWS: Mention this.

	xlat: update IFLA_* constants.
	* xlat/rtnl_ifla_info_data_bridge_attrs.in (IFLA_BR_MULTI_BOOLOPT): New
	constant introduced by Linux kernel commit v5.0-rc1~129^2~207^2~2.
	* NEWS: Mention this.
	* tests/nlattr_ifla_linkinfo.c (main): Update.

	xlat: update NETNSA_* constants.
	* xlat/rtnl_nsid_attrs.in (NETNSA_TARGET_NSID, NETNSA_CURRENT_NSID): New
	constants introduced by Linux kernel commits v5.0-rc1~129^2~201^2~2
	and v5.0-rc1~129^2~201^2, respectively.
	* rtnl_nsid.c (rtgenmsg_nla_decoders): Add NETNSA_TARGET_NSID
	and NETNSA_CURRENT_NSID.
	* NEWS: Mention this.

	xlat: update SECCOMP_* constants.
	* xlat/seccomp_ops.in (SECCOMP_GET_NOTIF_SIZES): New constant introduced
	by Linux kernel commit v5.0-rc1~66^2~1^2~1.
	* xlat/seccomp_ret_action.in (SECCOMP_RET_USER_NOTIF): Likewise.
	* xlat/seccomp_filter_flags.in (SECCOMP_FILTER_FLAG_NEW_LISTENER):
	Likewise.
	* NEWS: Mention this.
	* tests/seccomp-filter.c (main): Update expected output.
	* tests/seccomp-filter-v.c (main): Likewise.
	* tests/seccomp_get_action_avail.c (main): Check SECCOMP_RET_USER_NOTIF.

	xlat: update NT_* constants.
	* xlat/nt_descriptor_types.in (NT_ARM_PAC_MASK, NT_MIPS_MSA): New
	constants introduced by Linux kernel commits v5.0-rc1~35^2~21
	and v5.0-rc1~30^2~58, respectively.
	* NEWS: Mention this.

	xlat: update PR_* constants.
	* xlat/prctl_options.in (PR_PAC_RESET_KEYS): New constant introduced
	by Linux kernel commit v5.0-rc1~35^2~19.
	* NEWS: Mention this.

	xlat: update V4L2_* constants.
	* xlat/v4l2_buf_types.in (V4L2_BUF_TYPE_META_OUTPUT): New constant
	introduced by Linux kernel commit v5.0-rc1~181^2~21.
	* xlat/v4l2_device_capabilities_flags.in (V4L2_CAP_META_OUTPUT):
	Likewise.
	* xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_CNF4): New constant introduced
	by Linux kernel commit v5.0-rc1~182^2~120.
	* NEWS: Mention this.

	xlat: update KVM_CAP_* constants.
	* xlat/kvm_cap.in (KVM_CAP_MANUAL_DIRTY_LOG_PROTECT,
	KVM_CAP_HYPERV_CPUID): New constants introduced by Linux kernel commits
	v5.0-rc1~156^2~115 and v5.0-rc1~156^2~74, respectively.
	* NEWS: Mention this.

	xlat: update NDA_* constants.
	* xlat/rtnl_neigh_attrs.in (NDA_PROTOCOL): New constant introduced
	by Linux kernel commit v5.0-rc1~129^2~79.
	* rtnl_neigh.c (ndmsg_nla_decoders): Add NDA_PROTOCOL.
	* NEWS: Mention this.

	xlat: update BTRFS_FEATURE_INCOMPAT_* constants.
	* xlat/btrfs_features_incompat.in
	(BTRFS_FEATURE_INCOMPAT_METADATA_UUID): New constant introduced by Linux
	kernel commit v5.0-rc1~126^2~64.
	* NEWS: Mention this.

	xlat: update *_MAGIC constants.
	* xlat/fsmagic.in (BINDERFS_SUPER_MAGIC): New constant introduced
	by Linux kernel commit v5.0-rc1~95^2~15.
	* NEWS: Mention this.

	xlat: update KERN_* constants.
	* xlat/sysctl_kern.in (KERN_PANIC_ON_WARN, KERN_PANIC_PRINT): New
	constants introduced by Linux kernel commits v3.19-rc1~135^2~91
	and v5.0-rc1~38^2~16, respectively.
	* configure.ac (AC_CHECK_DECLS): Add them.
	* NEWS: Mention this.

	xlat: update BPF_F_* constants.
	* xlat/bpf_map_flags.in (BPF_F_ZERO_SEED): New constant introduced
	by Linux kernel commit v5.0-rc1~129^2~114^2~18^2~3.
	* xlat/bpf_prog_flags.in (BPF_F_ANY_ALIGNMENT): New constant introduced
	by Linux kernel commit v5.0-rc1~129^2~209^2~17^2~3.
	* NEWS: Mention this.
	* tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks,
	print_BPF_PROG_LOAD_attr3, print_BPF_PROG_LOAD_attr4): Update.

2019-01-05  Martin Lau  <kafai@fb.com>

	tests: fix prog_info initialization in bpf-obj_get_info_by_fd-prog*
	The sys_bpf(BPF_OBJ_GET_INFO_BY_FD, &bpf_prog_get_info_attr, ...) is
	called in a loop.  The bpf_prog_get_info_attr.info object is in size 104
	but bpf_prog_get_info_attr.info_len is in size 168.  Hence, if the prog
	is jited, the second iteration onwards will have nr_jited_ksyms == 1
	which is asking the kernel to fill the
	bpf_prog_get_info_attr.info.jited_ksyms and it is NULL.

	* tests/bpf-obj_get_info_by_fd.c (main): Clear memory beyond prog_info
	at the start of every iteration.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use tail_alloc instead of calloc in bpf-obj_get_info_by_fd-prog*
	This guarantees that map_info and prog_info objects are not accessed
	out of bounds.

	* tests/bpf-obj_get_info_by_fd.c: Include <string.h>.
	(main): Use tail_alloc instead of calloc for map_info and prog_info.

2019-01-02  Dmitry V. Levin  <ldv@altlinux.org>

	Bring lists back to the sorted order.
	* .gitignore: Make the list sorted again.
	* Makefile.am (strace_SOURCES): Likewise.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in: Likewise.
	* tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, EXTRA_DIST):
	Likewise.

2019-01-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix strace-k.test on alpha.
	Change strace-k.test to use chdir syscall instead of getpid syscall
	because the latter is not universally available, e.g. there is no getpid
	syscall on alpha.

	* tests/stack-fcall-3.c (f3) <default>: Replace getpid with chdir.
	* tests/strace-k.test: Likewise.
	* tests/strace-k.expected: Likewise.
	* tests/strace-k-demangle.expected: Likewise.
	* NEWS: Mention this.

2018-12-30  Dmitry V. Levin  <ldv@altlinux.org>

	Fix preprocessor indentation.
	Indent the C preprocessor directives to reflect their nesting
	using the following script:

	$ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do
		cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
	done

2018-12-30  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.26-1.
	* strace.spec.in: Likewise.

2018-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.26 release.
	* NEWS: Update for 4.26 release.

	strace.spec.in: add a comment about the license.

2018-12-26  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v4.20.
	* linux/32/ioctls_inc_align16.h: Update from linux v4.20
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/mips/ioctls_arch0.h: Likewise.
	* linux/powerpc/ioctls_arch0.h: Likewise.
	* linux/s390/ioctls_arch0.h: Likewise.
	* linux/s390x/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

	maint: update for linux 4.20.
	* maint/ioctls_sym.sh: Include linux/compiler_attributes.h in every
	processed file.
	Use asm/ioctls.h workaround for asm-generic/ioctls.h too.

2018-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update BPF_* constants.
	* xlat/bpf_map_types.in (BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE): New
	constant introduced by Linux kernel commit v4.20-rc1~14^2~124^2~12^2~7.
	(BPF_MAP_TYPE_QUEUE, BPF_MAP_TYPE_STACK): New constants introduced
	by Linux kernel commit v4.20-rc1~151^2~32^2~11^2~3.
	* xlat/bpf_commands.in (BPF_MAP_LOOKUP_AND_DELETE_ELEM): New constant
	introduced by Linux kernel commit v4.20-rc1~151^2~32^2~11^2~2.
	* tests/bpf.c (BPF_MAP_CREATE_checks): Update.

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add PR_SPEC_INDIRECT_BRANCH to pr_spec_cmds.
	* xlat/pr_spec_cmds.in (PR_SPEC_INDIRECT_BRANCH): New constant,
	introduced by Linux commit v4.20-rc5~4^2~3.
	* prctl.c (SYS_FUNC(prctl)) <case PR_GET_SPECULATION_CTRL, case
	PR_SET_SPECULATION_CTRL>: Add PR_SPEC_INDIRECT_BRANCH handling.
	* tests/prctl-spec-inject.c (main): Add PR_SPEC_INDIRECT_BRANCH decoding
	checks, update expected output.
	* NEWS: Mention this.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update V4L2_CID_* and V4L2_PIX_FMT_* constants.
	* xlat/v4l2_control_ids.in (V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS,
	V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION): New constants, introduced
	by Linux commit v4.20-rc1~51^2~4.
	* xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_MPEG2_SLICE): Likewise.
	(V4L2_PIX_FMT_SUNXI_TILED_NV12): New constant, introduced by Linux
	commit v4.20-rc1~51^2~3.
	* NEWS: Mention this.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add ABS_RESERVED to evdev_abs.
	* xlat/evdev_abs.in (ABS_RESERVED): New constant, introduced by Linux
	commit v4.20-rc1~133^2~2^2.
	* NEWS: Mention this.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add REL_RESERVED and REL_WHEEL_HI_RES to evdev_relative_axes.
	* xlat/evdev_relative_axes.in (REL_RESERVED): New constant, introduced
	by Linux commit v4.20-rc1~133^2~2^2.
	(REL_WHEEL_HI_RES): New constant, introduced by Linux commit
	v4.20-rc1~133^2~2^2~6 and updated by Linux commit v4.20-rc1~133^2~2^2.
	* NEWS: Mention this.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update kvm_cap.
	* xlat/kvm_cap.in (KVM_CAP_NESTED_STATE): New constant, introduced
	by Linux commit v4.19-rc1~87^2~62.
	(KVM_CAP_ARM_INJECT_SERROR_ESR): New constant, introduced by Linux
	commit v4.19-rc1~55^2~12^2~14, merged with its final value
	in v4.19-rc1~55^2~12.
	(KVM_CAP_MSR_PLATFORM_INFO): New constant, introduced by Linux commit
	v4.19-rc5~8^2~2.
	(KVM_CAP_PPC_NESTED_HV): New constant, introduced by Linux commit
	v4.20-rc1~113^2~107^2~1.
	(KVM_CAP_HYPERV_SEND_IPI): New constant, introduced by Linux commit
	v4.20-rc1~113^2~72.
	KVM_CAP_COALESCED_PIO): New constant, introduced by Linux commit
	v4.20-rc1~113^2~31.
	(KVM_CAP_HYPERV_ENLIGHTENED_VMCS): New constant, introduced by Linux
	commit v4.20-rc1~113^2~25.
	(KVM_CAP_EXCEPTION_PAYLOAD): New constant, introduced by Linux commit
	v4.20-rc1~113^2~8.
	(KVM_CAP_ARM_VM_IPA_SIZE): New constant, introduced by Linux commit
	v4.20-rc1~113^2~5^2~8 and updated by Linux commit
	v4.20-rc1~113^2~5.
	* NEWS: Mention this.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add IFA_TARGET_NETNSID to rtnl_addr_attrs.
	* xlat/rtnl_addr_attrs.in (IFA_TARGET_NETNSID): New constant, introduced
	by Linux commit v4.20-rc1~14^2~428^2~7.
	* NEWS: Mention this.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update neighbor_cache_entry_flags.
	* xlat/neighbor_cache_entry_flags.in (NTF_OFFLOADED): New constant,
	introduced by Linux commit v4.13-rc1~157^2~252^2~13.
	(NTF_STICKY): New constant, introduced by Linux commit
	v4.20-rc1~14^2~392.
	(NTF_USE, NTF_SELF, NTF_MASTER, NTF_PROXY, NTF_EXT_LEARNED, NTF_ROUTER):
	Add fallback definitions.
	* NEWS: Mention this.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add flow dissector bpf program type constants.
	* xlat/bpf_attach_type.in (BPF_FLOW_DISSECTOR): New constant
	introduced by Linux commit v4.20-rc1~14^2~259^2~9^2~4.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_FLOW_DISSECTOR): Likewise.
	* NEWS: Mention this.
	* tests/bpf.c (BPF_PROG_LOAD_checks, BPF_PROG_QUERY_checks): Update.
	* tests/kernel_version.c (print_bpf_attr): Update.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_tc: add TCA_STATS_BASIC_HW.
	* xlat/rtnl_tca_stats_attrs.in (TCA_STATS_BASIC_HW): New constant,
	introduced by Linux commit v4.20-rc1~14^2~274^2~1.
	* rtnl_tc.c (tca_stats_nla_decoders): Add TCA_STATS_BASIC_HW.
	* NEWS: Mention this.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add NETLINK_DUMP_STRICT_CHK to sock_netlink_options.
	* xlat/sock_netlink_options.in (NETLINK_DUMP_STRICT_CHK): New constant,
	introduced by Linux commit v4.20-rc1~14^2~130^2~17.
	* NEWS: Mention this.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add IFLA_BR_VLAN_STATS_PER_PORT to rtnl_ifla_info_data_bridge_attrs
	* xlat/rtnl_ifla_info_data_bridge_attrs.in
	(IFLA_BR_VLAN_STATS_PER_PORT): New constant, introduced by Linux commit
	v4.20-rc1~14^2~90.
	* rtnl_link.c (ifla_info_data_bridge_nla_decoders): Add
	IFLA_BR_VLAN_STATS_PER_PORT.
	* NEWS: Mention this.
	* tests/nlattr_ifla_linkinfo.c (main): Check it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add TCP_CLOSE to netlink_states.
	* xlat/netlink_states.in: Decode state 7 as TCP_CLOSE, since that's what
	net core sets socket's initial state to.

	xlat: add fallback definitions to setsock_ipv6_options.
	* xlat/setsock_ipv6_options.in: Add fallback definitions.

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add SOL_CAN_* to socketlayers.
	* xlat/socketlayers.in (SOL_CAN_BASE): New constant, introduced by Linux
	commit v2.6.25-rc1~1162^2~1414.
	(SOL_CAN_RAW): New constant, introduced by Linux commit
	v2.6.25-rc1~1162^2~1413.
	* NEWS: Mention this.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add FAN_ENABLE_AUDIT and FAN_REPORT_TID to fan_init_flags.
	* xlat/fan_init_flags.in (FAN_ENABLE_AUDIT): New constant, introduced
	by Linux commit v4.15-rc1~130^2^2~11.
	(FAN_REPORT_TID): New constant, introduced by Linux commit
	v4.20-rc1~75^2~2.
	* NEWS: Mention this.
	* tests/fanotify_init.c (main): Update expected output.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update siginfo_codes.
	* xlat/siginfo_codes.in (SI_LWP): Remove, as it is not present on Linux.
	(SI_NOINFO): Define only on SPARC, provide fallback value.

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	loop: use XLAT_MACROS_ONLY instead of #stop.
	As the former allows controlling presence of xlat definitions
	during the inclusion and not header generation.

	* xlat/loop_cmds.in: Remove #stop.
	* loop.c: Wrap "xlat/loop_cmds.h" inclusion in XLAT_MACROS_ONLY.
	* tests/ioctl_loop.c: Likewise.

2018-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syslog: move constant definitions to xlat.
	* syslog.c (enum): Remove.
	* xlat/syslog_action_type.in: Add fallback definitions.

2018-12-24  Dmitry V. Levin  <ldv@altlinux.org>

	Add copyright headers to some files that lack them.
	We do our best to keep copyright headers up to date, yet
	git history provides better information on this subject
	and is more accurate than copyright headers.

	Update copyright headers.

	Update NEWS.

2018-12-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: consistently use CTRL-combinations.

	strace.1.in: print names of entities in bold, provide man page sections.
	* strace.1.in (.SH DESCRIPTION, .SH OPTIONS): Add man page section
	numbers.  Make mentions of strace and other entities bold.

2018-12-24  Dmitry V. Levin  <ldv@altlinux.org>

	strace.1.in: document %net.
	* strace.1.in: Mention %net as a synonym to %network.

	Complements: v4.25-21-g97c3deca5 "basic_filters: add %net as a possible designation for network syscalls"

2018-12-24  Shankara Pailoor  <shankarapailoor@gmail.com>

	quotactl: add xlat styles support.
	* quota.c (print_qcmd): New function.
	(SYS_FUNC(quotactl)): Use it to print the quotactl command.
	* tests/quotactl.c (print_dqinfo, print_dqfmt): Handle XLAT_RAW
	and XLAT_VERBOSE.
	(QUOTA_STR, QUOTA_ID_STR, QUOTA_STR_INVALID): New macros.
	(gen_quotacmd, gen_quotaid): New functions.
	(main): Use them.
	* tests/quotactl-Xabbrev.c: New file.
	* tests/quotactl-Xraw.c: Likewise.
	* tests/quotactl-Xverbose.c: Likewise.
	* tests/gen_tests.in (quotactl-Xabbrev, quotactl-Xraw,
	quotactl-Xverbose): New tests.
	* tests/pure_executables.list: Add quotactl-Xabbrev, quotactl-Xraw,
	and quotactl-Xverbose.
	* tests/.gitignore: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-24  Dmitry V. Levin  <ldv@altlinux.org>

	xlat_idx: do not issue warnings for holes in indices.
	Some xlat indices like evdev_abs have holes, avoid issuing warnings
	about them.

	* xlat.c (xlat_idx): Do not issue warnings for holes in the index.

2018-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	rtnl_link: fix off-by-one errors in indexed and sorted xlat lookups.
	* rtnl_link.c (decode_nla_tun_type, decode_ifla_xdp_attached,
	decode_ifla_inet_conf, decode_ifla_inet6_flags, decode_ifla_inet6_conf,
	decode_ifla_inet6_stats, decode_ifla_inet6_icmp6_stats,
	decode_ifla_inet6_agm): Decrement xlat size by one to account
	for XLAT_END as other users of indexed and sorted xlats do.

	Fixes: v4.25~71 "rtnl_link: decode named constants for IFLA_XDP_ATTACHED attribute value"
	Fixes: v4.23~41 "rtnl_link: decode IFLA_AF_SPEC"
	Fixes: v4.23~37 "rtnl_link: implement IFLA_INFO_DATA for tun devices"

2018-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	net: fix off-by-one error in sorted xlat lookup.
	* net.c (ax25_protocols): Decrement xlat size by one to account
	for XLAT_END as other users of sorted xlats do.

	Fixes: v4.25~28 "net: add support for AX.25 protocols and socket option names decoding"

2018-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	netlink_smc_diag: fix off-by-one error in xlat lookup.
	* netlink_smc_diag.c (decode_smc_diag_shutdown): Decrement xlat size
	by one to account for XLAT_END as other users of xlats do.

	Fixes: v4.25~54 "netlink_smc_diag: decode SMC_DIAG_SHUTDOWN attribute value"

2018-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	aio: fix off-by-one error in indexed xlat lookup.
	* aio.c (tprint_lio_opcode): Decrement xlat size by one to account
	for XLAT_END as other users of indexed xlats do.

	Fixes: v4.24~71 "aio: print IOCB_CMD_* using xlat"

2018-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	nlattr: fix off-by-one error in indexed xlat lookup.
	* nlattr.c (decode_nla_meminfo): Decrement xlat size by one
	to account for XLAT_END as other users of indexed xlats do.

	Fixes: v4.23~89 "nlattr: print index names in netlink meminfo array"

2018-12-23  Eugene Syromiatnikov  <esyr@redhat.com>

	evdev: fix off-by-one error in decode_bitset.
	* evdev.c (decode_bitset): Decrement sorted/indexed xlat's size by one
	in order to account for guarding XLAT_END, as other sorted/indexed xlat
	wrappers do.

	Fixes: v4.23~261 "evdev: support various types of xlats in decode_bitset"

2018-12-22  Dmitry V. Levin  <ldv@altlinux.org>

	strace: terminate itself if interrupted by a signal.
	* strace.c (terminate): Terminate itself if interrupted by a signal.
	* NEWS: Mention this change.
	* tests/detach-running.test: Check it.
	* tests/detach-sleeping.test: Likewise.
	* tests/detach-stopped.test: Likewise.

2018-12-17  Shankara Pailoor  <shankarapailoor@gmail.com>

	tests: check that printsignal handles xlat styles properly.
	* tests/printsignal.c: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/printsignal-Xabbrev.c: New file.
	* tests/printsignal-Xraw.c: Likewise.
	* tests/printsignal-Xverbose.c: Likewise.
	* tests/gen_tests.in (printsignal-Xabbrev, printsignal-Xraw,
	printsignal-Xverbose): New tests.
	* tests/pure_executables.list: Add printsignal-Xabbrev,
	* printsignal-Xraw, and printsignal-Xverbose.
	* tests/.gitignore: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	signal: return NULL if signal number has no string representation.
	Also return NULL if signal number is 0.

	* signal.c (signame): Return NULL if signal name has not been found.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-17  Dmitry V. Levin  <ldv@altlinux.org>

	filter_qualify: prepare for the change of signame semantics.
	* filter_qualify.c (sigstr_to_uint): Check signame return value.

2018-12-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Use sprintsigname for converting signal number to string.
	As signame is being converted to an xlookup-like function, a separate
	routine is needed in order to get string representation of signal.

	* defs.h (sprintsigname): New prototype.
	* signal.c (sprintsigname): New function.
	* strace.c (print_debug_info, print_signalled, print_stopped): Use it
	instead of signame.
	* wait.c (printstatus): Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Use printsignal instead of signame.
	As the former respects xlat styles while the latter doesn't.

	* clone.c (SYS_FUNC(clone)): Use printsignal for printing termination
	signal in printflags.
	* fcntl.c (print_fcntl) <case F_SETSIG>: Use printsignal.
	* prctl.c (SYS_FUNC(prctl)) <case PR_GET_PDEATHSIG,
	case PR_SET_PDEATHSIG>: Likewise.
	* print_sigevent.c (print_sigevent): Likewise.
	* s390.c (s390_runtime_instr): Likewise.
	* signal.c (SYS_FUNC(kill), SYS_FUNC(tgkill)): Likewise.

2018-12-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	signal: make printisgnal honor xlat style.
	* signal.c (printsignal): Respect current xlat style.

2018-12-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Always define WCOREDUMP.
	wait.c does it already, now strace.c also does.

	* wait.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* strace.c: Replace <sys/wait.h> with "wait.h".
	[!WCOREDUMP]: Remove.
	* wait.c: Replace <sys/wait.h> with "wait.h".
	[!WCOREFLAG] (WCOREFLAG), [!WCOREDUMP] (WCOREDUMP): Move to wait.h,
	rework.
	[!W_STOPCODE] (W_STOPCODE), [!W_EXITCODE] (W_EXITCODE),
	[!W_CONTINUED] (W_CONTINUED): Move to wait.h.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-17  Masatake YAMATO  <yamato@redhat.com>

	net: enhance decoding of getsockopt(SO_ERROR)
	* net.c (print_get_error): New function decoding error
	number returned as option value for SO_ERROR option.
	(print_getsockopt) <case SO_ERROR>: Call print_get_error.

	* tests/so_error.c: New test.
	* tests/gen_tests.in (so_error): Likewise.
	* tests/pure_executables.list: Add so_error.
	* tests/.gitignore: Likewise.

2018-12-17  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: do not clobber r12 for raw syscalls.
	According to
	https://sourceware.org/ml/libc-alpha/2018-12/msg00470.html
	GCC mainline now gives errors for an asm that clobbers the stack
	pointer.

	According to
	https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00932.html>
	GCC previously ignored such a clobber; thus, this patch removes it
	from the clobbers for ia64 raw syscalls.

	* linux/ia64/raw_syscall.h (raw_syscall_0): Remove "r12" from clobbers.

2018-12-17  Dmitry V. Levin  <ldv@altlinux.org>

	block: decode BLKGETZONESZ and BLKGETNRZONES ioctls.
	These ioctls were introduced by linux kernel commits v4.20-rc1~17^2~16
	and v4.20-rc1~17^2~15, respectively.

	* block.c (block_ioctl): Handle BLKGETZONESZ and BLKGETNRZONES.
	* xlat/block_ioctl_cmds.in (BLKGETZONESZ, BLKGETNRZONES): New entries.

2018-12-13  Dmitry V. Levin  <ldv@altlinux.org>

	Implement PTRACE_GET_SYSCALL_INFO decoder.
	* defs.h (audit_arch): New prototype.
	* process.c: Include "ptrace_syscall_info.h".
	(SYS_FUNC(ptrace)) <PTRACE_GET_SYSCALL_INFO>: Call
	print_ptrace_syscall_info on exiting syscall.
	* ptrace_syscall_info.h (print_ptrace_syscall_info): New prototype.
	* ptrace_syscall_info.c: Include "print_fields.h" and
	"xlat/ptrace_syscall_info_op.h".
	(print_ptrace_syscall_info): New function.
	* xlat/ptrace_syscall_info_op.in: New file.
	* tests/ptrace_syscall_info.c: New file.
	* tests/gen_tests.in (ptrace_syscall_info): New test.
	* tests/pure_executables.list: Add ptrace_syscall_info.
	* tests/.gitignore: Likewise.

2018-12-13  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce PTRACE_GET_SYSCALL_INFO support.
	When PTRACE_GET_SYSCALL_INFO API works,
	use it instead of traditional upeek/get_regs API.

	Tested on x86_64 and x86.

	* get_personality.c: New file.
	* get_personality.h: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* linux/aarch64/arch_get_personality.c: New file.
	* linux/powerpc64/arch_get_personality.c: Likewise.
	* linux/riscv/arch_get_personality.c: Likewise.
	* linux/s390x/arch_get_personality.c: Likewise.
	* linux/sparc64/arch_get_personality.c: Likewise.
	* linux/tile/arch_get_personality.c: Likewise.
	* linux/x32/arch_get_personality.c: Likewise.
	* linux/x86_64/arch_get_personality.c: Likewise.
	* linux/check_scno.c: Likewise.
	* linux/x32/check_scno.c: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* linux/ia64/arch_getrval2.c (getrval2): Invoke get_regs()
	if ptrace_syscall_info is in use.
	* linux/mips/arch_getrval2.c: Likewise.
	* linux/sparc/arch_getrval2.c: Likewise.
	* defs.h (get_personality_from_syscall_info): New prototype.
	* syscall.c: Include "get_personality.h" and "ptrace_syscall_info.h".
	(get_regs_error): Define unconditionally.
	(ptrace_sci): New static variable.
	(clear_regs): Reset ptrace_sci.op.
	(ptrace_syscall_info_is_valid, ptrace_get_syscall_info,
	get_syscall_regs): New functions.
	(get_syscall_result_regs): Change to get_syscall_regs.
	(get_instruction_pointer, get_stack_pointer, get_scno, get_syscall_args,
	get_error, set_error, set_success): Add ptrace_syscall_info support.
	* tests/int_0x80.test: New test.
	* tests/Makefile.am (DECODER_TESTS): Add int_0x80.test.
	(XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Remove.
	* tests/gen_tests.in (int_0x80): Remove.

2018-12-13  Dmitry V. Levin  <ldv@altlinux.org>

	Check whether PTRACE_GET_SYSCALL_INFO is supported by the kernel.
	The result of this check is going to be used by subsequent commits.

	* ptrace_syscall_info.c: New file.
	* ptrace_syscall_info.h: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* strace.c: Include "ptrace_syscall_info.h".
	(init): Call test_ptrace_get_syscall_info.

2018-12-13  Dmitry V. Levin  <ldv@altlinux.org>

	Add definitions for PTRACE_GET_SYSCALL_INFO API.
	Provide fallback definitions for PTRACE_GET_SYSCALL_INFO API.
	Add very basic PTRACE_GET_SYSCALL_INFO support in the parser
	of ptrace syscall.

	* ptrace.h: Include <stdint.h>.
	[!PTRACE_GET_SYSCALL_INFO] (PTRACE_GET_SYSCALL_INFO,
	PTRACE_SYSCALL_INFO_NONE, PTRACE_SYSCALL_INFO_ENTRY,
	PTRACE_SYSCALL_INFO_EXIT, PTRACE_SYSCALL_INFO_SECCOMP,
	struct ptrace_syscall_info): Define.
	* xlat/ptrace_cmds.in: Add PTRACE_GET_SYSCALL_INFO.
	* process.c (SYS_FUNC(ptrace)): Handle it.

2018-12-10  Dmitry V. Levin  <ldv@altlinux.org>

	Change the license of strace to LGPL-2.1-or-later.
	strace is now provided under the terms of the GNU Lesser General
	Public License version 2.1 or later, see COPYING for more details.

	strace test suite is now provided under the terms of the GNU General
	Public License version 2 or later, see tests/COPYING for more details.

2018-12-10  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change the license to GPL-2.0-or-later.
	strace test suite is now provided under the terms of the GNU General
	Public License version 2 or later, see tests/COPYING for more details.

2018-12-10  Shankara Pailoor  <shankarapailoor@gmail.com>

	bpf: honor xlat styles when printing kernel version.
	* print_kernel_version.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (print_kernel_version): New prototype.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)):
	Use print_kernel_version.
	* tests/kernel_version.c: New file.
	* tests/kernel_version-Xabbrev.c: Likewise.
	* tests/kernel_version-Xraw.c: Likewise.
	* tests/kernel_version-Xverbose.c: Likewise.
	* tests/gen_tests.in (kernel_version, kernel_version-Xabbrev,
	kernel_version-Xraw, kernel_version-Xverbose): New tests.
	* tests/pure_executables.list: Add kernel_version,
	kernel_version-Xabbrev, kernel_version-Xraw, and kernel_version-Xverbose.
	* tests/.gitignore: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-10  Shankara Pailoor  <shankarapailoor@gmail.com>

	print_dev_t: add xlat styles support.
	* print_dev_t.c (print_dev_t): Respect xlat_verbosity.
	* tests/btrfs.c (sprint_makedev): New function.
	(btrfs_print_balance_args, btrfs_test_dev_info_ioctl,
	btrfs_test_dev_replace_ioctl, btrfs_test_get_dev_stats_ioctl,
	btrfs_test_scrub_ioctls): Use it to update expected output.
	* tests/xstatx.c (print_st_mode, sprint_makedev): New functions.
	(print_stat): Use them.
	* tests/fstat-Xabbrev.c: New file.
	* tests/fstat-Xraw.c: Likewise.
	* tests/fstat-Xverbose.c: Likewise.
	* tests/fstat64-Xabbrev.c: Likewise.
	* tests/fstat64-Xraw.c: Likewise.
	* tests/fstat64-Xverbose.c: Likewise.
	* tests/gen_tests.in (fstat-Xabbrev, fstat-Xraw, fstat-Xverbose,
	fstat64-Xabbrev, fstat64-Xraw, fstat64-Xverbose): New entries.
	* tests/trace_fstat.in: Likewise.
	* tests/trace_stat_like.in: Likewise.
	* tests/pure_executables.list: Add fstat-Xabbrev, fstat-Xraw,
	fstat-Xverbose, fstat64-Xabbrev, fstat64-Xraw, and fstat64-Xverbose.
	* tests/.gitignore: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	i386, x32: use upoke() instead of set_regs()
	This brings i386 and x32 in line with x86_64
	and removes redundant HAVE_GETREGS_OLD checks.
	Besides that, use of PTRACE_GET_SYSCALL_INFO would require
	an extra get_regs() invocation before set_regs().

	* syscall.c (ARCH_MIGHT_USE_SET_REGS): Define to 1.
	[HAVE_GETREGS_OLD] (ARCH_MIGHT_USE_SET_REGS): Redefine to 0.
	(ptrace_setregset_or_setregs): Check ARCH_MIGHT_USE_SET_REGS instead
	of HAVE_GETREGS_OLD.
	* linux/i386/arch_regs.c (ARCH_MIGHT_USE_SET_REGS): Redefine to 0.
	* linux/powerpc/arch_regs.c: Likewise.
	* linux/x86_64/arch_regs.c: Likewise.
	* linux/i386/set_error.c (arch_set_error, arch_set_success)
	[!HAVE_GETREGS_OLD]: Remove.
	* linux/i386/set_scno.c (arch_set_scno) [!HAVE_GETREGS_OLD]: Remove.
	* linux/powerpc/set_error.c (arch_set_error, arch_set_success)
	[!HAVE_GETREGS_OLD]: Remove.
	* linux/powerpc/set_scno.c (arch_set_scno) [!HAVE_GETREGS_OLD]: Remove.
	* linux/x86_64/set_error.c [!HAVE_GETREGS_OLD]: Remove.
	* linux/x86_64/set_scno.c: Likewise.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	upoke: workaround crippled x32.
	As PTRACE_POKEUSER is crippled on x32 by design from the very first
	linux kernel commit v3.4-rc1~33^2~2 when it was introduced,
	workaround this by using the raw x86_64 syscall instead.

	* linux/ptrace_pokeuser.c: New file.
	* linux/x32/ptrace_pokeuser.c: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* upoke.c: Include "ptrace_pokeuser.c".
	(upoke): Use ptrace_pokeuser instead of ptrace.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	x86_64: remove some annoying pieces of unused code.
	* linux/x86_64/get_scno.c (X32_PERSONALITY_NUMBER): Remove.
	(arch_get_scno): Remove ifdefed archeological artefacts.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	Refactor tamper_with_syscall_exiting()
	Move the code than deals with updating the return and error values
	to separate functions.

	* syscall.c (set_error, set_success): New functions.
	(tamper_with_syscall_exiting): Use them.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	Refactor get_syscall_args() and get_error()
	* linux/*/get_error.c: Rename all arch-specific implementations
	of get_error() to arch_get_error().
	* linux/*/get_syscall_args.c: Rename all arch-specific implementations
	of get_syscall_args() to arch_get_syscall_args().
	* syscall.c (get_syscall_args, get_error): New functions.
	(tamper_with_syscall_exiting, get_syscall_result): Do not clear
	tcp->u_error before get_error() invocation as the latter does it now.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	Refactor stack pointers.
	Change all linux/*/arch_regs.c to provide either ARCH_SP_REG
	or ARCH_SP_PEEK_ADDR.  Introduce get_stack_pointer(), rewrite
	all code accessing stack pointers to use get_stack_pointer().
	On some architectures stack pointers were referred to as frame pointers,
	clean up this confusion.

	* defs.h (get_stack_pointer): New prototype.
	* syscall.c (get_stack_pointer): New function.
	* linux/arch_rt_sigframe.c: New file.
	* linux/aarch64/arch_regs.c (aarch64_sp_ptr, arm_sp_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/alpha/arch_regs.c: Import linux/alpha/arch_regs.h.
	(REG_FP): Rename to REG_SP.
	(ARCH_SP_PEEK_ADDR): New macro.
	* linux/alpha/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
	* linux/arc/arch_regs.c (arc_sp_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/arm/arch_regs.c (arm_sp_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/arm/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
	* linux/avr32/arch_regs.c (avr32_sp_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/bfin/arch_regs.c (ARCH_SP_PEEK_ADDR): New macro.
	* linux/hppa/arch_regs.c: Import linux/hppa/arch_regs.h.
	(PT_GR30, ARCH_SP_PEEK_ADDR): New macros.
	* linux/hppa/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
	get_stack_pointer.
	* linux/i386/arch_regs.c (i386_esp_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/i386/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
	get_stack_pointer.
	* linux/i386/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/ia64/arch_regs.c (ia64_frame_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/ia64/arch_regs.h (ia64_frame_ptr): Remove.
	* linux/ia64/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
	get_stack_pointer.
	* linux/m68k/arch_regs.c (m68k_usp_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/m68k/arch_rt_sigframe.c: Link to i386/arch_rt_sigframe.c.
	* linux/m68k/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
	* linux/metag/arch_regs.c (metag_sp_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/metag/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
	get_stack_pointer.
	* linux/microblaze/arch_regs.c (ARCH_SP_PEEK_ADDR): New macro.
	* linux/mips/arch_regs.c: Import linux/mips/arch_regs.h.
	(mips_regs): Add static qualifier.
	(ARCH_SP_REG): New macro.
	* linux/mips/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
	* linux/nios2/arch_regs.c (nios2_sp_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/or1k/arch_regs.c (or1k_sp_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/powerpc/arch_regs.c (ppc_regs): Add static qualifier.
	(ARCH_SP_REG): New macro.
	* linux/powerpc/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
	get_stack_pointer.
	* linux/powerpc/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
	* linux/powerpc64/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
	get_stack_pointer.
	* linux/riscv/arch_regs.c (riscv_sp_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/s390/arch_regs.c (s390_frame_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/s390/arch_sigreturn.c (S390_FRAME_PTR): Remove.
	(arch_sigreturn): Use get_stack_pointer.
	* linux/s390x/arch_regs.c (s390_frame_ptr, s390x_frame_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/s390x/arch_sigreturn.c (S390_FRAME_PTR): Remove.
	* linux/sh/arch_regs.c (ARCH_SP_PEEK_ADDR): New macro.
	* linux/sh64/arch_regs.c: Likewise.
	* linux/sparc/arch_regs.c: Import linux/sparc/arch_regs.h.
	(sparc_regs): Add static qualifier.
	(ARCH_SP_REG): New macro.
	* linux/sparc/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
	* linux/sparc64/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use
	get_stack_pointer.
	* linux/tile/arch_regs.c (tile_regs): Add static qualifier.
	(ARCH_SP_REG): New macro.
	* linux/tile/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer.
	* linux/x86_64/arch_regs.c (i386_esp_ptr, x86_64_rsp_ptr): Remove.
	(ARCH_SP_REG): New macro.
	* linux/x86_64/arch_regs.h (i386_esp_ptr, x86_64_rsp_ptr): Remove.
	* linux/x86_64/arch_rt_sigframe.c: Link to i386/arch_rt_sigframe.c.
	* linux/xtensa/arch_regs.c (ARCH_SP_PEEK_ADDR): New macro.
	* linux/aarch64/arch_regs.h: Remove.
	* linux/aarch64/arch_rt_sigframe.c: Remove.
	* linux/alpha/arch_regs.h: Remove.
	* linux/alpha/arch_rt_sigframe.c: Remove.
	* linux/arc/arch_regs.h: Remove.
	* linux/arc/arch_rt_sigframe.c: Remove.
	* linux/arm/arch_regs.h: Remove.
	* linux/arm/arch_rt_sigframe.c: Remove.
	* linux/avr32/arch_regs.h: Remove.
	* linux/avr32/arch_rt_sigframe.c: Remove.
	* linux/bfin/arch_rt_sigframe.c: Remove.
	* linux/hppa/arch_regs.h: Remove.
	* linux/i386/arch_regs.h: Remove.
	* linux/m68k/arch_regs.h: Remove.
	* linux/metag/arch_regs.h: Remove.
	* linux/microblaze/arch_rt_sigframe.c: Remove.
	* linux/mips/arch_regs.h: Remove.
	* linux/mips/arch_rt_sigframe.c: Remove.
	* linux/nios2/arch_regs.h: Remove.
	* linux/nios2/arch_rt_sigframe.c: Remove.
	* linux/or1k/arch_regs.h: Remove.
	* linux/or1k/arch_rt_sigframe.c: Remove.
	* linux/powerpc/arch_regs.h: Remove.
	* linux/powerpc64/arch_regs.h: Remove.
	* linux/riscv/arch_regs.h: Remove.
	* linux/riscv/arch_rt_sigframe.c: Remove.
	* linux/s390/arch_regs.h: Remove.
	* linux/s390/arch_rt_sigframe.c: Remove.
	* linux/s390x/arch_regs.h: Remove.
	* linux/s390x/arch_rt_sigframe.c: Remove.
	* linux/sh/arch_rt_sigframe.c: Remove.
	* linux/sh64/arch_rt_sigframe.c: Remove.
	* linux/sparc/arch_regs.h: Remove.
	* linux/sparc/arch_rt_sigframe.c: Remove.
	* linux/sparc64/arch_regs.h: Remove.
	* linux/tile/arch_regs.h: Remove.
	* linux/tile/arch_rt_sigframe.c: Remove.
	* linux/xtensa/arch_rt_sigframe.c: Remove.
	* Makefile.am (EXTRA_DIST): Remove them, add linux/arch_rt_sigframe.c.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	Refactor print_pc()
	Split print_pc() into arch-independent print_instruction_pointer()
	and arch-specific get_instruction_pointer().

	* print_instruction_pointer.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (print_pc): Remove.
	(get_instruction_pointer, print_instruction_pointer): New prototypes.
	* syscall.c (print_pc): Remove.
	(get_instruction_pointer): New function.
	* strace.c (printleader): Replace print_pc with
	print_instruction_pointer.

2018-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	ppc64: remove redundant redefinition.
	* linux/powerpc64/arch_regs.c (ARCH_PC_REG): Remove.

2018-12-05  Shankara Pailoor  <shankarapailoor@gmail.com>

	print_dev_t: print major and minor numbers in hex like stat(1)
	* print_dev_t.c (print_dev_t): Print major and minor numbers in hex.
	* strace.1.in: Update makedev example.
	* tests/bpf-obj_get_info_by_fd.c (main): Update expected output.
	* tests/btrfs.c (btrfs_print_balance_args, btrfs_test_scrub_ioctls,
	btrfs_test_dev_info_ioctl, btrfs_test_get_dev_stats_ioctl,
	btrfs_test_dev_replace_ioctl): Update expected output.
	* tests/ioctl_dm.c (main): Likewise.
	* tests/ioctl_loop.c (print_loop_info, print_loop_info64): Likewise.
	* tests/mknod.c (main): Likewise.
	* tests/mknodat.c (main): Likewise.
	* tests/nlattr_unix_diag_msg.c (main): Likewise.
	* tests/ustat.c (main): Likewise.
	* tests/xstatx.c (print_stat): Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-12-05  Janosch Frank  <frankja@linux.ibm.com>

	s390x: beautify sthyi data tail prints.
	The test already expects a ", " before the print of struct
	padding. Let's add it to s390.c to make the output look a bit nicer and
	fix test runs on z/VM that have padding at the end of the STHYI structs.

	* s390.c (decode_ebcdic): Add missing comma.

2018-11-27  Dmitry V. Levin  <ldv@altlinux.org>

	Stop using SIG_0.
	Number 0 is not a valid signal number, and SIG_0 is not a valid
	description for a signal.

	* linux/signalent.h: Replace SIG_0 with 0.
	* linux/alpha/signalent.h: Likewise.
	* linux/hppa/signalent.h: Likewise.
	* linux/mips/signalent.h: Likewise.
	* linux/sparc/signalent.h: Likewise.
	* filter_qualify.c (sigstr_to_uint): Start iterations with number 1.
	* tests/fcntl-common.c (test_fcntl_others): Update expected output.
	* tests/kill.c (main): Likewise.
	* tests/ptrace.c (test_peeksiginfo): Likewise.
	* tests/s390_runtime_instr.c (main): Likewise.

2018-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	mem: fix build on architectures where kernel_ulong_t is bigger than long
	* mem.c (print_mmap_flags): Fix format string.

	Fixes: v4.25-26-g0933b3086 "mem: add xlat styles support to print_mmap_flags"

2018-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add remap_file_pages test variants with different xlat verbosity levels
	* tests/remap_file_pages-Xabbrev.c: New file.
	* tests/remap_file_pages-Xraw.c: Likewise.
	* tests/remap_file_pages-Xverbose.c: Likewise.
	* tests/remap_file_pages.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
	* tests/pure_executables.list: Add remap_file_pages-Xabbrev,
	remap_file_pages-Xraw, and remap_file_pages-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (remap_file_pages-Xabbrev, remap_file_pages-Xraw,
	remap_file_pages-Xverbose): New tests.

2018-11-26  Shankara Pailoor  <shankarapailoor@gmail.com>

	mem: add xlat styles support to print_mmap_flags.
	* mem.c (print_mmap_flags): Respect xlat_verbosity.
	* tests/mmap.c (main): Update expected output.
	* tests/old_mmap.c (main): Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add memfd_create test variants with different xlat verbosity levels
	* tests/memfd_create-Xabbrev.c: New file.
	* tests/memfd_create-Xraw.c: Likewise.
	* tests/memfd_create-Xverbose.c: Likewise.
	* tests/memfd_create.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
	* tests/pure_executables.list: Add memfd_create-Xabbrev, memfd_create-Xraw,
	and memfd_create-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (memfd_create-Xabbrev, memfd_create-Xraw,
	memfd_create-Xverbose): New tests.

2018-11-26  Shankara Pailoor  <shankarapailoor@gmail.com>

	memfd_create: add xlat styles support.
	* memfd_create.c (SYS_FUNC(memfd_create)): Respect xlat_verbosity.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-11-24  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance error diagnostics when the first exec fails.
	When the first exec fails, strace used to print the trace of the child
	process till its end, producing a lot of confusing output.
	Enhance the diagnostics by hiding irrelevant parts of the trace.

	* defs.h (TCB_CHECK_EXEC_SYSCALL): New macro.  Change values of TCB_*
	macros listed after TCB_CHECK_EXEC_SYSCALL.
	(check_exec_syscall): New macro.
	* strace.c (dispatch_event) <TE_STOP_BEFORE_EXECVE>: Clear
	TCB_CHECK_EXEC_SYSCALL flag.
	* syscall.c (syscall_entering_trace): Do not clear TCB_HIDE_LOG when
	TCB_CHECK_EXEC_SYSCALL is set, set TCB_CHECK_EXEC_SYSCALL along with
	clearing TCB_HIDE_LOG.
	(syscall_exiting_decode): Set TCB_HIDE_LOG if TCB_CHECK_EXEC_SYSCALL
	is set.
	* tests/first_exec_failure.test: New file.
	* tests/Makefile.am (MISC_TESTS): Add first_exec_failure.test.

	Closes: https://github.com/strace/strace/issues/88

2018-11-24  Dmitry V. Levin  <ldv@altlinux.org>

	build: use more traditional git options.
	The support of --no-patch alias to -s option in "git diff" and related
	git commands was added in git v1.8.4.

	* copyright-year-gen: Use "git show -s" instead of "git show --no-patch".
	* file-date-gen: Use "git log -s" instead of "git log --no-patch".

	Closes: https://github.com/strace/strace/issues/80

2018-11-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	basic_filters: add %net as a possible designation for network syscalls.
	* basic_filters.c (lookup_class) <syscall_class>: Add %net as an alias
	for TRACE_NETWORK.

2018-11-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	hppa: add a comment about old name of syscall number 102.
	Also, remove empty definition.

	* linux/hppa/syscallent.h ([102]): Remove empty definition,
	add a comment that it was socketcall.

2018-11-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mips: update syscall entry for reserved221 syscall.
	The syscall number 4221 is actually called "reserved221" on mips.

	* linux/mips/syscallent-o32.h ([4221]): Set to "reserved221".

2018-11-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	arm: add a comment that __ARM_NR_cmpxchg was removed in 4.4.
	* linux/arm/syscallent.h: Add a comment about __ARM_NR_cmpxchg.

	arm: replace empty syscall entry definitions with comments.
	* linux/arm/syscallent.h ([222]): Remove definition, add a comment
	that it was tux syscall.
	([223]): Remove definition, add comment that it was unused.
	([254]): Remove definition, add comment that it was reserved
	for set_thread_area.
	([255]): Remove definition, add comment that it was reserved
	for get_thread_area.

	linux/dummy.h: remove unused sys_phys definition.
	* linux/dummy.h (sys_phys): Remove.

	numa: use already existing array item printing function.
	* numa.c (print_int): Remove.
	(SYS_FUNC(move_pages)): Use print_int32_array_member instead of
	print_int.

	net: use already existing array item printing function.
	* net.c (print_uint32): Remove.
	(print_getsockopt): Use print_uint32_array_member instead of
	print_uint32.

2018-11-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Remove HAVE_LINUX_GENETLINK_H ifdefs.
	<linux/netlink.h> is available since Linux 2.6.15 (commit
	v2.6.15-rc1~53^2).

	* configure.ac (AC_CHECK_HEADERS): Remove linux/genetlink.h.
	* socketutils.c [!HAVE_LINUX_GENETLINK_H]: Remove.
	* tests/netlink_generic.c [!HAVE_LINUX_GENETLINK_H]: Likewise.

2018-11-21  Dmitry V. Levin  <ldv@altlinux.org>

	Document -X option in strace -h output.
	* strace.c (usage): Mention -X option.

	Reported-by: Dmitry Vyukov <dvyukov@google.com>
	Complements: v4.23~308 "Add user interface for configuring xlat output style"

2018-11-21  Dmitry V. Levin  <ldv@altlinux.org>

	Move kill_save_errno to a separate header file.
	This function is going to be used outside strace.c,
	so make it globally available and move it to a separate header file.

	* strace.c (kill_save_errno): Add "inline" keyword, change return type
	from "void" to "int", move the function ...
	* kill_save_errno.h: ... to this new file.
	* Makefile.am (strace_SOURCES): Add it.

2018-11-20  Dmitry V. Levin  <ldv@altlinux.org>

	syscall_entering_trace: set TCB_FILTERED along with TCB_HIDE_LOG.
	This allows to remove some of hide_log() checks that became redundant.

	* syscall.c (syscall_entering_trace): Set TCB_FILTERED along with
	TCB_HIDE_LOG, remove now redundant hide_log(tcp) check.
	(syscall_exiting_decode): Replace "filtered(tcp) || hide_log(tcp)"
	with "filtered(tcp)".

2018-11-20  Dmitry V. Levin  <ldv@altlinux.org>

	syscall_entering_trace: optimize clearing of TCB_HIDE_LOG flag.
	* syscall.c (syscall_entering_trace): Since we check for TCB_HIDE_LOG
	flag anyway, do not clean it unless it is set.

2018-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	print_inet_addr: print nameless and named addresses using the same style
	* sockaddr.c (print_inet_addr): Handle var_name == NULL case in a more
	structured way: use inet_addr("%s") form to print AF_INET addresses
	in structureless contexts where no structure field name is available.
	Likewise, use inet_pton(AF_INET6, "%s") that case.
	* tests/nlattr_ifaddrmsg.c (main): Update expected output.
	* tests/nlattr_ifla_af_spec.c (main): Likewise.

	Complements: v4.19~76 "print_inet_addr: add support of invocations without field name"

2018-11-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend test coverage of RND* ioctl commands.
	* tests/ioctl_random.c (main): Check the error path of RNDADDENTROPY
	parser.  Check decoding of unrecognized RND* ioctl commands.

2018-11-05  Rasmus Villemoes  <rasmus.villemoes@prevas.dk>

	Add support for /dev/[u]random ioctls.
	* random_ioctl.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (DECL_IOCTL): Add random.
	* ioctl.c (ioctl_decode): Add 'R' case.
	* xlat/random_ioctl_cmds.in: New file.
	* tests/ioctl_random.c: New file.
	* tests/.gitignore: Add ioctl_random.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (ioctl_random): New entry.

2018-11-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add dist/INSTALL.
	* dist/INSTALL: New file.
	* bootstrap: Copy it.
	* .gitignore: Add /INSTALL.

	References: https://github.com/strace/strace/issues/17
	References: https://github.com/strace/strace/issues/55
	Closes: https://github.com/strace/strace/issues/67

2018-11-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Rename INSTALL to README-configure.
	* INSTALL-git.md: Replace INSTALL with README-configure.
	* maint/install.texi: Likewise.
	* INSTALL: Rename to README-configure, regenerate.
	* Makefile.am (EXTRA_DIST): Add README-configure.

	References: https://github.com/strace/strace/issues/85
	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-11-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	dist/README: add more references.
	* dist/README: Mention README-hacking, add links to repositories
	and the mailing list archive.

	Suggested-by: Jamal Hadi Salim <jhs@mojatatu.com>
	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-11-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	README.md: add a link to the new contributors guide.
	* README.md: Add a link to the Guide of new contributors.

	Suggested-by: Jamal Hadi Salim <jhs@mojatatu.com>

2018-10-30  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.25-1.
	* strace.spec.in: Likewise.

	Prepare for 4.25 release.
	* NEWS: Update for 4.25 release.

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2018-10-25  Dmitry V. Levin  <ldv@altlinux.org>

	Update NEWS.

2018-10-25  Elvira Khabirova  <lineprinter@altlinux.org>

	Implement decoding of NBD_* ioctl commands.
	* nbd_ioctl.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (DECL_IOCTL): Add nbd.
	* ioctl.c (ioctl_decode): Add 0xab (nbd) case.
	* xlat/nbd_ioctl_cmds.in: Likewise.
	* xlat/nbd_ioctl_flags.in: Likewise.
	* tests/ioctl_nbd.c: Likewise.
	* tests/.gitignore: Add ioctl_nbd.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (ioctl_nbd): New entry.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-10-25  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix build with recent kernel headers.
	Linux commit v4.19-rc2-5-g2ecefa0a15fd0ef88b9cd5d15ceb813008136431
	changed the definition of struct keyctl_dh_params in an incompatible
	way again.  Workaround this issue by using designated initializers.

	* tests/keyctl.c (main): Use designated initializers for
	struct keyctl_dh_params.

2018-10-24  Dmitry V. Levin  <ldv@altlinux.org>

	arm, sparc, sparc64: wire up io_pgetevents.
	* linux/arm/syscallent.h ([399]): Wire up io_pgetevents syscall
	introduced by Linux commit v4.19-rc7~24^2~1.
	(ARM_FIRST_SHUFFLED_SYSCALL, SYS_socket_subcall): Raise from 400 to 500,
	to make room for new syscalls.
	* linux/sparc/syscallent.h ([361]): Wire up io_pgetevents syscall
	introduced by Linux commit v4.19~31^2~5.
	* linux/sparc64/syscallent.h: Likewise.

2018-10-24  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v4.19.
	* linux/32/ioctls_inc_align16.h: Update from linux v4.19-rc8
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/i386/ioctls_arch0.h: Likewise.
	* linux/x86_64/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

	maint: update for linux 4.19-rc8.
	* maint/ioctls_sym.sh (x86_list): Add KVM_[GS]ET_NESTED_STATE.

2018-10-24  Dmitry V. Levin  <ldv@altlinux.org>

	Remove redundant VIDIOC_SUBDEV_* constants.
	Remove those of VIDIOC_SUBDEV_* constants are defined exactly the same
	way by the Linux kernel as their VIDIOC_* origins.

	Linux kernel commit v4.19-rc1~137^2~248 introduced more of such
	duplicates, forward remove them as well.

	* linux/32/ioctls_inc_align16.h: Remove VIDIOC_SUBDEV_DV_TIMINGS_CAP,
	VIDIOC_SUBDEV_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_G_DV_TIMINGS,
	VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_QUERY_DV_TIMINGS,
	VIDIOC_SUBDEV_S_DV_TIMINGS, and VIDIOC_SUBDEV_S_EDID.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* maint/ioctls_sym.sh: Remove VIDIOC_SUBDEV_DV_TIMINGS_CAP,
	VIDIOC_SUBDEV_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUMSTD,
	VIDIOC_SUBDEV_G_DV_TIMINGS, VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_G_STD,
	VIDIOC_SUBDEV_QUERY_DV_TIMINGS, VIDIOC_SUBDEV_QUERYSTD,
	VIDIOC_SUBDEV_S_DV_TIMINGS, VIDIOC_SUBDEV_S_EDID, and
	VIDIOC_SUBDEV_S_STD.

2018-09-27  Dmitry V. Levin  <ldv@altlinux.org>

	xtensa: fix typo in pkey_alloc syscall number.
	* linux/xtensa/syscallent.h (pkey_alloc): Change from 249 to 349.

2018-09-23  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: print _IOC_NONE in symbolic form even if it is equal to 0.
	On some architectures _IOC_NONE equals to 1, on others it is 0.
	Change the way how ioctl direction flags are printed so that
	_IOC_NONE is printed in symbolic form even if it is equal to 0.

	* xlat/ioctl_dirs.in (_IOC_NONE): Move to the head of the list.
	* tests/ioctl_inotify.c (main): Update expected output.
	* tests/ioctl_loop. (main): Likewise.c
	* tests/ioctl_perf.c (main): Likewise.
	* tests/ioctl_scsi.c (main): Likewise.

2018-09-18  Dmitry V. Levin  <ldv@altlinux.org>

	Disable git-archive.
	Since configure uses git-version-gen which in turn depends
	on "git describe" or  a .tarball-version file, raw archives
	generated by "git archive" cannot be built.

	* .gitattributes: New file.
	* README-github_gitlab-autogenerated-archives.txt: Likewise.

2018-09-16  Dmitry V. Levin  <ldv@altlinux.org>

	Workaround signedness bugs in system NLMSG_OK reported by -Wsign-compare
	Introduce a replacement for NLMSG_OK provided by <linux/netlink.h> since
	that system macro contains signedness bugs that are not going to be fixed.

	* netlink.h: Include <stdbool.h>.
	(is_nlmsg_ok): New static inline function.
	* socketutils.c (receive_responses): Use it instead of NLMSG_OK.
	* tests/netlink_inet_diag.c (check_responses): Likewise.
	* tests/netlink_netlink_diag.c (check_responses): Likewise.
	* tests/netlink_unix_diag.c (check_responses): Likewise.

	Closes: https://github.com/strace/strace/issues/79

2018-09-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests/sprintrc.c: drop redundant check.
	* tests/sprintrc.c (sprintrc_ex): Remove fmt check, this also fixes the
	warning reported by clang -Wtautological-constant-out-of-range-compare.

	build: enable gcc -Woverride-init and clang -Winitializer-overrides.
	* m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Winitializer-overrides
	and -Woverride-init.

2018-09-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: exclude arm_sync_file_range from ksysent test.
	arm_sync_file_range is better known as sync_file_range2.

	* tests/ksysent.sed: Filter out arm_sync_file_range.

2018-09-16  Dmitry V. Levin  <ldv@altlinux.org>

	Ignore warnings about overridden initialization of hwaddr_sizes.
	As hwaddr_sizes array is explicitly initialized this way,
	ignore potential warnings reported by gcc -Woverride-init
	and clang -Winitializer-overrides.

	* gcc_compat.h (CLANG_PREREQ): New macro.
	(DIAG_PUSH_IGNORE_OVERRIDE_INIT, DIAG_POP_IGNORE_OVERRIDE_INIT): New
	macros non-trivially defined for gcc >= 4.2 and clang >= 2.8.
	* sock.c (print_ifreq): Use them to ignore warnings about overridden
	initialization of hwaddr_sizes array.

	Closes: https://github.com/strace/strace/issues/77

2018-09-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: workaround clang -Wunneeded-internal-declaration bug.
	* tests/execve.c (main): Explicitly mark q_envp variable as used
	to workaround clang -Wunneeded-internal-declaration bug.
	* tests/execveat.c (main): Likewise.
	* tests/nsyscalls.c (main): Explicitly mark syscallent variable as used
	to workaround clang -Wunneeded-internal-declaration bug.

	Closes: https://github.com/strace/strace/issues/78

2018-09-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	process: honor xlat style in print_user_offset_addr.
	* process.c (print_user_offset_addr): Print in accordance with xlat
	verbosity setting.

	time: add xlat styles support to printclockname.
	* time.c (printclockname): Respectl xlat_verbosity.

	perf: rewrite print_perf_event_attr using PRINT_FIELD_* macros.
	* perf.c: Include "print_fields.h".
	(PRINT_XLAT): Remove.
	(print_perf_event_attr): Use PRINT_FIELD_* macros.

2018-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check stack unwinding for signals.
	* tests/stack-fcall-3.c: Include <signal.h>.
	(f3): Call getpid or kill depending on the argument, store getpid result.
	* tests/stack-fcall.c (main): Remove arguments, call f0(0) and f0(1).
	* tests/strace-k-demangle.expected: Update expected output.
	* tests/strace-k.expected: Likewise.
	* tests/strace-k.test: Rewrite pattern matching code.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Print stack traces on signals.
	I don't know why it hasn't been done earlier.

	* strace.c (print_stopped) [ENABLE_STACKTRACE]: Call unwind_tcb_print
	if stack trace printing is enabled.

2018-09-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for open_access_modes constants.
	* xlat/open_access_modes.in: Add fallback values.

	xlat: update resources.
	* xlat/resources.in: Declare as #value indexed, provide fallback values.
	(RLIMIT_VMEM): Remove.

	nlattr: ignore nla_type flags when selecting nlattr decoder.
	* nlattr.c (decode_nlattr_with_data): Apply NLA_TYPE_MASK to nla_type
	before decoder selection.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	netlink_packet_diag: assorted decoding fixes.
	* xlat/af_packet_versions.in: New file.
	* netlink_packet_diag.c: Include "xlat/af_packet_versions.h".
	(decode_packet_diag_req): sdiag_protocol shouldn't be decoded as a protocol,
	currently it should be set to 0.
	(decode_packet_diag_info): Decode pdi_version field using af_packet_versions
	xlat; decode pdi_index field as an interface index.
	(packet_diag_msg_nla_decoders) <PACKET_DIAG_UID>: Decode using
	decode_nla_uid.
	(decode_packet_diag_msg): Decode pdiag_num as an low-level protocol.
	* tests/netlink_sock_diag.c: Update expected output.
	* tests/nlattr_packet_diag_msg.c: Likewise.

	sockaddr: add X.25 socket address decoding support.
	* sockaddr.c: Include <linux/x25.h>.
	(print_sockaddr_data_x25): New function.
	(sa_printers) <[AF_X25]>: New socket address handler.
	* tests/net-sockaddr.c (check_x25): New function.
	(main): Use it to check X.25 socket address decoding.

	net: add support for AX.25 protocols and socket option names decoding.
	* xlat/ax25_protocols.in: New file.
	* xlat/sock_ax25_options.in: Likewise.
	* net.c: Include "xlat/ax25_protocols.h" and "xlat/sock_ax25_options.h".
	* (SYS_FUNC(socket)): <[AF_AX25]>: Print protocol name using
	ax25_protocols xlat.
	(print_sockopt_fd_level_name) <[SOL_AX25]>: Print socket option name
	using sock_ax25_options xlat.

	sockaddr: decode AX.25 socket addresses.
	* defs.h (print_ax25_addr): New prototype.
	* print_fields.h (PRINT_FIELD_AX25_ADDR): New macro.
	* sockaddr.c: Include <linux/ax25.h>.
	(check_ax25_address, ax25_addr2str, print_ax25_addr_raw,
	print_ax25_addr, print_sockaddr_data_ax25): New functions.
	(sa_printers) <[AF_AX25]>: New printer.
	* tests/net-sockaddr.c (AX25_ADDR): New macro.
	(check_ax25): New function.
	(main): Use it to check AX.25 socket address decoding.

	macros: add ROUNDUP macro.
	* macros.h (ROUNDUP): New macro.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	futex: recognise FUTEX_BITSET_MATCH_ANY bitmask.
	* xlat/futexbitset.in: New file.
	* futex.c: Include "xlat/futexbitset.h".
	(futex) <FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET>: Decode val3 using
	futexbitset xlat.
	* tests/futex.c: Add checks for 0xffffffff bitset mask printing.

	Closes: Linux commit v4.16-rc1~166^2^2~2

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ioprio: move constant definitions to xlat.
	* xlat/ioprio_class.in: Add fallback values.
	* xlat/ioprio_who.in: Likewise.
	* ioprio.c: Remove IOPRIO_WHO_* and IOPRIO_CLASS_* enums.

	net: decode AF_PACKET protocols in socket syscall.
	* net.c: Include "xlat/ethernet_protocols.h" in XLAT_MACROS_ONLY mode.
	(SYS_FUNC(socket)) <AF_PACKET>: Decode using ethernet_protocols xlat.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_ifindex: add public get_ifname method.
	In order to be able to obtain sanitised device name internally.

	* defs.h (get_ifname): New declaration.
	* print_ifindex.c (get_ifname): Refactor, leaving out addition
	of if_nametoindex("") part.
	(sprint_ifname): New function, adds if_nametoindex("")
	to get_ifname's output.
	(print_ifindex): Use sprint_ifname instead of get_ifname.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	socketutils: introduce get_family_by_proto.
	Add a helper function that returns address family based on the internal
	notion of the socket protocol using protocols table.

	* defs.h (get_family_by_proto): New declaration.
	* socketutils.c (get_family_by_proto): New function.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	socketutils: add more IP/IPv6 transport protocols.
	* defs.h (sock_proto): Add SOCK_PROTO_UDPLITE, SOCK_PROTO_DCCP,
	SOCK_PROTO_SCTP, SOCK_PROTO_L2TP_IP, SOCK_PROTO_PING, SOCK_PROTO_RAW,
	SOCK_PROTO_UDPLITEv6, SOCK_PROTO_DCCPv6, SOCK_PROTO_L2TP_IPv6,
	SOCK_PROTO_SCTPv6, SOCK_PROTO_PINGv6, and SOCK_PROTO_RAWv6.
	* socketutils.c: Include "xlat/inet_protocols.h" in XLAT_MACROS_ONLY
	mode.
	(protocols): Add protocol descriptions for them.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	socketutils: store more information in protocols table.
	This also allows getting rid of all these *_v[46]_get calls.

	* socketutils.c (unix_get, inet_get, netlink_gen): Add family, protocol,
	and proto_name paramteres, use them where appropriate.
	(tcp_v4_get, udp_v4_get, tcp_v6_get, udp_v6_get): Remove.
	(protocols): Add family and proto fields to the structure, call inet_get
	for IP/IPv6 protocols.
	(get_sockaddr_by_inode_uncached): Update protocols->get calls.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sockaddr: whitespace cleanup, fix typo in comment.
	* sockaddr.c (print_sockaddr_data_bt): Fix typo, remove excess
	indentation from the switch statement.

	tests: add utimensat test variants with different xlat verbosity levels.
	* tests/utimensat-Xabbrev.c: New file.
	* tests/utimensat-Xraw.c: Likewise.
	* tests/utimensat-Xverbose.c: Likewise.
	* tests/utimensat.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
	* tests/pure_executables.list: Add utimensat-Xabbrev, utimensat-Xraw,
	and utimensat-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (utimensat-Xabbrev, utimensat-Xraw, utimensat-Xverbose): New
	tests.

	print_timespec: make print_timespec_t_utime respect xlat style setting.
	* print_timespec.c (print_timespec_t_utime): Print raw timespec value
	in accordance with xlat style setting.

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	netlink: honor custom xlat style setting during nlmsg flags printing.
	Commit v4.23~343 introduced xlat style argument to printflags_ex, but
	XLAT_STYLE_DEFAULT was introduced only in the next commit v4.23~342,
	which led to missing out fixing the sole external user of this
	peculiar extended interface.

	* netlink.c (decode_nlmsg_flags): Use XLAT_STYLE_DEFAULT instead of
	XLAT_STYLE_ABBREV in printflags_ex call.

	Fixes: v4.23~342 "Introduce XLAT_STYLE_DEFAULT"

2018-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	netlink_netfilter: use xlat styles for res_id workaround printing.
	* netlink_netfilter.c (decode_netlink_netfilter): Call print_xlat_ex
	in order to respect xlat style setting.

	xlat: provide fallback definitions for epollevents.
	* xlat/epollevents.in: Provide fallback definitions, add EPOLLNVAL
	constant (introduced by Linux commit v4.16-rc1~3^2~3).

	xlat: provide fallback definitions to pollflags.
	* xlat/pollflags.in: Add fallback definitions for POLLWRNORM,
	POLLWRBAND, POLLMSG, POLLREMOVE, and POLLRDHUP.

	xlat: provide fallback values for socktypes.
	* xlat/socktypes.in: Provide fallback values.

	xlat: provide fallback values to route_nexthop_flags.
	* xlat/route_nexthop_flags.in: Add fallback values.

2018-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	block: move fallback definitions for ioctl commands to xlat.
	* xlat/block_ioctl_cmds.in: New file.
	* block.c: Include "xlat/block_ioctl_cmds.h" in XLAT_MACROS_ONLY mode.
	(BLKPG, BLKTRACESETUP, BLKTRACESTART, BLKTRACESTOP, BLKTRACETEARDOWN,
	BLKDISCARD, BLKIOMIN, BLKIOOPT, BLKALIGNOFF, BLKPBSZGET,
	BLKDISCARDZEROES, BLKSECDISCARD, BLKROTATIONAL, BLKZEROOUT): Remove
	fallback definitions as those are porvided by block_ioctl_cmds xlat now.

2018-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Decode BLKGETSIZE64 unconditionally.
	It is available on all supported kernel versions.

	* block.c (block_ioctl): Remove #ifdef HAVE_BLKGETSIZE64.
	* configure.ac: Remove BLKGETSIZE64 check.

2018-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add ability to specify a default string to print_xlat_ex.
	In order to avoid dealing with xlat verbosity styles outside xlat code
	as much as possible.

	* defs.h (xlat_style_private_flag_bits): Rename from
	print_array_flag_bits, add PXF_DEFAULT_STR_BIT.
	(xlat_style_private_flags): Rename from print_array_flags, add
	FLAG_(PXF_DEFAULT_STR).
	* xlat.c (print_xlat_ex): Handle PXF_DEFAULT_STR by interpreting str
	as a default value (print both value and str in XLAT_STYLE_ABBREV).

2018-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nlattr: provide common AF_INET{,6} address decoders.
	Rename decode_ifla_inet6_token to decode_nla_in6_addr,
	add a sister function decode_nla_in_addr for future use.

	* nlattr.c (decode_nla_in_addr, decode_nla_in6_addr): New functions.
	* nlattr.h (DECL_NLA(in_addr), DECL_NLA(in6_addr)): New declarations.
	* rtnl_link.c (decode_ifla_inet6_token): Remove.
	(ifla_inet6_nla_decoders) <[IFLA_INET6_TOKEN]>: Use decode_nla_in6_addr.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	net: decode SOL_XDP socket option names.
	* xlat/sock_xdp_options.in: New file.
	* net.c: Include "xlat/sock_xdp_options.h".
	(print_sockopt_fd_level_name) <case SOL_XDP>: Print SOL_XDP socket
	option names.

	xlat: add SOL_XDP to socketlayers.in.
	* xlat/socketlayers.in (SOL_XDP): New constant, introduced by Linux
	commit v4.18-rc1~114^2~304^2~4^2~14.

	xlat: add AF_XDP to addrfams.in.
	* xlat/addrfams.in (AF_XDP): New constant, introduced by Linux commit
	v4.18-rc1~114^2~304^2~4^2~14.

	netlink_smc_diag: decode SMC_DIAG_SHUTDOWN attribute value.
	* xlat/sock_shutdown_flags.in: New file.
	* netlink_smc_diag.c: Include "xlat/sock_shutdown_flags.h".
	(decode_smc_diag_shutdown): New function.
	(smc_diag_msg_nla_decoders) <[SMC_DIAG_SHUTDOWN]>: Use
	decode_smc_diag_shutdown.
	* tests/nlattr_smc_diag_msg.c: Add checks for SMC_DIAG_SHUTDOWN.

	tests/ioctl_v4l2: do not calculate page end address each time.
	* tests/ioctl_v4l2.c (main): Replace page + size with page_end.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_fields: simplify UINT64_MAX printing.
	As we have print_xlat_u now.

	* print_fields.h (PRINT_FIELD_U64): Use print_xlat_u for UINT64_MAX
	printing.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nsfs: simplify auxstr logic.
	There's no need to check whether non-NULL value is being assigned to
	auxstr; syscall_exiting_trace does it itself.

	* nsfs.c (nsfs_ioctl) <case NS_GET_NSTYPE>: Simply assign result of
	xlookup to auxstr if syserror(tcp) is false.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add BPF_PROG_TYPE_SK_REUSEPORT to bpf_prog_types.in.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_SK_REUSEPORT): New constant,
	introduced by Linux commit v4.19-rc1~140^2~24^2~2^2~5.
	* tests/bpf.c: Update expected output.

	xlat: add IPSTATS_MIB_REASM_OVERLAPS to snmp_ip_stats_mib.in.
	* xlat/snmp_ip_stats.in (IPSTATS_MIB_REASM_OVERLAPS): New constant,
	introduced by Linux commit v4.19-rc1~140^2~128^2~2.

	xlat: update bpf_map_types.in.
	* xlat/bpf_map_types.in (BPF_MAP_TYPE_CGROUP_STORAGE): New constant,
	introduced by Linux commit v4.19-rc1~140^2~108^2~3^2~12.
	(BPF_MAP_TYPE_REUSEPORT_SOCKARRAY): New constant, introduced by Linux
	commit v4.19-rc1~140^2~24^2~2^2~6.
	* tests/bpf.c: Update expected output.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: add IFLA_MIN_MTU and IFLA_MAX_MTU attributes.
	Introduced by Linux commit v4.19-rc1~140^2~205^2~1.

	* rtnl_link.c (ifinfomsg_nla_decoders) <[IFLA_MIN_MTU], [IFLA_MAX_MTU]>:
	New decoder, calls decode_nla_u32.
	* xlat/rtnl_link_attrs.in (IFLA_MIN_MTU, IFLA_MAX_MTU): New constant.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add IPV4_DEVCONF_BC_FORWARDING-1 to inet_devconf_indices.in.
	* xlat/inet_devconf_indices.in (IPV4_DEVCONF_BC_FORWARDING-1): New
	constant, introduced by Linux commit v4.19-rc1~140^2~208^2~1.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_netconf: add NETCONFA_BC_FORWARDING attribute.
	Introduced by Linux commit v4.19-rc1~140^2~208^2~1.

	* rtnl_netconf.c (netconfmsg_nla_decoders) <[NETCONFA_BC_FORWARDING]>:
	New decoder, calls decode_nla_s32.
	* xlat/rtnl_netconf_attrs.in (NETCONFA_BC_FORWARDING): New constant.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	netlink_smc_diag: add SMC_DIAG_FALLBACK attribute support.
	Introduced by Linux commit v4.19-rc1~140^2~253^2~1.

	* linux/smc_diag.h (SMC_DIAG_FALLBACK): New enumeration item.
	(struct smc_diag_fallback): New type definition.
	* netlink_smc_diag.c: Include "xlat/smc_decl_codes.h".
	(decode_smc_diag_fallback): New function.
	(smc_diag_msg_nla_decoders) <[SMC_DIAG_FALLBACK]>: New decoder, calls
	decode_smc_diag_fallback.
	* tests/nlattr_smc_diag_msg.c: Add checks for SMC_DIAG_FALLBACK
	attribute decoding.
	* xlat/smc_decl_codes.in: New file.
	* xlat/smc_diag_attrs.in (SMC_DIAG_FALLBACK): New constant.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs.h: add style argument to printxval_search_ex macro.
	It is identical to printxval_search otherwise.

	* defs.h (printxval_search_ex): Add style argument.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update v4l2_pix_fmts.in.
	* xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_FWHT): New constant, introduced by
	Linux commit v4.19-rc1~137^2~221.
	(V4L2_PIX_FMT_SBGGR14P, V4L2_PIX_FMT_SGBRG14P, V4L2_PIX_FMT_SGRBG14P,
	V4L2_PIX_FMT_SRGGB14P): New constants, introduced by Linux commit
	v4.19-rc1~137^2~97.
	(V4L2_PIX_FMT_Y10P): New constant, introduced by Linux commit
	v4.19-rc1~137^2~95.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	netlink_smc_diag: decode smc_diag_msg.diag_fallback constant names.
	Introduced by Linux commit v4.19-rc1~140^2~285^2~4.

	* xlat/smc_diag_mode.in: New file.
	* netlink_smc_diag.c: Include "xlat/smc_diag_mode.h".
	(decode_smc_diag_msg): Print diag_fallback field using smc_diag_mode
	xlat.
	* tests/netlink_sock_diag.c (test_smc_diag_msg): Update expected output.
	* tests/nlattr_smc_diag_msg.c (print_smc_diag_msg): Likewise.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: add IFLA_BRPORT_BACKUP_PORT attribute.
	Introduced by Linux commit v4.19-rc1~140^2~288^2.

	* xlat/rtnl_ifla_brport_attrs.in (IFLA_BRPORT_BACKUP_PORT): New
	constant.
	* rtnl_link.c (ifla_brport_nla_decoders) <[IFLA_BRPORT_BACKUP_PORT]>:
	New decoder.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update nt_descriptor_types.in.
	* xlat/nt_descriptor_types.in (NT_VMCOREDD): New named constant,
	introduced by Linux commit v4.18-rc1~114^2~252^2~2.
	(NT_MIPS_DSP): New named constant, introduced by Linux commit
	v4.19-rc1~42^2~63.
	(NT_MIPS_FP_MODE): New named constant, introduced by Linux commit
	v4.19-rc1~42^2~62.

	xlat: add AUDIT_INTEGRITY_POLICY_RULE to nl_audit_types.in.
	* xlat/nl_audit_types.in (AUDIT_INTEGRITY_POLICY_RULE): New constant,
	introduced by Linux commit v4.19-rc1~124^2~5.

	rtnl_link: decode named constants for IFLA_XDP_ATTACHED attribute value.
	* xlat/rtnl_ifla_xdp_attached_mode.in: New file.
	* rtnl_link.c: Include "xlat/rtnl_ifla_xdp_attached_mode.h".
	(decode_ifla_xdp_attached): New function.
	(ifla_xdp_nla_decoders) <[IFLA_XDP_ATTACHED]>: Use
	decode_ifla_xdp_attached instead of decode_nla_u8.
	* tests/nlattr_ifla_xdp.c: Add checks for IFLA_XDP_ATTACHED decoding.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: add new IFLA_XDP_* attributes.
	Introduced by Linux commit v4.19-rc1~140^2~364^2~6^2~6.

	* xlat/rtnl_ifla_xdp_attrs.in (IFLA_XDP_DRV_PROG_ID,
	IFLA_XDP_SKB_PROG_ID, IFLA_XDP_HW_PROG_ID): New constants.
	* rtnl_link.c (ifla_xdp_nla_decoders): Add decoders for
	IFLA_XDP_DRV_PROG_ID, IFLA_XDP_SKB_PROG_ID, and IFLA_XDP_HW_PROG_ID.
	* tests/nlattr_ifla_xdp.c: Add checks for new attributes.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update v4l2_control_ids.in.
	* xlat/v4l2_control_ids.in (V4L2_CID_MPEG_VIDEO_VP8_PROFILE): Renamed
	from V4L2_CID_MPEG_VIDEO_VPX_PROFILE (the latter is now a synonym),
	by Linux commit v4.19-rc1~137^2~270.
	(V4L2_CID_MPEG_VIDEO_VP9_PROFILE): New constant, introduced by Linux
	commit v4.19-rc1~137^2~269.

	xlat: add SO_TXTIME to sock_options.in.
	* xlat/sock_options.in (SO_TXTIME): New constant, introduced by Linux
	commit v4.19-rc1~140^2~465^2~12.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	netlink_smc_diag: implement SMC_DIAG_DMBINFO decoding.
	The message has been added by Linux commit v4.19-rc1~140^2~507^2~1.

	* linux/smc_diag.h: Include "gcc_compat.h".
	(enum): Add SMC_DIAG_DMBINFO.
	(struct smcd_diag_dmbinfo): New type definition.
	* xlat/smc_diag_attrs.in (SMC_DIAG_DMBINFO): New constant.
	* netlink_smc_diag.c (decode_smc_diag_dmbinfo): New function.
	(smc_diag_msg_nla_decoders) [SMC_DIAG_DMBINFO]: New decoder, calls
	decode_smc_diag_dmbinfo.
	* tests/nlattr_smc_diag_msg.c: Add SMC_DIAG_DMBINFO check.

2018-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add SCTP_REUSE_PORT to sock_sctp_options.in.
	* xlat/sock_sctp_options.in (SCTP_REUSE_PORT): New constant, introduced
	by Linux commit v4.19-rc1~140^2~518.

	xlat: add IN_MASK_CREATE to inotify_flags.in.
	* xlat/inotify_flags.in (IN_MASK_CREATE): New constant, introduced by
	Linux commit v4.19-rc1~115^2.
	* tests/inotify.c (main): Update expected output.

2018-08-22  Dmitry V. Levin  <ldv@altlinux.org>

	tests: workaround systemd-nspawn habit of disabling unimplemented syscalls
	* tests/nsyscalls.c (test_syscall): Do not assume that unimplemented
	syscalls always fail with ENOSYS.

	tests: workaround systemd-nspawn habit of disabling mlockall syscall.
	* tests/mmap.c (main): Do not assume that mlockall syscall always
	succeeds.

	tests: workaround systemd-nspawn habit of disabling munlockall syscall.
	* tests/munlockall.c (main): Do not assume that munlockall syscall
	always succeeds.

2018-08-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Decode AF_SMC netlink messages unconditionally.
	As smc_diag.h is bundled, there is little sense to build AF_SMC support
	conditionally.

	* netlink_smc_diag.c [!AF_SMC]: Include xlat/addrfams.h under
	XLAT_MACROS_ONLY, enable the rest of file.
	* netlink_sock_diag.c: Include xlat/addrfams.h under XLAT_MACROS_ONLY.
	(diag_decoders): Remove "ifdef AF_SMC" condition for [AF_SMC], reorder
	in accordance with address family values.
	* tests/nlattr_smc_diag_msg.c [!AF_SMC]: Define AF_SMC to 43, enable
	the rest of test.

2018-08-19  Dmitry V. Levin  <ldv@altlinux.org>

	strace.c: introduce struct tcb_wait_data.
	Introduce a new structure to pass information between next_event(),
	restart_delayed_tcb(), and dispatch_event().

	This is going to be used by a subsequent change of next_event().

	* strace.c (struct tcb_wait_data): New type.
	(next_event): Remove parameters, return a pointer
	to const struct tcb_wait_data.  Return NULL instead of TE_BREAK.
	(dispatch_event): Replace all parameters with a pointer
	to const struct tcb_wait_data, obtain the trace event, siginfo,
	and status from its fields.
	(restart_delayed_tcb): Add local struct tcb_wait_data variable
	with te field set to TE_RESTART, pass it to dispatch_event().
	(main): Remove status and si variables, update next_event()
	and dispatch_event() invocations.

	Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-08-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: fix typo in smc_protocols.in.
	* xlat/smc_protocols.in: s/^MCPROTO_SMC/SMCPROTO_SMC/.

2018-08-19  Dmitry V. Levin  <ldv@altlinux.org>

	ci: add a test with the latest gcc and mainline headers.
	* .gitlab-ci.yml (gcc-x86_64-libdw-mainline): New entry.
	* .travis.yml (CC=gcc-8, KHEADERS=torvalds/linux): Likewise.

	ci: update gitlab ubuntu image.
	* .gitlab-ci.yml (image): Replace "ubuntu:17.10" with "ubuntu:18.04".

	ci: install kernel headers after compiler dependencies.
	* ci/install-dependencies.sh: Install kernel headers after compiler
	dependencies to avoid a needless attempt to install $common_packages.

	ci: fix kernel headers version diagnostics.
	* ci/run-build-and-tests.sh: Honor $CPPFLAGS when printing
	kernel headers version.

2018-08-19  Zhibin Li  <08826794brmt@gmail.com>

	tests: enhance test coverage of evdev ioctl.
	* tests/ioctl_evdev.c (main): Test EVIOCGMTSLOTS(8) command.

	tests: check decoding of successful evdev ioctl.
	* tests/ioctl_evdev-success.c: New file.
	* tests/ioctl_evdev-success-v.c: Likewise.
	* tests/ioctl_evdev-success.test: New test.
	* tests/ioctl_evdev-success-v.test: Likewise.
	* tests/.gitignore: Add ioctl_evdev-success and ioctl_evdev-success-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add the two tests mentioned above.

2018-08-19  Zhibin Li  <08826794brmt@gmail.com>

	evdev: fix decoding of EVIOCGBIT(0, ...)
	There is a comment in drivers/input/evdev.c which says:
	/* EV_SYN==0 is EV_CNT, _not_ SYN_CNT, see EVIOCGBIT */

	That is, EVIOCGBIT(0, ...) should return a bit mask with supported
	event types instead of SYN_* event codes.

	* defs.h (evdev_ev): New prototype.
	* evdev.c: Include "xlat/evdev_ev.h" and remove "xlat/evdev_sync.h".
	(bit_ioctl) <case EV_SYN>: Replace EV_SYN with 0, use evdev_ev
	with XT_SORTED in decode_bitset invocation instead.
	* ioctl.c: Do not include "xlat/evdev_ev.h".
	(evdev_decode_number): Print nr == 0x20 as "0" instead of "EV_SYN".
	* tests/ioctl_evdev.c (main): Use 0 instead of EV_SYN in EVIOCGBIT
	output.
	* xlat/evdev_sync.in: Remove.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
	Fixes: v4.10~89 "Add decoding for evdev ioctls"

2018-08-19  Zhibin Li  <08826794brmt@gmail.com>

	evdev: fix decoding of bit sets.
	According to drivers/input/evdev.c:bits_to_user(),
	the Linux kernel returns the number of bytes, not bits.

	* evdev.c (decode_bitset_): Treat syscall return value as the number
	of bytes.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
	Fixes: v4.10~89 "Add decoding for evdev ioctls"

2018-08-19  Pierre Marsais  <pierre.marsais@lse.epita.fr>

	kvm: decode the argument of KVM_CHECK_EXTENSION.
	xlat/kvm_cap.in has been generated using the following command line:

	grep '#define\s\+KVM_CAP' $linux/include/uapi/linux/kvm.h |
	sed -E -e 's/^#define\s+([^ \t]+)\s*([0-9]+).*$/printf "%-40s%s\n" \1 \2/e' \
	       -e 's/ {8}/\t/g; s/ +/\t/g'

	* xlat/kvm_cap.in: New file.
	* kvm.c: Include "xlat/kvm_cap.h".
	(kvm_ioctl_decode_check_extension): New function.
	(kvm_ioctl): Use it.
	* tests/ioctl_kvm_run_common.c (main): Check decoding
	of KVM_CHECK_EXTENSION command.

2018-08-19  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update V4L2_CID_USER_*_BASE constants.
	* xlat/v4l2_control_id_bases.in (V4L2_CID_USER_S2255_BASE,
	V4L2_CID_USER_SI476X_BASE, V4L2_CID_USER_SAA7134_BASE,
	V4L2_CID_USER_ADV7180_BASE, V4L2_CID_USER_TC358743_BASE,
	V4L2_CID_USER_MAX217X_BASE): New constants.

2018-08-19  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: workaround V4L2_CID_USER_IMX_BASE Linux kernel ABI breakage.
	Linux kernel commit v4.18-rc2-106-g421860b9d47053badce4b247576fa48df9ab4c48
	has changed the value of V4L2_CID_USER_IMX_BASE constant introduced
	by commit v4.13-rc1~141^2~121 because the old value was already used
	by V4L2_CID_USER_MAX217X_BASE.

	This is of course an ABI breakage that affects Linux kernels starting
	with 4.13 and up to 4.18, as well as their LTS derivatives.

	Since the imx driver didn't provide any public control ID definitions,
	it looks like the best way to handle this situation is to pretend that
	the old value of V4L2_CID_USER_IMX_BASE didn't exist.

	* xlat/v4l2_control_id_bases.in (V4L2_CID_USER_IMX_BASE): Redefine.

	Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-08-14  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.24-1.
	* strace.spec.in: Likewise.

	Prepare for 4.24 release.
	* NEWS: Update for 4.24 release.

2018-08-12  Dmitry V. Levin  <ldv@altlinux.org>

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2018-08-12  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v4.18.
	* linux/32/ioctls_inc_align16.h: Update from linux v4.18-rc8
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/s390x/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

	maint: update for linux v4.18.
	* maint/ioctls_sym.sh: Add workaround for linux/omap3isp.h file.

2018-08-12  Dmitry V. Levin  <ldv@altlinux.org>

	Replace BTRFS_IOC_[GS]ET_FSLABEL with FS_IOC_[GS]ETFSLABEL.
	Linux kernel commit v4.18-rc1~37^2~66 introduced FS_IOC_[GS]ETFSLABEL
	ioctl constants as generalized copies of BTRFS_IOC_[GS]ET_FSLABEL.

	* linux/32/ioctls_inc_align16.h: Replace BTRFS_IOC_[GS]ET_FSLABEL
	with FS_IOC_[GS]ETFSLABEL.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* maint/ioctls_sym.sh: Remove BTRFS_IOC_[GS]ET_FSLABEL.
	* tests/btrfs.c (FS_IOC_GETFSLABEL, FS_IOC_SETFSLABEL): Add fallback
	definitions.
	(btrfs_test_label_ioctls, btrfs_test_read_ioctls): Replace
	BTRFS_IOC_[GS]ET_FSLABEL with FS_IOC_[GS]ETFSLABEL.

2018-08-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	open.c: use __O_TMPFILE.
	As it is the flag kernel actually checks against,
	and it is now guaranteed to have a fallback definition.

	* open.c (STRACE_O_TMPFILE): Remove.
	(decode_open): Use __O_TMPFILE instead of STRACE_O_TMPFILE.

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: regenerate sock_options.in.
	* xlat/sock_options.in: Regenerate using maint/gen_xlat_defs.sh script.
	* xlat/sock_options.sh: Remove.

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: add fallback definitions to open_mode_flags.
	* xlat/open_mode_flags.in: Regenerate using maint/gen_xlat_defs.sh script
	to provide fallback definitions.  Implement a workaround for O_NDELAY.

	Co-Authored-by: Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: remove non-Linux flags from open_mode_flags.
	* xlat/open_mode_flags.in (O_PRIV, FNDELAY, FAPPEND, FMARK, FDEFER,
	FSHLOCK, FEXLOCK, FCREAT, FTRUNC, FEXCL, FNBIO, FSYNC, FNOCTTY,
	O_SHLOCK, O_EXLOCK): Remove flags that are not present in Linux.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: add fallback definitions to madvise_cmds.
	* xlat/madvise_cmds.in: Regenerate using maint/gen_xlat_defs.sh script
	to provide fallback definitions.

	Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: add fallback definitions to mmap_flags.
	* xlat/mmap_flags.in: Regenerate using maint/gen_xlat_defs.sh script
	to provide fallback definitions.  Implement a workaround for MAP_RENAME.

	Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	maint: add a Linux UAPI headers crawler.
	This script is going to be used to generate xlat fallback values.

	* maint/gen_xlat_defs.sh: New file.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

	strace.spec.in: use $RPM_OPT_FLAGS when building auxiliary programs.
	* strace.spec.in: Set CFLAGS_FOR_BUILD to "$RPM_OPT_FLAGS" so that
	$RPM_OPT_FLAGS is honored when building auxiliary programs like
	ioctlsort.

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

	strace.spec.in: compress changelog files.
	Some say uncompressed changelog files are too big.

	* strace.spec.in: Compress ChangeLog and ChangeLog-CVS using gzip -9n.

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

	strace.spec.in: use a SUSE-specific group name for SUSE.
	Since, apparently, it isn't quite happy with a simple group name
	"Development/Debuggers".

	* strace.spec.in (Group): Add %{?suse_version:/Tools}.

2018-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.spec.in: use a SUSE-specific license name for SUSE.
	Since, apparently, it isn't quite happy with a simple "BSD".

	* strace.spec.in (License): Add %{?suse_version:-3-Clause}.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: allow any error code when trying to set time.
	Lower expectations of particular error code numbers when trying to set
	time.  This helps to workaround issues with unexpected return codes
	in some exotic environments where EPERM is returned instead of EINVAL
	(e.g. mock that uses systemd-nspawn).

	* tests/clock_xettime.c (main): Do not hardcode EINVAL, print return
	codes using sprintrc.
	* tests/xettimeofday.c (main): Likewise.
	* NEWS: Mention this fix.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	s390x: fix build with old kernel headers.
	Avoid defining psw_compat_t and s390_compat_regs if their definitions
	are provided by kernel.  Before Linux commit v3.10-rc1~201^2~11,
	these definition were available in <asm/ptrace.h>.

	* configure.ac (AC_CHECK_TYPES): Check for s390_compat_regs.
	* linux/s390x/arch_regs.c [HAVE_S390_COMPAT_REGS]: Do not define
	psw_compat_t and s390_compat_regs.
	* NEWS: Mention this fix.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

	strace.spec.in: minor updates here and there.
	* strace.spec.in: Add descriptive comments to build requirements.
	Introduce %maybe_use_defattr and use it instead of %defattr.
	Add output of ld --version to the build environment information.
	Use printf instead of echo -e.

2018-08-05  Dmitry V. Levin  <ldv@altlinux.org>

	strace.spec.in: remove strace64 subpackage.
	strace64 subpackage used to be installed into ppc32 and sparc32
	userspace running by a 64-bit kernel to trace 64-bit processes.

	As simultaneous decoding of processes running both in 64-bit and 32-bit
	personality is fully supported on every architecture with compat kernel
	support for quite some time, one can just install a 64-bit strace and
	there is no more need for that strace64 kludge.

	* strace.spec.in (strace64_arches, copy64, %ifarch %{strace64_arches}):
	Remove.

2018-08-04  Dmitry V. Levin  <ldv@altlinux.org>

	Update NEWS.

	Update NEWS.

	rtnl_route: decode new RTA_* attributes.
	* rtnl_route.c (rtmsg_nla_decoders): Add entries for RTA_IP_PROTO,
	RTA_SPORT, and RTA_DPORT.

	xlat: update RTA_* constants.
	* xlat/rtnl_route_attrs.in: Add RTA_IP_PROTO, RTA_SPORT, and RTA_DPORT
	* constants introduced by Linux kernel commit v4.18-rc1~114^2~165^2~2.

	rtnl_link: decode new IFLA_BRPORT_* attributes.
	* rtnl_link.c (ifla_brport_nla_decoders): Add entries for
	IFLA_BRPORT_GROUP_FWD_MASK, IFLA_BRPORT_NEIGH_SUPPRESS, and
	IFLA_BRPORT_ISOLATED.

	xlat: update IFLA_BRPORT_* constants.
	* xlat/rtnl_ifla_brport_attrs.in: Add IFLA_BRPORT_GROUP_FWD_MASK
	constant introduced by Linux kernel commit v4.15-rc1~84^2~607.
	Add IFLA_BRPORT_NEIGH_SUPPRESS constant introduced by Linux kernel
	commit v4.15-rc1~84^2~523^2~2.
	Add IFLA_BRPORT_ISOLATED constant introduced by Linux kernel commit
	v4.18-rc1~114^2~142.

	xlat: update IFA_* constants.
	* xlat/rtnl_addr_attrs.in: Add IFA_RT_PRIORITY constant introduced
	by Linux kernel commit v4.18-rc1~114^2~108^2~3

	xlat: update RTPROT_* constants.
	* xlat/routing_protocols.in: Add RTPROT_BGP, RTPROT_ISIS, RTPROT_OSPF,
	RTPROT_RIP, and RTPROT_EIGRP constants introduced by Linux kernel commit
	v4.18-rc1~114^2~90.

2018-08-01  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: save the script used to generate xlat/sock_options.in.
	* xlat/sock_options.sh: New file from commit message of commit v4.23~199.

2018-08-01  Zhibin Li  <08826794brmt@gmail.com>

	tests: check decoding of getsockopt(PACKET_STATISTICS)
	* tests/net-tpacket_stats.c: New file.
	* tests/net-tpacket_stats-success.c: Likewise.
	* tests/gen_tests.in (net-tpacket_stats): New test.
	* tests/net-tpacket_stats-success.test: Likewise.
	* tests/.gitignore: Add net-tpacket_stats and net-tpacket_stats-success.
	* tests/Makefile.am (check_PROGRAMS): Add net-tpacket_stats-success.
	(DECODER_TESTS): Add net-tpacket_stats-success.test.
	* tests/pure_executables.list: Add net-tpacket_stats.

	tests: check decoding of setsockopt(PACKET_[R|T]X_RING)
	* tests/net-tpacket_req.c: New file.
	* tests/.gitignore: Add net-tpacket_req.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (net-tpacket_req): New test.

	tests: check decoding of setsockopt(PACKET_[ADD|DROP]_MEMBERSHIP)
	* tests/net-packet_mreq.c: New file.
	* tests/.gitignore: Add net-packet_mreq.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (net-packet_mreq): New test.

2018-07-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: bring lists back to the sorted order.
	* tests/.gitignore: Make the list sorted again.
	* tests/pure_executables.list: Likewise.
	* tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS):
	Likewise.

2018-07-20  Zhibin Li  <08826794brmt@gmail.com>

	tests: check decoding of successful quotactl.
	* tests/quotactl-success.c: New file.
	* tests/quotactl-success-v.c: Likewise.
	* tests/quotactl-xfs-success.c: Likewise.
	* tests/quotactl-xfs-success-v.c: Likewise.
	* tests/quotactl-success.test: New test.
	* tests/quotactl-success-v.test: Likewise.
	* tests/quotactl-xfs-success.test: Likewise.
	* tests/quotactl-xfs-success-v.test: Likewise.
	* tests/.gitignore: Add quotactl-success, quotactl-success-v,
	quotactl-xfs-success and quotactl-xfs-success-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add four new tests listed above.
	* tests/quotactl.h: [INJECT_RETVAL] (check_quota): Use errstr instead of
	sprintrc; check that returned value is equivalent to the injected one;
	append "(INJECTED)" string to errstr.
	* tests/quotactl.c: Changed condition rc != 0 to rc < 0 in callback
	functions and value of opaque pointer addr_cb_arg in order to check
	successful injection.
	* tests/quotactl-xfs.c: Likewise.

2018-07-18  Dmitry V. Levin  <ldv@altlinux.org>

	net: enhance decoding of getsockopt(PACKET_STATISTICS)
	* net.c (print_tpacket_stats): Change decoder to match the kernel
	behaviour: getsockopt syscall accepts any non-negative *optlen and
	writes either MIN(sizeof(struct tpacket_stats), *optlen) or
	MIN(sizeof(struct tpacket_stats_v3), *optlen) bytes of data.

	net: compile SO_PEERCRED/SO_ATTACH_FILTER/SO_ATTACH_REUSEPORT_CBPF code unconditionally
	* net.c: Remove checks for SO_PEERCRED, SO_ATTACH_FILTER, and
	SO_ATTACH_REUSEPORT_CBPF macros as they are defined unconditionally
	since commit v4.23~199.

	net: enhance decoding of getsockopt(SO_PEERCRED)
	* net.c (print_ucred): Rename to print_get_ucred, change decoder
	to match the kernel behaviour: getsockopt syscall accepts any
	non-negative *optlen and writes MIN(sizeof(struct ucred), *optlen)
	bytes of data.
	(print_getsockopt): Replace print_ucred with print_get_ucred.
	* tests/so_percred.c: Include <string.h>.
	(main): Update expected output.

	net: enhance decoding of getsockopt(SO_LINGER)
	* net.c (print_get_linger): Change decoder to match the kernel
	behaviour: getsockopt syscall accepts any non-negative *optlen
	and writes MIN(sizeof(struct linger), *optlen) bytes of data.
	(print_set_linger): Move after definition of SYS_FUNC(getsockopt).
	* tests/so_linger.c: Include <stddef.h> and <string.h>.
	(main): Update expected output.

	net: generalize getsockopt length check.
	* net.c (print_getsockopt): Apply (ulen < 0 || rlen < 0) check for all
	cases.  As the kernel neither accepts nor returns a negative length
	in case of successful getsockopt syscall invocation, these negative
	values must have been forged by userspace.

2018-07-15  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix build with fresh glibc.
	Workaround additional incompatibility between <sys/stat.h> and
	<asm/stat.h> introduced by glibc-2.27.9000-566-gfd70af4.

	* tests/xstatx.c (statx, statx_timestamp): Redefine before the inclusion
	of <sys/stat.h> to avoid conflicts between definitions provided by the
	linux kernel headers and the GNU libc.

2018-07-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/quotactl.h: document check_quota.
	* tests/quotactl.h (check_quota): Add a comment describing the function
	usage.

2018-07-15  Zhibin Li  <08826794brmt@gmail.com>

	tests/quotactl-xfs.c: fix indentation.

2018-07-15  Zhibin Li  <08826794brmt@gmail.com>

	tests: use check_quota for invalid quotactl commands.
	Use check_quota function for invalid commands instead of manual quotactl
	syscall invocations. In this way successful injection can also be checked
	for these commands in the next commit.

	* tests/quotactl.c (main): Add invalid_cmd_str and invalid_id_str local
	variables, remove unused variable rc, use check_quota instead of manual
	quotactl syscall invocations.
	* tests/quotaclt.c (main): Add invalid_cmd_str variable, remove unused
	variable rc, use check_quota instead of manual quotactl syscall invocations.

2018-07-15  Zhibin Li  <08826794brmt@gmail.com>

	tests: enhance test coverage of quotactl syscall parser.
	* tests/quotactl.c (print_dqfmt): New function.
	(main): Use print_dqfmt to print flags of quota format, improve existing
	tests and add more tests for Q_GETFMT.
	* tests/quotactl-xfs.c: Improve existing tests and add more tests for
	Q_XGETQSTAT and Q_XGETQSTATV.

	tests/quotactl-xfs.c: fix typos in QCMD.
	* tests/quotactl-xfs.c (main): fix typos of sub-commands in QCMD.

	Mpersify decoder of struct xfs_dqstats.
	* xfs_quota_stat.h: New file.
	* fetch_struct_xfs_quotastat.c: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* quota.c: Include xfs_quota_stat.h
	(struct fs_qfilestat, struct xfs_dqstats): Moved to xfs_quota_stat.h.
	(decode_cmd_data) <case Q_XGETQSTAT>: Use fetch_struct_quotastat.

	quota: fix disorder of PRINT_FIELD invocations.
	* quota.c (decode_cmd_data) <case Q_XGETQSTAT>: Print fields
	of struct xfs_dqstats in the structure order.

2018-07-12  Zhibin Li  <08826794brmt@gmail.com>

	tests: extend coverage for other fcntl flags.
	* tests/fcntl-common.c: Include <assert.h>.
	(struct fcntl_cmd_check): New structure.
	(print_retval_flags, test_other_set_cmd, test_other_get_cmd,
	print_flags_getfd, print_flags_getsig, print_flags_getlease,
	test_fcntl_others): New functions.
	(main): Use test_fcntl_others.

2018-07-11  Dmitry V. Levin  <ldv@altlinux.org>

	Implement -e kvm= option on all architectures.
	Make -e kvm= interface available on all architectures by adding a stub
	on those architectures that do not have <linux/kvm.h>.

	* filter_qualify.c (qualify_kvm): Define unconditionally.
	(qual_options): Define qualify_kvm entry unconditionally.
	* strace.c (usage): Mention kvm argument of -e option unconditionally.

2018-07-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update bpf(2)-related constants.
	* xlat/bpf_attach_type.in (BPF_CGROUP_UDP4_SENDMSG,
	BPF_CGROUP_UDP6_SENDMSG): New constant, introduced by Linux commit
	v4.18-rc1~114^2~9^2~20^2~4.
	(BPF_LIRC_MODE2): New constant, introduced by Linux commit
	v4.18-rc1~114^2~9^2~15^2~1.
	* xlat/bpf_commands.in (BPF_BTF_LOAD): New constant, introduced by Linux
	commit v4.18-rc1~114^2~417^2~1^2~5.
	(BPF_BTF_GET_FD_BY_ID): New constant, introduced by Linux commit
	v4.18-rc1~114^2~223^2~21^2~4.
	(BPF_TASK_FD_QUERY): New constant, introduced by Linux commit
	v4.18-rc1~114^2~148^2~1^2~5.
	* xlat/bpf_map_types.in (BPF_MAP_TYPE_XSKMAP): New constant, introduced
	by Linux commit v4.18-rc1~114^2~304^2~4^2~8.
	(BPF_MAP_TYPE_SOCKHASH): New constant, introduced by Linux commit
	v4.18-rc1~114^2~223^2~5^2~2.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_LWT_SEG6LOCAL): New constant,
	introduced by Linux commit v4.18-rc1~114^2~148^2~2^2~1.
	(BPF_PROG_TYPE_LIRC_MODE2): New constant, introduced by Linux commit
	v4.18-rc1~114^2~9^2~15^2~1.
	* tests/bpf.c: Update expected output.

2018-07-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Wire up io_pgetevents and rseq on hppa, microblaze, mips, powerpc, and s390
	* linux/hppa/syscallent.h ([350]): Wire up io_pgetevents syscall
	introduced by Linux commit v4.18-rc3~7^2~2.
	* linux/microblaze/syscallent.h ([399], [400]): Wire up io_pgetevents
	and rseq syscalls introduced by Linux commit v4.18-rc3~33^2~2.
	* linux/mips/syscallent-n32.h ([6331], [6332]): Wire up rseq and
	io_pgetevents syscalls introduced by Linux commits v4.18-rc2~11^2~2
	and v4.18-rc2~11^2, respectively.
	* linux/mips/syscallent-n64.h ([5327], [5328]): Likewise.
	* linux/mips/syscallent-o32.h ([4367], [4368]): Likewise.
	* linux/powerpc/syscallent.h ([388]): Wire up io_pgetevents syscall
	introduced by Linux commit v4.18-rc3~14^2~2.
	* linux/powerpc64/syscallent.h ([388]): Likewise.
	* linux/s390/syscallent.h ([382], [383]): Wire up io_pgetevents
	and rseq syscalls introduced by Linux commits v4.18-rc4~18^2~1
	and v4.18-rc4~18^2, respectively.
	* linux/s390x/syscallent.h([382], [383]): Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-07-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	maint: improve the tag message.
	* maint/gen-tag-message.sh: Align the wording of the changes section
	header with the one used in NEWS, add a reference to CREDITS in
	"Contributors" section.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-07-10  Dmitry V. Levin  <ldv@altlinux.org>

	Upgrade invalid -e kvm= argument to a fatal error.
	* filter_qualify.c (qualify_kvm): Call error_msg_and_die instead of
	error_msg in case of invalid -e kvm= argument.
	* tests/options-syntax.test: Check it.

	Mention -e inject option in "strace -h" output.
	* strace.c (usage): Mention inject argument of -e option.

2018-07-07  Masatake YAMATO  <yamato@redhat.com>

	tests: check decoding of vcpu auxstr.
	* tests/ioctl_kvm_run_common.c: Rename from ioctl_kvm_run.c.
	(run_kvm): Parametrize printing of KVM_RUN ioctl with print_KVM_RUN
	invocation.
	(main): Invoke optional KVM_NO_CPUID_CALLBACK macro when the old kernel
	behavior is detected.
	* tests/Makefile.am (EXTRA_DIST): Add ioctl_kvm_run_common.c.
	* tests/ioctl_kvm_run.c: New file, a wrapper around
	ioctl_kvm_run_common.c.
	* ioctl_kvm_run_auxstr_vcpu.c: Likewise.
	* tests/gen_tests.in (ioctl_kvm_run_auxstr_vcpu): New test.
	* tests/pure_executables.list: Add ioctl_kvm_run_auxstr_vcpu.
	* tests/.gitignore: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-07-07  Masatake YAMATO  <yamato@redhat.com>

	strace.1.in: document -e kvm=vcpu option.
	* strace.1.in (-e kvm=vcpu): Document new option.
	* NEWS: Mention -e kvm=vcpu option.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-07-07  Masatake YAMATO  <yamato@redhat.com>

	kvm: attach the exit reason of vcpu as auxstr to KVM_RUN output.
	In KVM, a virtual machine implementation like Qemu can access a vcpu
	via ioctl.  KVM_RUN is an ioctl command to enter vcpu.  The command
	returns control for various reasons: needs of device emulation or
	consuming time slices are the typical ones.  The vmi takes a different
	action for the reason.

	We, strace users, want to know the reason to understand kvm.  This
	change prints the reason as auxstr if "-e kvm=vcpu" option is given,
	and if strace runs on Linux 4.16.0 or higher, which includes commit
	e46b469278a59781f9b25ff608af84892963821b, "kvm: embed vcpu id to dentry
	of vcpu anon inode."

	The way to get the reason is a bit complicated because the ioctl does
	not return it to the userspace directly.  Instead, the vmi and kvm
	communicate via an area of the process virtual memory where the fd of
	vcpu is mmap'ed.  strace must peek the area to know the reason.

	The change does three things: (1) recording the area for the given vcpu
	when the target calls VCPU_CREATE to vcpu_info_list per tcb data field,
	(2) verifying the data recorded in vcpu_info_list before doing (3), and
	(3) decoding the exit reason field of the area.

	The change is complicated because there is a case that strace
	does not have a chance to do (1) if -p option is used.
	In this case, vcpu_info data created in the step (2).

	The area has more fields than "exit reason",
	dumping them may be implemented in the future.

	* defs.h (struct tcb) [HAVE_LINUX_KVM_H]: Add vcpu_info_list field.
	[HAVE_LINUX_KVM_H]: (kvm_run_structure_decoder_init,
	kvm_vcpu_info_free): New declarations.
	* strace.c (usage): Add "kvm" as a new expression for -e option.
	(droptcb): Call kvm_vcpu_info_free.
	* filter_qualify.c (qualify_kvm): New function calling
	kvm_run_structure_decoder_init to enable for attaching the exit
	reason to auxstr.
	(qual_options): Add "kvm" as an entry.
	* xlat/kvm_exit_reason.in: New file.
	* kvm.c: Include xmalloc.h and mmap_cache.h.
	(dump_kvm_run_structure): New static variable.
	(kvm_run_structure_decoder_init): New function.
	(vcpu_info): New struct definition representing the 3-tuple: vcpu file
	descriptor, id of the vcpu, and mmap'ed entry.
	(vcpu_find, vcpu_alloc, vcpu_register, vcpu_getinfo,
	kvm_vcpu_info_free): New functions to access tcb's vcpu_info_list
	field and vcpu_info data type.
	(is_map_for_file, map_len): New helper functions.
	(kvm_ioclt_run_attach_auxstr, kvm_ioctl_decode_run): New functions
	decoding vcpu exit reason and attaching the decoded data to auxstr
	field of tcb.
	(kvm_ioctl_create_vcpu): Call vcpu_register to make an entry mapping
	a file descriptor and the vcpu id associated with the fd.
	(kvm_ioctl): Call kvm_ioctl_decode_run.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-07-07  Masatake YAMATO  <yamato@redhat.com>

	mmap_cache: add customizable search function.
	* mmap_cache.c (mmap_cache_search_custom): New function.
	* mmap_cache.h (mmap_cache_search_fn): New type.
	(mmap_cache_search_custom): New function prototype.

2018-07-07  Pierre Marsais  <pierre.marsais@lse.epita.fr>

	tests: check verbose decoding of kvm ioctl.
	* tests/ioctl_kvm_run-v.c: New file.
	* tests/ioctl_kvm_run.c: Include xlat.h and xlat/kvm_cpuid_flags.h.
	(print_kvm_segment, print_kvm_sregs, print_kvm_regs): New functions.
	(run_kvm): Use them.
	(print_cpuid_ioctl) [VERBOSE]: Print verbose ioctl decoding.
	* tests/gen_tests.in (ioctl_kvm_run-v): New entry.
	* tests/pure_executables.list: Add ioctl_kvm_run-v.
	* tests/.gitignore: Likewise.

	tests: check decoding of kvm ioctls related to struct kvm_cpuid2.
	* tests/ioctl_kvm_run.c [!HAVE_STRUCT_KVM_CPUID2]: Skip the test.
	(KVM_MAX_CPUID_ENTRIES): New macro.
	(print_cpuid_ioctl): New function.
	(main): Add tests for cpuid related ioctl.

2018-07-07  Pierre Marsais  <pierre.marsais@lse.epita.fr>

	kvm: decode the argument of KVM_SET_CPUID2 and KVM_GET_*_CPUID ioctl commands
	* configure.ac (AC_CHECK_TYPES): Add struct kvm_cpuid2.
	* xlat/kvm_cpuid_flags.in: New file.
	* kvm.c [HAVE_STRUCT_KVM_CPUID2]: Include "xlat/kvm_cpuid_flags.h".
	[HAVE_STRUCT_KVM_CPUID2] (print_kvm_cpuid_entry, kvm_ioctl_decode_cpuid2):
	New functions.
	(kvm_ioctl) [HAVE_STRUCT_KVM_CPUID2]: Use kvm_ioctl_decode_cpuid2.
	* NEWS: Mention this improvement.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-07-07  Zhibin Li  <08826794brmt@gmail.com>

	net: fix a typo in print_tpacket_stats.

2018-07-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix race condition in aio.test.
	* tests/aio.c (main): Print aio_key fields before the io_submit syscall
	invocation to avoid races with the kernel.

2018-07-03  Dmitry V. Levin  <ldv@altlinux.org>

	ci: robustify network-related operations.
	Reduce false positives by wrapping network-related operations into a loop.

	* ci/install-dependencies.sh (retry_if_failed): New function.
	Use it to invoke apt-get update, apt-get install, git clone,
	add-apt-repository, and pip install.

2018-06-29  Zhibin Li  <08826794brmt@gmail.com>

	.gitignore: ignore linux/linux.
	Ignore directory linux/linux created by workaround from commit
	v4.23-11-g15003d4.

	* .gitignore: Add /linux/linux.

2018-06-18  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build on systems where libc relies on <linux/signal.h>
	Commit v4.23~10 has broken the build with Android's libc because it
	relies on the UAPI headers (such as <linux/signal.h>) to define various
	types, rather than copying them into the libc headers (such as <signal.h>)
	like most other Linux C libraries.

	* linux/linux/signal.h: Rename to linux/signal.h.in.
	* Makefile.am (strace_SOURCES): Remove linux/linux/signal.h.
	(EXTRA_DIST): Add linux/signal.h.in.
	(DISTCLEANFILES): Add linux/linux/signal.h.
	* configure.ac (AC_CACHE_CHECK): Check whether <linux/signal.h>
	can be used along with <signal.h>, install linux/linux/signal.h
	workaround if they cannot be used together.

	Reported-by: Elliott Hughes <enh@google.com>
	Closes: https://github.com/strace/strace/issues/72

2018-06-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add AUDIT_INTEGRITY_EVM_XATTR to nl_audit_types.
	* xlat/nl_audit_types.in (AUDIT_INTEGRITY_EVM_XATTR): New constant,
	introduced by Linux commit v4.18-rc1~100^2~9.

	xlat: add UDP_SEGMENT to sock_udp_options.
	* xlat/sock_udp_options.in (UDP_SEGMENT): New constant, introduced by
	Linux commit v4.18-rc1~114^2~377^2~8.

2018-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	Remove redundant range initializers in syscallent files.
	* linux/aarch64/syscallent.h: Remove redundant range initializers.
	* linux/x32/syscallent.h: Likewise.

2018-06-17  Chen Jingpiao  <chenjingpiao@gmail.com>

	x32: move rseq syscall entry to a suitable place.
	As rseq syscall is not x32-specific, move it after the previous one
	that is not x32-specific.  Fix the unused syscall number range.

	* linux/x32/syscallent.h ([334]): Move it after [333].
	([335 ... 511]): Update the range.

2018-06-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	aio: make iocb array output more strucutred.
	* aio.c (print_iocb): Print curly brackets.
	(print_iocbp): Do not print curly brackets.
	* tests/aio.c: Update expected output.

	aio: print IOCB_CMD_* using xlat.
	* xlat/aio_cmds.in: New file.
	* aio.c (tprint_lio_opcode): Change array of structs "cmds" to array of
	enums "subs", use printxval_indexn_ex for printing cmd, return sub type
	using subs array.

	xlat/sock_tcp_options.in: add #value_indexed.
	* xlat/sock_tcp_options.in: Add #value_indexed, provide fallback
	definitions.
	* net.c (print_sockopt_fd_level_name) <case SOL_TCP>: Use
	printxval_index instead of printxval.

	xlat/sock_tcp_options.in: update.
	* xlat/sock_tcp_options.in (TCP_ZEROCOPY_RECEIVE): New constant,
	introduced by Linux commit v4.18-rc1~114^2~351^2~1.
	(TCP_INQ): New constant, introduced by Linux commit v4.18-rc1~114^2~330.

	xlat/sigtrap_codes.in: add TRAP_UNK.
	* xlat/sigtrap_codes.in (TRAP_UNK): New constant, introduced by Linux
	commit v4.17-rc1-15-gdb78e6a.

2018-06-15  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.23-1.
	* strace.spec.in: Likewise.

2018-06-14  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.23 release.
	* NEWS: Update for 4.23 release.

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

	tests: add missing copyright headers.
	* tests/prctl-spec-inject.test: Add copyright header.
	* tests/qualify_personality.sh: Likewise.

	maint: document release procedure.
	* maint/README-release: New file.
	* maint/gen-release-notes.sh: Likewise.
	* maint/gen-release-github.sh: Likewise.
	* maint/gen-release-gitlab.sh: Likewise.

	maint: prepend contributor names in tag messages with an asterisk.
	* maint/gen-tag-message.sh: Prepend every line of
	gen-contributors-list.sh output with an asterisk.

2018-06-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.

2018-06-13  Dmitry V. Levin  <ldv@altlinux.org>

	Wire up rseq syscall.
	This new syscall was introduced by Linux commit v4.17-1308-gd7822b1.

	* linux/dummy.h (sys_rseq): New macro.
	* linux/arm/syscallent.h (398): Add rseq entry.
	* linux/i386/syscallent.h (386): Likewise.
	* linux/powerpc/syscallent.h (387): Likewise.
	* linux/powerpc64/syscallent.h (387): Likewise.
	* linux/x32/syscallent.h (334): Likewise.
	* linux/x86_64/syscallent.h (334): Likewise.

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of io_pgetevents syscall.
	* configure.ac (AC_CHECK_TYPES): Check for struct __aio_sigset
	in <linux/aio_abi.h>.
	* tests/aio_pgetevents.c: New file.
	* tests/.gitignore: Add aio_pgetevents.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (aio_pgetevents): New test.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement io_pgetevents syscall decoding.
	Introduced by Linux commit v4.17-rc3-7-g7a074e9.

	* print_aio_sigset.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* aio.c (print_io_getevents): Rename from SYS_FUNC(io_getevents), add
	has_usig flag, print user sigset on exiting if has_usig is set to true.
	(SYS_FUNC(io_getevents), SYS_FUNC(io_pgetevents)): New functions,
	wrappers for print_io_getevents.
	* linux/32/syscallent.h ([292]): Wire up io_pgetevents.
	* linux/64/syscallent.h ([292]): Likewise.
	* linux/i386/syscallent.h ([385]): Likewise.
	* linux/x32/syscallent.h ([333]): Likewise.
	* linux/x86_64/syscallent.h ([333]): Likewise.
	* NEWS: Mention this improvement.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-13  Dmitry V. Levin  <ldv@altlinux.org>

	travis: re-enable testing with the latest mainline kernel headers.
	As <linux/signal.h> is out of the game now, the Linux commit
	v4.17-rc3-7-g7a074e9 should not cause harm anymore, so let's enable
	testing with the latest mainline kernel headers again.

	* .travis.yml (matrix): Do not specify KBRANCH for KHEADERS=torvalds/linux.

2018-06-13  Dmitry V. Levin  <ldv@altlinux.org>

	Workaround incompatibility between <linux/signal.h> and libc headers.
	Override <linux/signal.h> with <signal.h> so that those few linux
	headers that include <linux/signal.h> could be included along with libc
	headers.

	* linux/linux/signal.h: New file.
	* Makefile.am (strace_SOURCES): Add it.

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add personality specification syntax checks.
	* tests/options-syntax.test: Add personality specification syntax
	checks.

	tests: add basic checks for personality designation support.
	* tests/qualify_personality.sh: New file.
	* tests/qualify_personality_empty.in: Likewise.
	* tests/trace_personality_32.in: Likewise.
	* tests/trace_personality_64.in: Likewise.
	* tests/trace_personality_regex_32.in: Likewise.
	* tests/trace_personality_regex_64.in: Likewise.
	* tests/trace_personality_regex_x32.in: Likewise.
	* tests/trace_personality_x32.in: Likewise.
	* tests/Makefile.am (EXTRA_DIST): Add them.
	* tests/gen_tests.in (trace_personality_32, trace_personality_64,
	trace_personality_x32, trace_personality_regex_32,
	trace_personality_regex_64, trace_personality_regex_x32): New tests.

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add support for personality designation in regex qualifications.
	* basic_filters.c (qualify_syscall_regex): Copy syscall name
	to a temporary buffer, append the personality designation to it,
	and check it against regular expression if the syscall name
	hasn't been matched already.

	References: https://github.com/strace/strace/issues/35

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add support for personality designation in syscall qualifications.
	* syscall.c (personality_designators): New array.
	* defs.h (personality_designators): New declaration.
	* basic_filters.c (qualify_syscall_separate_personality,
	qualify_syscall_number_personality): New functions.
	(qualify_syscall_number): Use qualify_syscall_separate_personality for
	checking for a personality specification, call
	qualify_syscall_number_personality for setting number set for specific
	personality.
	(qualify_syscall_name_personality): New function.
	(qualify_syscall_name): Use qualify_syscall_separate_personality for
	checking for a personality specification, call
	qualify_syscall_name_personality for setting number set for specific
	personality.
	* strace.1.in (.SS Filtering): Document it.
	* NEWS: Mention it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
	Closes: https://github.com/strace/strace/issues/35

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add basic checks for inject=SET:syscall= expression syntax.
	* tests/qual_fault-syscall.test: New test.
	* tests/qual_inject-error-signal-syscall.test: Likewise.
	* tests/qual_inject-retval-syscall.test: Likewise.
	* tests/qual_inject-signal-syscall.test: Likewise.
	* tests/Makefile.am (MISC_TESTS): Add them.
	* tests/qual_fault-syntax.test: Add checks for inject=SET:syscall=
	expression syntax.
	* tests/qual_inject-syntax.test: Likewise.
	* tests/qual_fault.test: Append $suffix to -e fault arguments, override
	$NAME with $name_override if the latter is set.
	* tests/qual_inject-error-signal.test: Append $suffix to -e inject
	arguments, override $NAME with $name_override if the latter is set.
	* tests/qual_inject-retval.test: Likewise.
	* tests/qual_inject-signal.test: Likewise.

2018-06-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement injection of syscalls with no side effects as an alternative to -1
	* defs.h (INJECT_F_SYSCALL, INJECT_ACTION_FLAGS, TCB_TAMPERED_NO_FAIL,
	syscall_tampered_nofail): New macros.
	(inject_data): Add scno field.
	* filter_qualify.c (struct inject_personality_data): New type.
	(parse_inject_token): Add "pdata" argument, parse "syscall=" option.
	(parse_inject_expression): Add "pdata" argument, forward it to
	parse_inject_token.
	(qualify_inject_common) <pdata>: New variable array, pass it to
	parse_inject_expression, copy it into inject_vec.
	* syscall.c (tamper_with_syscall_entering): Inject the specified syscall
	if INJECT_F_SYSCALL is set.
	(tamper_with_syscall_exiting): Update the check for a failed syscall
	injection.
	(get_syscall_result): Update get_error invocation.
	* strace.1.in: Document new syscall injection expression.
	* NEWS: Mention it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
	Closes: https://github.com/strace/strace/issues/26

2018-06-13  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: remove legacy i386 entries from the syscall entry table.
	Remove the last piece of IA-32 mode support.  Besides being obsolete,
	these bogus syscall entries cause problems with syscall name resolution.

	* linux/ia64/syscallent.h [CST > 0]: Remove.

	Complements: v4.21~17 "linux/ia64: remove IA-32 mode support"

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	linux: set error flags in arch_set_error on POWER and Alpha.
	* alpha/set_error.c (arch_set_error): Set alpha_r3 to 1, update tracee's
	REG_A3.
	* powerpc/set_error.c (arch_set_error): Set bit 28 in CCR register,
	update tracee's PT_CCR.

	Fixes: v4.15~126 "Implement arch specific methods of changing syscall number and error code"

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of IFLA_LINKINFO netlink attribute.
	* tests/nlattr_ifla_linkinfo.c: New file.
	* tests/pure_executables.list: Add nlattr_ifla_linkinfo.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (nlattr_ifla_linkinfo): New test.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add print_quoted_stringn to print string with a size limit.
	This is similar to print_quoted_cstring, but not quite the same.

	* tests/print_quoted_string.c (print_quoted_stringn): New function.
	* tests/tests.h (print_quoted_stringn): New declaration.

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add fallback_func argument to TEST_NESTED_NLATTR_OBJECT_EX_
	* tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT_EX_): Add fallback_func
	argument, call it instead of print_quoted_hex.
	(TEST_NESTED_NLATTR_OBJECT_EX, TEST_NESTED_NLATTR_OBJECT): Specify
	print_quoted_hex as a fallback_func.
	* tests/nlattr_ifla_af_spec.c: Specify print_quoted_hex as
	a fallback_func in TEST_NESTED_NLATTR_OBJECT_EX_ calls.

	tests/test_nlattr.h: add ability to provide additional nlattr payload.
	* tests/test_nlattr.h (print_nlattr): Add add_data argument, print
	opening square bracket if add_data is set to true.
	(TEST_NLATTR_EX_): Rename from TEST_NLATTR_, add nla_total_len_
	argument, use it for msg_len calculation, print square brackets
	if nla_total_len_ is greater than nla_data_len_.
	(TEST_NLATTR_): New macro, a wrapper for TEST_NLATTR_EX_.

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: decode struct ifla_bridge_id unconditionally.
	Since it is relatively simple.

	* rtnl_link.c (decode_ifla_bridge_id): Provide struct definition for
	the id variable.
	[!HAVE_STRUCT_IFLA_BRIDGE_ID] (decode_ifla_bridge_id): Decode struct
	ifla_bridge_id.

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nlattr: specify size for ethernet protocol.
	Otherwise it tries to decode payload of size 1, which makes little
	sense.

	* nlattr.c (decode_nla_ether_proto) <opts>: Specify size field.

	Fixes: v4.22-321-gfd0cd65 "nlattr: add ethernet protocol decoder"

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: use ARRSZ_PAIR where appropriate.
	It reduces code duplication somewhat and allows avoiding errors like
	the one fixed in the previous commit.

	* rtnl_link.c (decode_ifla_protinfo, decode_nla_linkinfo_data_bridge,
	decode_nla_linkinfo_data_tun, decode_ifla_linkinfo, decode_ifla_port,
	decode_ifla_vf_ports, decode_ifla_xdp,
	DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)): Use ARRSZ_PAIR in
	decode_nlattr call arguments.

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: fix incorrect variable names in ARRAY_SIZE arguments.
	* rtnl_link.c (decode_nla_linkinfo_data_bridge): Change
	rtnl_ifla_info_data_bridge_attrs to ifla_info_data_bridge_nla_decoders
	in ARRAY_SIZE call.
	(decode_nla_linkinfo_data_tun): Change rtnl_ifla_info_data_tun_attrs
	to ifla_info_data_tun_nla_decoders in ARRAY_SIZE call.

	Fixes: v4.22-328-g1e6d5a8 "rtnl_link: implement IFLA_INFO_DATA for bridges"
	Fixes: v4.22-329-g4eab3a4 "rtnl_link: implement IFLA_INFO_DATA for tun devices"

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mips: add missing pure flag to syscall entries.
	* linux/mips/syscallent-n32.h ([6038], [6100], [6102], [6105], [6106],
	[6108], [6109], [6178]): Add pure flag to getpid, getuid, getgid, geteuid,
	getegid, getpgid, getpgrp, and gttid syscall descriptors.
	* linux/mips/syscallent-n64.h ([5038], [5100], [5102], [5105], [5106],
	[5108], [5109], [5178]): Likewise.
	* linux/mips/syscallent-o32.h ([4020], [4024], [4047], [4049], [4050],
	[4064], [4065], [4222]): Likewise.

	Complements: v4.21~29 "Add pure syscall flag"

2018-06-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mips: add missing "never fails" flag to getpgrp syscall entries.
	* linux/mips/syscallent-n32.h ([6109]): Add NF flag.
	* linux/mips/syscallent-n64.h ([5109]): Likewise.
	* linux/mips/syscallent-o32.h ([4065]): Likewise.

	Complements: v4.21~46 "Add SYSCALL_NEVER_FAILS flag to getpgrp"

2018-06-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.
	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

	xlat: describe IPV4_DEVCONF_* weirdness.
	* xlat/inet_devconf_indices.in: Add a comment about fallback definitions.

2018-06-07  Dmitry V. Levin  <ldv@altlinux.org>

	configure.ac: fix the check for struct tc_sizespec on old kernel headers
	* configure.ac (AC_CHECK_TYPES): Include <linux/types.h> before
	<linux/pkt_sched.h> to check for struct tc_sizespec on linux kernel
	headers without v2.6.29-rc4~77^2~26 fix.

2018-06-06  Dmitry V. Levin  <ldv@altlinux.org>

	travis: use kernel headers from v4.17.
	There is too much noise when using unreleased kernel uapi.

	* ci/install-dependencies.sh (clone_repo): Add optional "branch"
	argument, pass it to "git clone".
	($KHEADERS): Pass $KBRANCH as branch argument of clone_repo.
	* .travis.yml (matrix): Specify KBRANCH=v4.17 for
	KHEADERS=torvalds/linux.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of IFLA_AF_SPEC netlink attribute.
	* configure.ac (AC_CHECK_TYPES): Check for struct ifla_cacheinfo in
	<linux/rtnetlink.h>
	(AC_CHECK_DECLS): Check for IFLA_AF_SPEC in <linux/rtnetlink.h>.
	* tests/nlattr_ifla_af_spec.c: New file.
	* tests/pure_executables.list: Add nlattr_ifla_af_spec.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (nlattr_ifla_af_spec): New test.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add TEST_NESTED_NLATTR_ARRAY_EX to test_nlattr.h.
	An ability to specify custom depth is going to be needed later to check
	IFLA_AF_SPEC decoding.

	* configure.ac (AC_CHECK_DECLS): Check for TCA_STAB_DATA in
	<linux/pkt_sched.h>.
	* tests/test_nlattr.h (TEST_NESTED_NLATTR_ARRAY_EX): Rename from
	TEST_NESTED_NLATTR_ARRAY, add depth_ argument, perform padding and
	output accordingly.
	(TEST_NESTED_NLATTR_ARRAY): New macro, a thin wrapper around
	TEST_NESTED_NLATTR_ARRAY_EX.
	* tests/nlattr_tca_stab.c [!HAVE_DECL_TCA_STAB_DATA] (TCA_STAB_DATA):
	New enumeration declaration.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: pass index to print_elem_ callback in TEST_NLATTR_NESTED_ARRAY.
	* tests/test_nlattr.h (TEST_NLATTR_NESTED_ARRAY): Pass array index
	to the print_elem_ callback.
	* tests/nlattr_tca_stab.c (print_uint16): Add index argument.

	tests: move common ifinfomsg boilerplate into a separate header.
	* configure.ac (AC_CHECK_DECLS): Check for IFLA_PORT_SELF, IFLA_PROTINFO, and
	IFLA_XDP in <linux/rtnetlink.h>.
	* tests/nlattr_ifla.h: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/nlattr_ifla_brport.c [!HAVE_DECL_IFLA_PROTINFO] (IFLA_PROTINFO):
	New declaration.
	(hdrlen, init_ifinfomsg, print_ifinfomsg): Remove.
	(IFLA_ATTR): Define to IFLA_PROTINFO.
	Include nlattr_ifla.h.
	* tests/nlattr_ifla_port.c [!HAVE_DECL_IFLA_PORT_SELF] (IFLA_PORT_SELF):
	New declaration.
	(hdrlen, init_ifinfomsg, print_ifinfomsg): Remove.
	(IFLA_ATTR): Define to IFLA_PORT_SELF.
	Include nlattr_ifla.h.
	* tests/nlattr_ifla_xdp.c
	* tests/nlattr_ifla_xdp.c [!HAVE_DECL_IFLA_XDP] (IFLA_XDP): New
	declaration.
	(hdrlen, init_ifinfomsg, print_ifinfomsg): Remove.
	(IFLA_ATTR): Define to IFLA_XDP.
	Include nlattr_ifla.h.

	rtnl_link: implement IFLA_INFO_DATA for tun devices.
	* xlat/rtnl_ifla_info_data_tun_attrs.in: New file.
	* xlat/tun_device_types.in: Likewise.
	* rtnl_link.c: Include xlat/rtnl_ifla_info_data_tun_attrs.h and
	xlat/tun_device_types.h.
	(decode_nla_tun_type, decode_nla_linkinfo_data_tun): New functions.
	(ifla_info_data_tun_nla_decoders): New decoder dispatcher table.
	(decode_nla_linkinfo_data): Use decode_nla_linkinfo_data_tun if kind
	is
	"tun".

	rtnl_link: implement IFLA_INFO_DATA for bridges.
	* xlat/rtnl_ifla_info_data_bridge_attrs.in: New file.
	* rtnl_link.c: Include xlat/rtnl_ifla_info_data_bridge_attrs.h.
	(ifla_info_data_bridge_nla_decoders): New decoder dispatcher table.
	(decode_nla_linkinfo_data_bridge, decode_nla_linkinfo_data): New
	functions.
	(ifla_linkinfo_nla_decoders) <IFLA_INFO_DATA>: Use
	decode_nla_linkinfo_data as a decoder.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: implement IFLA_INFO_XSTATS decoding.
	So far, only CAN provides it.

	* rtnl_link.c (decode_nla_linkinfo_xstats_can,
	decode_nla_linkinfo_xstats): New function.
	(ifla_linkinfo_nla_decoders) <IFLA_INFO_XSTATS>: Use
	decode_nla_linkinfo_xstats as a decoder.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: add basic IFLA_INFO_* handling.
	Dispatch for IFLA_INFO_* attributes should be performed based on the
	string provided in a IFLA_INFO_KIND attribute.

	* nlattr.h (struct ifla_linkinfo_ctx): New type definition.
	* rtnl_link.c (decode_nla_linkinfo_kind): New function.
	(ifla_linkinfo_nla_decoders) <IFLA_INFO_KIND>: Use
	decode_nla_linkinfo_kind as decoder.
	(decode_ifla_linkinfo): Add struct ifla_linkinfo_ctx context, pass it to
	the decode_nlattr call as opaque data.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: decode IFLA_AF_SPEC.
	* xlat/in6_addr_gen_mode.in: New file.
	* xlat/inet6_devconf_indices.in: Likewise.
	* xlat/inet6_if_flags.in: Likewise.
	* xlat/inet_devconf_indices.in: Likewise.
	* xlat/rtnl_ifla_af_spec_inet6_attrs.in: Likewise.
	* xlat/rtnl_ifla_af_spec_inet_attrs.in: Likewise.
	* xlat/snmp_icmp6_stats.in: Likewise.
	* xlat/snmp_ip_stats.in: Likewise.
	* rtnl_link.c: Include netinet/in.h, xlat/in6_addr_gen_mode.h,
	xlat/inet_devconf_indices.h, xlat/inet6_devconf_indices.h,
	xlat/inet6_if_flags.h, xlat/rtnl_ifla_af_spec_inet_attrs.h,
	xlat/rtnl_ifla_af_spec_inet6_attrs.h, xlat/snmp_icmp6_stats.h,
	and xlat/snmp_ip_stats.h.
	(decode_ifla_inet_conf, decode_ifla_inet6_flags,
	decode_ifla_inet6_conf, decode_ifla_inet6_stats,
	decode_ifla_inet6_cacheinfo, decode_ifla_inet6_icmp6_stats,
	decode_ifla_inet6_token, decode_ifla_inet6_agm, decode_ifla_af,
	decode_ifla_af_spec): New functions.
	(ifla_inet_nla_decoders, ifla_inet6_nla_decoders,
	nla_decoder_table_desc): New static constant variables.
	(ifinfomsg_nla_decoders) <[IFLA_AF_SPEC]>: Change value from NULL to
	decode_ifla_af_spec.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nlattr: add size check to decode_nla_xval and decode_nla_flags.
	If the field size is known, do not print as valid numbers those
	attributes that are too short, and ignore extra data.

	This change puts xval/flags printing in line with the reset of attribute
	decoders.

	* nlattr.h (struct decode_nla_xlat_opts): Add size field.
	* nlattr.c (decode_nla_xval, decode_nla_flags): Check that len is at
	least opts->size, limit len to opts->size.
	(decode_nla_ip_proto): Specify size of 1.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nlattr: add UID/GID netlink attribute decoders.
	* nlattr.h (DECL_NLA(uid), DECL_NLA(gid)): New declarations.
	* nlattr.c (decode_nla_uid, decode_nla_gid): New functions.

	nlattr: add unsigned int decoders that print in hex form.
	* nlattr.h (DECL_NLA(x8), DECL_NLA(x16), DECL_NLA(x32), DECL_NLA(x64)):
	New declarations.
	* nlattr.c (DECODE_NLA_INTEGER(x8, uint8_t, "%#" PRIx8),
	DECODE_NLA_INTEGER(x16, uint16_t, "%#" PRIx16),
	DECODE_NLA_INTEGER(x32, uint32_t, "%#" PRIx32),
	DECODE_NLA_INTEGER(x64, uint64_t, "%#" PRIx64)): New decoders.

	nlattr: add ethernet protocol decoder.
	* nlattr.h (DECL_NLA(ether_proto)): New declaration.
	* nlattr.c (process_host_order, decode_nla_ether_proto): New functions.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nlattr: add value processing support for xlat/flags nlattr decoders.
	Needed for upcoming decoder of ethernet proto which is stored in the
	host order and has to be converted to the network order before printing
	as an xval constant.  This change also adds ability to provide
	prefix/suffix in order to enclose the printed value in something that
	describes the performed conversion.

	* nlattr.h (struct decode_nla_xlat_opts): Add prefix, suffix, and
	process_fn fields.
	* nlattr.c (decode_nla_xval, decode_nla_flags): Handle process_fn,
	prefix, snd uffix parameters.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nlattr: introduce decode_nla_flags.
	Similar to decode_nla_xval.

	* nlattr.c (decode_nla_flags): New function.
	* nlattr.h: (DECL_NLA(flags)): New declaration.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nlattr: add ability to pass nla_type to decoder in decode_nlattr.
	As of now, it's impossible to introduce a dispatching nlattr decoder
	that performs actions based on the type of the message, so let's use
	a combination of zero decoder list size and non-zero decoder pointer
	for this.

	This is going to be used later in IFLA_AF_SPEC decoding.

	* nlattr.c (decode_nlattr_with_data): Handle zero size and non-NULL
	decoders in a special way.
	(decode_nlattr): Add an error message about ignoring of opaque_data
	argument when zero size and non-NULL decoders are provided.
	* nlattr.h (decode_nlattr): Add a comment about the new special case.

2018-06-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use STRINGIFY instead of _STR.
	Remove _STR which is essentially the same as STRINGIFY but from
	the namespace where we should not introduce new identifiers.

	* tests/tests.h (_STR): Remove.
	* tests/add_key.c (main): Replace _STR with STRINGIFY.
	* tests/keyctl.c (XARG_STR): Likewise.
	* tests/request_key.c (main): Likewise.

2018-06-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of IFLA_EVENT netlink attribute.
	* tests/nlattr_ifinfomsg.c (main): Add a check for IFLA_EVENT attribute
	decoding.

2018-06-05  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: handle xlat constants that are not identifiers.
	Extend xlat generator to support such input lines as
		IPV4_DEVCONF_FORWARDING-1	0

	This is going to be used later in IFLA_AF_SPEC decoding.

	* xlat/gen.sh (cond_def): If the xlat value is not an identifier name,
	extract an identifier name from the beginning of xlat value.

2018-06-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat.c: handle NULL xlat in lookup routines as incremental search.
	This is going to be used later in IFLA_AF_SPEC decoding.

	* xlat.c (xlookup): Add static variable pos, store xlat there when it is
	non-NULL, use pos for lookup.
	(xlat_search, xlat_idx): Add static variables pos and memb_left, store
	xlat and nmemb there when xlat is non-NULL, use them for lookup.
	(printxvals_ex): Store the last non-NULL xlat in static variable "last".
	If the first xlat argument is NULL, use "last" instead.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat.c: cleanup printxvals_ex a bit.
	* xlat.c (printxvals_ex): Change "str" variable visibility to the whole
	function, jump to va_end instead of duplicating call and return, return
	!!str.

	Leverage the fact that inet_protocols xlat is sorted.
	* defs.h (inet_protocols): Move up, add description.
	(inet_protocols_size): New declaration.
	* net.c (inet_protocols_size): New constant variable.
	* nlattr.c (decode_nla_ip_proto): Specify xlat_size, set xt to XT_SORTED.

2018-06-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Print arp_hardware_types as a sorted xlat.
	* rtnl_link.c (DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)): Use
	PRINT_FIELD_XVAL_SORTED_SIZED instead of PRINT_FIELD_XVAL for
	arp_hardware_types.
	* sock.c (print_ifreq): Likewise.

	Provide a value for arp_hardware_types_size array.
	* defs.h (arp_hardware_types_size): New declaration.
	* sockaddr.c (arp_hardware_types_size): New variable.

2018-06-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_fields.h: introduce PRINT_FIELD_XVAL_SORTED_SIZED.
	For those cases when array definition is not readily available
	and should be provided separately.

	* print_fields.h (PRINT_FIELD_XVAL_SORTED_SIZED): New macro.

2018-06-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/opipe.test: remove unneeded run_prog call.
	There is no need to invoke grep using run_prog.

	* tests/opipe.test: Remove run_prog decoration for the grep invocation.

2018-06-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check BPF_OBJ_GET_INFO_BY_FD decoding.
	* tests/bpf-obj_get_info_by_fd-prog-v.c: New file.
	* tests/bpf-obj_get_info_by_fd-prog.c: Likewise.
	* tests/bpf-obj_get_info_by_fd-v.c: Likewise.
	* tests/bpf-obj_get_info_by_fd.c: Likewise.
	* configure.ac (AC_CHECK_HEADERS): Check for struct bpf_insn,
	struct bpf_map_info, and struct bpf_prog_info.
	* tests/pure_executables.list: Add bpf-obj_get_info_by_fd,
	bpf-obj_get_info_by_fd-v, bpf-obj_get_info_by_fd-prog, and
	bpf-obj_get_info_by_fd-prog-v.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (bpf-obj_get_info_by_fd,
	bpf-obj_get_info_by_fd-v, bpf-obj_get_info_by_fd-prog,
	bpf-obj_get_info_by_fd-prog-v): New tests.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-04  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: enhance BPF_OBJ_GET_INFO_BY_FD decoder further.
	* bpf.c (print_ebpf_prog): Remove "decode" argument, all users updated.
	(print_bpf_prog_info): Use the minimum of xlated_prog_len values on
	entering and exiting syscall as the size of xlated_prog_insns array
	to be decoded.  Likewise, use the minimum of nr_map_ids values on entering
	and exiting syscall as the size of map_ids array to be decoded.

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: enhance BPF_OBJ_GET_INFO_BY_FD decoder.
	* bpf.c (print_bpf_map_info): Print only those fields that are
	present in the structure, as it has been growing over time.
	(print_bpf_prog_info): Likewise.  Print map_ids field as an array
	of uint32_t instead of uint64_t; print "name" field.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: move handling of the saved state to BPF_OBJ_GET_INFO_BY_FD decoder.
	As it is needed for proper info_len printing on exiting.

	* bpf.c (print_bpf_obj_info_fn): Change return type to void, add "saved"
	argument.
	(struct obj_get_info_saved): New type definition.
	(print_bpf_map_info, print_bpf_prog_info): Change return type to void,
	add "saved" argument, do not handle private tcb data allocation and
	obtainment.
	(print_bpf_obj_info_addr): Change return type to void, add tcb argument,
	print the address only on exiting.
	(print_bpf_obj_info): Change return type to void, add "saved" argument.
	(BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)): Handle private data
	allocation/saving/restoring, use it for storing/printing info_len field.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: print log_buf field as a string.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Print log_buf field
	as a string.
	* tests/bpf.c: Update expected output.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: print xlated_prog_insns only when xlated_prog_len had not been 0.
	If xlated_prog_len is zero on entering syscall and non-zero on exiting,
	the program itself is not written into xlated_prog_insns.

	* bpf.c (print_ebpf_prog): Add decode argument, print the address only
	if decode is false.
	(BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Specify decode == true argument
	to print_ebpf_prog.
	(print_bpf_prog_info): Specify saved xlated_prog_len as decode argument
	to print_ebpf_prog.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: move print_big_u64_addr inside print_ebpf_prog.
	* bpf.c (print_ebpf_prog): Add static qualifier.  Change the type
	of "addr" argument from kernel_ulong_t to uint64_t, print it using
	print_big_u64_addr.
	(BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD), print_bpf_prog_info): Do not call
	print_big_u64_addr before print_ebpf_prog.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-06-02  Dmitry V. Levin  <ldv@altlinux.org>

	bpf_attr.h: add ATTRIBUTE_ALIGNED(8) to all fields of type uint64_t.
	Our policy is that all fields of type uint64_t in this header file
	must have this attribute.

	This shouldn't cause any contradictions with <linux/bpf.h>
	unless the latter is buggy.

	By word "buggy" I mean containing such changes as Linux kernel commit
	v4.16-rc1~123^2~109^2~5^2~4.

	* bpf_attr.h (struct BPF_MAP_UPDATE_ELEM_struct): Add
	ATTRIBUTE_ALIGNED(8) to "flags" field.
	(struct bpf_prog_info_struct): Add ATTRIBUTE_ALIGNED(8) to "load_time"
	field.

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: cast printf arguments to short when %h format qualifier is used.
	Reported by clang.

	* tests/mknod.c (main): Cast printf argument for %#03ho format to short.
	* tests/mknodat.c (main): Likewise.
	* tests/net-sockaddr.c (main): Cast printf argument for %hu format
	to short.
	* tests/semop.c (main): Likewise.

2018-06-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat/evdev_keycode.in: remove constants with duplicating values.
	Those are used for describing input device category and not specific
	button.

	Reported by clang.

	* xlat/evdev_keycode.in (BTN_MOUSE, BTN_JOYSTICK, BTN_GAMEPAD, BTN_DIGI,
	BTN_WHEEL, BTN_TRIGGER_HAPPY): Remove.

2018-06-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	configure.ac: include <sys/socket.h> before <linux/rtnetlink.h>
	This is needed for old Linux UAPI headers that do no contain commit
	v3.1-rc2~19^2~29.

	* configure.ac: Include <sys/socket.h> before <linux/rtnetlink.h>
	in AC_CHECK_* invocations.

2018-06-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	configure.ac: check for linux/rtnetlink.h instead of linux/if_link.h for declarations
	Historically, type definitions and declarations related to netlink route
	interface attributes were in linux/rtnetlink.h, later they were moved
	elsewhere (first linux/if.h, then linux/if_link.h) with the inclusion
	of the corresponding header file in linux/rtnetlink.h.

	* configure.ac: Use <linux/rtnetlink.h> instead of <linux/if_link.h>
	in checks for interface netlink attributes-related declarations
	and definitions.

2018-06-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	m4: move the gawk script from m4/gen_bpf_attr_m4.sh into a separate file
	As it turns out, old versions of gawk do not support -e option.

	* m4/gen_bpf_attr_m4.sh: Move the gawk script ...
	* m4/gen_bpf_attr_m4.awk: ... here.

2018-06-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	s390: wire up kexec_file_load syscall.
	* linux/s390/syscallent.h ([381]): Add kexec_file_load syscall.
	* linux/s390/syscallent.h ([381]): Likewise.

2018-06-01  Zhibin Li  <08826794brmt@gmail.com>

	tests: check short read of struct flock/flock64.
	* tests/fcntl-common.c (test_flock_einval): Check short read
	of struct flock.
	(test_flock64_einval): Check short read of struct flock64.

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend struct flock/flock64 decoding checks.
	* tests/fcntl-common.c (test_flock_einval, test_flock): Create
	struct_kernel_flock object using tail_alloc.
	(test_flock64_einval): Create struct_kernel_flock64 object using
	tail_alloc.
	* tests/fcntl64.c (test_flock64_lk64): Likewise.

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend F_OFD_* decoding checks.
	Check that non-faulty F_OFD_* fcntl operations are decoded properly.

	* tests/fcntl-common.c: Include <string.h>.
	(test_flock64_ofd): New function.
	(test_flock64): Invoke it, remove [F_OFD_SETLK].

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests/fcntl-common.c: define and initialize errstr.
	Initialize errstr inside invoke_test_syscall so that its users
	won't have to go into trouble of caring about clobbering errno.

	* tests/fcntl-common.c (errstr): New variable.
	(invoke_test_syscall): Initialize it.
	(test_flock_einval, test_flock64_einval, test_flock,
	test_f_owner_ex_type_pid): Use it.
	* tests/fcntl.c (test_flock64_undecoded): Likewise.
	* tests/fcntl64.c (test_flock64_lk64): Likewise.

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests/fcntl-common.c: add fd argument to invoke_test_syscall.
	Extend invoke_test_syscall for later use with different file
	descriptors.

	* tests/fcntl-common.c (invoke_test_syscall): Add fd argument, pass it
	to TEST_SYSCALL_NR syscall.  All users updated.

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: move F_OFD_SETLK* checks from fcntl64.c to fcntl-common.c.
	This change enables F_OFD_SETLK* tests for fcntl as well.

	* tests/fcntl64.c (test_flock64): Rename to test_flock64_lk64.
	[F_OFD_SETLK]: Remove.
	(test_flock64_einval): Move ...
	* tests/fcntl-common.c: ... here.
	(test_flock64_lk64): New protype.
	(test_flock64_einval, test_flock64): New functions.
	* tests/fcntl.c (test_flock64_einval): Rename to test_flock64_undecoded.
	(TEST_FLOCK64_UNDECODED): New macro.
	(test_flock64): Rename to test_flock64_lk64, replace TEST_FLOCK64_EINVAL
	with TEST_FLOCK64_UNDECODED.

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: move F_OWNER_* tests to fcntl-common.c.
	This change enables F_OWNER_* tests for fcntl64 as well.

	* tests/fcntl.c: Move main, [TEST_FLOCK64_EINVAL],
	and [TEST_F_OWNER_EX] ...
	* tests/fcntl-common.c: ... here.
	(test_flock64): New prototype.
	* tests/fcntl64.c (main): Remove.

2018-06-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rename struct_flock.c to fcntl-common.c.
	It is not limited to struct flock, more fcntl tests are going to land
	in this file.

	* tests/struct_flock.c: Rename to fcntl-common.c.
	* tests/Makefile.am (EXTRA_DIST): Rename struct_flock.c
	to fcntl-common.c.
	* tests/fcntl.c: Likewise.
	* tests/fcntl64.c: Likewise.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of new FRA_* netlink attributes.
	* configure.ac (AC_CHECK_TYPES): Check for struct fib_rule_port_range
	in <linux/fib_rules.h>.
	* tests/nlattr_fib_rule_hdr.c: Include <linux/in.h>.
	(FRA_PROTOCOL, FRA_IP_PROTO, FRA_SPORT_RANGE, FRA_DPORT_RANGE): New
	macro constants.
	[!HAVE_STRUCT_FIB_RULE_PORT_RANGE] (struct fib_rule_port_range): New
	type.
	(main): Check decoding of new FRA_* netlink attributes.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_rule: decode new FRA_* attributes.
	* nlattr.h (DECL_NLA(ip_proto), DECL_NLA(rt_proto)): New declarations.
	* nlattr.c (decode_nla_ip_proto): New function.
	* rtnl_route.c (decode_nla_rt_proto): Likewise.
	* rtnl_rule.c (decode_rule_port_rang): Likewise.
	(fib_rule_hdr_nla_decoders) <[FRA_PROTOCOL]>: New attribute, introduced
	by Linux commit v4.17-rc1~148^2~371.
	(fib_rule_hdr_nla_decoders) <[FRA_IP_PROTO], [FRA_SPORT_RANGE],
	[FRA_DPORT_RANGE]>: New attributes, introduced by Linux commit
	v4.17-rc1~148^2~328^2~4.
	* xlat/rtnl_rule_attrs.in (FRA_PROTOCOL, FRA_IP_PROTO, FRA_SPORT_RANGE,
	FRA_DPORT_RANGE): New constants.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nlattr: introduce decode_nla_xval helper.
	* nlattr.c (decode_nla_xval): New function.
	* nlattr.h: Include "xlat.h".
	(struct decode_nla_xlat_opts): New type.
	(DECL_NLA(xval)): New declaration.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-30  Dmitry V. Levin  <ldv@altlinux.org>

	Move definitions of xlat_type and xlat_style from defs.h to xlat.h.
	* defs.h (enum xlat_type, enum xlat_style, XLAT_STYLE_FORMAT_SHIFT,
	XLAT_STYLE_VERBOSITY_MASK, XLAT_STYLE_FORMAT_MASK, XLAT_STYLE_SPEC_BITS,
	XLAT_STYLE_MASK): Move ...
	* xlat.h: ... here.

	travis: switch from gcc-7 to gcc-8.
	* .travis.yml (matrix): Change gcc-7 to gcc-8.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: use syscall() for ioctl() calls with oversized arguments.
	* tests/ioctl_inotify.c (sys_ioctl): New function.
	(main): Use sys_ioctl for ioctl calls with oversized arguments.
	* tests/ioctl_loop.c: Likewise.
	* tests/ioctl_perf.c: Likewise.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_ifindex: respect xlat style settings.
	Print interface indices according to the preferred xlat style settings.

	* print_ifindex.c (INI_PFX, INI_SFX): New helper macros.
	[HAVE_IF_INDEXTONAME] (get_ifname): New function.
	[HAVE_IF_INDEXTONAME] (print_ifindex): Implement as a wrapper around
	get_ifname and print_xlat_ex.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/test_nlattr.h: fix pointer calculation in TEST_NLATTR_ARRAY, take 2
	The old code works only when an array contains exactly two items.

	* tests/test_nlattr.h (TEST_NLATTR_ARRAY): Fix pointer address
	for the case of incomplete read.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nlattr: print index names in netlink meminfo array.
	* xlat/netlink_sk_meminfo_indices.in: New file.
	* nlattr.c: Include xlat/netlink_sk_meminfo_indices.h.
	(decode_nla_meminfo): Use print_array_ex, pass
	netlink_sk_meminfo_indices as index xlat table.
	* tests/nlattr_inet_diag_msg.c: Update expected output.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Introduce ARRSZ_PAIR macro.
	A shorthand similar to ARG_STR in its purpose: it provides and ability
	to pass an array an its size without variable name duplication.

	* macros.h (ARRSZ_PAIR): New macro.

2018-05-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_array: add support for printing array indices.
	* defs.h (XLAT_STYLE_SPEC_BITS, XLAT_STYLE_MASK): New macro constants.
	(tfetch_mem_fn, print_fn): New typedefs.
	(enum print_array_flag_bits, enum print_array_flags): New enumerations.
	(print_array_ex): Rename from print_array, add flags, index_xlat,
	index_xlat_size, and index_dflt arguments.
	(print_array): New static inline function, a thin wrapper around
	print_array_ex.
	util.c: Include "xlat.h".
	(print_array): Rename to print_array_ex, add flags, index_xlat,
	index_xlat_size, and index_dflt arguments.  Print array indices
	according to the style settings specified by flags if PAF_PRINT_INDICES
	is set.

2018-05-29  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance printing of unfetchable object addresses in sequences and arrays
	* btrfs.c (btrfs_print_tree_search): Print the address of unfetchable
	object inside the sequence using printaddr_comment.
	* msghdr.c (decode_msg_control): Likewise.
	* execve.c (printargv): Print the address of unfetchable object inside
	the array using printaddr_comment.
	* netlink.c (fetch_nlmsghdr): Add in_array argument.  When in_array
	is true, print the address of unfetchable object using
	printaddr_comment.
	* nlattr.c (fetch_nlattr): Likewise.
	* tests/execve.c (main): Update expected output.
	* tests/execveat.c (main): Likewise.
	* tests/msg_control.c (test_scm_rights1, test_scm_rights2,
	test_scm_security): Likewise.
	* tests/netlink_protocol.c (send_query): Likewise.
	* tests/nlattr.c (test_nlattr): Likewise.

2018-05-29  Dmitry V. Levin  <ldv@altlinux.org>

	print_array: enhance printing of unfetchable object addresses.
	When umoven_func invocation fails to fetch data, it prints the faulty
	address.  If this happens to a subsequent umoven_func invocation,
	the printed address may be undistinguishable from a valid data printed
	by print_func, e.g. when the data is printed in a numeric form like
	[0x1, 0x2, 0x3, 0xdefaced].

	Fix this source of confusion by moving the printing of the faulty
	address from umoven_func to print_array itself.  This change renames
	umoven_func to tfetch_mem_func and changes its semantics, so that
	 - tfetch_mem_func never prints anything;
	 - tfetch_mem_func returns true if the fetch succeeded,
	   and false otherwise.

	* defs.h (print_array): Replace umoven_func argument with
	tfetch_mem_func.
	* util.c (print_array): Replace umoven_func argument with
	tfetch_mem_func, document expected tfetch_mem_func return value
	semantics.  When tfetch_mem_func returns false, print either addr
	or "... /* addr */" depending on the context (inside the array or not).
	* bpf.c (print_ebpf_prog, print_bpf_prog_info,
	BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Replace umoven_or_printaddr
	argument of print_array with tfetch_mem.
	* bpf_filter.c (print_bpf_fprog): Likewise.
	* btrfs.c (btrfs_print_logical_ino_container,
	btrfs_print_ino_path_container, btrfs_print_qgroup_inherit,
	btrfs_ioctl): Likewise.
	* dm.c (dm_decode_dm_target_deps): Likewise.
	* epoll.c (epoll_wait_common): Likewise.
	* file_ioctl.c (file_ioctl): Likewise.
	* ipc_sem.c (tprint_sembuf_array): Likewise.
	* kexec.c (print_kexec_segments): Likewise.
	* mem.c (SYS_FUNC(subpage_prot)): Likewise.
	* net.c (print_getsockopt): Likewise.
	* netlink.c (decode_nlmsgerr_attr_cookie): Likewise.
	* netlink_netlink_diag.c (decode_netlink_diag_groups): Likewise.
	* netlink_packet_diag.c (decode_packet_diag_mclist): Likewise.
	* netlink_unix_diag.c (decode_unix_diag_inode): Likewise.
	* nlattr.c (decode_nla_meminfo): Likewise.
	* numa.c (print_nodemask, SYS_FUNC(move_pages),
	* perf_ioctl.c (perf_ioctl_query_bpf): Likewise.
	* poll.c (decode_poll_entering): Likewise.
	* printsiginfo.c (print_siginfo_array): Likewise.
	* rtnl_tc.c (decode_tca_stab_data): Likewise.
	* sock.c (decode_ifconf): Likewise.
	* uid.c (print_groups): Likewise.
	* io.c (SYS_FUNC(io_submit), SYS_FUNC(io_getevents)): Replace
	umoven_or_printaddr argument of print_array with tfetch_mem.
	(tprint_iov_upto): Replace umoven_or_printaddr_ignore_syserror
	with tfetch_mem_ignore_syserror.
	* v4l2.c (print_v4l2_format_fmt): Replace umoven_or_printaddr argument
	of print_array with tfetch_mem.
	(print_v4l2_ext_controls): Replace umoven_or_printaddr_ignore_syserror
	with tfetch_mem_ignore_syserror.
	* mmsghdr.c (fetch_struct_mmsghdr_or_printaddr): Rename
	to fetch_struct_mmsghdr_for_print, do not print address, return bool.
	(decode_mmsgvec): Replace fetch_struct_mmsghdr_or_printaddr
	with fetch_struct_mmsghdr_for_print.
	* tests/aio.c (main): Update expected output.
	* tests/bpf.c (print_BPF_PROG_QUERY_attr5): Likewise.
	* tests/ioctl_perf-success.c (main): Likewise.
	* tests/ioctl_v4l2.c (main): Update expected output.
	* tests/kexec_load.c (main): Likewise.
	* tests/mmsg_name.c (test_mmsg_name): Update expected output.
	* tests/move_pages.c (print_page_array, print_node_array): Likewise.
	* tests/poll.c (print_pollfd_array_entering): Likewise.
	* tests/preadv-pwritev.c (main): Likewise.
	* tests/preadv2-pwritev2.c (dumpio): Likewise.
	* tests/process_vm_readv_writev.c (print_iov): Likewise.
	* tests/pwritev.c (print_iovec): Likewise.
	* tests/readv.c (main): Likewise.
	* tests/seccomp-filter-v.c
	* tests/semop.c (main): Likewise.
	* tests/set_mempolicy.c (print_nodes): Likewise.
	* tests/setgroups.c (main): Likewise.
	* tests/test_nlattr.h (print_nlattr) Likewise.

	Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-05-29  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce tfetch_* family of functions and macros.
	These new functions are going to be used instead of umove_or_printaddr*
	as umoven_func argument of print_array.

	* defs.h (tfetch_mem64, tfetch_mem64_ignore_syserror): New
	function prototypes.
	(tfetch_mem, tfetch_mem_ignore_syserror): New static inline
	wrappers.
	(tfetch_obj): New macro wrapper around tfetch_mem.
	* util.c (tfetch_mem64, tfetch_mem64_ignore_syserror): New
	functions.
	(umoven_or_printaddr64, umoven_or_printaddr64_ignore_syserror): Use
	them.

2018-05-29  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce printaddr_comment.
	* defs.h (printaddr_comment): New static inline wrapper around
	tprintf_comment.

	Turn printaddr into a thin wrapper around printaddr64.
	* util.c (printaddr): Move ...
	* defs.h: ... here, add "static inline" qualifiers.

2018-05-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs.h: add comments about umove* return values.
	* defs.h (umoven, umoven_or_printaddr64,
	umoven_or_printaddr64_ignore_syserror, umovestr): Add comments about
	return values.

2018-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use TAIL_ALLOC_OBJECT_CONST_PTR where appropriate.
	* tests/kcmp.c (main): Use TAIL_ALLOC_OBJECT_CONST_PTR.
	* tests/modify_ldt.c (main): Likewise.
	* tests/netlink_protocol.c (send_query): Likewise.
	* tests/ptrace.c (test_peeksiginfo, main): Likewise.
	* tests/s390_guarded_storage.c (main): Likewise.
	* tests/s390_sthyi.c (main): Likewise.
	* tests/xet_thread_area_x86.c (main): Likewise.

2018-05-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: decode bpf_attr.info field used by BPF_OBJ_GET_INFO_BY_FD command.
	* bpf_attr.h [!BPF_TAG_SIZE] (BPF_TAG_SIZE): Define.
	[BPF_TAG_SIZE]: Check that BPF_TAG_SIZE is 8.
	(struct bpf_map_info_struct, struct bpf_prog_info_struct): New
	structures.
	(bpf_map_info_struct_size, expected_bpf_map_info_struct_size,
	bpf_prog_info_struct_size, expected_bpf_prog_info_struct_size): New
	macro constants.
	* bpf.c (print_bpf_obj_info_fn): New type.
	(print_bpf_map_info, print_bpf_prog_info, fetch_bpf_obj_info,
	print_bpf_obj_info_addr, print_bpf_obj_info): New functions.
	(BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)): Print bpf_fd and info_len
	fields only on entering, call print_bpf_obj_info for printing info field.
	* tests/bpf.c (BPF_OBJ_GET_INFO_BY_FD_checks): Print info field
	as a pointer.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: add support for checking structures outside union bpf_attr.
	struct bpf_prog_info and bpf_map_info need essentially the same handling
	as union bpf_attr.

	* gen_bpf_attr_check.sh: Derive type_name from $struct if it doesn't
	start with "BPF_", derive TYPE_NAME from type_name, use them in code
	generation.
	* m4/gen_bpf_attr_m4.sh: Rewrite parsing/generation code into awk,
	add support for structures outside union bpf_attr.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: remove bpf_priv_data.
	As various bpf commands need different data to save between entering
	and exiting of the syscall, do not emulate union bpf_attr approach.

	* bpf.c (struct bpf_priv_data): Remove.
	(DECL_BPF_CMD_DECODER): Remove "struct bpf_priv_data *" argument.
	(BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Use set_tcb_priv_ulong
	and get_tcb_priv_ulong to keep bpf_attr.query.prog_cnt field.
	(SYS_FUNC(bpf)): Remove priv variable, do not initialize it,
	and do not pass it to bpf_cmd_decoders.

2018-05-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add union bpf_attr.query.prog_ids field decoding checks.
	* tests/bpf-success-v.c: New file.
	* tests/bpf-success.c: Likewise.
	* tests/bpf-success-v.test: New test.
	* tests/bpf-success.test: Likewise.
	* tests/.gitignore: Add bpf-success and bpf-success-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add bpf-success.test and bpf-success-v.test.
	* tests/bpf.c [INJECT_RETVAL] (sys_bpf): Check that retuned value
	is equivalent to the injected one; append "(INJECTED)" string to errstr.
	(prog_load_ids, prog_load_ids_ptr): New variables.
	(init_BPF_PROG_QUERY_attr4, print_BPF_PROG_QUERY_attr4,
	init_BPF_PROG_QUERY_attr5, print_BPF_PROG_QUERY_attr5): New functions.
	(BPF_PROG_QUERY_checks): Drop "const" qualifier, add new checks.

	bpf: BPF_PROG_QUERY bpf_attr.query.prog_ids printing fixes.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Use
	print_uint32_array_member instead of print_uint64_array_member for
	printing prog_ids elements (and change the type of prog_id_buf from
	uint64_t to uint32_t), as they are 32-bit; use common trick with
	print_big_u64_addr for handling possible ambiguity with prog_ids
	address.
	* tests/bpf.c (BIG_ADDR_MAYBE): New macro.
	(BPF_PROG_QUERY_checks): Update expected output.

	bpf: add support for instruction decoding.
	* xlat/ebpf_regs.in: New file.
	* bpf.c (struct ebpf_insn, struct ebpf_insns_data): New type definitions.
	(print_ebpf_insn, print_ebpf_prog): New functions.
	(DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Use them.

2018-05-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of successful PERF_EVENT_IOC_{ID,QUERY_BPF} ioctls
	As these have some argument output on the exit path.

	* tests/ioctl_perf-success.c: New file.
	* tests/ioctl_perf-success.test: New test.
	* tests/Makefile.am (DECODER_TESTS): Add it.
	(check_PROGRAMS): Add ioctl_perf-success.
	* tests/.gitignore: Likewise.
	* tests/ioctl_perf.c: Remove TODO.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement PERF_EVENT_IOC_* decoding.
	* perf.c (fetch_perf_event_attr, print_perf_event_attr): Remove "static"
	qualifier.
	* defs.h (fetch_perf_event_attr, print_perf_event_attr): New
	declarations.
	* perf_event_struct.h (struct perf_event_query_bpf): New type
	definition.
	* perf_ioctl.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* xlat/perf_ioctl_cmds.in: New file.
	* xlat/perf_ioctl_flags.in: Likewise.
	* ioctl.c (ioctl_decode) <case '$'>: Call perf_ioctl.
	* tests/gen_tests.in (ioctl_perf): New test.
	* tests/ioctl_perf.c: New file.
	* tests/pure_executables.list: ioctl_perf.
	* tests/.gitignore: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix ipc_msgbuf.test.
	* tests/ipc_msgbuf.test: Fix -a argument.

2018-05-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update IPPROTO_* constants.
	* xlat/inet_protocols.in (IPPROTO_GGP, IPPROTO_HELLO, IPPROTO_ND):
	Remove, not defined in Linux.
	(IPPROTO_BEETPH): New constant, introduced by Linux commit
	v2.6.19-rc1~33^2.
	(IPPROTO_L2TP): New constant, introduced by Linux commit
	v2.6.35-rc1~473^2~594.
	(IPPROTO_MH): New constant, introduced by Linux commit
	v2.6.19-rc1~1272^2~157.
	Add default values to constants, sort the file.

	xlat: add fallback definitions to RTPROT_* constants.
	* xlat/routing_protocols.in: Add default values to constants.

	xlat: add SECCOMP_FILTER_FLAG_SPEC_ALLOW.
	* xlat/seccomp_filter_flags.in (SECCOMP_FILTER_FLAG_SPEC_ALLOW): New
	constant, introduced by Linux commit v4.17-rc3-24-g00a02d0.
	* tests/seccomp-filter.c: Update expected output.
	* tests/seccomp-filter-v.c: Likewise.

	prctl: add PR_GET_SPECULATION_CTRL/PR_SET_SPECULATION_CTRL decoding.
	* xlat/pr_spec_cmds.in: New fille.
	* xlat/pr_spec_get_store_bypass_flags.in: Likewise.
	* xlat/pr_spec_set_store_bypass_flags.in: Likewise.
	* xlat/prctl_options.in (PR_GET_SPECULATION_CTRL,
	PR_SET_SPECULATION_CTRL): New constants, introduced by Linux commit
	v4.17-rc3-15-gb617cfc.
	* prctl.c (SYS_FUNC(prctl)) <case PR_GET_SPECULATION_CTRL,
	case PR_SET_SPECULATION_CTRL>: Implement decoding of new prctl options.
	* tests/Makefile.am (check_PROGRAMS): Add prctl-spec-inject.
	(DECODER_TESTS): Add prctl-spec-inject.test.
	* tests/prctl-spec-inject.c: New file.
	* tests/prctl-spec-inject.test: New test.
	* tests/.gitignore: Add prctl-spec-inject.

	tests: add keyctl variants with different xlat verbosity levels.
	* tests/keyctl-Xabbrev.c: New file.
	* tests/keyctl-Xraw.c: Likewise.
	* tests/keyctl-Xverbose.c: Likewise.
	* tests/keyctl.c (XARG_STR): New macro.
	(do_keyctl): Print command in accordance with XLAT_RAW/XLAT_VERBOSE settings.
	(main): Update expected output.
	* tests/pure_executables.list: Add keyctl-Xabbrev, keyctl-Xraw,
	and keyctl-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (keyctl-Xabbrev, keyctl-Xraw, keyctl-Xverbose): New
	tests.

	keyctl: print KEYCTL_SET_REQKEY_KEYRING argument as an integer.
	* xlat/key_reqkeys.in: Add #val_type int.
	* keyctl.c (SYS_FUNC(keyctl)) <case KEYCTL_SET_REQKEY_KEYRING>: Print
	arg2 as an integer.
	* tests/keyctl.c: Update expected output.

	keyctl: respect xlat style when printing errno.
	* keyctl.c (keyctl_reject_key): Use print_xlat_ex for printing error
	argument.

2018-05-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall.c: unify error value printing.
	There's little reason not to decode error code for syscalls printed in
	raw; moreover, it creates inconsistencies for unknown syscall printing.

	Another issue was with error numbers unknown to strace: previously, they
	were printed as "... = -1 1234 (Unknown error 1234)" which looked kinda
	weird.

	* syscall.c (print_err_ret): New function.
	(syscall_exiting_trace): Remove u_error variable, use tcp->u_error
	instead. Remove u_error_str variable.
	(syscall_exiting_trace) <if (raw(tcp))>: Call print_err_ret if u_error
	is non-zero.
	(syscall_exiting_trace) <if (!(sys_res & RVAL_NONE) && tcp->u_error)>:
	Use print_err_ret for default error printing.
	* tests/nsyscalls.c [!LINUX_MIPSO32] (test_syscall): Update expected
	output.
	* tests/qual_fault.c (invoke) <if (is_raw)>: Likewise.
	* strace.1.in (.SH DESCIPTION): Update unknown syscall example.

2018-05-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ioctl: implement INOTIFY_IOC_SETNEXTWD decoding.
	* inotify_ioctl.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (DECL_IOCTL(inotify)): New declaration.
	* ioctl.c (ioctl_decode) <case 'I'>: Call inotify_ioctl.
	* tests/ioctl_inotify.c: New file.
	* tests/.gitignore: Add ioctl_inotify.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (ioctl_inotify): New test.

	tests/test_nlattr.h: avoid testing cropped objects of size 1.
	* tests/test_nlattr.h (TEST_NLATTR_OBJECT_EX_): Check
	"len < sizeof(obj_)" case only if "sizeof(obj_) > 1".

	tests: pass index to print_elem_ callback in TEST_NLATTR_ARRAY.
	* tests/test_nlattr.h (TEST_NLATTR_ARRAY): Pass array index to the
	print_elem_ callback.
	* tests/nlattr_inet_diag_msg.c (print_uint): Add index argument.
	* tests/nlattr_netlink_diag_msg.c (print_xlong): Likewise.
	* tests/nlattr_packet_diag_msg.c (print_packet_diag_mclist,
	print_sock_filter): Likewise.
	* tests/nlattr_unix_diag_msg.c (print_uint): Likewise.

2018-05-24  Dmitry V. Levin  <ldv@altlinux.org>

	tests: further cleanup bpf big address checks.
	Replace BIG_ADDR_IS_64BIT and BIG_ADDR_IS_32BIT with BIG_ADDR().

	* tests/bpf.c (BIG_ADDR): New macro.
	(BIG_ADDR_IS_64BIT, BIG_ADDR_IS_32BIT): Remove.
	(BPF_PROG_LOAD_checks, BPF_OBJ_PIN_checks,
	BPF_RAW_TRACEPOINT_OPEN_checks): Use BIG_ADDR() instead of
	BIG_ADDR_IS_64BIT and BIG_ADDR_IS_32BIT.

2018-05-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: cleanup bpf big address checks.
	Introduce BIG_ADDR_IS_64BIT and BIG_ADDR_IS_32BIT to reduce redundancy.

	* tests/bpf.c (BIG_ADDR_IS_64BIT, BIG_ADDR_IS_32BIT): New macros.
	(BPF_PROG_LOAD_checks, BPF_OBJ_PIN_checks,
	BPF_RAW_TRACEPOINT_OPEN_checks): Use them.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: add support for BPF_RAW_TRACEPOINT_OPEN command decoding.
	* bpf_attr.h (struct BPF_RAW_TRACEPOINT_OPEN_struct): New type
	definition.
	(BPF_RAW_TRACEPOINT_OPEN_struct_size,
	expected_BPF_RAW_TRACEPOINT_OPEN_struct_size): New macros.
	* xlat/bpf_commands.in (BPF_RAW_TRACEPOINT_OPEN): New constant,
	introduced by Linux commit v4.17-rc1~148^2~19^2~4^2~3.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_RAW_TRACEPOINT): Likewise.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_RAW_TRACEPOINT_OPEN)): New bpf
	command decoder.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Add
	BPF_CMD_ENTRY(BPF_RAW_TRACEPOINT_OPEN).
	* tests/bpf.c (union bpf_attr_data): Add
	BPF_ATTR_DATA_FIELD(BPF_RAW_TRACEPOINT_OPEN).
	(BPF_PROG_LOAD_checks): Update.
	(init_BPF_RAW_TRACEPOINT_attr2): New function.
	(BPF_RAW_TRACEPOINT_OPEN_checks): New checks array.
	(main) <checks>: Add CHK(BPF_RAW_TRACEPOINT_OPEN).

	bpf: add support for decoding struct bpf_attr.expected_attach_type field
	* bpf_attr.h (struct BPF_PROG_LOAD_struct): Add expected_attach_type
	field.
	(BPF_PROG_LOAD_struct_size): Update to offsetofend of
	expected_attach_type field.
	(expected_BPF_PROG_LOAD_struct_size): Update to 72.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Decode
	expected_attach_type field.
	* tests/bpf.c: Update expected output.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nlattr: do not assume that SK_MEMINFO_VARS is constant.
	SK_MEMINFO_VARS changes over time (as it was in Linux commit
	v4.7-rc1~154^2~354^2~4, for example), so we cannot use it
	for sanity checks.

	* nlattr.c (print_meminfo): Remove.
	(decode_nla_meminfo): Use generic print_uint32_array_member element
	printer callback.
	* tests/nlattr_inet_diag_msg.c (main): Update expected output.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Introduce print_uint32_array_member helper function.
	Analogous to print_int32_array_member, this helper is going to be used
	in various decoders, including BPF_PROG_QUERY, PERF_EVENT_IOC_*,
	and netlink meminfo.

	* defs.h (print_uint32_array_member): New declaration.
	* util.c (print_uint32_array_member): New function.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Introduce print_int32_array_member helper function.
	Analogous to print_uint64_array_member, this helper is going to be used
	for IFLA_AF_SPEC decoding.

	* defs.h (print_int32_array_member): New declaration.
	* util.c (print_int32_array_member): New function.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs.h: move print_uint64_array_member and print_array declarations down
	In preparation for the forthcoming changes.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/test_nlattr.h: fix pointer calculation in TEST_NLATTR_ARRAY.
	The old code works only when an array contains exactly two items.

	* tests/test_nlattr.h (TEST_NLATTR_ARRAY): Fix pointer address
	for the case of incomplete read.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sockaddr: add support for sockaddr_l2 without l2_bdaddr_type.
	Apparently, struct sockaddr_l2 changed over time: the l2_bdaddr_type
	field was added only by commit v3.5-rc1~35^2~3^2~18^2^2~39.

	* configure.ac (AC_CHECK_HEADERS): Move bluetooth/bluetooth.h check into
	a separate check.
	(AC_CHECK_HEADERS([bluetooth/bluetooth.h])): New check, also checks for
	struct sockaddr_l2.l2_bdaddr_type member in case of success.
	* sockaddr.c (print_sockaddr_data_bt) <case offsetof(struct sockaddr_l2,
	l2_bdaddr_type)>: Add to sizeof(struct sockaddr_l2) case. Print
	l2_bdaddr_type field only if the provided sockaddr is big enough.
	* tests/net-sockaddr.c (check_l2): Put l2_bdaddr_type usage/printing
	under HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE ifdef, add a check for the
	sockaddr_l2 structure without the l2_bdaddr_type field.

2018-05-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sock: guess ifr_hwaddr size in SIOCSIFHWADDR/SIOCGIFHWADDR.
	And make the output more structured.

	* sock.c: Include xlat/arp_hardware_types.h in XLAT_MACROS_ONLY mode.
	(print_ifreq) <case SIOCSIFHWADDR, case SIOCGIFHWADDR>: Introduce
	hwaddr_sizes array, print ifr_hwaddr.sa_family, print ifr_hwaddr.sa_data
	using hwaddr_sizes and PRINT_FIELD_MAC_SZ.

2018-05-22  Dmitry V. Levin  <ldv@altlinux.org>

	Simplify errnoent and signalent.
	Remove personality support for errnoent and signalent as
	there is nothing personality-specific in these files.

	* linux/aarch64/errnoent1.h: Remove.
	* linux/aarch64/signalent1.h: Likewise.
	* linux/powerpc64/errnoent1.h: Likewise.
	* linux/powerpc64/signalent1.h: Likewise.
	* linux/riscv/errnoent1.h: Likewise.
	* linux/riscv/signalent1.h: Likewise.
	* linux/s390x/errnoent1.h: Likewise.
	* linux/s390x/signalent1.h: Likewise.
	* linux/sparc64/errnoent1.h: Likewise.
	* linux/sparc64/signalent1.h: Likewise.
	* linux/tile/errnoent1.h: Likewise.
	* linux/tile/signalent1.h: Likewise.
	* linux/x32/errnoent1.h: Likewise.
	* linux/x32/signalent1.h: Likewise.
	* linux/x86_64/errnoent1.h: Likewise.
	* linux/x86_64/errnoent2.h: Likewise.
	* linux/x86_64/signalent1.h: Likewise.
	* linux/x86_64/signalent2.h: Likewise.
	* Makefile.am (EXTRA_DIST): Remove them.
	* defs.h (errnoent0): Rename to errnoent.
	(signalent0): Rename signalent.
	(nerrnos, nsignals): Change to const variables unconditionally.
	* syscall.c (errnoent0): Rename to errnoent.
	(signalent0): Rename signalent.
	(nerrnos, nsignals): Change to const variables unconditionally.
	(nerrnos0, nsignals0): Remove.
	[SUPPORTED_PERSONALITIES > 1] (errnoent1, signalent1, nerrnos1,
	nsignals1): Remove.
	[SUPPORTED_PERSONALITIES > 2] (errnoent2, signalent2, nerrnos2,
	nsignals2): Likewise.
	(set_personality): Do not assign errnoent, signalent, nerrnos,
	and nsignals.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: mention -Xraw in -eraw description.
	* strace.1.in (\fB\-e\ raw\fR=\,\fIset\fR): Mention -X raw.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: display -k option description only if it is enabled.
	Leverage the fact that manpage is generated and add condition statements
	around mentions of -k option.

	* strace.1.in (.SH SYNOPSIS): Put option list inside an
	".if '@ENABLE_STACKTRACE_TRUE@'#' .ig end_unwind_opt ... .end_unwind_opt"
	condition; add a second list of options without -k and put it inside
	".if '@ENABLE_STACKTRACE_FALSE@'#' .ig end_no_unwind_opt ... .end_no_unwind_opt"
	condition.
	(.SS Output format) <-k>: Put it inside
	".if '@ENABLE_STACKTRACE_TRUE@'#' .ig end_unwind ... .end_unwind"
	condition, remove the mention of --enable-stacktrace configuration
	option requirement.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: format a reference to "open" syscall using bold font.
	* strace.1.in (.SH DESCRIPTION): Format a reference to "open" syscall
	using bold font.

	tests/qual_fault.test: add -efu arguments to the interpreter.
	* tests/qual_fault.test (#!/bin/sh): Add -efu arguments.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/qual_fault.test: swap expected/output files in match_diff calls.
	match_diff expects the first argument as strace output and the second
	argument as expected output.

	* tests/qual_fault.test (check_fault_injection): Swap arguments
	in match_diff calls.

2018-05-21  Dmitry V. Levin  <ldv@altlinux.org>

	defs.h: convert some macro wrappers into static inline functions.
	* defs.h (pathtrace_select, pathtrace_match, printxval_searchn,
	printxval_indexn, sprintxval, sprintflags, printnum_slong,
	printnum_ulong, printnum_ptr, printnum_kptr): Convert macro wrappers
	into static inline functions.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add support for xlat_styles in printxval_dispatch.
	* defs.h (printxval_dispatch_ex): Rename from printxval_dispatch, add
	style argument.
	(printxval_dispatch): New static inline function, a thin wrapper around
	printxval_dispatch_ex.
	* xlat.c (printxval_dispatch): Rename to printxval_dispatch_ex, add
	style argument, handle it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Make printxval_dispatch publicly available.
	* evdev.c (enum xlat_type, printxval_dispatch): Move elsewhere.
	* defs.h (enum_xlat_type): Move from evdev.c.
	(printxval_dispatch): New declaration.
	* xlat.c (printxval_dispatch): Move from evdev.c, drop static qualifier.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Revert "evdev: remove XT_NORMAL"
	This reverts commit cc52da10c6f13feba577a83088f34916c6350165
	in preparation for printxval_dispatch generalisation.

	* evdev.c (enum xlat_type): Add XT_NORMAL back.
	(printxval_dispatch): Handle XT_NORMAL again.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs.h: introduce is_bigendian macro.
	This macro is going to be used in inline checks.

	* defs.h (is_bigendian): New macro constant.

2018-05-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util.c: make memory allocation error messages more informative.
	As those are pretty unusual, let's add some additional information
	that can be reported by users.

	* util.c (print_quoted_string_ex, dumpstr): Add reasons for memory
	allocation errors.
	(sizeof_iov): Change type from size_t to unsigned int.
	(dumpiov_upto): Rewrite size initialisation similarly to the way it's
	done in print_quoted_string_ex, add reasons for memory allocation errors.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: fix -A description.
	* strace.1.in (.SS Output format) <-A>: Add missing .B.

	strace.1.in: document x32 64-bit syscall peculiarity.
	* strace.1.in (.SH NOTES): Document "#64" suffix for 64-bit syscalls on
	x32.

2018-05-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	linux/x32/syscallent.h: change 64-bit syscall designation.
	The current way of designation of 64-bit specific syscalls in x32
	personality not only conflicts with fault injection specification
	syntax, but also makes it impossible to specify such syscalls at all
	(since everything that starts from a digit is considered a syscall
	number specification).  So, let's change prefix to suffix and use
	octothorpe instead of colon as a separator.

	* linux/x32/syscallent.h (13, 15, 16, 19, 20, 45, 46, 47, 54, 55, 59,
	101, 127, 128. 129, 131, 134, 156, 174, 177, 178, 180, 205, 206, 209,
	211, 214, 215, 222, 236, 244, 246, 247, 273, 274, 278, 279, 295, 296,
	297, 299, 307, 310, 311, 32, 327, 328): Change "64:" prefix to "#64"
	suffix in syscall name.

	Closes: https://github.com/strace/strace/issues/36

2018-05-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add BPF_PROG_TYPE_SK_MSG.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_SK_MSG): New constant,
	introduced by Linux commit v4.17-rc1~148^2~156^2~1^2~13.
	* tests/bpf.c (BPF_PROG_LOAD_checks): Update expected output.

	xlat: update bpf_attach_type constants.
	* xlat/bpf_attach_type.in (BPF_SK_MSG_VERDICT): New constant,
	introduced by Linux commit v4.17-rc1~148^2~156^2~1^2~13.
	(BPF_CGROUP_INET4_BIND, BPF_CGROUP_INET6_BIND): New constants,
	introduced by Linux commit v4.17-rc1~148^2~19^2^2~6.
	(BPF_CGROUP_INET4_CONNECT, BPF_CGROUP_INET6_CONNECT): New constants,
	introduced by Linux commit v4.17-rc1~148^2~19^2^2~3.
	(BPF_CGROUP_INET4_POST_BIND, BPF_CGROUP_INET6_POST_BIND): New constants,
	introduced by Linux commit v4.17-rc1~148^2~19^2^2~1.
	* tests/bpf.c (BPF_PROG_QUERY_checks): Update expected output.

2018-05-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat/sock_rds_options.in: make it sorted.
	Define SO_TIMESTAMP twice, for PA-RISC and all the other architectures.

	* xlat/sock_rds_options.in [!__hppa__] (SO_TIMESTAMP): Define to 29.
	[__hppa__] (SO_TIMESTAMP): Define to 0x4012.
	* net.c (print_sockopt_fd_level_name) <case SOL_RDS>: Use
	printxval_search instead of printxval.

2018-05-17  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v4.17.
	* linux/32/ioctls_inc_align16.h: Update from linux v4.17-rc5
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/i386/ioctls_arch0.h: Likewise.
	* linux/x86_64/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

	maint: update for linux 4.17-rc5.
	* maint/ioctls_sym.sh: (x86_list): Add KVM_HYPERV_EVENTFD.

2018-05-16  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: use indexed lookups where appropriate.
	* xlat/bpf_attach_type.in: Add "#value_indexed" directive.
	* xlat/bpf_class.in: Likewise.
	* xlat/bpf_map_types.in: Likewise.
	* xlat/bpf_map_update_elem_flags.in: Likewise.
	* xlat/bpf_prog_types.in: Likewise.
	* xlat/ebpf_class.in: Likewise.
	* bpf_filter.c (print_bpf_filter_code): Use printxval_index
	instead of printxval for decoding bpf_class and ebpf_class.
	* print_fields.h (PRINT_FIELD_XVAL_INDEX): New macro.
	* bpf.c: Use it instead of PRINT_FIELD_XVAL for decoding bpf_attach_type,
	bpf_map_types, bpf_map_update_elem_flags, and bpf_prog_types.

2018-05-15  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: use printxval_index lookup instead of printxval.
	* xlat/bpf_commands.in: Add "#value_indexed" directive.
	* bpf.c (SYS_FUNC(bpf)): Use printxval_index instead of printxval.

	time: use indexed lookups.
	* defs.h (xlat_idx): New prototype.
	* xlat.c (xlat_idx): Remove static qualifier.
	* time.c (do_adjtimex): Use xlat_idx instead of xlookup.
	(SYS_FUNC(getitimer), SYS_FUNC(setitimer)): Use printxval_index
	instead of printxval.
	[ALPHA] (SYS_FUNC(osf_getitimer), SYS_FUNC(osf_setitimer)): Likewise.
	(printclockname) [CLOCKID_TO_FD]: Likewise.
	* xlat/adjtimex_state.in: Add "#value_indexed" directive.
	* xlat/clocknames.in: Likewise.
	* xlat/cpuclocknames.in: Add "#value_indexed" directive, add default
	values to constants.
	* xlat/itimer_which.in: Likewise.

2018-05-15  Andre McCurdy  <armccurdy@gmail.com>

	linux/arm/raw_syscall.h: avoid r7 specified register variables with Thumb
	If Thumb code is being generated and frame pointers are enabled, the
	Thumb frame pointer in r7 clashes with any local variable which may
	need to be assigned to r7 (e.g. the syscall NR when making a raw
	syscall).

	With gcc, the double use of r7 results in a build error, e.g.

	  strace-4.22/tests/inject-nf.c:86:1: error: r7 cannot be used in asm here

	With clang, the double use of r7 can result in the compiler silently
	generating broken code which crashes at run time due to frame pointer
	corruption:

	  https://bugs.llvm.org/show_bug.cgi?id=34165

	In most cases the problem isn't visible as frame pointers will be
	disabled automatically due to optimisation level. However to handle
	cases where frame pointers are enabled (e.g. when CFLAGS etc are set
	to support a debug build, etc) provide a version of raw_syscall_0
	which manually saves and restores the frame pointer value in r7
	to a temporary register before setting up the syscall NR in r7
	and invoking the syscall.

	* linux/arm/raw_syscall.h (raw_syscall_0) [__thumb__]: Provide
	an alternative version.

2018-05-15  Dmitry V. Levin  <ldv@altlinux.org>

	sockaddr: use printxval_index lookup instead of printxval.
	* xlat/addrfams.in: Add "#value_indexed" directive.
	* xlat/af_packet_types.in: Likewise.
	* xlat/hci_channels.in: Likewise.
	* sockaddr.c (print_sockaddr_data_bt, print_sockaddr,
	* print_sockaddr_data_ll): Use printxval_index instead of printxval.

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sockaddr: use printxval_search for ARPHRD_* constants.
	This xlat table is quite big.

	* sockaddr.c (print_sockaddr_data_ll): Replace printxval call with
	printxval_search for printing of struct sockaddr_ll.sll_hatype field.

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add a common MAC address printing routine.
	* print_mac.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (sprint_mac_addr): New declaration.
	(print_mac_addr): New function, a thin wrapper around sprint_mac_addr.
	* print_fields.h (PRINT_FIELD_MAC, PRINT_FIELD_MAC_SZ): New macros.
	* rtnl_link.c (decode_ifla_bridge_id): Use PRINT_FIELD_MAC for bridge
	address printing.
	* sock.c (print_ifreq) <case SIOCGIFHWADDR>: Use print_mac_addr for
	ifr_hwaddr printing.
	* sockaddr.c (print_sockaddr_data_bt): Use print_mac_addr for
	{sco,rc,l2}_bdaddr field printing.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sockaddr: decode Bluetooth L2 CID values.
	* xlat/bluetooth_l2_cid.in: New file.
	* sockaddr.c: Include xlat/bluetooth_l2_cid.h.
	(print_bluetooth_l2_cid): New function.
	(print_sockaddr_data_bt): Use it to decode struct sockaddr_l2.l2_cid
	field.
	* tests/net-sockaddr.c (check_l2): Update expected output.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sockaddr: decode Bluetooth L2 PSM values.
	* xlat/bluetooth_l2_psm.in: New file.
	* sockaddr.c: Include xlat/bluetooth_l2_psm.h.
	(print_bluetooth_l2_psm): New function.
	(print_sockaddr_data_bt): Use it to decode struct sockaddr_l2.l2_psm
	field.
	* tests/net-sockaddr.c (check_l2): Update expected output.

	sockaddr: decode bluetooth address type names.
	* xlat/bdaddr_types.in: New file.
	* sockaddr.c: Include xlat/bdaddr_types.h.
	(print_sockaddr_data_bt): Decode struct sockaddr_l2.l2_bdaddr_type field
	using constants from bdaddr_types xlat.
	* tests/net-sockaddr.c (check_l2): Check decoding
	of struct sockaddr_l2.l2_bdaddr_type field.

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sockaddr: decode Bluetooth socket address unconditionally.
	* sockaddr.c [HAVE_BLUETOOTH_BLUETOOTH_H]: Do not include
	bluetooth/bluetooth.h, bluetooth/hci.h, bluetooth/l2cap.h,
	bluetooth/rfcomm.h, and bluetooth/sco.h.
	[!HAVE_BLUETOOTH_BLUETOOTH_H]: Include xlat/hci_channels.h.
	(btohs): New function.
	(print_sockaddr_data_bt): Define unconditionally, add definitions
	of struct sockaddr_hci, struct bdaddr, struct sockaddr_sco,
	struct sockaddr_rc, and struct sockaddr_l2.
	(sa_printers) <AF_BLUETOOTH>: Define unconditionally.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Avoid using print_array as a local variable name.
	We have a function with the same name.

	* netlink.c (decode_netlink) <print_array>: Rename to is_array, all
	users updated.
	* nlattr.c (decode_nlattr) <print_array>: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update MSG_* constants.
	Sync them with kernel's include/linux/socket.h, since syscalls perform
	almost no checks for incorrect flags.

	* xlat/msg_flags.in (MSG_OOB, MSG_PEEK, MSG_DONTROUTE, MSG_CTRUNC,
	MSG_PROBE, MSG_TRUNC, MSG_DONTWAIT, MSG_EOR, MSG_WAITALL, MSG_FIN,
	MSG_SYN, MSG_CONFIRM, MSG_RST, MSG_ERRQUEUE, MSG_NOSIGNAL, MSG_MORE,
	MSG_WAITFORONE, MSG_FASTOPEN, MSG_CMSG_CLOEXEC): Add default values
	to all constants.
	(MSG_SENDPAGE_NOTLAST, MSG_NO_SHARED_FRAGS): New constants.  It is
	an internal one, but, apparently, nothing prohibits passing it
	to the kernel.
	(MSG_CMSG_COMPAT): New constant.  Override the value provided
	by system headers.
	(MSG_EOF): Commented out, as it is a synonym for MSG_FIN.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-14  Dmitry V. Levin  <ldv@altlinux.org>

	socketutils: use exact match of unix domain sockets on fresh kernels.
	* socketutils.c (unix_send_query): Do not add NLM_F_DUMP to nlmsg_flags
	when kernel version is 4.4.4 or later, initialize udiag_cookie
	unconditionally.

	Complements: v4.12~536 ("Change unix_diag requests back to use full dump instead of exact match")

2018-05-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

	socketutils: do not request NDIAG_SHOW_MEMINFO.
	This information is not used and it looks like it negatively affects
	ability to find the socket under high load.

	* socketutils.c (netlink_send_query) <req>: Remove NDIAG_SHOW_MEMINFO
	flag from netlink_diag_req.ndiag_show field.
	* tests/netlink_netlink_diag.c (send_query) <req>: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: introduce midtail_alloc and use it in netlink tests.
	netlink tests happen to access memory located before the tail_malloc'ed
	pointers, a practice that doesn't go well with the latest compilers
	because tail_malloc is marked with ATTRIBUTE_MALLOC.
	For example, glibc in -D_FORTIFY_SOURCE=2 mode and gcc 8 with
	-Warray-bounds enabled complain about negative offsets out of bounds.
	Fix this issue by introducing midtail_alloc.

	* tests/tests.h (midtail_alloc): New macro.
	* tests/netlink_crypto.c: Use it instead of tail_malloc for nlh0 allocation.
	* tests/netlink_netfilter.c: Likewise.
	* tests/netlink_protocol.c: Likewise.
	* tests/netlink_route.c: Likewise.
	* tests/netlink_selinux.c: Likewise.
	* tests/netlink_sock_diag.c: Likewise.
	* tests/nlattr_br_port_msg.c: Likewise.
	* tests/nlattr_crypto_user_alg.c: Likewise.
	* tests/nlattr_dcbmsg.c: Likewise.
	* tests/nlattr_fib_rule_hdr.c: Likewise.
	* tests/nlattr_ifaddrlblmsg.c: Likewise.
	* tests/nlattr_ifaddrmsg.c: Likewise.
	* tests/nlattr_ifinfomsg.c: Likewise.
	* tests/nlattr_ifla_brport.c: Likewise.
	* tests/nlattr_ifla_port.c: Likewise.
	* tests/nlattr_ifla_xdp.c: Likewise.
	* tests/nlattr_inet_diag_msg.c: Likewise.
	* tests/nlattr_inet_diag_req_compat.c: Likewise.
	* tests/nlattr_inet_diag_req_v2.c: Likewise.
	* tests/nlattr_mdba_mdb_entry.c: Likewise.
	* tests/nlattr_mdba_router_port.c: Likewise.
	* tests/nlattr_ndmsg.c: Likewise.
	* tests/nlattr_ndtmsg.c: Likewise.
	* tests/nlattr_netconfmsg.c: Likewise.
	* tests/nlattr_netlink_diag_msg.c: Likewise.
	* tests/nlattr_nlmsgerr.c: Likewise.
	* tests/nlattr_packet_diag_msg.c: Likewise.
	* tests/nlattr_rtgenmsg.c: Likewise.
	* tests/nlattr_rtmsg.c: Likewise.
	* tests/nlattr_smc_diag_msg.c: Likewise.
	* tests/nlattr_tc_stats.c: Likewise.
	* tests/nlattr_tca_stab.c: Likewise.
	* tests/nlattr_tcamsg.c: Likewise.
	* tests/nlattr_tcmsg.c: Likewise.
	* tests/nlattr_unix_diag_msg.c: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Use MIN where appropriate.
	* netlink.c (decode_nlmsghdr_with_payload): Use MIN.
	* netlink_packet_diag.c (print_packet_diag_mclist): Likewise.
	* nlattr.c (decode_nlattr_with_data): Likewise.
	* rtnl_route.c (decode_rta_multipath): Likewise.

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add fallback definitions to {msg,sem,shm}ctl command constants.
	* xlat/msgctl_flags.in: Add default values to all constants, reorder
	to make them sorted by value.
	* xlat/semctl_flags.in: Likewise.
	* xlat/shmctl_flags.in: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add MSG_STAT_ANY.
	* xlat/msgctl_flags.in (MSG_STAT_ANY): New constant, introduced
	by Linux commit v4.17-rc1~52^2~21.
	* tests/ipc_msg.c: Check it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add SEM_STAT_ANY.
	* xlat/semctl_flags.in (SEM_STAT_ANY): New constant, introduced
	by Linux commit v4.17-rc1~52^2~22.
	* tests/ipc_sem.c: Check it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add SHM_STAT_ANY.
	* xlat/shmctl_flags.in (SHM_STAT_ANY): New constant, introduced
	by Linux commit v4.17-rc1~52^2~23.
	* tests/ipc_shm.c: Check it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	net: print SO_GET_FILTER in getsockopt.
	SO_ATTACH_FILTER and SO_GET_FILTER have the same value; the former
	constant is intended for use in setsockopt, and the latter is for
	getsockopt.  Handle that the same way as similar SOL_IP/SOL_IPV6 socket
	options are handled.

	* xlat/getsock_options.in: New file.
	* xlat/setsock_options.in: Likewise.
	* xlat/sockoptions.in (SO_ATTACH_FILTER): Move to
	xlat/setsock_options.in.
	* net.c: Include "xlat/setsock_options.h" and "xlat/getsock_options.h".
	(print_sockopt_fd_level_name) <case SOL_SOCKET>: Use
	getsock_options or setsock_options as auxiliary xlats based on the value
	of is_getsockopt flag.
	* tests/sock_filter-v.c: Update expected output.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add sock_filtrer-v variants with different xlat verbosity levels.
	* tests/sock_filter-v-Xabbrev.c: New file.
	* tests/sock_filter-v-Xraw.c: Likewise.
	* tests/sock_filter-v-Xverbose.c: Likewise.
	* tests/sock_filter-v.c (PRINT_STMT_SYM, PRINT_STMT_SYM_,
	PRINT_STMT_VAL, PRINT_STMT_VAL_, PRINT_JUMP_): Remove.
	(HEX_FMT, XLAT_FMT, XLAT_ARGS, PRINT_STMT): New macros.
	(PRINT_JUMP): Rewrite.
	(print_filter): Rewrite using PRINT_STMT and new PRINT_JUMP.
	(main): Print SOL_SOCKET, SO_ATTACH_FILTER, and SO_ATTACH_REUSEPORT_CBPF
	using XLAT_FMT/XLAT_ARGS macros.
	* tests/pure_executables.list: Add sock_filter-v-Xabbrev,
	sock_filter-v-Xraw, and sock_filter-v-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (sock_filter-v-Xabbrev, sock_filter-v-Xraw,
	sock_filter-v-Xverbose): New tests.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs.h: fix ethernet_protocols comment.
	Starting with commit v4.22~109, sorted xlat tables are terminated
	with XLAT_END.

	* defs.h (ethernet_protocols): Remove the "unterminated" part from
	description.

2018-05-08  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: rename *sock*options xlat tables.
	Such names as sockrxrpcoptions are incomprehensible.

	* xlat/getsockipoptions.in: Rename to xlat/getsock_ip_options.in.
	* xlat/getsockipv6options.in: Rename to xlat/getsock_ipv6_options.in.
	* xlat/setsockipoptions.in: Rename to xlat/setsock_ip_options.in.
	* xlat/setsockipv6options.in: Rename to xlat/setsock_ipv6_options.in.
	* xlat/sockalgoptions.in: Rename to xlat/sock_alg_options.in.
	* xlat/sockbluetoothoptions.in: Rename to xlat/sock_bluetooth_options.in.
	* xlat/sockcaifoptions.in: Rename to xlat/sock_caif_options.in.
	* xlat/sockdccpoptions.in: Rename to xlat/sock_dccp_options.in.
	* xlat/sockipoptions.in: Rename to xlat/sock_ip_options.in.
	* xlat/sockipv6options.in: Rename to xlat/sock_ipv6_options.in.
	* xlat/sockipxoptions.in: Rename to xlat/sock_ipx_options.in.
	* xlat/sockirdaoptions.in: Rename to xlat/sock_irda_options.in.
	* xlat/sockiucvoptions.in: Rename to xlat/sock_iucv_options.in.
	* xlat/sockkcmoptions.in: Rename to xlat/sock_kcm_options.in.
	* xlat/sockllcoptions.in: Rename to xlat/sock_llc_options.in.
	* xlat/socknetlinkoptions.in: Rename to xlat/sock_netlink_options.in.
	* xlat/socknfcllcpoptions.in: Rename to xlat/sock_nfcllcp_options.in.
	* xlat/sockoptions.in: Rename to xlat/sock_options.in.
	* xlat/sockpacketoptions.in: Rename to xlat/sock_packet_options.in.
	* xlat/sockpnpoptions.in: Rename to xlat/sock_pnp_options.in.
	* xlat/sockpppol2tpoptions.in: Rename to xlat/sock_pppol2tp_options.in.
	* xlat/sockrawoptions.in: Rename to xlat/sock_raw_options.in.
	* xlat/sockrdsoptions.in: Rename to xlat/sock_rds_options.in.
	* xlat/sockrxrpcoptions.in: Rename to xlat/sock_rxrpc_options.in.
	* xlat/socksctpoptions.in: Rename to xlat/sock_sctp_options.in.
	* xlat/socktcpoptions.in: Rename to xlat/sock_tcp_options.in.
	* xlat/socktipcoptions.in: Rename to xlat/sock_tipc_options.in.
	* xlat/socktlsoptions.in: Rename to xlat/sock_tls_options.in.
	* xlat/sockudpoptions.in: Rename to xlat/sock_udp_options.in.
	* net.c: Update.

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	net: decode more SOL_* socket options.
	* xlat/sockalgoptions.in: New file.
	* xlat/sockbluetoothoptions.in: Likewise.
	* xlat/sockcaifoptions.in: Likewise.
	* xlat/sockdccpoptions.in: Likewise.
	* xlat/sockiucvoptions.in: Likewise.
	* xlat/sockkcmoptions.in: Likewise.
	* xlat/sockllcoptions.in: Likewise.
	* xlat/socknfcllcpoptions.in: Likewise.
	* xlat/sockpnpoptions.in: Likewise.
	* xlat/sockpppol2tpoptions.in: Likewise.
	* xlat/sockrdsoptions.in: Likewises.
	* xlat/sockrxrpcoptions.in: Likewise.
	* xlat/socktipcoptions.in: Likewise.
	* xlat/socktlsoptions.in: Likewise.
	* xlat/sockudpoptions.in: Likewise.
	* net.c: Include "xlat/sockalgoptions.h", "xlat/sockbluetoothoptions.h",
	"xlat/sockcaifoptions.h", "xlat/sockdccpoptions.h",
	"xlat/sockiucvoptions.h", "xlat/sockkcmoptions.h",
	"xlat/sockllcoptions.h", "xlat/socknfcllcpoptions.h",
	"xlat/sockpnpoptions.h", "xlat/sockpppol2tpoptions.h",
	"xlat/sockrdsoptions.h", "xlat/sockrxrpcoptions.h",
	"xlat/socktipcoptions.h", "xlat/socktlsoptions.h",
	and "xlat/sockudpoptions.h".
	(print_sockopt_fd_level_name): Decode SOL_UDP, SOL_IRDA, SOL_LLC,
	SOL_DCCP, SOL_TIPC, SOL_RXRPC, SOL_PPPOL2TP, SOL_BLUETOOTH, SOL_PNPIPE,
	SOL_RDS, SOL_IUCV, SOL_CAIF, SOL_ALG, SOL_NFC, SOL_KCM, and SOL_TLS
	socket option names.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	net: decode more AF_* protocol names.
	* xlat/caif_protocols.in: New file.
	* xlat/can_protocols.in: Likewise.
	* xlat/irda_protocols.in: Likewise.
	* xlat/isdn_protocols.in: Likewise.
	* xlat/kcm_protocols.in: Likewise.
	* xlat/nfc_protocols.in: Likewise.
	* xlat/phonet_protocols.in: Likewise.
	* xlat/smc_protocols.in: Likewise.
	* net.c: Include "xlat/irda_protocols.h", "xlat/can_protocols.h",
	"xlat/isdn_protocols.h", "xlat/phonet_protocols.h",
	"xlat/caif_protocols.h", "xlat/nfc_protocols.h",
	"xlat/kcm_protocols.h", and "xlat/smc_protocols.h".
	(SYS_FUNC(socket)): Decode AF_IRDA, AF_CAN, AF_RXRPC, AF_ISDN,
	AF_PHONET, AF_CAIF, AF_NFC, AF_KCM, and AF_SMC protocol names.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Remove some duplicate fallback definitions.
	There is no need to provide duplicate fallback definitions anymore,
	inclusion of the appropriate xlat header in XLAT_MACROS_ONLY mode
	does the right thing.

	* btrfs.c [!BTRFS_FIRST_FREE_OBJECTID] (BTRFS_FIRST_FREE_OBJECTID):
	Remove, a fallback definition is already provided by included
	"xlat/btrfs_tree_objectids.h".
	* net.c: Include "xlat/addrfams.h" in XLAT_MACROS_ONLY mode.
	[!AF_BLUETOOTH] (AF_BLUETOOTH): Remove.
	* syscall.c: Include "xlat/nt_descriptor_types.h" in XLAT_MACROS_ONLY
	mode.
	[!NT_PRSTATUS] (NT_PRSTATUS): Remove.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat/gen.sh: introduce XLAT_MACROS_ONLY macro.
	Sometimes we need just fallback definitions and nothing else.
	This change adds an interface of skipping xlat table prototypes
	and definitions.

	* xlat/gen.sh (gen_header): Place xlat table prototype or definition
	under "#ifndef XLAT_MACROS_ONLY" guard.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: print IFLA_NEW_IFINDEX using decode_nla_ifindex.
	As it is an interface index.

	* rtnl_link.c (ifinfomsg_nla_decoders) <[IFLA_NEW_IFINDEX]>: Change
	the value from decode_nla_s32 to decode_nla_ifindex.

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ci: install libbluetooth-dev.
	* ci/install-dependencies.sh (common_packages): Add libbluetooth-dev.

	xlat: provide fallback definitions for HCI_CHANNEL_* constants.
	* xlat/hci_channels.in: Provide fallback definitions.

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	s390: simplify s390_runtime_instr command printing.
	As the header with command definitions is now a part of UAPI (since
	Linux commit v4.16-rc1~21^2~11), there's no need for a very special
	printing routine for command names.

	* s390.c (SYS_FUNC(s390_runtime_instr)): Use printxval_d to print
	the command argument.
	* tests/s390_runtime_instr.c: Update expected output.

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/init.sh: add run_prog_match_grep.
	* tests/init.sh (run_prog_match_grep): New function, similar
	to run_prog_match_diff.

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add so_peercred variants with different xlat verbosity levels.
	* tests/so_peercred-Xabbrev.c: New file.
	* tests/so_peercred-Xraw.c: Likewise.
	* tests/so_peercred-Xverbose.c: Likewise.
	* tests/pure_executables.list: Add so_peercred-Xabbrev,
	so_peercred-Xraw, and so_peercred-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/so_peercred.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
	* tests/gen_tests.in (so_peercred-Xabbrev, so_peercred-Xraw,
	so_peercred-Xverbose): New tests.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add personality variants with different xlat verbosity levels.
	* tests/personality-Xabbrev.c: New file.
	* tests/personality-Xraw.c: Likewise.
	* tests/personality-Xverbose.c: Likewise.
	* tests/pure_executables.list: Add personality-Xabbrev,
	personality-Xraw, and personality-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/personality.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
	* tests/personality.test: Add support for accepting test arguments.
	* tests/gen_tests.in (personality-Xabbrev, personality-Xraw,
	personality-Xverbose): New tests.

	tests: add fanotify_mark variants with different xlat verbosity levels.
	* tests/fanotify_mark-Xabbrev.c: New file.
	* tests/fanotify_mark-Xraw.c: Likewise.
	* tests/fanotify_mark-Xverbose.c: Likewise.
	* tests/pure_executables.list: Add fanotify_mark-Xabbev,
	fanotify_mark-Xraw, and fanotify_mark-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/fanotify_mark.c: Add handling of XLAT_RAW and XLAT_VERBOSE
	flags.
	* tests/gen_tests.in (fanotify_mark-Xabbev, fanotify_mark-Xraw,
	fanotify_mark-Xverbose): New tests.

2018-05-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for IFF_* constants.
	* xlat/iffflags.in: Provide fallback definitions.  Mention that
	the array is sorted.

	xlat: update IFF_* constants.
	* xlat/iffflags.in (IFF_DYNAMIC): New constant, had been introduced
	before the current git repository was conceived.
	(IFF_LOWER_UP, IFF_DORMANT): New constants, introduced by Linux commit
	v2.6.17-rc1~1175^2~206.
	(IFF_ECHO): New constant, introduced by Linux commit
	v2.6.25-rc1~1162^2~1415.

	xlat: provide fallback definitions for ARPHRD_* constants.
	* xlat/arp_hardware_types.in: Provide fallback definitions, sort.

	tests: add more v4l2 checks.
	* tests/ioctl_v4l2.c (main): Add more VIDIOC_S_EXT_CTRLS checks.

	tests: add variants of IPC tests with different xlat verbosity levels.
	* tests/.gitignore: Add ipc_msg-Xabbrev, ipc_msg-Xraw, ipc_msg-Xverbose,
	ipc_msgbuf-Xabbrev, ipc_msgbuf-Xraw, ipc_msgbuf-Xverbose,
	ipc_sem-Xabbrev, ipc_sem-Xraw, ipc_sem-Xverbose, ipc_shm-Xabbrev,
	ipc_shm-Xraw, and ipc_shm-Xverbose.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (ipc_msg-Xabbrev, ipc_msg-Xraw, ipc_msg-Xverbose,
	ipc_msgbuf-Xabbrev, ipc_msgbuf-Xraw, ipc_msgbuf-Xverbose,
	ipc_sem-Xabbrev, ipc_sem-Xraw, ipc_sem-Xverbose, ipc_shm-Xabbrev,
	ipc_shm-Xraw, ipc_shm-Xverbose): New tests.
	* tests/ipc_msg-Xabbrev.c: New file.
	* tests/ipc_msg-Xraw.c: Likewise.
	* tests/ipc_msg-Xverbose.c: Likewise.
	* tests/ipc_msgbuf-Xabbrev.c: Likewise.
	* tests/ipc_msgbuf-Xraw.c: Likewise.
	* tests/ipc_msgbuf-Xverbose.c: Likewise.
	* tests/ipc_sem-Xabbrev.c: Likewise.
	* tests/ipc_sem-Xraw.c: Likewise.
	* tests/ipc_sem-Xverbose.c: Likewise.
	* tests/ipc_shm-Xabbrev.c: Likewise.
	* tests/ipc_shm-Xraw.c: Likewise.
	* tests/ipc_shm-Xverbose.c: Likewise.
	* tests/ipc.sh: Add support for accepting test arguments.
	* tests/ipc_msgbuf.test: Likewise.
	* tests/ipc_msg.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
	* tests/ipc_msgbuf.c: Likewise.
	* tests/ipc_sem.c: Likewise.
	* tests/ipc_shm.c: Likewise.

	tests: make ipc tests a bit more strict.
	* tests/gen_tests.in (ipc_msg, ipc_sem, ipc_shm): Add -a option.
	* tests/ipc_msg.c: Replace " +" with " " in expected output.
	* tests/ipc_sem.c: Likewise.
	* tests/ipc_shm.c: Likewise.

	ipc_shm: print SHM_HUGE_SHIFT using print_xlat_u.
	* ipc_shm.c (SYS_FUNC(shmget)): Print SHM_HUGE_SHIFT using print_xlat_u.

	tests: check all bits of mtype in ipc_msgbuf test.
	* tests/ipc_msgbuf.c: Include <unistd.h> and <asm/unistd.h>.
	(sys_msgrcv): New function.
	(msgrcv): Use it instead of msgrcv.  Add bits to mtype,
	check for -mtype in msgrcv.

	tests: print expected output by ipc_msgbuf test itself.
	* tests/ipc_msgbuf.expected: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove tests/ipc_msgbuf.expected.
	* tests/ipc_msgbuf.c: Add expected output.
	* tests/ipc_msgbuf.test: Add -a31.  Redirect output to $EXP.  Call
	match_grep with $LOG and $EXP arguments.

2018-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: provide fallback definitions for SKF_*_OFF constants.
	* xlat/skf_off.in: New file.
	* bpf_sock_filter.c: Include "xlat/skf_off.h".

	xlat: provide fallback definitions for BPF_* constants.
	* xlat/bpf_class.in: Add default values for constants.
	* xlat/bpf_miscop.in: Likewise.
	* xlat/bpf_mode.in: Likewise.
	* xlat/bpf_op_alu.in: Likewise.
	* xlat/bpf_op_jmp.in: Likewise.
	* xlat/bpf_rval.in: Likewise.
	* xlat/bpf_size.in: Likewise.
	* xlat/bpf_src.in: Likewise.

2018-05-06  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: fix F_* fallback definitions on mips64.
	* xlat/fcntlcmds.in (F_GETLK64, F_SETLK64, F_SETLKW64) [__mips64]: Fix
	default values.

	Fixes: v4.22-122-gfa8f486 ("xlat: fix F_* fallback definitions on alpha, hppa, mips, and sparc")

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add fallback definitions to SO_* constants.
	Regenerate xlat/sockoptions.in using the following script:

	  sed -n 's/^\(SO_[^[:space:]]*\).*/\1/p' xlat/sockoptions.in |
	  uniq |
	  while read name; do
	    sed -rn 's/#define[[:space:]]+('"$name"')[[:space:]]+([[:digit:]]+)$/\2\t\1/p' \
	      /path/to/linux/include/uapi/asm-generic/socket.h
	  done |
	  sort -n |
	  while read def name; do
	    grep -EH '#define[[:space:]]+'"$name"'[[:space:]]+(0x[[:xdigit:]]+|[[:digit:]]+)' \
	      /path/to/linux/arch/*/include/uapi/asm/socket.h |
	    sed -rn 's|^[^#]*/arch/([^/]+)/include/uapi/asm/socket\.h:#define[[:space:]]+'"$name"'[[:space:]]+([^[:space:]]+)([[:space:]].*)?$|\1\t\2|p' |
	    sed s/parisc/hppa/ |sort |
	    awk -vname="$name" -vdef="$def" '
	      {
	        i=strtonum($2)
	        if (i == def) next
	        if (a[i])
	          a[i]=a[i] " || defined __" $1 "__"
	        else
	          a[i]="defined __" $1 "__"
	      }
	      END {
	        iftext="#if"
	        for (i in a) {
	          printf("%s %s\n%s %u\n",iftext,a[i],name,i)
	          iftext="#elif"
	        }
	        if (iftext != "#if")
	          print "#else"
	        printf("%s %s\n", name, def)
	        if (iftext == "#if")
	          print ""
	        else
	          print "#endif\n"
	      }'
	  done

	* xlat/sockoptions.in: Add fallback definitions.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: remove socket options with duplicate names.
	* xlat/sockoptions.in (SO_GET_FILTER): Remove as it is defined
	to SO_ATTACH_FILTER.
	(SO_DETACH_BPF): Remove as it is defined to SO_DETACH_FILTER.

	xlat: remove socket options that do not exist in Linux.
	* xlat/sockoptions.in (SO_ALLRAW, SO_ICS, SO_IMASOCKET, SO_LISTENING,
	SO_MGMT, SO_ORDREL, SO_PARALLELSVR, SO_PROTOTYPE, SO_RDWRSO_SEMA,
	SO_USELOOPBACK): Remove.

	xlat: treat socketlayers as a sorted array.
	* xlat/socketlayers.in: Add a comment that the xlat is sorted.
	* net.c (print_sockopt_fd_level_name): Use printxval_search
	instead of printxval for decoding socket layer name.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	net: decode Bluetooth protocol names unconditionally.
	As we have all BTPROTO_* constant definitions now, there is no need
	to rely on bluetooth.h header anymore.

	* net.c (AF_BLUETOOTH): Provide a fallback definition.
	[HAVE_BLUETOOTH_BLUETOOTH_H]: Do not include <bluetooth/bluetooth.h>.
	[!HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/bt_protocols.h".
	[!HAVE_BLUETOOTH_BLUETOOTH_H] (decode_sockbuf): Decode AF_BLUETOOTH.
	(decode_sockbuf) <case AF_BLUETOOTH>: Use printxval_index.
	* xlat/bt_protocols.in: Add "#value_indexed" directive.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat/gen.sh: invoke the shell interpreter with -e -u options.
	* xlat/gen.sh: Change interpreter from "/bin/sh" to "/bin/sh -eu".

	xlat: update FPE_* constants.
	* xlat/sigfpe_codes.in (FPE_FLTUNK): New constant, introduced by Linux
	commit v4.17-rc1~107^2~2.
	(FPE_CONDTRAP): New constant, introduced by Linux commit
	v4.17-rc1~31^2~3.

	xlat: add MAP_FIXED_NOREPLACE.
	* xlat/mmap_flags.in (MAP_FIXED_NOREPLACE): New constant, introduced
	by Linux commit v4.17-rc1~52^2~14.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for BTPROTO_* constants.
	As they are architecture-independent.

	* xlat/bt_protocols.in: Add values to constants.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add NETLINK_SMC.
	* xlat/netlink_protocols.in (NETLINK_SMC): New constant, introduced
	by Linux commit v4.11-rc1~94^2~43^2.

	xlat: provide fallback definitions for V4L2_CID_* constants.
	* xlat/v4l2_control_id_bases.in: New file with fallback definitions.
	* xlat/v4l2_control_ids.in: Add fallback definitions.
	* v4l2.c: Reorder includes, include "xlat/v4l2_control_id_bases.h",
	remove legacy V4L2_CID_* constant definitions.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update V4L2_CID_* constants.
	Synchronise v4l2_control_ids list with the one provided by kernel's
	include/uapi/linux/v4l2-controls.h.  A few notes:
	 - V4L2_CID_CHROMA_GAIN and V4L2_CID_COLORFX_CBCR moved in accordance
	   with their position/values.
	 - V4L2_CID_WHITENESS is removed as it has the same value as
	   V4L2_CID_GAMMA.
	 - V4L2_CID_PRIVATE_BASE is removed.
	 - V4L2_CID_HCENTER and V4L2_CID_VCENTER that were removed by Linux
	   commit v3.9-rc1~93^2~237, are retained for historical reasons.

	* xlat/v4l2_control_ids.in: Update.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for V4L2_CTRL_CLASS_* constants.
	As those are architecture-independant.  Also note that the xlat
	is sorted.

	* xlat/v4l2_control_classes.in: Add values.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update V4L2_CTRL_CLASS_* constants.
	* xlat/v4l2_control_classes.in (V4L2_CTRL_CLASS_DV): New constant,
	introduced by Linux commit v3.7-rc1~101^2^2~322.
	(V4L2_CTRL_CLASS_RF_TUNER): New constant, introduced by Linux commit
	v3.15-rc1~85^2~192.
	(V4L2_CTRL_CLASS_DETECT): New constant, introduced by Linux commit
	v3.17-rc1~112^2~340.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update BPF_F_* constants.
	Apparently, BPF_F_RDONLY and BPF_F_WRONLY are also used in map_flags.
	Moreover, set of flags depends on the type of map, but let's leave that
	for another day.

	* xlat/bpf_map_flags.in (BPF_F_RDONLY, BPF_F_WRONLY): New constants.
	(BPF_F_STACK_BUILD_ID): New constant, introduced by Linux commit
	v4.17-rc1~148^2~156^2~3^2~1.
	* xlat/bpf_map_flags.in: Update expected output.

2018-05-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add V4L2_PIX_FMT_HEVC.
	* xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_HEVC): New constant, introduced
	by Linux commit v4.17-rc1~143^2~60.

	xlat: add ETH_P_PREAUTH.
	* xlat/ethernet_protocols.in (ETH_P_PREAUTH): New constant, introduced
	by Linux commit v4.17-rc1~148^2~379^2~3.

	xlat: update SCTP_* constants.
	* xlat/socksctpoptions.in (SCTP_AUTH_DEACTIVATE_KEY): New constant,
	introduced by Linux commit v4.17-rc1~148^2~191^2~2.
	(SCTP_SENDMSG_CONNECT): New constant, introduced by Linux commit
	v4.17-rc1~96^2~9.

	xlat: add SPARC ADI-related SIGSEGV codes.
	* xlat/sigsegv_codes.in (SEGV_ACCADI, SEGV_ADIDERR, SEGV_ADIPERR): New
	constants, introduced by Linux commit v4.17-rc1~147^2~4^2~10.

	xlat: add PROT_ADI.
	* xlat/mmap_prot.in (PROT_ADI): New constant, introduced by Linux commit
	v4.17-rc1~147^2~4^2~1.

2018-05-05  Dmitry V. Levin  <ldv@altlinux.org>

	build: rewrite libdw detection without pkg-config.
	pkg-config expected to be more convenient way to configure libdw,
	but in practice it appeared to be less portable than good old
	AC_CHECK_HEADERS and AC_CHECK_LIB.

	* ci/install-dependencies.sh (common_packages): Remove pkg-config.
	(STACKTRACE == "libdw"): Do not install libz-dev and liblzma-dev.
	* debian/control (Build-Depends): Remove pkg-config.
	* m4/st_libdw.m4 (st_ARG_LIBDW, st_LIBDW): Rewrite without pkg-config.

2018-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	ci: add more variants of unwinder to test matrices.
	Check x86_64 builds with libdw, with libunwind, and without stacktrace.
	As Travis CI doesn't provide a suitable libdw, do not test libdw there.

	* ci/install-dependencies.sh (common_packages): Remove libdw-dev.
	Install libdw-dev or libunwind8-dev depending on $STACKTRACE.
	* ci/run-build-and-tests.sh: Specify --with-libdw=yes,
	--with-libunwind=yes, or --without-stacktrace depending on $STACKTRACE.
	* .gitlab-ci.yml (gcc-x86_64): Rename to gcc-x86_64-libdw,
	add STACKTRACE=libdw.
	(gcc-x86): Rename to gcc-x86-nounwind, add STACKTRACE=no.
	(clang-x86_64): Rename to clang-x86_64-libdw, add STACKTRACE=libdw.
	(clang-x86): Rename to clang-x86-nounwind, add STACKTRACE=no.
	(gcc-x86_64-libunwind, gcc-x86_64-nounwind, gcc-x86-nounwind,
	clang-x86_64-libunwind, clang-x86_64-nounwind, clang-x86-nounwind):
	New test matrix entries.
	* .travis.yml: Add STACKTRACE=libunwind to all x86_64 test matrix
	entries except musl-gcc, add STACKTRACE=no to other matrix entries,
	add test matrix entries with STACKTRACE=no variants on x86_64.

2018-05-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update af_packet_types.
	* xlat/af_packet_types.in: Add values.
	(PACKET_USER, PACKET_KERNEL): New constants, introduced by Linux commit
	v3.14-rc1~94^2~349.

	xlat: add values to adjtimex_state, adjtimex_status, advise xlats.
	* xlat/adjtimex_state.in: Add values.
	* xlat/adjtimex_status.in: Likewise.
	* xlat/advise.in: Likewise.

	xlat: update adjtimex_modes.
	* xlat/adjtimex_modes.in: Add values to constants.
	(0): Remove.
	(ADJ_OFFSET_SS_READ): Move to the first place.
	(ADJ_OFFSET_SINGLESHOT): Move to the second place.

2018-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	mmap_cache: do not activate unless requested.
	Do not call mmap_cache functions until mmap_cache_enable is invoked.
	Change struct mmap_cache_t into a proxy structure, move all mmap_cache
	data from struct tcb inside this new structure.

	* Makefile.am (strace_SOURCES): Move mmap_cache.c and mmap_cache.h
	to libstrace_a_SOURCES.
	* defs.h (struct tcb): Remove mmap_cache_size and mmap_cache_generation
	* fields.
	* mmap_cache.h (struct mmap_cache_t): Rename
	to struct mmap_cache_entry_t, create a new struct mmap_cache_t,
	all users updated.
	(mmap_cache_delete): Remove.
	* mmap_cache.c (mmap_cache_delete): Rename to delete_mmap_cache,
	add static qualifier.
	(build_mmap_cache): Merge into mmap_cache_rebuild_if_invalid.
	* strace.c (droptcb): Replace mmap_cache_delete invocation
	with tcp->mmap_cache->free_fn.

2018-05-03  Dmitry V. Levin  <ldv@altlinux.org>

	mmap_cache: remove mmap_cache_is_enabled.
	This function is no longer used and could be removed.

	* mmap_cache.c (mmap_cache_is_enabled): Remove.
	* mmap_cache.h: Likewise.

2018-05-03  Masatake YAMATO  <yamato@redhat.com>

	unwind-libdw: use the mmap_notify subsystem.
	The unwind subsystem uses the mmap_cache subsystem even it uses
	unwind-libdw as backend. unwind-libdw doesn't need the full set of the
	mmap_cache subsystem; libdw has a feature for caching a memory
	mapping.

	This commit does three things.

	(1) Make the unwind subsystem not use the mmap_cache subsystem.
	The unwind subsystem never concern the memory mapping of the target.
	It becomes a thin layer.

	(2) Make unwind-libunwind use the mmap_cache subsystem directly.

	(3) Make unwind-libdw use the mmap_notify subsystem to know when it
	should call dwfl_linux_proc_report/dwfl_report_end for updating the
	cache.

	Here is a subsystem structure that this patch
	introduces:

		+-------------------------------------+
		|            unwind subsys            |
		+------------------+------------------+
		| unwind-libunwind |   unwind-libdw   |
		+------------------+------------------+
		|    mmap_cache    |                  |
		+------------------+                  |
		|               mmap_notify           |
		+-------------------------------------+
		|                syscall              |
		+-------------------------------------+
	               mmap/munmap/mprotect/brk...

	* unwind.c: Don't include "mmap_cache.h".
	(unwind_init): Don't call mmap_cache_enable.
	(unwind_tcb_print, unwind_tcb_capture): Don't call mmap_cache related
	functions, just invoke unwinder.tcb_walk.
	* unwind.h (struct unwind_unwinder_t): Remove tcb_flush_cache field.

	* unwind-libdw.c: Include "mmap_notify.h" instead of "mmap_cache.h".
	(struct ctx): Add last_proc_updating field to record the generation
	of memory mapping that is cached by dwfl_linux_proc_report
	and dwfl_report_end.
	(mapping_generation): A variable counting how many times the memory
	mapping of targets has been changed.
	(updating_mapping_generation): New utility function for updating
	mapping_generation.
	(init): New function for registering updating_mapping_generation
	in the mmap_notify subsystem as a callback function.
	(tcb_init): Initialize ctx::last_proc_updating.
	(tcb_flush_cache): Rename to flush_cache_maybe.  Rebuild the cache data
	only if the data is stale.
	(tcb_walk): Call flush_cache_maybe for avoiding referring staled cache data.
	(unwinder): Set init function, remove tcb_flush_cache field.
	* unwind-libunwind.c (init): Enable the mmap_cache subsystem.
	(tcb_walk): Call mmap_cache_rebuild_if_invalid and unw_flush_cache for
	updating the cache of the memory mapping before walking the stack.
	(tcb_walk): Rename to walk.
	(unwinder): Remove tcb_flush_cache field.

2018-05-03  Masatake YAMATO  <yamato@redhat.com>

	unwind-libdw: introduce indirect data structure for storing unwinding context
	unwind-libdw uses Dwfl as the data structure for storing unwinding
	context.  It is raw data that come from libdw.

	This commit introduces "struct ctx" file local data type for allowing
	unwind-libdw to attach strace side data to the unwinding context.

	* unwind-libdw.c (struct ctx): New struct definition.
	(tcb_init, tcb_fin, tcb_walk, tcb_flush_cache): Use struct ctx instead
	of Dwfl directly.

2018-05-03  Masatake YAMATO  <yamato@redhat.com>

	mmap_notify: rename the macro for tracking memory mapping.
	* sysent.h (STACKTRACE_INVALIDATE_CACHE): Rename to
	MEMORY_MAPPING_CHANGE.  All users updated.

	mmap_cache: use the mmap_notify subsystem.
	* mmap_cache.c: Include mmap_notify.h.
	(mmap_cache_enable): Call mmap_notify_register_client to use
	the mmap_notify subsystem, mmap_cache_invalidate is specified
	to handle the change of memory mapping.
	(mmap_cache_invalidate): Add static qualifier.
	* mmap_cache.h (mmap_cache_invalidate): Remove.
	* syscall.c: Include mmap_notify.h instead of mmap_cache.h.
	(syscall_exiting_decode): Call mmap_notify_report instead
	of mmap_cache_invalidate.

2018-05-03  Masatake YAMATO  <yamato@redhat.com>

	mmap_notify: new subsystem for tracking the changes of memory mappings.
	This subsystem is a spin-off of the mmap_cache subsystem.

	The mmap_cache subsystem had two features: (1) tracking the change
	of memory mapping, and (2) maintaining the cache of memory mapping.

	mmap_notify is a subsystem specialized to provide feature (2).
	unwind-libdw itself has the feature (1).  It needs only (2).

	* mmap_notify.h: New file.
	* mmap_notify.c: Likewise.
	* Makefile.am (strace_SOURCES): Add them.

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	btrfs: add missing braces.
	Reported by Coverity.

	* btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case
	BTRFS_IOC_TREE_SEARCH_V2>: Add missing braces.

	Fixes: v4.22-76-gf766447 "btrfs: use PRINT_FIELD_*"

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.c: check return code of never failing fcntl call.
	Because the kernel cannot be trusted.

	* strace.c (set_cloexec_flag): Call perror_msg_and_die if fcntl(F_SETFD)
	has failed.

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sock: use error_func_msg for printing function name.
	* sock.c (decode_ifconf): Use error_func_msg instead of error_msg with
	manual function name printing.

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util.c: add len sanity checks to dumpstr.
	Reported by clang.

	* util.c (dumpstr): Check that len is sane.

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mmap_cache: fool-proofing build_mmap_cache.
	Let's try to handle better the situation when build_mmap_cache is called
	without mmap_cache/mmap_cache_size being reset prior to the call.

	Reported by Coverity scan.

	* mmap_cache.c (build_mmap_cache): Set cache_head to tcp->mmap_cache.
	Reset tcp->mmap_cache_size to 0.

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	error_prints: add missing va_end() calls.
	These missing va_end() calls are followed by die() calls that never
	return, so the only practical effect of this change is appeasement
	of code checking tools.

	Reported by cppcheck.

	* error_prints.c (error_msg_and_die, error_msg_and_help,
	perror_msg_and_die): Add va_end().

2018-05-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mem: handle potential error from sysconf(_SC_PAGESIZE)
	Reported by Coverity scan.

	* mem.c (get_pagesize): Handle the case when sysconf(_SC_PAGESIZE)
	returns an error.

2018-05-03  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: merge fcntl64cmds into fcntlcmds.
	Since we don't have to workaround old F_[GS]ETOWN_EX == F_[SG]ETLK64
	kernel bug any longer, there is a room for cleanup.

	* xlat/fcntlcmds.in (F_GETLK64, F_SETLK64, F_SETLKW64): Add from
	xlat/fcntl64cmds.in.
	* xlat/fcntl64cmds.in: Remove.
	* fcntl.c: Do not include "xlat/fcntl64cmds.h".
	(SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Do not use fcntl64cmds, call
	printxval instead of printxvals.

2018-05-03  Zhibin Li  <08826794brmt@gmail.com>

	tests: check decoding of F_GETOWN_EX and F_SETOWN_EX fcntl commands.
	* tests/fcntl.c (TEST_F_OWNER_EX): New macro.
	[TEST_F_OWNER_EX]: Include "f_owner_ex.h".
	[TEST_F_OWNER_EX] (test_f_owner_ex_type_pid,
	test_f_owner_ex_umove_or_printaddr, test_f_owner_ex): New functions.
	(main) [TEST_F_OWNER_EX]: Use test_f_owner_ex.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-05-03  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce f_owner_ex.h.
	Some headers define struct f_owner_ex, some struct __kernel_f_owner_ex,
	we have to support both variants.

	* configure.ac (AC_CHECK_TYPES): Check for "struct f_owner_ex"
	and "struct __kernel_f_owner_ex" in <linux/fcntl.h>.
	* f_owner_ex.h: New file.
	* Makefile.am (strace_SOURCES): Add it.

2018-05-02  Masatake YAMATO  <yamato@redhat.com>

	tests/ioctl_kvm_run.c: handle cpuid at the end of vcpu dentry.
	Since Linux 4.16, kernel appends the cpuid as suffix to the entry
	for a kvm vcpu in /proc/$pid/fd like:

	    anon_inode:kvm-vcpu:0

	That was

	    anon_inode:kvm-vcpu

	This kernel change causes the test case failure on newer kernels.
	Update the test to deal with the new name as well as the old one.

	* tests/ioctl_kvm_run.c: Include unistd.h for using readlink(2).
	(vcpu_dev_should_have_cpuid): New function for detecting whether
	a proc entry for given fd has the cpuid suffix or not.
	(main): Trim vcpu_dev to remove the cpuid suffix if needed.
	(vcpu_dev): Remove const modifier.

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: check that system definitions match fallback definitions.
	For each constant that is accompanied by a fallback definition,
	generate a sanity check that the definition provided by system headers
	matches the fallback definition.

	* gcc_compat.h (DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE,
	DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE): New macros.
	* xlat/gen.sh (cond_def): Generate a code that checks the system
	definition against the default.
	(gen_header): Generate a code that includes "gcc_compat.h" and
	"static_assert.h".

	Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: override values of F_SETOWN_EX and F_GETOWN_EX constants.
	Linux kernel commit v2.6.32-rc7~23 has changed values of F_SETOWN_EX
	and F_GETOWN_EX constants introduced by commit v2.6.32-rc1~96 to fix
	the conflict with F_GETLK64 and F_SETLK64 constants.

	Looks like the best way to handle this situation is to pretend that
	old values of F_SETOWN_EX and F_GETOWN_EX didn't exist.

	* xlat/fcntlcmds.in (F_SETOWN_EX, F_GETOWN_EX): Undefine.

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: fix F_* fallback definitions on alpha, hppa, mips, and sparc.
	* xlat/fcntlcmds.in (F_GETLK, F_SETLK, F_SETLKW, F_SETOWN, F_GETOWN,
	F_SETSIG, F_GETSIG) [alpha || hppa || mips || sparc]: Fix definitions.
	* xlat/fcntl64cmds.in (F_GETLK64, F_SETLK64, F_SETLKW64) [hppa || mips]:
	Likewise.

	xlat: fix SI_* fallback definitions on mips.
	* xlat/siginfo_codes.in [mips] (SI_ASYNCIO, SI_TIMER, SI_MESGQ): Define
	to -2, -3, and -4, respectively.

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: override values of KEY_RFKILL and KEY_BRIGHTNESS_MIN constants.
	KEY_RFKILL and KEY_NUMERIC_A constants were introduced by Linux kernel
	commits v2.6.33~17^2~2 and v4.1-rc1~150^2~1^10~6, respectively.
	Apparently, RHEL6 introduced an alternative KEY_RFKILL constant
	with the same value as upstream KEY_NUMERIC_A.

	KEY_BRIGHTNESS_MIN and KEY_BRIGHTNESS_MAX constants were introduced
	by Linux kernel commit v3.16-rc1~30^2~6^2~1^2~7.
	Apparently, RHEL7 introduced an alternative KEY_BRIGHTNESS_MIN constant
	with the same value as upstream KEY_BRIGHTNESS_MAX.

	Downstream vendors are *not* allowed to do this.
	Ignore the system value of KEY_RFKILL and KEY_BRIGHTNESS_MIN.

	* xlat/evdev_keycode.in (KEY_RFKILL, KEY_BRIGHTNESS_MIN): Undefine.

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: override the value of KEY_DATA constant.
	Linux kernel commit v4.9-rc8~12^2 has changed the value of KEY_DATA
	constant introduced by commit v4.7-rc6~32^2~6^2 because the old value
	was already used by KEY_FASTREVERSE.

	Looks like the best way to handle this situation is to pretend that
	the old value of KEY_DATA didn't exist.

	* xlat/evdev_keycode.in (KEY_DATA): Undefine.

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: override the value of AUDIT_FEATURE_CHANGE constant.
	Linux kernel commit v3.15-rc1~18^2~1 has changed the value
	of AUDIT_FEATURE_CHANGE constant introduced by commit v3.13-rc1~19^2~20
	which is of course an ABI breakage that affected 3.13 and 3.14 kernel
	releases as well as their LTS derivatives.

	Linux kernel commit v3.15-rc1~18^2~1 also claims that the old value
	of AUDIT_FEATURE_CHANGE was ignored by userspace because of the
	established convention how netlink messages for the audit system
	are divided into blocks.

	Looks like the best way to handle this situation is to pretend that
	the old value of AUDIT_FEATURE_CHANGE didn't exist.

	* xlat/nl_audit_types.in (AUDIT_FEATURE_CHANGE): Undefine.

	Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: fix MCL_* fallback definitions on alpha, ppc, ppc64, and sparc.
	On these architectures, MCL_* constants are different.

	* xlat/socketlayers.in [__alpha__ || __powerpc__ || __powerpc64__
	|| __sparc__] (MCL_CURRENT, MCL_FUTURE, MCL_ONFAULT): Define to 0x2000,
	0x4000, and 0x8000, respectively.

2018-04-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: fix SOL_SOCKET fallback definition on alpha, hppa, mips, and sparc
	On these architectures, SOL_SOCKET is 0xffff and not 1.

	* xlat/socketlayers.in [__alpha__ || __hppa__ || __mips__ || __sparc__]
	(SOL_SOCKET): Define to 0xffff.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add more mount checks.
	* tests/gen_tests.in (mount, mount-Xabbrev, mount-Xraw, mount-Xverbose):
	Add -a33 option.
	* tests/mount.c: Check printing of flags and pointers.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use sprintrc in mount test.
	* tests/mount.c (main): Use sprintrc.

2018-04-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add mount variants with different xlat verbosity levels.
	* tests/mount-Xabbrev.c: New file.
	* tests/mount-Xraw.c: Likewise.
	* tests/mount-Xverbose.c: Likewise.
	* tests/mount.c: Add handling of XLAT_RAW and XLAT_VERBOSE macros.
	* tests/pure_executables.list: Add mount-Xabbrev, mount-Xraw,
	and mount-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (mount-Xabbrev, mount-Xraw, mount-Xverbose): New
	tests.

	tests: add old_mmap variants with different xlat verbosity levels.
	* tests/old_mmap-Xabbrev.c: New file.
	* tests/old_mmap-Xraw.c: Likewise.
	* tests/old_mmap-Xverbose.c: Likewise.
	* tests/old_mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE
	macros.
	* tests/pure_executables.list: Add old_mmap-Xabbrev, old_mmap-Xraw,
	and old_mmap-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (old_mmap-Xabbrev, old_mmap-Xraw,
	old_mmap-Xverbose): New tests.

2018-04-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add mmap/mmap64 variants different xlat verbosity levels.
	* tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define.
	[!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise.
	* tests/mmap-Xabbrev.c: New file.
	* tests/mmap-Xraw.c: Likewise.
	* tests/mmap-Xverbose.c: Likewise.
	* tests/mmap64-Xabbrev.c: Likewise.
	* tests/mmap64-Xraw.c: Likewise.
	* tests/mmap64-Xverbose.c: Likewise.
	* tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros.
	* tests/mmap.test: Add handling of optional test arguments that set
	alignment and xlat verbosity options.
	* tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS,
	mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS.
	* tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw,
	mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose,
	mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-27  Dmitry V. Levin  <ldv@altlinux.org>

	Fix fallback definition of MSG_ZEROCOPY.
	* xlat/msg_flags.in (MSG_ZEROCOPY): Set fallback definition to 0x4000000.

	Fixes: v4.21~316 ("Update MSG_* constants")

2018-04-27  Dmitry V. Levin  <ldv@altlinux.org>

	build: try to use _Static_assert if static_assert is not available.
	* configure.ac: Check for _Static_assert if static_assert
	is not available.
	* static_assert.h [!HAVE_STATIC_ASSERT && HAVE__STATIC_ASSERT]
	(static_assert): Define to _Static_assert.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	printmode: add xlat style support to print_symbolic_mode_t.
	* printmode.c (print_symbolic_mode_t): Set ifmt to an empty string,
	print raw and decoded values based on current xlat_verbosity setting.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	evdev: remove XT_NORMAL.
	It is no longer used.

	* evdev.c (enum xlat_type) <XT_NORMAL>: Remove.
	(printxval_dispatch) <case XT_NORMAL>: Remove.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Switch to use of value-indexed xlats for evdev constants.
	* xlat/evdev_abs.in: Add "#value_indexed" directive.
	* xlat/evdev_autorepeat.in: Likewise.
	* xlat/evdev_ff_status.in: Likewise.
	* xlat/evdev_keycode.in: Likewise.
	* xlat/evdev_leds.in: Likewise.
	* xlat/evdev_misc.in: Likewise.
	* xlat/evdev_prop.in: Likewise.
	* xlat/evdev_relative_axes.in: Likewise.
	* xlat/evdev_snd.in: Likewise.
	* xlat/evdev_switch.in: Likewise.
	* xlat/evdev_sync.in: Likewise.
	* xlat/evdev_ff_types.in: Add a comment about sorting.
	* evdev.c (keycode_ioctl, keycode_V2_ioctl): Use printxval_index
	instead of printxval.
	(bit_ioctl): Use XT_SORTED for evdev_ff_types, use XT_INDEXED
	for other xlats.
	(evdev_read_ioctl): Use XT_INDEXED for all xlats.
	* ioctl.c (evdev_decode_number): Use printxval_indexn instead of
	printxval for evdev_abs.

	evdev: support various types of xlats in decode_bitset.
	* evdev.c (enum xlat_type): New enumeration.
	(printxval_dispatch): New function.
	(decode_bitset_): Rename from decode_bitset, add decode_nr_size
	and xt arguments, call printxval_dispatch instead of printxval.
	(decode_bitset): Add a decode_bitset_ wrapper that derives
	decode_nr_size from the ARRAY_SIZE of decode_nr.
	(bit_ioctl, evdev_read_ioctl): Update decode_bitset calls.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Move xlat/evdev_abs.h inclusion from ioctl.c to evdev.c.
	Also introduce evdev_abs_size constant, which will be needed later.

	* defs.h (evdev_abs_size): New declaration.
	* ioctl.c: Move xlat/evdev_abs.h inclusion ...
	* evdev.c: ... here.
	(evdev_abs_size): New constant variable.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add support for value-indexed xlats.
	There are quite a few xlats that start from 0 and not too sparse,
	we can push the search time for them down to O(1).

	* defs.h (printxval_indexn_ex): New declaration.
	(printxval_indexn, printxval_index, printxval_index_ex): New macros.
	* xlat.c (printxval_sized): Rename from printxval_searchn_ex,
	add fn argument, call it instead of xlat_search.
	(printxval_searchn_ex): Implement as a thin wrapper around
	printxval_sized using xlat_search as a search function.
	(xlat_idx): New function.
	(printxval_indexn_ex): New function, a thin wrapper around
	printxval_sized using xlat_idx as a search function.
	* xlat/gen.sh: Add support for "#value_indexed" directive.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	socketcall: use printxval_d for printing call argument.
	* socketcall.c (SYS_FUNC(socketcall)): Use printxval_d instead of manual
	call argument decoding.

	signal: use print_xlat_ex in print_sa_handler.
	* signal.c (print_sa_handler): Call print_xlat_ex instead of tprints
	in order to respect current xlat style setting.

	s390: use printxvals_ex for command printing in s390_runtime_instr.
	* s390.c (SYS_FUNC(s390_runtime_instr)): Replace manual command argument
	decoding with a printxvals_ex call.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	printsiginfo: use print_xlat_ex in print_si_code.
	In order to respect current xlat style setting.

	* printsiginfo.c (print_si_code): Use print_xlat_ex instead of manual
	string/value printing.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	open: use print_xlat_ex for printing open modes.
	In order to respect xlat style setting.

	* open.c (tprint_open_modes): Use print_xlat_ex instead of
	tprint_open_modes.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	netlink: use print_xlat_ex in decode_nlmsg_type_netfilter.
	In order to respect current xlat style setting.

	* netlink.c (decode_nlmsg_type_netfilter): Use print_xlat_ex
	instead of tprints.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	net: use print_xlat_ex in tprint_sock_type.
	In order to respect current xlat style setting.

	* next.c (tprint_sock_type): Use print_xlat_ex instead of tprints
	for socket type printing.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	keyctl: use printxval_d for printing keyring serial number.
	* keyctl.c (print_keyring_serial_number): Use printxval_d instead of
	looking up and printing xlat value manually.
	* xlat/key_spec.in: Add "#val_type int" so the xlat values have sign
	bit propagated.

	ipc: use printxval_u instead of manual xlat value printing.
	* ipc.c (SYS_FUNC(ipc)): Decode call argument using printxval_u.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ioprio: use sprintxval instead of xlookup and string/value printing.
	In order to respect current xlat style.

	* ioprio.c (sprint_ioprio): Use sprintxval for producing string
	representation of ioprio class, use the produced string representation
	in resulting xsprintf.

2018-04-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: handle NULL str in print_xlat_ex.
	It allows to use the following code pattern:

		print_xlat_ex(val, xlookup(xlat, val), XLAT_STYLE_FMT_D);

	* xlat.c (print_xlat_ex): Handle str being NULL: print val instead.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: fix typo (Ronald -> Roland)
	A very unfortunate one, though.

	NEWS: mention that -X option addresses Debian bug #692915.

2018-04-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ioctl: do not include linux/input.h.
	All the ABS_* and EV_* values are now available internally,
	there's no need to include the header.

	* ioctl.c [HAVE_LINUX_INPUT_H]: Do not include linux/input.h.

2018-04-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add more evdev ioctl checks.
	tests/ioctl_evdev.c (TEST_NULL_ARG_EX): Rename from TEST_NULL_ARG, add
	str argument, print it instead of #cmd.
	(TEST_NULL_ARG): Implement as a TEST_NULL_ARG_EX wrapper.
	(main): Add checks for EVIOCSABS and EVIOCGBIT ioctls.

	evdev: decode EV_SW unconditionally.
	* evdev.c (bit_ioctl): Remove [EV_SW] check.
	* tests/ioctl_evdev.c [!EV_SW] (EV_SW): Define.
	(main): Remove [EV_SW] check.

2018-04-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for arch-independent evdev constants.
	* xlat/evdev_abs.in: Add constant values.
	* xlat/evdev_autorepeat.in: Likewise.
	* xlat/evdev_ev.in: Likewise.
	* xlat/evdev_ff_status.in: Likewise.
	* xlat/evdev_ff_types.in: Likewise.
	* xlat/evdev_leds.in: Likewise.
	* xlat/evdev_misc.in: Likewise.
	* xlat/evdev_prop.in: Likewise.
	* xlat/evdev_relative_axes.in: Likewise.
	* xlat/evdev_snd.in: Likewise.
	* xlat/evdev_switch.in: Likewise.
	* xlat/evdev_sync.in: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat/evdev_switch.in: update.
	* xlat/evdev_switch.in (SW_RADIO): Remove, as it was renamed to
	SW_RFKILL_ALL and marked as deprecated by Linux commit v2.6.26-rc5~32^2.
	(SW_PEN_INSERTED): New constant, was added by Linux commit v4.7~11^2~7.

2018-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util.c: make "Out of memory" messages a bit more informative.
	Since these are emitted in multiple places and are not expected during
	any normal operation, it makes sense to report the caller name.

	* util.c (print_quoted_string_ex, print_quoted_string_ex, dumpiov_upto,
	dumpstr): Replace error_msg with error_func_msg.

2018-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ci: reorder travis jobs.
	Run coverage check first as it is the longest one.

	* .travis.yml (matrix): Reorder.

2018-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add MS_SUBMOUNT constant.
	* xlat/mount_flags.in (MS_SUBMOUNT): New constant, introduced
	by Linux commit v4.11-rc1~82^2~7.

2018-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	fcntl: replace combinations of xlookup and printxval with printxvals.
	After all, that's what printxvals for.

	* fcntl.c (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Use printxvals for
	printing value with multiple xlat tables as constant sources.

2018-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Move xlat_verbose and xlat_format from xlat.c to defs.h.
	As it will be used elsewhere.

	* xlat.c (xlat_verbose, xlat_format): Move...
	* defs.h: ...here.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	btrfs: use printxval_u for error types printing.
	* btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case
	BTRFS_IOC_GET_DEV_STATS>: Use printxval_u for error type printing.
	* tests/btrfs.c (btrfs_test_get_dev_stats_ioctl): Update expected output.

	btrfs: print device IDs using PRINT_FIELD_DEV.
	* btrfs.c (btrfs_print_balance_args): Print devid field using
	PRINT_FIELD_DEV.
	(MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_DEV_INFO,
	case BTRFS_IOC_GET_DEV_STATS, case BTRFS_IOC_SCRUB,
	case BTRFS_IOC_SCRUB_PROGRESS>: Likewise.
	(MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_DEV_REPLACE>: Print
	start.srcdevid field using PRINT_FIELD_DEV.
	* tests/btrfs.c: Update expected output.

	btrfs: print cont_reading_from_srcdev_mode as xlat.
	* xlat/btrfs_cont_reading_from_srcdev_mode.in: New file.
	* btrfs.c: Include "xlat/btrfs_cont_reading_from_srcdev_mode.h".
	(MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_DEV_REPLACE>: Print
	named values for the
	struct btrfs_ioctl_dev_replace_args.start.cont_reading_from_srcdev_mode
	field.
	* tests/btrfs.c: Include "xlat/btrfs_cont_reading_from_srcdev_mode.h".
	(btrfs_test_dev_replace_ioctl): Update expected output.

	btrfs: use PRINT_FIELD_*
	* btrfs.c (btrfs_print_balance_args, btrfs_print_balance,
	btrfs_print_features, btrfs_print_qgroup_limit,
	btrfs_print_data_container_header,
	print_btrfs_data_container_logical_ino, btrfs_print_qgroup_inherit,
	btrfs_print_tree_search, print_btrfs_ioctl_space_info, btrfs_ioctl):
	Use PRINT_FIELD_* macros for printing structure fields.

	btrfs: make BTRFS_IOC_GET_DEV_STATS error statistics output more structured
	* btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case
	BTRFS_IOC_GET_DEV_STATS>: Print array index in square brackets before
	the value in order to avoid confusion.
	* tests/btrfs.c (btrfs_test_get_dev_stats_ioctl): Update expected output.

	ioctl: print ioctl number in accordance with xlat verbosity setting.
	* ioctl.c (SYS_FUNC(ioctl)): Print ioctl command name in accordance
	with the current xlat_verbosity setting.
	* tests/btrfs.c (sprint_xlat_): New function.
	(ioc): New macro, a wrapper for sprint_xlat_.
	Update expected output.

	file_ioctl: make abbreviated output more structured.
	* file_ioctl.c (file_ioctl): Print fm_extents field name only in case
	of non-abbreviated output.
	* tests/btrfs.c (btrfs_test_ino_path_ioctls): Update expected output.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	btrfs: fix printing of struct btrfs_ioctl_quota_ctl_args.
	For some reason, he decoder of BTRFS_IOC_QUOTA_CTL command didn't print
	opening curly brace and field name, only the closing curly brace.

	* btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_QUOTA_CTL>:
	Print "{cmd=".
	* tests/btrfs.c (btrfs_test_quota_ctl_ioctl): Update expected output.

	Fixes: v4.12~100 "ioctl: add decoding support for btrfs ioctls"

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	btrfs: consistently use PRINT_FIELD_U64.
	* btrfs.c (print_u64, print_member_u64, print_key_value_internal,
	print_key_value): Remove.
	(btrfs_print_balance_args): Use PRINT_FIELD_U64 instead of
	print_member_u64.
	(btrfs_print_tree_search): Use PRINT_FIELD_U64 instead of
	print_key_value.
	(MPERS_PRINTER_DECL(btrfs_ioctl)): Use PRINT_FIELD_U64 instead of manual
	UINT64_MAX printing.
	* tests/btrfs.c: Update expected output in order to account fields that
	are now affected by xlat_verbosity setting.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	btrfs: print {min,max}_{offset,transid} unconditionally.
	As it looks like there's no reason to skip their printing.

	* btrfs.c (print_key_value_internal): Do not check value argument
	for holding non-zero value.
	* tests/btrfs.c (btrfs_print_search_key): Update expected output.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/btrfs.c: accept possible failure of BTRFS_IOC_BALANCE_V2.
	BTRFS_IOC_BALANCE_V2 ioctl might fail sometimes (for example, if it
	decides that it doesn't have enough free space).

	* tests/btrfs.c (btrfs_test_balance_ioctls): Print expected output for
	the BTRFS_IOC_BALANCE_V2 call based on its return code.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/btrfs.c: support volumes with mixed data/metadata in BTRFS_IOC_BALANCE_V2
	For these volumes, pend/vend should be the same for data and meta.

	* tests/btrfs.c (btrfs_test_balance_ioctls): Set args.meta.pend and
	args.meta.vend to the same values as args.data.pend and args.data.vend,
	respectively.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/btrfs.c: check BTRFS_IOC_SUBVOL_CREATE_V2 result.
	Otherwise the subsequent openat call fails with a cryptic message.

	* tests/btrfs.c (btrfs_test_subvol_ioctls): Check return code of the
	BTRFS_IOC_SUBVOL_CREATE_V2 ioctl call that is supposed to be successful.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/btrfs.c: add pid suffix to the created directory, remove it on exit
	If multiple tests are running simultaneously in the same directory,
	conflicts (and test failures) may happen.

	* tests/btrfs.c (path, dir_name_fmt, dir_name): New variables.
	(btrfs_test_ino_path_ioctls): Use dir_name for printing directory name.
	(rm_test_dir): New function.
	(main): Generate dir_name, use it instead of fixed name, add rm_test_dir
	as an atexit handler.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	btrfs: duplicate printing of opening braces on entering/exiting.
	* btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)): Print opening bracket
	on entering and exiting separately.

	btrfs: refactor timespec printing into print_btrfs_timespec.
	* btrfs.c (print_btrfs_timespec): New function.
	(MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_SET_RECEIVED_SUBVOL>:
	Use print_btrfs_timespec for printing stime and rtime fields.
	* tests/btrfs.c (btrfs_test_set_received_subvol_ioctl): Update expected
	output.

	btrfs: print abbreviations and field names more consistently.
	* btrfs.c (btrfs_print_data_container_header): Do not print ", val=".
	(btrfs_print_ino_path_container): Print val field name only in case
	of non-abbreviated output.
	(btrfs_print_qgroup_inherit): Print qgroups field name only in case
	of non-abbreviated output.
	(btrfs_print_tree_search): Print buf field name only in case
	of non-abbreviated output.
	(MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_SEND>: Print
	clone_sources field name only in case of non-abbreviated output.
	(MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_SPACE_INFO>: Print
	spaces field name only in case of non-abbreviated output.
	* tests/btrfs.c: Update expected output.

	btrfs: move printing of the field name inside btrfs_print_qgroup_limit.
	* btrfs.c (btrfs_print_qgroup_limit): Print ", lim=".
	(btrfs_print_qgroup_inherit, MPERS_PRINTER_DECL(btrfs_ioctl)): Do not
	print ", lim=" before btrfs_print_qgroup_limit call.

	btrfs: convert btrfs_print_{objectid,key_type} to PRINT_FIELD_XVAL_U.
	* btrfs.c (btrfs_print_key_type, btrfs_print_objectid): Convert into
	thin wrappers around PRINT_FIELD_XVAL_U.
	(btrfs_print_data_container_header, btrfs_print_tree_search,
	MPERS_PRINTER_DECL(btrfs_ioctl)): Update calls to btrfs_print_key_type
	and btrfs_print_objectid in accordance with the new calling convention.
	(print_objectid_callback): Use printxvals_ex directly instead of
	btrfs_print_objectid call.
	* tests/btrfs.c (btrfs_print_objectid, btrfs_print_key_type): Update
	expected output.

	tests: add btrfs tests with verbose xlat decoding.
	* tests/btrfs-X.test: New test.
	* tests/btrfs-vX.test: Likewise.
	* tests/btrfs-vwX.test: Likewise.
	* tests/btrfs-wX.test: Likewise.
	* tests/Makefile.am (DECODER_TESTS): Add them.
	* tests/btrfs.c (verbose_xlat): New static variable.
	(prfl_btrfs, prxval_btrfs): New function.
	(btrfs_print_qgroup_inherit, btrfs_print_vol_args_v2,
	btrfs_print_balance_args, btrfs_test_balance_ioctls,
	btrfs_test_clone_ioctls, btrfs_test_defrag_ioctls,
	btrfs_test_space_info_ioctl, btrfs_print_defrag_range_args,
	btrfs_test_scrub_ioctls, btrfs_test_ino_path_ioctls,
	btrfs_test_send_ioctl, btrfs_test_send_ioctl,
	btrfs_test_quota_ctl_ioctl, btrfs_test_get_dev_stats_ioctl,
	btrfs_test_get_dev_stats_ioctl, btrfs_test_dev_replace_ioctl,
	btrfs_test_dev_replace_ioctl, btrfs_print_features): Use prfl_btrfs and
	prxval_btrfs instead of printflags and printxval, respectively.
	(btrfs_test_balance_ioctls, btrfs_test_ino_path_ioctls,
	btrfs_test_quota_ctl_ioctl, btrfs_test_dev_replace_ioctl,
	btrfs_test_dev_replace_ioctl): Update expected output based on
	verbose_xlat setting.
	(btrfs_print_defrag_range_args): Add compress_type_known arg, pass it
	to prxval_btrfs.
	(main): Handle -X option.

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check -X option syntax.
	* tests/options-syntax.test: Add checks for -X option with invalid
	arguments.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add user interface for configuring xlat output style.
	* strace.c (init): Handle -X option, set xlat_verbosity
	according to -X argument.
	* strace.1.in: Document -X option.
	* NEWS: Mention it.

	Closes: https://github.com/strace/strace/issues/27
	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: print fields that interpreted as pointers using printaddr64.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_ELEM),
	BEGIN_BPF_CMD_DECODER(BPF_MAP_UPDATE_ELEM)): Print key and value
	fields using PRINT_FIELD_ADDR64.
	(BEGIN_BPF_CMD_DECODER(BPF_MAP_DELETE_ELEM)): Print key field using
	PRINT_FIELD_ADDR64.
	(BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_NEXT_KEY)): Print key and next_key
	field using PRINT_FIELD_ADDR64.
	(BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Print insns and log_buf fields
	using PRINT_FIELD_ADDR64.
	(BEGIN_BPF_CMD_DECODER(BPF_PROG_TEST_RUN)): Print data_in and data_out
	fields using PRINT_FIELD_ADDR64.
	* tests/bpf.c: Update expected output.

2018-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	build: make it even more reproducible.
	* Makefile.am (today): Consistently print the UTC date in C locale.
	* configure.ac (RPM_CHANGELOGTIME, DEB_CHANGELOGTIME): Likewise.
	* maint/update_copyright_years.sh: Likewise.
	* copyright-year-gen: Likewise.  When $SOURCE_DATE_EPOCH is non-empty,
	use it as fallback date before the current system date.

	References: https://github.com/strace/strace/pull/68

2018-04-19  Dmitry V. Levin  <ldv@altlinux.org>

	unwind: move unwind_tcb_init invocation to after_successful_attach.
	There is no need to call unwind_tcb_init before the tracee is attached.

	* strace.c (alloctcb) [ENABLE_STACKTRACE]: Move unwind_tcb_init
	invocation ...
	(after_successful_attach) [ENABLE_STACKTRACE]: ... here.
	(init) [ENABLE_STACKTRACE]: Remove unwind_tcb_init invocation loop.
	* unwind.c (unwind_tcb_fin): Skip if tcp->unwind_queue is NULL.

2018-04-19  Dmitry V. Levin  <ldv@altlinux.org>

	strace: move setting of post-attach flags inside after_successful_attach
	* strace.c (after_successful_attach): Add "flags" argument.
	Set TCB_ATTACHED, TCB_STARTUP, and "flags" in tcp->flags.
	All users updated.

2018-04-19  Dmitry V. Levin  <ldv@altlinux.org>

	strace: rename newoutf to after_successful_attach.
	This function is going to be used for other things that have to be done
	right after a successful attach, hence the rename.

	* strace.c (newoutf): Rename to after_successful_attach,
	all users updated.

2018-04-19  Dmitry V. Levin  <ldv@altlinux.org>

	unwind: remove stray newline in error diagnostics.
	* unwind-libdw.c (tcb_init): Do not pass trailing "\n" to error_msg
	as the latter prints newline itself.

2018-04-19  Dmitry V. Levin  <ldv@altlinux.org>

	build: make it more reproducible.
	* file-date-gen: Consistently print the UTC date in C locale.
	When $SOURCE_DATE_EPOCH is non-empty, use it as fallback date
	before the current system date.

	Reported-by: Chris Lamb <lamby@debian.org>
	Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896016
	Closes: https://github.com/strace/strace/pull/68

2018-04-19  Masatake YAMATO  <yamato@redhat.com>

	unwind: initialize unwind context only if given tcb is initialized.
	With libdw based unwinder, following warnings are reported
	when -p is passed before -k:

	   $ ./strace -p 1 -k
	   ...
	   ./strace: dwfl_linux_proc_attach returned an error for process 0: No such file or directory
	   ...

	It seems that commit 54c7792b, "Fix libunwind segfault when -p is
	passed before -k" doesn't fix the original issue.

	* strace.c (init) [ENABLE_STACKTRACE]: Initialize unwind context only
	if given tcb is initialized.

2018-04-12  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: harmonize length checks.
	The rest of the decoder uses offsetof to check the length.

	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_OBJ_PIN),
	BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_NEXT_ID),
	BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_FD_BY_ID),
	BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_FD_BY_ID)): Use offsetof instead
	of offsetofend.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: add support for map_name and map_ifindex fields in BPF_MAP_CREATE.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Decode map_name
	and map_ifindex fields that were added in Linux commits
	v4.15-rc1~84^2~605^2~3 and v4.16-rc1~123^2~145^2~5^2~8, respectively.
	* bpf_attr.h (struct BPF_MAP_CREATE_struct): Add map_name
	and map_ifindex fields.
	* tests/bpf.c (init_BPF_MAP_CREATE_attr7): New function.
	(BPF_MAP_CREATE_checks): Remove const qualifier, add two more checks.

	bpf: improve handling of various sizes of BPF_MAP_CREATE attributes.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Skip printing
	the rest of the structure if len is less than the offset of the end
	of max_entries, map_flags, or inner_map_fd field.
	* tests/bpf.c (BPF_MAP_CREATE_checks): Add two more checks.

	tests: add checks for bpf BPF_MAP_CREATE arguments.
	* tests/bpf.c (BPF_MAP_CREATE_checks): Add two more checks.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: print numa_node using xlat.
	As the value of -1 has a special meaning.  The issue is complicated
	by the fact that this constant is not exported by UAPI.

	* xlat/numa_node.in: New file.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Print numa_node field
	using printxvals_ex with a special xlat style.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	btrfs: use umove_or_printaddr_ignore_syserror instead of u_error mangling
	* btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case
	BTRFS_IOC_TREE_SEARCH_V2>: Use umove_or_printaddr_ignore_syserror
	instead of tcp->u_error mangling around umove_or_printaddr call.

	defs.h: introduce umove_or_printaddr{,64}_ignore_syserror wrappers.
	* defs.h (umove_or_printaddr64_ignore_syserror): New macro, a thin
	wrapper around umoven_or_printaddr64_ignore_syserror.
	(umove_or_printaddr_ignore_syserror): New macro, a thin wrapper around
	umoven_or_printaddr_ignore_syserror.

	print_fields.h: add PRINT_FIELD_XVAL_U for printing xlat in %u format.
	* print_fields.h (PRINT_FIELD_XVAL_U): New macro.

	print_fields.h: add PRINT_FIELD_U64 for printing u64 with UINT64_MAX handling
	* print_fields.h (PRINT_FIELD_U64): New macro.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf_sock_filter: use print_xlat32.
	We can't simply use print_xlat here due to the way those SKF_*_OFF
	constants are defined.

	* bpf_sock_filter.c (print_sock_filter_k): Use print_xlat32 for printing
	SKF_AD_OFF, SKF_NET_OFF, and SKF_LL_OFF named constants.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs.h: add print_xlat32 macro.
	For those cases where inadvertent sign extension is possible.

	* defs.h (print_xlat32): New macro, a wrapper for print_xlat_ex.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	open: use print_xlat_d in print_dirfd.
	* open.c (print_dirfd): Use print_xlat_d for printing AT_FDCWD named
	constant.

	fanotify: use print_xlat_d.
	* fanotify.c (SYS_FUNC(fanotify_mark)): Use print_xlat_d for printing
	FAN_NOFD named constant.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add print_xlat_u and print_xlat_d shorthands.
	Add variants of print_xlat with various value printing formats.

	* defs.h (print_xlat_u, print_xlat_d): New macro, a wrapper for
	print_xlat_ex.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: introduce XLAT_STYLE_FMT_D.
	As there are some possible users for it, apparently.

	* defs.h (XLAT_STYLE_FORMAT_MASK): Update the value in order to
	accommodate XLAT_STYLE_FMT_D.
	(enum xlat_style) <XLAT_STYLE_FMT_D>: New enumeration entity.
	(printxval64_d, printxval_d): New function, a shorthand for
	printxvals_ex with a single xlat and XLAT_STYLE_FMT_D xlat style.
	* xlat.c (sprint_xlat_val): Handle XLAT_STYLE_FMT_D.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs.h: add shorthands for printing xval with XLAT_STYLE_FMT_U.
	* defs.h (printxval_u, printxval64_u): New function, a shorthand for
	printxvals_ex with a single xlat and XLAT_STYLE_FMT_U as a style.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add support for various xlat formats.
	Since xlat printing routines now have a notion of "style" that should be
	used for printing xlat values, we can also employ this argument for
	passing information about number printing format (unsigned decimal
	or hexadecimal, so far).

	* defs.h (XLAT_STYLE_FORMAT_SHIFT, XLAT_STYLE_FORMAT_MASK): New macro
	constant.
	(enum xlat_style) <XLAT_STYLE_FMT_X, XLAT_STYLE_FMT_U>: New enumeration
	entities.
	* xlat.c (xlat_verbose, xlat_format): New macro for checking specific
	aspect of style argument.
	(get_xlat_style): Use xlat_verbose for checking xlat verbosity style.
	(sprint_xlat_val, print_xlat_val): New function, for easing printing
	raw constant number with respect to printing format style.
	(printxvals_ex, sprintxval_ex, printxval_searchn_ex,
	printxval_searchn_ex, sprintflags_ex, printflags_ex, print_xlat_ex):
	Use xlat_verbose macro for xlat verbosity style checks. Use
	print_xlat_val instead of direct raw xlat value printing.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: use print_xlat in print_v4l2_queryctrl.
	* v4la.c (print_v4l2_queryctrl): Use print_xlat for printing
	V4L2_CTRL_FLAG_NEXT_CTRL named constant.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	prctl: use print_xlat_ex to print PR_SET_PTRACER_ANY.
	We cannot simply use print_xlat as PR_SET_PTRACER_ANY is defined
	differently in kernel headers.

	* prctl.c (SYS_FUNC(prctl)) <case PR_SET_PTRACER>: Use print_xlat_ex
	for printing PR_SET_PTRACER_ANY named constant.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nlattr: use print_xlat.
	* nlattr.c (print_nlattr): Use print_xlat for printing NLA_F_NESTED and
	NLA_F_NET_BYTEORDER named constants.

	ipc_defs.h: use print_xlat.
	* ipc_defs.h (PRINTCTL): Use print_xlat for printing IPC_64 named
	constant.

	futex: use print_xlat.
	* futex.c [!FUTEX_OP_OPARG_SHIFT] (FUTEX_OP_OPARG_SHIFT): New macro
	constant.
	(SYS_FUNC(futex)): Use print_xlat for printing FUTEX_OP_OPARG_SHIFT
	named constant.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ipc: use printxval for printing key.
	Convert explicit constant printing logic into a printxval call in order
	to account for xlat style setting.

	* defs.h (ipc_private): New xlat array declaration.
	* ipc_msg.c (SYS_FUNC(msgget)): Use printxval for printing IPC_PRIVATE.
	* ipc_sem.c (SYS_FUNC(semtimedop)): Likewise.
	* ipc_shm.c (SYS_FUNC(shmget)): Likewise.
	* xlat/ipc_private.in: New file.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mount: use print_xlat for printing MS_MGC_VAL.
	* mount.c (SYS_FUNC(mount)): Use print_xlat for printing MS_MGC_VAL
	named constant.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Introduce print_xlat and print_xlat_ex.
	print_xlat_ex prints a named constant in accordance with xlat style
	provided, print_xlat is a thin wrapper around print_xlat_ex that passes
	stringified constant name as a string and XLAT_STYLE_DEFAULT as a style.

	* defs.h (print_xlat_ex): New function prototype.
	(print_xlat): New macro, a thin wrapper around print_xlat_ex.
	* xlat.c (print_xlat_ex): New function.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Introduce XLAT_STYLE_DEFAULT.
	This will be needed later, with the introduction of user-configurable
	xlat style setting (stored in xlat_verbosity variable).

	* defs.h (XLAT_STYLE_VERBOSITY_MASK): New macro constant.
	(enum xlat_style) <XLAT_STYLE_DEFAULT>: New enumeration entity.
	(xlat_verbosity): New external declaration.
	(printxvals, printxval_searchn, printxval_search_ex, sprintxval,
	sprintflags, printflags64): Use XLAT_STYLE_DEFAULT instead of
	XLAT_STYLE_ABBREV.
	* strace.c (xlat_verbosity): New variable.
	* xlat.c (get_xlat_style): New function.
	(printxvals_ex, sprintxval_ex, printxval_searchn_ex, sprintflags_ex,
	printflags_ex): Use it.

2018-04-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Introduce xlat verbosity styles.
	* defs.h (printxvals_ex): Rename from printxvals, add style argument.
	(enum xlat_style): New enumeration.
	(printxvals): New macro, a wrapper for printxvals_ex.
	(printxval_searchn_ex): Rename from printxval_searchn, add style
	argument.
	(printxval_searchn): New macro, a wrapper for printxval_searchn_ex.
	(printxval_search_ex): New macro, a wrapper for printxval_searchn_ex.
	(sprintxval_ex): Rename from sprintxval, add style argument.
	(sprintxval): New macro, a wrapper for sprintxval_ex.
	(printflags_ex): Add style argument.
	(sprintflags_ex): Rename from sprintflags, add style argument.
	(sprintflags): New macro, a wrapper for sprintflags_ex.
	(printflags64): Pass XLAT_STYLE_ABBREV as a style in printflags_ex call.
	* netlink.c (decode_nlmsg_flags): Pass XLAT_STYLE_ABBREV as a style in
	printflags_ex call.
	* xlat.c (printxvals_ex): Rename from printxvals, add style argument,
	handle it.
	(sprintxval_ex): Rename from sprintxval, add style argument, handle it.
	(printxval_searchn_ex): Rename from printxval_searchn, add style
	argument, handle it.
	(sprintflags_ex): Rename from sprintflags, add style argument,
	handle it.
	(printflags_ex): Add style argument, handle it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
	References: https://github.com/strace/strace/issues/27

2018-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify signal delivery test against kernel bugs.
	Recent kernel siginfo changes, namely, v4.14-rc1~60^2^2~1,
	v4.16-rc1~159^2~37, and v4.16-rc1~159^2~39, introduced ABI regressions
	that render the whole siginfo interface unreliable.

	Looks like the kernel side is not eager to fix the breakage,
	so here is a workaround.

	* tests/signal_receive.c (s_sig, s_code, s_pid, s_uid): New volatile
	variables.
	(handler): Add siginfo_t parameter, save siginfo_t fields.
	(sig_print): Remove.
	(main): Rewrite.  Use variables saved by handler to print expected
	siginfo output. Print diagnostics in case of siginfo mismatch.
	* strace.spec.in (%check): Extract the diagnostics.

	Closes: https://github.com/strace/strace/issues/21

2018-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	Lift experimental status from stack tracing feature.
	* strace.1.in (.SH OPTIONS) <.B \-k>: Remove " (experimental)".
	* strace.c (usage) [ENABLE_STACKTRACE]: Likewise.

2018-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	Enable stack tracing in packages on all architectures.
	The stack tracing feature used to be enabled in packages on x86_64 only.
	This change enables -k option on all architectures.

	* debian/control (Build-Depends) [!amd64]: Add pkg-config, libdw-dev,
	and libiberty-dev.
	* strace.spec.in (BuildRequires) [!x86_64]: Add
	%buildrequires_stacktrace.

2018-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	Use libdw-based unwinder in ci and packages.
	* ci/install-dependencies.sh (common_packages): Add pkg-config,
	replace libunwind8-dev with libdw-dev.
	* debian/control (Build-Depends) [amd64]: Add pkg-config,
	replace libunwind-dev with libdw-dev.
	* debian/rules (build-udeb/Makefile): Replace --without-libunwind
	with --without-stacktrace.
	* strace.spec.in (buildrequires_libunwind_devel): Rename
	to buildrequires_stacktrace, replace libunwind-devel with
	either elfutils-devel or libdw-devel.

	tests: skip -k tests on unsupported architectures.
	* tests/strace-k.test: When actual strace -k output doesn't match the
	expected output because of limited architecture support, skip the test
	on architectures that are not currently supported by libdw.

2018-04-11  Masatake YAMATO  <yamato@redhat.com>

	unwind: add libdw as an unwinder.
	Implement alternative libdw-based unwinder for stack tracing.
	Add --with-libdw configure option to control whether libdw can be used
	as an unwinder.

	* m4/st_libdw.m4: New file.
	* m4/st_stacktrace.m4 (st_STACKTRACE): Invoke st_ARG_LIBDW and st_LIBDW,
	check for mutually exclusive configure options,
	(AM_CONDITIONAL): Add USE_LIBDW.
	* unwind-libdw.c: New file.
	* Makefile.am [USE_LIBDW] (strace_SOURCES): Append unwind-libdw.c.
	[USE_LIBDW] (strace_CPPFLAGS): Append $(libdw_CPPFLAGS).
	[USE_LIBDW] (strace_CFLAGS): Append $(libdw_CFLAGS).
	[USE_LIBDW] (strace_LDFLAGS): Append $(libdw_LDFLAGS).
	[USE_LIBDW] (strace_LDADD): Append $(libdw_LIBS).
	* NEWS: Mention this improvement.

	Closes: https://github.com/strace/strace/issues/12
	Closes: https://github.com/strace/strace/issues/13
	Co-Authored-by: Mark Wielaard <mjw@redhat.com>
	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check corner cases of udev_monitor_netlink_header decoding.
	* tests/netlink_kobject_uevent.c (test_nlmsg_type_kernel): Create
	a tail-allocated udev_monitor_netlink_header object and pass it
	to sys_send.
	(test_nlmsg_type_udev): Likewise.  Check decoding of
	udev_monitor_netlink_header object that ends in unmapped memory region.

2018-04-11  Harsha Sharma  <harshasharmaiitr@gmail.com>

	tests: check decoding of udev_monitor_netlink_header.
	* tests/netlink_kobject_uevent.c: Include <string.h>, <arpa/inet.h>,
	and "netlink_kobject_uevent.h".
	(test_nlmsg_type_udev, test_nlmsg_type_kernel): New functions.
	(main): Use them.

2018-04-11  Harsha Sharma  <harshasharmaiitr@gmail.com>

	netlink: decode libudev netlink header.
	* defs.h (decode_netlink_kobject_uevent): New prototype.
	* netlink.c (decode_netlink): Decode family kobject_uevent.
	* netlink_kobject_uevent.h: New file.
	* netlink_kobject_uevent.c: Likewise.
	* Makefile.am (strace_SOURCES): Add them.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-11  Harsha Sharma  <harshasharmaiitr@gmail.com>

	tests: check basic decoding of PTP_* ioctl commands.
	* tests/ioctl_ptp.c: New file.
	* tests/gen_tests.in (ioctl_ptp): New entry.
	* tests/pure_executables.list: Add ioctl_ptp.
	* tests/.gitignore: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: decode BPF_PROG_QUERY command.
	BPF_PROG_QUERY was introduced in Linux commit v4.15-rc1~84^2~558^2~6.

	* xlat/bpf_commands.in (BPF_PROG_QUERY): New constant.
	* xlat/bpf_query_flags.in: New file.
	* bpf.c: Include it.
	(DECL_BPF_CMD_DECODER): Add priv argument for passing tcb private data.
	(BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): New function.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders>: Add BPF_PROG_QUERY entry.
	(SYS_FUNC(bpf)): Fetch buf on entering and exiting, pass buf on exiting,
	retrieve private data on exiting, pass it to decoder as well, explicitly
	rework rc handling logic for size argument printing.
	* bpf_attr.h (struct BPF_PROG_QUERY_struct): New structure declaration.
	(BPF_PROG_QUERY_struct_size, expected_BPF_PROG_QUERY_struct_size): New
	macro.
	* tests/bpf.c: Add checks for BPF_PROG_QUERY command.

2018-04-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Make print_uint64 from btrfs.c globally available.
	And rename it to print_uint64_array_member to make the name sensible
	without additional context.

	* defs.h (print_uint64_array_member): New function prototype.
	* btrfs.c (print_uint64): Move...
	* util.c (print_uint64_array_member): ...here, drop "static" qualifier.

2018-04-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Introduce umoven_or_printaddr64* functions.
	Counterparts for umoven_or_printaddr/umoven_or_printaddr_ignore_syserror
	that always print 64 bits of addr (as this is needed in bpf and btrfs
	decoders).

	* util.c (umoven_or_printaddr64): Rename from umoven_or_printaddr,
	change addr argument type to uint64_t, call printaddr64 instead of
	printaddr.
	(umoven_or_printaddr64_ignore_syserror): Rename from
	umoven_or_printaddr_ignore_syserror, change addr argument type to
	uint64_t, call printaddr64 instead of printaddr.
	* defs.h (umoven_or_printaddr64): Rename from umoven_or_printaddr,
	change addr argument type to uint64_t.
	(umoven_or_printaddr64_ignore_syserror): Rename from
	umoven_or_printaddr_ignore_syserror, change addr argument type to
	uint64_t.
	(umove_or_printaddr64): New macro, a wrapper for umoven_or_printaddr64.
	(umoven_or_printaddr): New function, a wrapper for
	umoven_or_printaddr64.
	(umoven_or_printaddr_ignore_syserror): New function, a wrapper for
	umoven_or_printaddr64_ignore_syserror.

2018-04-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf_filter.c: add support for decoding eBPF instruction codes.
	* bpf_filter.c (print_bpf_filter_code): Add extended argument, remove
	static qualifier.  Add support for decoding eBPF instruction code.
	* defs.h (print_bpf_filter_code): New declaration.
	* xlat/ebpf_class.in: New file.
	* xlat/ebpf_mode.in: Likewise.
	* xlat/ebpf_op_alu.in: Likewise.
	* xlat/ebpf_op_jmp.in: Likewise.
	* xlat/ebpf_size.in: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-08  Dmitry V. Levin  <ldv@altlinux.org>

	unwind: prepare configure subsystem for alternative unwinders.
	Introduce --enable-stacktrace configure option to control whether
	-k option support is compiled in, --with-libunwind option remains
	available to control whether libunwind can be used as an unwinder.

	* m4/st_demangle.m4: New file.
	* m4/st_libunwind.m4: Likewise.
	* m4/st_stacktrace.m4: Likewise.
	* configure.ac: Replace all libunwind and libiberty checks
	with a single st_STACKTRACE invocation.
	* Makefile.am: Conditionalize checks for USE_LIBUNWIND and USE_DEMANGLE
	on ENABLE_STACKTRACE.
	[ENABLE_STACKTRACE] (strace_SOURCES): Append unwind.c and unwind.h.
	* strace.1.in: Replace libunwind with an unwinder-agnostic wording.
	* defs.h: Replace USE_LIBUNWIND with ENABLE_STACKTRACE.
	* strace.c: Likewise.
	(print_version): Print stack-trace instead of stack-unwind.
	* syscall.c: Replace USE_LIBUNWIND with ENABLE_STACKTRACE.
	* tests/Makefile.am: Likewise.  Replace LIBUNWIND_TESTS
	with STACKTRACE_TESTS.
	* tests/strace-V.test: Update expected output.

2018-04-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: implement decoding of prog_name and prog_ifindex fields.
	* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Add support for decoding
	of prog_name (introduced in Linux commit v4.15-rc1~84^2~605^2~4) and
	prog_ifindex (introduced as prog_target_ifindex in v4.15-rc1~84^2~127^2~13,
	renamed in v4.15-rc1~15^2~5^2~3^2~7).
	* bpf_attr.h [!BPF_OBJ_NAME_LEN] (BPF_OBJ_NAME_LEN): New macro constant.
	[BPF_OBJ_NAME_LEN]: Check that BPF_OBJ_NAME_LEN is equal to 16.
	(struct BPF_PROG_LOAD_struct): Add prog_name and prog_ifindex fields.
	(BPF_PROG_LOAD_struct_size, expected_BPF_PROG_LOAD_struct_size): Update.
	* tests/bpf.c (init_BPF_PROG_LOAD_attr): Rename
	to init_BPF_PROG_LOAD_attr3.
	(print_BPF_PROG_LOAD_attr): Rename to print_BPF_PROG_LOAD_attr3.
	(init_BPF_PROG_LOAD_attr4, print_BPF_PROG_LOAD_attr4): New functions.
	(BPF_PROG_LOAD_checks): Check new decoding features.

2018-04-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: add support for array fields.
	* gen_bpf_attr_check.sh: Ignore field array size definition.
	* m4/gen_bpf_attr_m4.sh (filter_entries): Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify strace -k tests.
	Allow __getpid as an alternative name for getpid,
	allow __kernel_vsyscall after getpid.

	* tests/strace-k.expected: New file.
	* tests/strace-k-demangle.expected: Likewise.
	* tests/Makefile.am (EXTRA_DIST): Add them.
	* tests/strace-k-demangle.test (expected): Remove.
	* tests/strace-k.test: Likewise.  Use grep to check the output.

2018-04-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ipc_msg: sign extend msgtyp in m32 personality.
	msgtyp has to be treated as a signed type all the way from fetching
	to printing.

	* ipc_msg.c (fetch_msgrcv_args): Sign extend msgtyp when fetching.

2018-04-05  Dmitry V. Levin  <ldv@altlinux.org>

	strace.spec.in: update Source URL.
	* strace.spec.in (Source): Change to https://strace.io/files/.

	debian: enable mpers support for ppc64el and s390x.
	* debian/control (Build-Depends) [ppc64el, s390x]: Add gcc-multilib.

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.22-1.
	* strace.spec.in: Likewise.

	Prepare for 4.22 release.
	* NEWS: Update for 4.22 release.

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2018-04-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.

2018-04-05  Masatake YAMATO  <yamato@redhat.com>

	unwind: split unwind code into front-end and back-end.
	This opens the way for alternative unwinder back-ends.

	* unwind.h: New file, defines the unwinder back-end interface.
	* unwind.c: Move all libunwind related code ...
	* unwind-libunwind.c: ... here.
	* Makefile.am [USE_LIBUNWIND] (strace_SOURCES): Add unwind.h
	and unwind-libunwind.c.

2018-04-05  Masatake YAMATO  <yamato@redhat.com>

	unwind: rename public functions in an object-oriented fashion.
	This change renames functions exported to strace core part from unwind
	subsystem.

	The new names imply that unwind subsystem exports two types of
	functions.  One is for manipulating back-end itself, "unwind_" prefix
	is used for this type.  Another is for manipulating back-end private data
	structure (unwind_ctx) attached to tcb, "unwind_tcb_" is used for this
	type.

	This naming should help people to understand unwind subsystem
	and the relation between unwind subsystem and back-ends.

	* defs.h (unwind_print_stacktrace): Rename to unwind_tcb_print.
	(unwind_capture_stacktrace): Rename to unwind_tcb_capture.
	* unwind.c: Ditto.
	* syscall.c (syscall_entering_trace, syscall_exiting_trace): Use
	new names.

2018-04-05  Masatake YAMATO  <yamato@redhat.com>

	unwind: add unwind_ prefix to struct tcb.queue field and its type.
	The names given to struct tcb.queue field and its type are too common,
	this may cause conflicts in the future if new fields are added
	to struct tcb.

	* defs.h (struct tcb): Rename queue field to unwind_queue,
	rename its type queue_t to unwind_queue_t.
	* unwind.c (struct unwind_queue_t): Rename to unwind_queue_t.
	All users updated.

2018-04-05  Masatake YAMATO  <yamato@redhat.com>

	unwind: make the field type of struct tcb independent from libunwind.
	Narrowing the area where the code refers to names associated with
	libunwind is needed to utilize libdw of elfutils as an alternative
	unwinder.

	* defs.h (struct tcb): Rename libunwind_ui field to unwind_ctx, change
	its type to "void *".
	* unwind.c (unwind_tcb_init, unwind_tcb_fin, stracetrace_walk): Reflect
	* the above field renaming.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify options-syntax.test against ash.
	* tests/options-syntax.test: Do not assume that shell provides $UID,
	use "id -u" if it doesn't.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.c: add support for opening output file in append mode.
	* strace.c (open_append): New variable.
	(init): Handle -A option.
	(strace_fopen): Open file in "a" mode if open_append is set to true.
	* strace.1.in: Document this.
	* NEWS: Mention this.

	Suggested-by: Philipp Marek <philipp.marek@emerion.com>
	Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=528488

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.c: support simultaneous usage of -r and -t options.
	* strace.c (init): Do not set tflag when rflag is set.
	(printleader): Handle rflag and tflag separately.
	* strace.1.in (.SH OPTIONS): Add a note about differences between
	the monotonic clock time  and the wall clock time.
	* tests/options-syntax.test: Remove the check for
	"-tt has no effect with -r" warning.
	* NEWS: Mention this.

	Suggested-by: Josh Triplett <josh@freedesktop.org>
	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
	Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466195

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall.c: dump write I/O even if error is returned.
	It makes sense to try to dump the argument of write syscalls as they can
	be readily available despite the fact that error has been returned.

	* syscall.c (dumpio): Move check for syserror and check for fd in
	read_set to the end of the function.
	* tests/read-write.c: Add a check for this behaviour.
	* tests/pread64-pwrite64.c: Update expected output.
	* NEWS: Mention this.

	Suggested-by: J. Bruce Fields <bfields@fieldses.org>
	Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=436284

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace: handle possible NULL from localtime() call.
	* strace.c (printleader): Print raw tv_sec value if localtime() returned
	NULL.
	* tests/localtime.c: New file.
	* tests/localtime.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add localtime.
	(MISC_TESTS): Add localtime.test.
	(localtime_LDADD): New variable.
	* tests/.gitignore: Add localtime.
	* ci/install-dependencies.sh (common_packages): Add faketime.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
	Closes: https://github.com/strace/strace/issues/42

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Return RVAL_STR unconditionally.
	There is no reason to check for auxstr being non-NULL
	because syscall_exiting_trace already does the check.

	* sched.c (SYS_FUNC(sched_getscheduler)): Do not check tcp->auxstr,
	return RVAL_STR unconditionally.
	* time.c (do_adjtimex): Likewise.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	dist/README: s/linux/Linux/
	* dist/README: Replace "linux" with "Linux".

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: fix formatting of -e trace class descriptions.
	Use .TP instead .PP as it is ought to be.

	* strace.1.in (.SS Filtering): Use .TP instead .PP as it is ought to be.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	nlattr: check NLA_TYPE_MASK at compile time.
	* nlattr.c: Include "static_assert.h"
	(print_nlattr): Check the expectations about NLA_TYPE_MASK.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: add a comment about bpf_attr decoding.
	* bpf.c: Add comment.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of bpf_attr of size 1.
	* tests/bpf.c (BPF_PROG_GET_NEXT_ID_checks): New entry.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: use print_big_u64_addr.
	Since pointers stored in the bpf_attr union are 64-bit regardless
	of architecture bitness.

	* bpf.c (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Call print_big_u64_addr
	for attr.license.
	(DEF_BPF_CMD_DECODER(BPF_OBJ_PIN)): Call print_big_u64_addr
	for attr.pathname.
	* tests/bpf.c (BPF_OBJ_PIN_checks): Check it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: add support for file mode flags.
	These were introduced by Linux commit v4.15-rc1~84^2~384^2~4.

	* bpf_attr.h (struct BPF_OBJ_PIN_struct): Add file_flags field.
	(struct BPF_PROG_GET_NEXT_ID_struct, struct BPF_PROG_GET_FD_BY_ID_struct,
	struct BPF_MAP_GET_FD_BY_ID_struct): Add open_flags field.
	(BPF_OBJ_PIN_struct_size, expected_BPF_OBJ_PIN_struct_size,
	expected_BPF_PROG_GET_NEXT_ID_struct_size,
	expected_BPF_PROG_GET_FD_BY_ID_struct_size,
	expected_BPF_MAP_GET_FD_BY_ID_struct_size): Update.
	* bpf.c (DEF_BPF_CMD_DECODER(BPF_OBJ_PIN)): Check the length, skip
	printing the rest of attributes if it is less than offset of the
	end of the bpf_fd field, print file_flags field otherwise.
	(DEF_BPF_CMD_DECODER(BPF_PROG_GET_NEXT_ID),
	DEF_BPF_CMD_DECODER(BPF_PROG_GET_FD_BY_ID),
	DEF_BPF_CMD_DECODER(BPF_MAP_GET_FD_BY_ID)): Check the length, skip
	printing the rest of attributes if it is less than offset of the
	end of the next_id field, print open_flags field otherwise.
	* xlat/bpf_file_mode_flags.in: New file.
	* tests/bpf.c (BPF_OBJ_PIN_checks, BPF_PROG_GET_NEXT_ID_checks,
	BPF_PROG_GET_FD_BY_ID_checks, BPF_MAP_GET_FD_BY_ID_checks): Check it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: refactor bpf test.
	The aim of this change is to introduce an ability to perform multiple
	checks for a specific bpf command.  In order to achieve so, all the
	related data is stored in check descriptor, and test_bpf iterates over
	it.  There are also some provisions made in regard to future changes
	(specifically, the way bpf_attr_data union is defined).

	* tests/bpf.c (print_bpf_attr): New function, a wrapper around
	struct bpf_check.printer.
	(test_bpf_): Rename to...
	(test_bpf): ...this.  Replace arguments with struct bpf_check pointer.
	Iterate over possible attribute variants. Account for changes in
	attribute initialisation routine: provide a pointer to locally defined
	union bpf_attr_data and perform memcpy afterwards. Initialise memory
	from data each time before a bpf call.
	(TEST_BPF, DEF_*, init_*, print_*): Remove.
	(init_BPF_PROG_LOAD_attr, print_BPF_PROG_LOAD_attr,
	init_BPF_OBJ_PIN_attr): New functions.
	(license, pathname): New variables.
	(BPF_MAP_CREATE_checks, BPF_MAP_LOOKUP_ELEM_checks,
	BPF_MAP_UPDATE_ELEM_checks, BPF_MAP_DELETE_ELEM_checks,
	BPF_MAP_GET_NEXT_KEY_checks, BPF_PROG_LOAD_checks, BPF_OBJ_PIN_checks,
	BPF_PROG_ATTACH_checks, BPF_PROG_DETACH_checks,
	BPF_PROG_TEST_RUN_checks, BPF_PROG_GET_NEXT_ID_checks,
	BPF_PROG_GET_FD_BY_ID_checks, BPF_MAP_GET_FD_BY_ID_checks,
	BPF_OBJ_GET_INFO_BY_FD_checks): New arrays.
	(BPF_OBJ_GET_checks, BPF_MAP_GET_NEXT_ID_checks): New macros.
	(CHK): New macro, a shorthand for initialising array of struct bpf_check.
	(main): New static constant checks, iterate over checks and run test_bpf
	with each element.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_fields.h: introduce PRINT_FIELD_ADDR and PRINT_FIELD_ADDR64 macros
	* print_fields.h (PRINT_FIELD_ADDR, PRINT_FIELD_ADDR64): New macro.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_fields.h: introduce PRINT_FIELD_CSTRING_SZ macro.
	A variant of PRINT_FIELD_CSTRING with an ability to pass string size
	explicitly.

	* print_fields.h (PRINT_FIELD_CSTRING_SZ): New macro.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_fields.h: check whether passed field is an array in PRINT_FIELD_CSTRING
	* print_fields.h (PRINT_FIELD_CSTRING): Add MUST_BE_ARRAY to the size
	value in order to check whether (where_).field_ is an array in compile
	time.

	print_fields.h: whitespace fix in PRINT_FIELD_HEX_ARRAY.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

	bpf_attr: add more size checks.
	* bpf_attr.h: Add expected sizes of structures.
	* gen_bpf_attr_check.sh: Check them.

	tests: check bpf syscall decoder unconditionally.
	* configure.ac (AC_CHECK_HEADERS([linux/bpf.h])): Check for
	struct bpf_insn.
	* tests/bpf.c: Remove the test guard, include "scno.h", "bpf_attr.h",
	"xlat.h", and "xlat/bpf_commands.h".  Conditionalize inclusion of
	<linux/bpf.h> on HAVE_LINUX_BPF_H.  Remove all HAVE_UNION_* checks.
	(BPF_ATTR_DATA_FIELD): New macro.
	(bpf_attr_data): New union.  Note that it is larger than modern
	union bpf_attr, this allows more checks to be implemented in the future.
	(sizeof_attr, test_bpf_): Replace union bpf_attr with
	union bpf_attr_data.
	(DEF_BPF_INIT_FIRST): Replace union bpf_attr with the corresponding
	structure.
	(init_BPF_MAP_CREATE_attr): Replace union bpf_attr with
	struct BPF_MAP_CREATE_struct.
	(init_BPF_MAP_LOOKUP_ELEM_attr): Replace union bpf_attr with
	struct BPF_MAP_LOOKUP_ELEM_struct.
	(init_BPF_MAP_UPDATE_ELEM_attr): Replace union bpf_attr with
	struct BPF_MAP_UPDATE_ELEM_struct.
	(init_BPF_MAP_DELETE_ELEM_attr): Replace union bpf_attr with
	struct BPF_MAP_DELETE_ELEM_struct.
	(init_BPF_MAP_GET_NEXT_KEY_attr): Replace union bpf_attr with
	struct BPF_MAP_GET_NEXT_KEY_struct.
	(init_BPF_PROG_LOAD_attr): Replace union bpf_attr with
	struct BPF_PROG_LOAD_struct.
	(init_BPF_OBJ_PIN_attr): Replace union bpf_attr with
	struct BPF_OBJ_PIN_struct.
	(init_BPF_PROG_ATTACH_attr): Replace union bpf_attr with
	struct BPF_PROG_ATTACH_struct.
	(init_BPF_PROG_DETACH_attr): Replace union bpf_attr with
	struct BPF_PROG_DETACH_struct.
	(init_BPF_PROG_GET_NEXT_ID_attr): Replace union bpf_attr with
	struct BPF_PROG_GET_NEXT_ID_struct.
	(sample_BPF_PROG_TEST_RUN_attr): Change type from union bpf_attr to
	struct BPF_PROG_TEST_RUN_struct, all users updated.
	(sample_BPF_OBJ_GET_INFO_BY_FD_attr): Change type from union bpf_attr
	to struct BPF_OBJ_GET_INFO_BY_FD_struct, all users updated.

	Check that structures defined by bpf_attr.h match system union bpf_attr.
	* gen_bpf_attr_check.sh: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	(strace_SOURCES_check): New variable.
	(strace_SOURCES): Add $(strace_SOURCES_check).
	(BUILT_SOURCES, CLEANFILES): Add bpf_attr_check.c.
	(bpf_attr_check.c): New rule.
	(sys_func_h_sources): New variable.
	(sys_func.h): Use it instead of strace_SOURCES_c.
	* .gitignore: Add /bpf_attr_check.c.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

	build: generate all union bpf_attr checks automatically.
	Rather than list by hand some members of union bpf_attr that we check
	for availability, automatically list all members of union bpf_attr we
	are aware of.

	* m4/gen_bpf_attr_m4.sh: New file.
	* bootstrap: Invoke it.
	* configure.ac (AC_CHECK_HEADERS([linux/bpf.h])): Use st_BPF_ATTR.
	* m4/.gitignore: New file.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: move definitions of bpf_attr structures to separate header file.
	This also unifies decoders of bpf commands by moving common code
	to new macros.

	* bpf_attr.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* bpf.c: Include it.
	(DEF_BPF_CMD_DECODER): Rename to BEGIN_BPF_CMD_DECODER, add code common
	to all decoders.  All users updated.
	(END_BPF_CMD_DECODER): New macro, add its invocation to all users
	of BEGIN_BPF_CMD_DECODER macro.

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Introduce print_big_u64_addr.
	This is needed at least for bpf, btrfs, and sg_io, as 32-bit tracer
	cannot figure out whether the kernel is 32-bit or 64-bit,
	and its behaviour differs when it handles u64 as a pointer.

	* linux/arch_defs_.h [!CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL]
	(CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): New definition, default to 0.
	* linux/arm/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
	Define to 1.
	* linux/i386/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
	Likewise.
	* linux/mips/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
	Likewise.
	* linux/powerpc/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
	Likewise.
	* linux/riscv/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
	Likewise.
	* linux/s390/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
	Likewise.
	* linux/sparc/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
	Likewise.
	* linux/tile/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL):
	Likewise.
	* defs.h (print_big_u64_addr): New function.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs.h: introduce max_addr and max_kaddr macros.
	In order to check an address against maximum addr/kaddr value
	for the current personality.

	* degs.h (max_addr, max_kaddr): New macros.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce static_assert.
	We are going to use static_assert provided by <assert.h> or,
	if it doesn't work, our cheap imitation that doesn't display
	the message specified as the second argument of static_assert.

	* configure.ac (AC_CACHE_CHECK): Check for static_assert in <assert.h>,
	define HAVE_STATIC_ASSERT if it is available.
	* static_assert.h: New file.
	* Makefile.am (strace_SOURCES): Add it.

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: forward SIZEOF_KERNEL_LONG_T and SIZEOF_LONG to C preprocessor.
	* tests/Makefile.am (AM_CPPFLAGS): Forward SIZEOF_KERNEL_LONG_T
	and SIZEOF_LONG as TESTS_SIZEOF_KERNEL_LONG_T and TESTS_SIZEOF_LONG.
	* tests/tests.h [TESTS_SIZEOF_KERNEL_LONG_T] (SIZEOF_KERNEL_LONG_T):
	Redefine to TESTS_SIZEOF_KERNEL_LONG_T.
	[TESTS_SIZEOF_LONG] (SIZEOF_LONG): Redefine to TESTS_SIZEOF_LONG.

	Complements: v4.21~5 ("Export SIZEOF_LONG and SIZEOF_KERNEL_LONG_T to tests")

2018-04-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests/tests.h: fix indentation.

	tests: fix potential errno clobbering in netlink_kobject_uevent.test.
	* tests/netlink_kobject_uevent.c (errstr): New variable.
	(sys_send): New function.
	(main): Use them.

2018-04-03  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Restore kvm ioctl definitions for aarch64 and mips architectures.
	* maint/ioctls_sym.sh: Add aarch64 and mips architectures to the list
	of kvm-capable architectures.
	* linux/aarch64/ioctls_arch0.h: Regenerate.
	* linux/mips/ioctls_arch0.h: Regenerate.

	Fixes: v4.15~92 ("Move KVM_* ioctl entries from ioctls_inc*.h to ioctls_arch*.h")

2018-04-03  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v4.16.
	* linux/32/ioctls_inc_align16.h: Update from linux v4.16
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/arm/ioctls_arch0.h: Likewise.
	* linux/i386/ioctls_arch0.h: Likewise.
	* linux/powerpc/ioctls_arch0.h: Likewise.
	* linux/s390/ioctls_arch0.h: Likewise.
	* linux/s390x/ioctls_arch0.h: Likewise.
	* linux/x86_64/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

	maint: update for linux 4.16.
	* maint/ioctls_sym.sh: Add workaround for linux/ndctl.h file.
	Update workaround for media/v4l2-common.h file.
	(x86_list): Add KVM_GET_MSR_FEATURE_INDEX_LIST.

2018-04-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util.c: amend sprinttime_ex description a bit.
	* util.c (sprinttime_ex): Document return value.

	tests/bpf.c: add a check for NULL bpf_attr pointer.
	* tests/bpf.c (main): Add a check with 0 passed in the third argument.

2018-04-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: print byte range for extra data.
	As it could be not entirely clear what bytes are printed.

	* bpf.c (decode_attr_extra_data): Print a comment about the byte range
	to be printed.
	* tests/bpf.c: Update expected output.

2018-04-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Remove addflags.
	It has only single user and implementation of xlat styles for it would
	lead to lots of code duplication.

	* defs.h (addflags): Remove declaration.
	* mem.c (print_mmap_flags): Convert addflags call into printflags64 with
	non-zeroeness flags check.
	* xlat.c (addflags): Remove.

2018-04-01  Dmitry V. Levin  <ldv@altlinux.org>

	Add i18n support.
	Let's make a step towards the growing strace userbase all around
	the world and translate something to the language of their choice.

	This change enables translation of error messages corresponding
	to errno codes, making it consistent with error diagnostics of other
	i18n-aware tools, e.g.

	$ LANG=es_ES strace -qq -a38 -P /missing unlink /missing
	unlink("/missing")                    = -1 ENOENT (No existe el fichero o el directorio)
	unlink: no se puede deshacer el enlace '/missing': No existe el fichero o el directorio

	* strace.c: Include <locale.h>.
	(main): Invoke setlocale.
	* tests/init.sh: Export LC_ALL=C.
	* NEWS: Mention this enhancement.

2018-03-29  Dmitry V. Levin  <ldv@altlinux.org>

	Remove RVAL_PRINT_ERR_VAL.
	* defs.h (RVAL_PRINT_ERR_VAL): Remove.
	* ldt.c (SYS_FUNC(modify_ldt)): Return 0.
	* syscall.c (syscall_exiting_trace): When printing an error,
	always print struct tcb.u_rval as if RVAL_PRINT_ERR_VAL was set.

2018-03-29  Dmitry V. Levin  <ldv@altlinux.org>

	Treat RVAL_DECIMAL the same way as RVAL_UDECIMAL.
	Assuming that syscalls may return negative values only as error codes,
	always print non-error syscall return codes as unsigned.

	* defs.h (RVAL_UDECIMAL): Remove.
	(RVAL_DECIMAL): Rename to RVAL_UDECIMAL.
	* syscall.c (syscall_exiting_trace) <case RVAL_DECIMAL>: Remove.
	* clone.c (SYS_FUNC(fork)): Remove RVAL_UDECIMAL.
	* lseek.c (SYS_FUNC(lseek)): Likewise.
	* prctl.c (SYS_FUNC(prctl)): Likewise.
	* uid.c (SYS_FUNC(getuid), SYS_FUNC(setfsuid)): Likewise.
	* times.c (SYS_FUNC(times)): Always return 0.
	* tests/inject-nf.c (main): Update expected output.

2018-03-29  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check handling of some invalid delay injection parameters.
	* tests/qual_inject-syntax.test: Check for negative delay injection
	parameters.  Check for overriding delay injection parameters.

2018-03-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement injection of negative return values.
	Extend the range of injected return value to the maximum, print warnings
	if negative injection value can be clipped in compat personality or can
	inadvertently turn into a fault injection.

	* defs.h (INJECT_F_ERROR): New macro.
	* filter_qualify.c (parse_inject_token): Revert type of intval local
	variable back to int, check INJECT_F_ERROR along with INJECT_F_RETVAL,
	use strtoull to parse retval argument, print warnings in case of retval
	clipping and inadvertent fault injection.
	(qualify_inject_common): Set INJECT_F_ERROR instead of INJECT_F_RETVAL.
	* syscall.c (tamper_with_syscall_exiting): Check inject_data.flags
	to determine whether a fault injection or retval injection has to be
	performed.
	(syscall_exiting_trace) <case RVAL_DECIMAL>: Explicitly print
	tcp->u_rval as int if current_klongsize < sizeof(tcp->u_rval).
	* tests/inject-nf.c (main): Update.
	* tests/inject-nf.test: Test injection of negative return values.
	* tests/qual_inject-syntax.test: Remove retval=-1 check as it is now
	allowed, add checks for invalid retval parameters.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-28  Dmitry V. Levin  <ldv@altlinux.org>

	arch_defs.h: fix typo in comment.

	Move delay interface from defs.h to delay.h.
	* defs.h (alloc_delay_data, fill_delay_data, is_delay_timer_armed,
	delay_timer_expired, arm_delay_timer, delay_tcb): Move...
	* delay.h: ... to new file.
	* Makefile.am (strace_SOURCES): Add it.
	* filter_qualify.c: Include it.
	* strace.c: Likewise.
	* syscall.c: Likewise.

2018-03-28  Dmitry V. Levin  <ldv@altlinux.org>

	Turn struct inject_data.rval into an index.
	Add one level of indirection to decrease the size of struct inject_data
	as hundreds of these structures are created for each process when
	injection mechanism is activated.

	* retval.h: New file.
	* retval.c: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* defs.h (struct inject_data): Replace rval field with rval_idx.
	* filter_qualify.c: Include "retval.h".
	(parse_inject_token, qualify_inject_common): Initialize
	struct inject_data.rval_idx using retval_new.
	* syscall.c: Include "retval.h".
	(tamper_with_syscall_exiting): Obtain the value that has to be injected
	using retval_get.

2018-03-27  Dmitry V. Levin  <ldv@altlinux.org>

	defs.h: update comment.
	* defs.h (struct inject_data): Update comment about flags.

	Complements: v4.21-108-gba8e768 ("Implement delay injection")

2018-03-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: cleanup mmap_flags.in.
	* xlat/mmap_flags.in (_MAP_NEW): Remove SunOS-specific comment, add
	a comment that this is a SPARC-specific constant (from
	arch/sparc/include/uapi/asm/mman.h).
	(MAP_GROWSUP): IA-64-specific constant (from
	arch/ia64/include/uapi/asm/mman.h).
	(MAP_INHERIT): Add a comment that this is a SPARC-specific constant
	(from arch/sparc/include/uapi/asm/mman.h).
	(_MAP_INHERIT): Add a comment that this is an Alpha-specific constant
	(from arch/alpha/include/uapi/asm/mman.h).
	(MAP_ANON): Remove, FreeBSD-specific constant.
	(MAP_HASSEMAPHORE): Rename to...
	(_MAP_HASSEMAPHORE): ...this, add a comment that this is an
	Alpha-specific constant (from arch/alpha/include/uapi/asm/mman.h).
	(MAP_NOSYNC, MAP_NOCORE): Remove.
	(MAP_AUTOGROW, MAP_AUTORSRV, MAP_LOCAL): Add a comment that this is
	an architecture-specific constant (from
	arch/mips/include/uapi/asm/mman.h, arch/xtensa/include/uapi/asm/mman.h).
	(_MAP_UNALIGNED): Add a comment that this is an Alpha-specific constant
	(from arch/alpha/include/uapi/asm/mman.h).

2018-03-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of kern_features syscall.
	* tests/kern_features.c: New file.
	* tests/kern_features-fault.test: New test.
	* tests/gen_tests.in (kern_features): New entry.
	* tests/Makefile.am (DECODER_TESTS): Add kern_features-fault.test.
	* tests/pure_executables.list: Add kern_features.
	* tests/.gitignore: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sparc, sparc64: implement kern_features decoder.
	* sparc.c: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* linux/sparc/syscallent.h ([340]): Remove NF flag, set kern_features
	decoder.
	* linux/sparc64/syscallent.h ([340]): Likewise.
	* xlat/sparc_kern_features.in: New file.
	* NEWS: Mention this enhancement.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-27  Dmitry V. Levin  <ldv@altlinux.org>

	evdev: move mpers-specific parsers to a separate file.
	This change reduces binary code duplication on mpers platforms
	and prepares evdev parsers to use printxval_bsearch.

	* defs.h (evdev_ioctl, print_evdev_ff_type): New prototypes.
	* evdev.c (evdev_ioctl): Un-mpersify.
	(evdev_write_ioctl) Remove EVIOCSFF case, forward default case
	to evdev_write_ioctl_mpers.
	(decode_envelope, ff_effect_ioctl): Move to...
	* evdev_mpers.c: ... new file.
	* Makefile.am (strace_SOURCES): Add evdev_mpers.c.

2018-03-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ci: install libunwind8-dev.
	While in debian/control we use libunwind-dev in Build-Depends, in case
	of ci we have to be more conservative and use the name portable across
	different ci implementations.

	* ci/install-dependencies.sh (common_packages): Add libunwind8-dev.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check injection of return values into a "never fails" syscall.
	* tests/inject-nf.c: New file.
	* tests/inject-nf.test: New test.
	* tests/.gitignore: Add inject-nf.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add inject-nf.test.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-23  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce raw syscall invocation wrappers.
	Unfortunately, syscall(3) provided by libc is too smart
	for some of our needs.

	* linux/raw_syscall.h: New file.
	* linux/aarch64/raw_syscall.h: Likewise.
	* linux/alpha/raw_syscall.h: Likewise.
	* linux/arc/raw_syscall.h: Likewise.
	* linux/arm/raw_syscall.h: Likewise.
	* linux/avr32/raw_syscall.h: Likewise.
	* linux/bfin/raw_syscall.h: Likewise.
	* linux/hppa/raw_syscall.h: Likewise.
	* linux/i386/raw_syscall.h: Likewise.
	* linux/ia64/raw_syscall.h: Likewise.
	* linux/m68k/raw_syscall.h: Likewise.
	* linux/metag/raw_syscall.h: Likewise.
	* linux/microblaze/raw_syscall.h: Likewise.
	* linux/mips/raw_syscall.h: Likewise.
	* linux/nios2/raw_syscall.h: Likewise.
	* linux/or1k/raw_syscall.h: Likewise.
	* linux/powerpc/raw_syscall.h: Likewise.
	* linux/powerpc64/raw_syscall.h: Likewise.
	* linux/riscv/raw_syscall.h: Likewise.
	* linux/s390/raw_syscall.h: Likewise.
	* linux/s390x/raw_syscall.h: Likewise.
	* linux/sh/raw_syscall.h: Likewise.
	* linux/sh64/raw_syscall.h: Likewise.
	* linux/sparc/raw_syscall.h: Likewise.
	* linux/sparc64/raw_syscall.h: Likewise.
	* linux/tile/raw_syscall.h: Likewise.
	* linux/x32/raw_syscall.h: Likewise.
	* linux/x86_64/raw_syscall.h: Likewise.
	* linux/xtensa/raw_syscall.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.

2018-03-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix potentially unbound variable in kernel_version_code.
	Fix the following use case:

		$ sh -uc '. tests/init.sh; kernel_version_code 4.5'
		tests/init.sh: line 242: 3: unbound variable

	* tests/init.sh (kernel_version_code): Fix potentially unbound variable.

2018-03-23  Dmitry V. Levin  <ldv@altlinux.org>

	strace: further optimize unblocking of the delay signal handler.
	Do not unblock the delay signal handler unless the delay timer is armed.

	* defs.h (is_delay_timer_created): Remove.
	(is_delay_timer_armed, delay_timer_expired): New prototypes.
	* delay.c (delay_timer_is_armed): New static variable.
	(is_delay_timer_created): Add static qualifier.
	(is_delay_timer_armed, delay_timer_expired): New functions.
	(arm_delay_timer): Set delay_timer_is_armed.
	* strace.c (next_event): Use is_delay_timer_armed instead of
	is_delay_timer_created to check whether the delay signal handler
	has to be unblocked.
	(timer_sighandler): Invoke delay_timer_expired.

2018-03-23  Dmitry V. Levin  <ldv@altlinux.org>

	strace: rewrite restart error handling without sigsetjmp/siglongjmp.
	Further simplify and optimize error handling of the delay signal handler
	by replacing sigsetjmp/siglongjmp mechanism with an error flag.

	* strace.c: Do not include <setjmp.h>.
	(restart_failed): New volatile variable.
	(timer_jmp_buf): Remove.
	(next_event): Cache is_delay_timer_created() return value,
	remove sigsetjmp invocation, check restart_failed instead.
	(timer_sighandler): Replace siglongjmp with setting restart_failed.

2018-03-23  Dmitry V. Levin  <ldv@altlinux.org>

	strace: do not call sigsetjmp without a delay timer.
	As sigsetjmp costs a syscall, do not call it unless a delay timer
	is already created and its signal handler is going to be unblocked.

	* strace.c (next_event): Move sigsetjmp invocation under
	is_delay_timer_created() condition.

	Optimizes: v4.21-108-gba8e768 ("Implement delay injection")

2018-03-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/bpf.c: convert TEST_BPF_ macro to a function.
	As it looks like there's no compelling reason to keep it as a macro and
	leaving it so quite complicates modification of the routine and makes
	them error-prone.

	* tests/bpf.c (TEST_BPF_): Convert it to...
	(test_bpf): ...this.  Rename cmd_ to cmd, cmd_str_ to cmd_str,
	init_first_ to init_first, print_first_ to print_first, init_attr_
	to init_attr, print_attr_ to print_attr.
	(TEST_BPF): Call test_bpf_ instead of TEST_BPF_.

2018-03-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: btrfs.c whitespace cleanup.
	* tests/btrfs.c: Add spaces after PRI* format specifiers.

2018-03-22  Elvira Khabirova  <lineprinter@altlinux.org>

	tests: check delay injection.
	* tests/delay.c: New file.
	* tests/delay.test: New test.
	* tests/.gitignore: Add delay.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(delay_LDADD): New variable.
	(MISC_TESTS): Add delay.test.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-22  Elvira Khabirova  <lineprinter@altlinux.org>

	Implement delay injection.
	Add -e inject=SET:delay_enter= and -e inject=SET:delay_exit= options.

	* configure.ac (AC_SEARCH_LIBS): Check for timer_create -lrt.
	* delay.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	(strace_LDADD): Add $(timer_LIBS).
	* defs.h (INJECT_F_DELAY_ENTER, INJECT_F_DELAY_EXIT,
	TCB_INJECT_DELAY_EXIT, TCB_DELAYED, inject_delay_exit, syscall_delayed):
	New macros.
	(alloc_delay_data, fill_delay_data, is_delay_timer_created,
	arm_delay_timer, delay_tcb): New prototypes.
	(struct inject_data): Replace reserved field with delay_idx.
	(struct tcb): Add delay_expiration_time field.
	* filter_qualify.c (parse_delay_token): New function.
	(parse_inject_token): Use it.
	(qualify_inject_common): Initialize struct inject_opts.data.delay_idx.
	* strace.c: Include <setjmp.h>
	(timer_jmp_buf, timer_set): New static variables.
	(timer_sighandler, restart_delayed_tcb, restart_delayed_tcbs): New
	functions.
	(init): Block SIGALRM, set SIGALRM handler.
	(dispatch_event): Do not restart delayed syscalls.
	(next_event): Unblock SIGALRM during wait4 invocation.
	* syscall.c (tamper_with_syscall_entering): Arm delay timer if
	INJECT_F_DELAY_ENTER injection flag is set, set TCB_INJECT_DELAY_EXIT
	flag if INJECT_F_DELAY_EXIT injection flag is set.
	tamper_with_syscall_exiting): Arm delay timer if inject_delay_exit.
	(syscall_exiting_trace): Call tamper_with_syscall_exiting in case of
	inject_delay_exit.
	(syscall_exiting_finish): Clear TCB_INJECT_DELAY_EXIT flag.
	* strace.1.in: Document delay injection.
	* NEWS: Mention this improvement.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-22  Dmitry V. Levin  <ldv@altlinux.org>

	Do not block handled signals in interactive mode.
	Let these signals be handled asynchronously as they are acted on
	only when waiting for process state changes.

	* strace.c (start_set, blocked_set): Remove.
	(set_sighandler): Do not update blocked_set.
	(startup_attach, init, next_event): Remove all sigprocmask calls.

2018-03-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: improve handling of various sizes of bpf_prog_attr structure.
	As program attributes have been added gradually over kernel versions,
	attribute size less than expected should be printed accordingly.

	* bpf.c (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Do not print structure
	fields if their size is less than the initially introduced (in Linux
	commit v3.18-rc1~52^2~1^2~7) version.  Print fields of union bpf_attr
	introduced in various kernel versions when the length is big enough
	(new fields were introduced in Linux commits v3.18-rc1~52^2~1^2~4,
	v4.1-rc1~84^2~50, and v4.12-rc2~34^2~29^2~2).
	* tests/bpf.c (print_BPF_PROG_LOAD_first): Update expected output.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	btrfs: print struct btrfs_ioctl_logical_ino_args.reserved if non-zero.
	* btrfs.c (btrfs_ioctl) <case BTRFS_IOC_LOGICAL_INO>: Print
	struct btrfs_ioctl_logical_ino_args.reserved field if it is not zero.
	* tests/btrfs.c (btrfs_test_ino_path_ioctls): Check it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Move is_filled and IS_ZERO to macros.h, rename IS_ZERO to IS_ARRAY_ZERO.
	* s390.c: Replace all IS_ZERO invocations with IS_ARRAY_ZERO.
	(is_filled, IS_ZERO): Move...
	* macros.h: ...here.
	(is_filled): Add inline qualifier, add const qualifier to ptr.
	(IS_ZERO): Rename to IS_ARRAY_ZERO, cast arr_ to "const char *".

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-20  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.m4: enhance workaround for missing gnu/stubs-*.h files.
	Make generated empty gnu stub files available for mpers_test.sh check.

	* m4/mpers.m4 (st_MPERS): Add $IFLAG to CPPFLAGS for mpers_test.sh
	invocation.

	Complements: v4.11~223 ("mpers.m4: workaround missing gnu/stubs-*.h files")

2018-03-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	README.md: add references to binary strace packages.
	* README.md: Add references to binary strace packages in OBS,
	Fedora rawhide, and Sisyphus.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	INSTALL-git.md: enhance phrasing.
	* INSTALL-git.md: Enhance phrasing.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-20  Dmitry V. Levin  <ldv@altlinux.org>

	bootstrap: distribute README.
	* bootstrap: Install README before invoking autoreconf to get README
	included into distributed tarball.

	Fixes: v4.21-93-g4bb8454 ("Move README to dist subdirectory")

2018-03-20  Dmitry V. Levin  <ldv@altlinux.org>

	Replace struct timeval with struct timespec in time measurements.
	This is required to implement more precise time measurements.

	* Makefile.am (strace_LDADD): Add $(clock_LIBS).
	* defs.h (struct tcb): Change the type of stime, dtime, and etime fields
	from struct timeval to struct timespec, all users updated.
	(syscall_exiting_decode, syscall_exiting_trace, count_syscall): Change
	the type of "struct timeval *" argument to "struct timespec *", all
	users updated.
	(tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_div, tv_mul): Rename to
	ts_nz, ts_cmp, ts_float, ts_add, ts_sub, ts_div, and ts_mul.  Change
	the type of all "struct timeval *" arguments to "struct timespec *",
	all users updated.
	* util.c (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_div, tv_mul):
	Rename to ts_nz, ts_cmp, ts_float, ts_add, ts_sub, ts_div, and ts_mul.
	Change the type of all "struct timeval *" arguments to "struct timespec *".
	* count.c (struct call_counts): Change the type of "time" field
	from struct timeval to struct timespec, all users updated.
	(overhead): Change type from struct timeval to struct timespec, all
	users updated.
	(count_syscall): Change the type of "struct timeval *" argument to
	"struct timespec *".
	* strace.c (printleader): Change the type of struct timeval variables
	to struct timespec, call clock_gettime instead of gettimeofday.
	(next_event, trace_syscall): Change the type of struct timeval variables
	to struct timespec.
	* syscall.c (syscall_entering_finish, syscall_exiting_decode): Call
	clock_gettime instead of gettimeofday.

2018-03-20  Dmitry V. Levin  <ldv@altlinux.org>

	Fix -O option handling.
	Fast syscalls usually take less than a microsecond of system cpu time
	nowadays, making -O option almost useless.

	* count.c (call_summary_pers): Avoid negative time counts.
	* tests/count.test: Check it.
	* NEWS: Mention it.

2018-03-16  Dmitry V. Levin  <ldv@altlinux.org>

	count: cleanup count_syscall.
	* count.c (shortest): Remove.
	(overhead): Initialize to zero.
	(call_summary_pers): Remove shortest handling.
	(count_syscall): Remove dead code.  The remaining code does the same
	wrong calculations as before the change, though.

	printleader: cleanup tflag handling.
	* strace.c (printleader): Move declarations of variables closer
	to their first use.

2018-03-16  Dmitry V. Levin  <ldv@altlinux.org>

	Move install.texi to maint subdirectory.
	This file comes from GNU Autoconf and is used to generate INSTALL file.

	* install.texi: Move...
	* maint/install.texi: ...here.

2018-03-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	doc: update commit requirements.
	* README-hacking (Requirements): Enhance phrasing.
	(Commit log requirements): Rename to "Commit requirements",
	describe "absence of whitespace errors" requirement, add references
	to the Linux kernel coding style and scripts/checkpatch.pl script.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Move README to dist subdirectory.
	README was originally written for users of distribution tarballs.
	Nowadays it appears to be confusing for those who build strace
	using a GIT version of strace source code.

	* README: Move...
	* dist/README: ...here.
	* bootstrap: Copy README from dist subdirectory to the toplevel
	directory after successful autoreconf.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
	References: https://github.com/strace/strace/issues/56

2018-03-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	README: synchronise with README.md.
	* README: Extend description, reference COPYING.

2018-03-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	poll.c: remove special INFTIM handling.
	On Linux, poll syscall interprets any negative timeout value as an
	infinite timeout, so no need to handle BSD-specific INFTIM.

	* poll.c (SYS_FUNC(poll)): Remove INFTIM handling.

2018-03-14  Dmitry V. Levin  <ldv@altlinux.org>

	build: do not hardcode -lrt.
	Depending on libc implementation, various -lrt functions can be
	implemented either in -lc or in -lrt.  For example, starting with
	glibc-2.17 the clock_* suite of functions is available directly in -lc.

	Check whether clock_* and mq_* suites of functions are provided
	by -lrt or by the main C library, do not link with -lrt unnecessarily.

	This change affects only tests yet, but this is going to be
	more important as soon as strace starts using clock_gettime.

	* configure.ac (AC_SEARCH_LIBS): Check for clock_gettime and mq_open
	in -lrt.
	(AC_SUBST): Add clock_LIBS and mq_LIBS.
	* tests/Makefile.am (mq_LDADD): Replace -lrt with $(mq_LIBS).
	(threads_execve_LDADD, times_LDADD): Replace -lrt with $(clock_LIBS).

2018-03-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests: do not link with -lrt unnecessarily.
	* tests/Makefile.am (attach_f_p_LDADD): Remove -lrt.
	(clock_xettime_LDADD, mq_sendrecv_LDADD, mq_sendrecv_read_LDADD,
	mq_sendrecv_write_LDADD): Remove.

2018-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	Optimize pid2tcb.
	Introduce an internal cache of pid2tcb translations.
	This can save more than 80% of CPU user time spent by strace.

	Tested using the following setup:

		#include <unistd.h>
		#include <sys/stat.h>
		#include <sys/wait.h>
		int main()
		{
			int i;
			sleep(1);
			for (i = 1; i < 1000; ++i) {
				pid_t pid = fork();
				if (pid < 0)
					return 2;
				if (pid)
					return wait(&i) != pid || i;
			}
			sleep(1);
			for (i = 0; i < 10000000; ++i)
				umask(0777);
			return 0;
		}

		old$ ./set_ptracer_any ./pid2tcb >pid2tcb.wait & \
		  while [ ! -s pid2tcb.wait ]; do sleep 0.1; done; \
		  time -f '%Uuser %Ssystem %eelapsed %PCPU' \
		  ../strace -qq -enone -esignal=none -f -p $!
		5.51user 104.90system 122.45elapsed 90%CPU

		new$ ./set_ptracer_any ./pid2tcb >pid2tcb.wait & \
		  while [ ! -s pid2tcb.wait ]; do sleep 0.1; done; \
		  time -f '%Uuser %Ssystem %eelapsed %PCPU' \
		  ../strace -qq -enone -esignal=none -f -p $!
		1.29user 102.78system 114.97elapsed 90%CPU

2018-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	Enable USE_SEIZE code unconditionally.
	It is by no means an experimental code.

	* defs.h (USE_SEIZE): Remove.
	* strace.c [!USE_SEIZE]: Remove.

2018-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	ci: clone musl from the local server.
	Assume that strace project on the local server contains an appropriate
	musl repository, use this repository instead of hardcoded github
	location.

	* ci/install-dependencies.sh (clone_repo): Use local server by default.
	(musl-gcc): Un-hardcode the location of musl repository.

2018-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	ci: refactor cloning of additional repositories.
	* ci/install-dependencies.sh (clone_repo): New function.
	Use it instead of direct invocations of git clone.

	ci: extend error diagnostics when configure invocation fails.
	* ci/run-build-and-tests.sh: Include $CC -dumpspecs output in addition
	to config.log when ./configure fails.

	ci: rename travis-build.sh and travis-install.sh scripts.
	* travis-build.sh: Rename to ci/run-build-and-tests.sh, all callers
	updated.
	* travis-install.sh: Rename to ci/install-dependencies.sh, all callers
	updated.

	tests: extend ioctl.test libc protection to -y output.
	* tests/ioctl.test: Extend the filter of ioctl calls with standard
	descriptor arguments to -y output.

2018-03-12  Harsha Sharma  <harshasharmaiitr@gmail.com>

	ptp.c: print field names and use macros form print_fields.h.
	* ptp.c: Include "print_fields.h".
	(ptp_ioctl): Print field names with field values for PTP_PEROUT_REQUEST,
	use macros from print_fields.h.

2018-03-11  Chen Jingpiao  <chenjingpiao@gmail.com>

	tests: add check for decoding of netfilter subsystem.
	* tests/netlink_netfilter.c(test_nfgenmsg): Add check for decoding
	of netfilter subsystem.

	nfnetlink: introduce generic netfilter subsystem decoder.
	* netlink_netfilter.c: Include "nlattr.h".
	(decode_netlink_netfilter): Call decode_nlattr.

2018-03-11  Chen Jingpiao  <chenjingpiao@gmail.com>

	Move nl_netfilter_msg_types definition from netlink.c to netlink_netfilter.c
	The side effect of #include "xlat/nl_netfilter_msg_types.h" is
	NFNL_MSG_BATCH_* constants properly defined in that header file.
	While netlink.c does not use these constants itself,
	netlink_netfilter.c is going to need them soon.

	* defs.h (nl_netfilter_msg_types): New xlat prototype.
	* netlink.c: Move inclusion of "xlat/nl_netfilter_msg_types.h" ...
	* netlink_netfilter.c: ... here.

2018-03-11  Chen Jingpiao  <chenjingpiao@gmail.com>

	tests: add check for NETLINK_NETFILTER parser.
	* tests/netlink_netfilter.c: Include <netinet/in.h>, <arpa/inet.h>
	and <linux/netfilter/nf_tables.h>.
	Replace "netlink.h" with "test_netlink.h".
	(NFNL_SUBSYS_NFTABLES, NFT_MSG_NEWTABLE): New macros.
	(test_nlmsg_done, test_nfgenmsg): New functions.
	(main): Use them.

	netlink: introduce NETLINK_NETFILTER parser.
	* netlink_netfilter.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (decode_netlink_netfilter): New prototype.
	* netlink.c (netlink_decoders): Add NETLINK_NETFILTER.
	* xlat/netfilter_versions.in: New file.

2018-03-11  Chen Jingpiao  <chenjingpiao@gmail.com>

	xlat: remove NFNL_SUBSYS_COUNT constant.
	NFNL_SUBSYS_COUNT is not a symbol with some constant value, it changes
	with time, just print it as an unrecognized number.

	* xlat/nl_netfilter_subsys_ids.in (NFNL_SUBSYS_COUNT): Remove.

2018-03-10  Dmitry V. Levin  <ldv@altlinux.org>

	inject_data: make room for more injection features.
	* defs.h (struct inject_data): Squeeze flags and signo fields from
	uint16_t to uint8_t to make room for more injection features.

2018-03-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: sort v4l2_pix_fmts.in and v4l2_sdr_fmts.in.
	* xlat/v4l2_pix_fmts.in: Sort by value, add a comment about sorting.
	* xlat/v4l2_sdr_fmts.in: Likewise.

2018-03-09  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: add comments to all sorted xlat files.
	Add a short comment describing the method used to sort entries.

	* xlat/ethernet_protocols.in: Update the comment about sorting.
	* xlat/fsmagic.in: Likewise.
	* xlat/evdev_keycode.in: Add a comment about sorting.
	* xlat/hw_breakpoint_type.in: Likewise.
	* xlat/perf_hw_cache_id.in: Likewise.
	* xlat/perf_hw_cache_op_id.in: Likewise.
	* xlat/perf_hw_cache_op_result_id.in: Likewise.
	* xlat/perf_hw_id.in: Likewise.
	* xlat/perf_sw_ids.in: Likewise.
	* xlat/perf_type_id.in: Likewise.

2018-03-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: remove page size caching.
	get_pagesize() has a static cache anyway, no need to duplicate it.

	* bpf.c (SYS_FUNC(bpf)): Remove static size_t page_size and its
	initialisation, use get_pagesize() as the size of buf directly.

2018-03-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf_filter: fix indentation of the switch clause.
	* bpf_filter.c (print_bpf_filter_code): Fix switch clause indentation.

2018-03-08  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: provide fallback definitions for arch-independent mmap flags.
	This is important for recently introduced MAP_SHARED_VALIDATE flag.

	* xlat/mmap_flags.in (MAP_SHARED, MAP_PRIVATE, MAP_SHARED_VALIDATE):
	Add constant values.

	Fixes: v4.21-67-g8c209d1 ("tests: fix remap_file_pages.test breakage on hppa")

2018-03-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bpf: print kern_version in the form of KERNEL_VERSION macro.
	* bpf.c (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Print
	union bpf_attr.kern_version in the form of KERNEL_VERSION macro call.
	* tests/bpf.c: Update expected output.

2018-03-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: fix remap_file_pages.test breakage on hppa.
	Apparently, hppa is the only architecture that has MAP_TYPE
	defined to 0x3 instead of 0xf, and the tests hit that corner case.

	* tests/remap_file_pages.c (main) [MAP_HUGETLB]: Print the value
	of mapping type depending on the architecture (MAP_SHARED_VALIDATE
	for hppa and unknown value for other architectures).

	Fixes: v4.21~59 ("xlat: update MAP_* constants")

2018-03-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Sort Ethernet protocols xlat.
	* defs.h (ethernet_protocols_size): New declaration.
	* netlink_packet_diag.c (decode_packet_diag_req): Use
	printxval_searchnn to print Ethernet protocols.
	* sockaddr.c (ethernet_protocols_size): New constant, item count
	in ethernet_protocols array.
	(print_sockaddr_data_ll): Use printxval_search instead of
	printxval to print Ethernet protocols.
	* xlat/ethernet_protocols.in: Sort it by value, add comment
	about the fact.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Change sorted arrays to be terminated with XLAT_END like unsorted arrays
	It is quite unwieldy to have this distinction between sorted and
	unsorted arrays when we can just decrement the size in a wrapper.

	* defs.h (printxval_search): Decrement array size.
	* xlat/fsmagic.in (#unterminated): Remove.
	* xlat/hw_breakpoint_type.in (#unterminated): Remove.
	* xlat/perf_hw_cache_id.in (#unterminated): Remove.
	* xlat/perf_hw_cache_op_id.in (#unterminated): Remove.
	* xlat/perf_hw_cache_op_result_id.in (#unterminated): Remove.
	* xlat/perf_hw_id.in (#unterminated): Remove.
	* xlat/perf_sw_ids.in (#unterminated): Remove.
	* xlat/perf_type_id.in (#unterminated): Remove.
	* xlat/gen.sh (gen_header): Remove #unterminated support.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: add a note about tracing of scripts without shebang.
	* strace.1.in (.SH NOTES): Note that tracing of scripts without shebang
	won't work.

	Reported-by: Mike Parker
	Closes: https://github.com/strace/strace/issues/46

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: mention that -c suppresses regular output.
	As the note that -C makes strace "also print regular output" can be
	easily overlooked.

	* strace.1.in (.SS Statistics) <.TP .B \-c>: Mention that -c supresses
	regular output.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	errnoent.h: add ERECALLCONFLICT.
	* linux/errnoent.h ([530]): Add ERECALLCONFLICT error introduced by
	Linux commit v4.7-rc1~40^2~6.
	* linux/alpha/errnoent.h ([530]): Likewise.
	* linux/hppa/errnoent.h ([530]): Likewise.
	* linux/mips/errnoent.h ([530]): Likewise.
	* linux/sparc/errnoent.h ([530]): Likewise.

	xlat: add BPF_F_ALLOW_MULTI constant.
	* xlat/bpf_attach_flags.in (BPF_F_ALLOW_MULTI): New constant, introduced
	by Linux commit v4.15-rc1~84^2~558^2~7.

	xlat: add BPF_MAP_TYPE_CPUMAP constant.
	* xlat/bpf_map_types.in (BPF_MAP_TYPE_CPUMAP): New constant, introduced
	by Linux commit v4.15-rc1~84^2~427^2~4.

	tests/test_printstrn.c: do not declare i again.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/s390_sthyi.c: make utility functions inline.
	When built with --enable-gcc-Werror, s390_sthyi test build fails
	with the following error:

		s390_sthyi.c:63:1: error: ‘print_u8’ defined but not used [-Werror=unused-function]
		 print_u8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero)
		 ^~~~~~~~

	Apparently, after some back and forth, all occurrences of printing u8
	values landed under verbose printing, so this function is no longer
	used in non-verbose mode.  Let's avoid this in the future by inlining
	all the utility functions in this test.

	* tests/s390_sthyi.c (print_0x8, print_u8, print_u16, print_x32,
	print_weight, ebcdic2ascii, is_empty, print_ebcdic): Add inline
	qualifier.
	[!VERBOSE] (is_empty): Remove "# if VERBOSE" guard.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	btrfs: print struct btrfs_ioctl_logical_ino_args.flags field.
	The field has been introduced in Linux commit v4.15-rc1~135^2~17.

	* btrfs.c: Implement decoding of
	struct btrfs_ioctl_logical_ino_args.flags field.
	* configure.ac: Check for struct btrfs_ioctl_logical_ino_args.flags
	presence in linux/btrfs.h.
	* tests/btrfs.c: Update expected output, add additional checks.
	* xlat/btrfs_logical_ino_args_flags.in: New file.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	btrfs.c: print __u64 fields with pointer semantics using printaddr64.
	* btrfs.c (btrfs_ioctl) <case BTRFS_IOC_INO_PATHS>: Print fspath field
	with printaddr64.
	(btrfs_ioctl) <case BTRFS_IOC_LOGICAL_INO>: Print inodes field with
	printaddr64.
	* tests/btrfs.c: Add checks for NULL in fspath and inodes fields.
	* NEWS: Mention it.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util.c: introduce printaddr64.
	Sometimes, 64-bit value is expected to be interpreted as an address
	(in BTRFS ioctl interface, for example).

	* defs.h (printaddr64): New declaration.
	* util.c (printaddr64): Rename from printaddr, change argument type
	to uint64_t.
	(printaddr): Turn into a thin wrapper around printaddr64.
	(printnum_addr_int, printnum_addr_int64): Use printaddr64 instead of
	printaddr.  printnum_addr_int64 is not used outside the cases where
	kernel_long is less or equal than 64 bit currently, so this change
	should be safe.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	prctl: add decoding of PR_SVE_SET_VL and PR_SVE_GET_VL commands.
	These commands were introduced in Linux commit v4.15-rc1~110^2~9.

	* xlat/pr_sve_vl_flags.in: New file.
	* xlat/prctl_options.in: Likewise.
	* prctl.c: Include "xstring.h" and "xlat/pr_sve_vl_flags.h".
	[!PR_SVE_VL_LEN_MASK] (PR_SVE_VL_LEN_MASK): New macro constant.
	(sprint_sve_val): New function.
	(SYS_FUNC(prctl)): Add decoding for PR_SVE_GET_VL and PR_SVE_SET_VL
	commands.
	* NEWS: Mention it.

2018-03-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement PTRACE_SECCOMP_GET_METADATA ptrace request decoding.
	* defs.h (seccomp_filter_flags): New declaration.
	* process.c (SYS_FUNC(ptrace)): Implement PTRACE_SECCOMP_GET_METADATA
	request decoding.
	* ptrace.h [!PTRACE_SECCOMP_GET_METADATA] (PTRACE_SECCOMP_GET_METADATA):
	New macro constant.
	* xlat/ptrace_cmds.in (PTRACE_SECCOMP_GET_METADATA): New constant.
	* tests/ptrace.c (main): Add some checks for PTRACE_SECCOMP_GET_METADATA
	request decoding.
	* NEWS: Mention it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-06  Dmitry V. Levin  <ldv@altlinux.org>

	build: prepare for -Wimplicit-fallthrough=5.
	* gcc_compat.h (ATTRIBUTE_FALLTHROUGH): New macro.
	* block.c (block_ioctl): Use it instead of "fall through" comment.
	* btrfs.c (btrfs_ioctl): Likewise.
	* loop.c (loop_ioctl): Likewise.
	* mtd.c (mtd_ioctl): Likewise.
	* rtc.c (rtc_ioctl): Likewise.
	* v4l2.c (v4l2_ioctl): Likewise.
	* dm.c (dm_decode_values): Likewise.
	* process.c (SYS_FUNC(ptrace)): Likewise.
	* quota.c (decode_cmd_data): Likewise.
	* ucopy.c (umovestr): Likewise.
	* unwind.c (unwind_print_stacktrace, unwind_capture_stacktrace)):
	Likewise.
	* term.c (term_ioctl): Add ATTRIBUTE_FALLTHROUGH.
	* ioctl.c (ioctl_decode) [ALPHA || POWERPC]: Likewise.
	* m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Wimplicit-fallthrough=5.
	* tests/ioctl_v4l2.c (init_v4l2_format): Reorganize the switch statement
	without implicit fallthrough.

2018-03-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add eBPF-based device controller constants.
	Add new BPF_PROG_TYPE_CGROUP_DEVICE eBPF program type and new
	BPF_CGROUP_DEVICE eBPF program attach type, added in Linux commit
	v4.15-rc1~84^2~120^2~2.

	* xlat/bpf_attach_type.in (BPF_CGROUP_DEVICE): New constant.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_DEVICE): Likewise.
	* NEWS: Mention it.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for input event constants.
	Values added using the following pair of commands:

		$ cat xlat/evdev_keycode.in |
			while read r; do [ -n "$r" ] &&
				sed -rn 's/^#define[[:space:]]+('$r'[[:space:]]+[^[:space:]]+).*/\1/p' \
				~/dev/linux/include/uapi/linux/input-event-codes.h || echo;
			done > xlat/evdev_keycode.in.new
		$ sort -s -n -k1,1 \
			<(awk '{if (NF>1) {last = strtonum($2)}; printf("%d %s\n", last, $0)}' \
				xlat/evdev_keycode.in.new) \
			| sed 's/^[0-9]* //'  > xlat/evdev_keycode.in

	It also verifies that the values are sorted and bsearch-ready.

	* xlat/evdev_keycode.in: Add constant values.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update the list of input event constants.
	Remove some duplicating definitions and add the new ones.

	* xlat/evdev_keycode.in (KEY_HANGUEL): Remove, an alternative name for
	KEY_HANGEUL.
	(KEY_DIRECTION): Remove, an alternative name for KEY_ROTATE_DISPLAY.
	(KEY_BRIGHTNESS_ZERO): Remove, an alternative name for
	KEY_BRIGHTNESS_AUTO.
	(KEY_WIMAX): Remove, an alternative name for KEY_WWAN.
	(BTN_A): Remove, an alternative name for BTN_SOUTH.
	(BTN_B): Remove, an alternative name for BTN_EAST.
	(BTN_X): Remove, an alternative name for BTN_NORTH.
	(BTN_Y): Remove, an alternative name for BTN_WEST.
	(BTN_STYLUS3): New constant, added in Linux commit v4.15-rc1~114^2^2~1.
	(KEY_BRIGHTNESS_TOGGLE): Remove, an alternative name for
	KEY_DISPLAYTOGGLE.
	(KEY_ROTATE_LOCK_TOGGLE): New constant, added in Linux commit
	v4.16-rc1~54^2~67.
	(KEY_DATA): New constant, added in Linux commit v4.9-rc8~12^2.
	(KEY_ONSCREEN_KEYBOARD): New constant, added in Linux commit
	v4.12-rc1~126^2~2^12~5.
	* NEWS: Mention it.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for SCTP socket option constants.
	Values for SCTP_GET_PEER_ADDRS_NUM_OLD, SCTP_GET_PEER_ADDRS_OLD,
	SCTP_GET_LOCAL_ADDRS_NUM_OLD, SCTP_GET_LOCAL_ADDRS_OLD are reconstructed
	from Linux commit v2.6.33-rc1~388^2~167^2~7.

	xlat/socksctpoptions.in: Add constant values.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update the list of SCTP socket option constants.
	* xlat/socksctpoptions.in (SCTP_DELAYED_ACK): Rename to...
	(SCTP_DELAYED_SACK): ...this, per Linux commit v2.6.38-rc2~33^2.
	(SCTP_SOCKOPT_PEELOFF_FLAGS): New constant, introduced in Linux commit
	v4.13-rc1~157^2~39.
	(SCTP_STREAM_SCHEDULER): New constant, introduced in Linux commit
	v4.15-rc1~84^2~567^2~3.
	(SCTP_STREAM_SCHEDULER_VALUE): New constant, introduced in Linux commit
	v4.15-rc1~84^2~567^2~2.
	(SCTP_INTERLEAVING_SUPPORTED): New constant, introduced in Linux commit
	 v4.16-rc1~123^2~384^2~11.
	* NEWS: Mention it.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for Ethernet protocol constants.
	As those are not architecture-specific.

	* xlat/ethernet_protocols.in: Add values to constants.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update the list of Ethernet protocol constants.
	* xlat/ethernet_protocols.in (ETH_P_ERSPAN2): New constant, introduced
	in Linux commit v4.16-rc1~123^2~355^2~2.
	(ETH_P_IBOE): New constant, introduced in commit v4.11-rc1~73^2~74.
	* NEWS: Mention it.

	v4l2: print known pixel/SDR formats.
	* xlat/v4l2_pix_fmts.in: New file.
	* xlat/v4l2_sdr_fmts.in: Likewise.
	* v4l2.c [!v4l2_fourcc_be] (v4l2_fourcc_be): New macro.
	(print_pixelformat): Add xlat parameter, print constant name
	as a comment if it has been found in xlat.
	(print_v4l2_fmtdesc, print_v4l2_frmivalenum): Pass v4l2_pix_fmts
	to print_pixelformat.
	(print_v4l2_format_fmt) <case V4L2_BUF_TYPE_VIDEO_CAPTURE, case
	V4L2_BUF_TYPE_VIDEO_OUTPUT, case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, case V4L2_BUF_TYPE_VBI_CAPTURE,
	case V4L2_BUF_TYPE_VBI_OUTPUT>: Pass v4l2_pix_fmts to print_pixelformat.
	(print_v4l2_format_fmt) <case V4L2_BUF_TYPE_SDR_OUTPUT, case
	V4L2_BUF_TYPE_SDR_CAPTURE>: Pass v4l2_sdr_fmts to print_pixelformat.
	* tests/v4l2.c: Test it, update expected output.
	* NEWS: Mention it.

2018-03-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: v4l2_fourcc is endianness-agnostic.
	v4l2_fourcc(a, b, c, d) is defined as (a | (b << 8) | (c << 16) | (d << 24)
	regardless of endianness (no mnemonic on big-endian architectures),
	so we don't need special handling for WORDS_BIGENDIAN both in decoder
	and in the test.

	* v4l2.c (print_pixelformat): Change initialisation to a simple
	assignment of character array.
	* tests/ioctl_v4l2.c [WORDS_BIGENDIAN]: Remove.
	* NEWS: Mention this fix.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
	Fixes: v4.10~371 "Implement Video4Linux video-input ioctls decoder"

2018-03-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: do not include <stdbool.h> in files that include "tests.h"
	Starting with commit v4.21-37-g4f63bc70ca95012d72e288fc3c1eeb3ba26068a4,
	<stdbool.h> is included by tests.h, so all tests that already include
	"tests.h" do not need to include <stdbool.h>.

	* tests/btrfs.c: Do not include <stdbool.h>.
	* tests/file_handle.c: Likewise.
	* tests/futex.c: Likewise.
	* tests/ioctl_dm.c: Likewise.
	* tests/ioctl_loop.c: Likewise.
	* tests/ioctl_sock_gifconf.c: Likewise.
	* tests/keyctl.c: Likewise.
	* tests/mq_sendrecv.c: Likewise.
	* tests/perf_event_open.c: Likewise.
	* tests/s390_guarded_storage.c: Likewise.
	* tests/s390_pci_mmio_read_write.c: Likewise.
	* tests/s390_sthyi.c: Likewise.
	* tests/xet_thread_area_x86.c: Likewise.

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check printing of block/char device numbers in -yy mode.
	* tests/dev-yy.c: New file.
	* tests/pure_executables.list: Add dev-yy.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (dev-yy): New test.

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	printfd: print character/block device number in -yy mode.
	* util.c: Include <sys/stat.h>, <sys/sysmacros.h>,
	and "largefile_wrappers.h".
	(printsocket, printdev): New functions.
	(printfd): Move socket matching/printing logic to printsocket.  Check
	also for printdev.  Escape opening angle bracket in addition to closing angle
	bracket as it can show up as a separator in printdev.
	* tests/fsync-y.c: Update expected output.
	* strace.1.in: Mention this.
	* NEWS: Likewise.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util.c: escape closing angle bracket in printfd.
	* util.c (printfd): Use print_quoted_string_ex instead of
	print_quoted_string, specify ">" as escape_chars argument.
	* tests/fsync-y.c (main): Update expected output.
	* NEWS: Mention it.

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util.c: add support for additional escape characters in string_quote.
	Quotes are not always used to denote string limits; printfd uses angle
	brackets for that, for example.  As result, mechanism for supplying
	set of additional characters in order to avoid ambiguities regarding
	the end of the quoted string is needed.

	* defs.h (string_quote): Add escape_chars parameter.
	(print_quoted_string_ex): New function prototype.
	* util.c (string_quote): Add escape_chars parameter.
	(print_quoted_string_ex): Rename from print_quoted_string, add
	escape_chars parameter, pass it to string_quote call.
	(print_quoted_string): Turn into a thin wrapper around
	print_quoted_string_ex.
	(printstr_ex): Pass NULL as escape_chars argument of string_quote call.
	* socketutils.c (unix_parse_response): Pass NULL as escape_chars
	argument of string_quote call.
	* tests/print_quoted_string.c (print_octal): New function.
	print_quoted_memory_ex): Use it.  Add escape_chars parameter.
	(print_quoted_memory): Pass NULL as escape_chars argument
	of print_quoted_memory_ex call.
	* tests/tests.h (print_quoted_string_ex, print_quoted_memory_ex): Add
	escape_chars parameter.
	* tests/fsync-y.c: Pass NULL as escape_chars argument of
	print_quoted_string_ex call.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check file name printing in strace -y mode.
	* tests/fsync-y.c: New file.
	* tests/.gitignore: Add fsync-y.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	* tests/gen_tests.in (fsync-y): New test.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add print_quoted_string_ex and print_quoted_memory_ex functions.
	* tests/tests.h (print_quoted_string_ex, print_quoted_memory_ex): New
	declarations.
	* tests/print_quoted_string.c (print_quoted_string_ex): New function,
	a thin wrapper around print_quoted_memory_ex wrapper.
	(print_quoted_memory_ex): Rename from print_quoted_memory, add quote
	argument.
	(print_quoted_memory): Turn into a thin wrapper around
	print_quoted_memory_ex.

	tests: check escaping in string printing.
	* tests/test_printstrn.c (test_print_memory): New function.
	(test_printstrn): Use it.

	Do not go full octal if the next char is '8' or '9'
	* util.c (string_quote): Change the upper limit for the next character
	in unabbreviated octal printing from '9' to '7'.
	* tests/print_quoted_string.c (print_quoted_memory): Likewise.

	tests: fix abbreviated octal escape check in print_quoted_memory.
	* tests/print_quoted_string.c (print_quoted_memory): Check the next
	character after octal-escaped one instead of the first one in the
	string.

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util.c: reduce indentation in non-hexadecimal case in string_quote.
	As it is already too deep there.

	* util.c (string_quote): Add string_ended label, jump there
	after the loop in "if (usehex)" case.

2018-03-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util.c: fix switch statement indentation in string_quote.
	While we are here, let's also remove unnecessary break statement
	in the default case.

2018-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	Replace fopen_for_input and fopen_for_output with fopen_stream.
	* largefile_wrappers.h (fopen_for_input, fopen_for_output): Replace
	with fopen_stream.
	* mmap_cache.c (fopen_for_input) Likewise.
	* strace.c (fopen_for_output): Likewise.

2018-02-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update the list of INET_DIAG_BC_* operators.
	* linux/inet_diag.h (INET_DIAG_BC_S_EQ, INET_DIAG_BC_D_EQ): New
	enumeration items introduced by linux kernel commit v4.16-rc1~123^2~259.
	* xlat/inet_diag_bytecodes.in (INET_DIAG_BC_S_EQ, INET_DIAG_BC_D_EQ): New
	constants.
	* NEWS: Mention it.

	xlat: update the list of SCHED_FLAG_* constants.
	* xlat/sched_flags.in (SCHED_FLAG_RECLAIM, SCHED_FLAG_DL_OVERRUN): New
	constants introduced by linux kernel commits v4.13-rc1~205^2~27 and
	v4.16-rc1~164^2~8, respectively.
	(SCHED_FLAG_RESET_ON_FORK): Add constant value.
	* tests/sched_xetattr.c: Update expected output.
	* NEWS: Mention it.

	xlat: provide fallback definitions for arch-independent poll event flags
	* xlat/pollflags.in (POLLIN, POLLPRI, POLLOUT, POLLRDNORM, POLLRDBAND,
	POLLERR, POLLHUP, POLLNVAL, POLL_BUSY_LOOP): Add constant values.

2018-02-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update the list of poll event flags.
	POLL_BUSY_LOOP was introduced by linux kernel commit v3.11-rc1~64^2~129
	as POLL_LL and then renamed in v3.11-rc1~64^2~9.  POLLRDHUP was
	introduced by linux kernel commit v2.6.17-rc1~796.  POLLMSG and
	POLLREMOVE predate git repository.  POLLFREE was introduced by linux
	kernel commit v3.3-rc5~8 for internal use only.

	* xlat/pollflags.in (POLLMSG, POLLREMOVE, POLLRDHUP, POLL_BUSY_LOOP):
	New constants.
	* NEWS: Mention it.

2018-02-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add arch-specific si_codes constants.
	Based on Linux commits v4.16-rc1~159^2~17, v4.16-rc1~159^2~16,
	v4.16-rc1~159^2~15, and v4.16-rc1~159^2~14.

	* xlat/sigbus_codes.in (BUS_OPFETCH): New constant.
	* xlat/sigfpe_codes.in (FPE_MDAOVF, __FPE_DECOVF, __FPE_DECDIV,
	__FPE_DECERR, __FPE_INVASC, __FPE_INVDEC): New constants.
	* xlat/sigill_codes.in (ILL_ILLPARAOP, ILL_ILLEXCPT, ILL_CPLB_VI,
	ILL_CPLB_MISS, ILL_CPLB_MULHIT, ILL_DBLFLT, ILL_HARDWALL, ILL_BADIADDR,
	__ILL_BREAK, __ILL_BNDMOD): Likewise.
	* xlat/sigsegv_codes.in (SEGV_STACKFLOW, __SEGV_PSTKOVF): Likewise.
	* xlat/sigtrap_codes.in (TRAP_STEP, TRAP_TRACEFLOW, TRAP_WATCHPT,
	TRAP_ILLTRAP): Likewise.
	* NEWS: Mention it.

2018-02-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_tc: support new TCA_* attributes.
	* xlat/rtnl_tc_attrs.in (TCA_HW_OFFLOAD, TCA_INGRESS_BLOCK,
	TCA_EGRESS_BLOCK): New constants introduced by linux kernel commits
	v4.15-rc4~13^2~5^2~2 and v4.16-rc1~123^2~139^2~5.
	* rtnl_tc.c (tcmsg_nla_decoders) <TCA_HW_OFFLOAD, TCA_INGRESS_BLOCK,
	TCA_EGRESS_BLOCK>: New items.

	rtnl_link: add decoding of new IFLA_* attributes.
	* xlat/rtnl_link_attrs.in (IFLA_NEW_NETNSID, IFLA_IF_NETNSID,
	IFLA_CARRIER_UP_COUNT, IFLA_CARRIER_DOWN_COUNT, IFLA_NEW_IFINDEX): New
	constants introduced by linux kernel commits v4.15-rc1~84^2~557,
	v4.15-rc1~84^2~133^2, v4.16-rc1~123^2~91, and v4.16-rc1~123^2~24^2.
	* rtnl_link.c (ifinfomsg_nla_decoders) <IFLA_NEW_NETNSID,
	IFLA_IF_NETNSID, IFLA_CARRIER_UP_COUNT, IFLA_CARRIER_DOWN_COUNT,
	IFLA_NEW_IFINDEX>: New items.

	rtnl_link: implement IFLA_EVENT_* decoding.
	* rtnl_link.c (decode_ifla_event): New function.
	(ifinfomsg_nla_decoders) <[IFLA_EVENT]>: Use it.
	* xlat/rtnl_ifla_events.in: New file.
	* NEWS: Mention it.

	xlat: update the list of RWF_* constants.
	* xlat/rwf_flags.in (RWF_APPEND): New constant introduced by linux
	kernel commit v4.16-rc1~145^2~7.
	* NEWS: Mention it.

	tests: check decoding of ip6:port pairs associated with socket descriptors
	* tests/net-yy-inet.c: Generalise test.
	* tests/net-yy-inet6.c: New file.
	* tests/pure_executables.list: Add net-yy-inet6.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (net-yy-inet6): New entry.

2018-02-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Print IPv6 addresses in brackets.
	Follow a common practice for printing address:port pair to distinguish
	address parts delimiter from address/port delimiter.

	* socketutils.c (inet_parse_response) <ob, cb>: New variables,
	initialise them to open/closing brackets or empty strings based
	on address family.
	(inet_parse_response): Print ob and cb around src_buf and dst_buf.
	* NEWS: Mention this improvement.

2018-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	strace.spec.in: add gcc to build requirements.
	There are rumors in circulation that some rpm-based distributions
	are going to exclude gcc from their default build environments.
	Workaround this policy silliness by adding gcc to build requirements.

	* strace.spec.in (BuildRequires): Add gcc.

2018-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	Move definitions of fopen_for_input to largefile_wrappers.h.
	* largefile_wrappers.h (fopen_for_input): Define along with
	fopen_for_output.
	* mmap_cache.c: Include "largefile_wrappers.h".
	(fopen_for_input): Remove.

2018-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce mmap_cache.h.
	Let's avoid bloating defs.h and introduce a separate header for
	mmap_cache.

	* defs.h (struct mmap_cache_t, enum mmap_cache_protection,
	enum mmap_cache_rebuild_result, mmap_cache_enable, mmap_cache_is_enabled,
	mmap_cache_invalidate, mmap_cache_delete, mmap_cache_rebuild_if_invalid,
	mmap_cache_search): Move ...
	* mmap_cache.h: ... to this new file.
	* Makefile.am (strace_SOURCES): Add mmap_cache.h.
	* mmap_cache.c: Include mmap_cache.h.
	* strace.c: Likewise.
	* syscall.c: Likewise.
	* unwind.c: Likewise.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

	mmap_cache: record device major and minor numbers.
	* defs.h (struct mmap_cache_t): Add major and minor fields.
	* mmap_cache.c (build_mmap_cache): Record device major and minor numbers.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

	mmap_cache: add function to enable mmap_cache.
	mmap_cache was enabled indirectly via unwind feature.  As now mmap_cache
	can be used by other part of strace, a way to enable mmap_cache directly
	is needed.

	* defs.h (mmap_cache_enable, mmap_cache_is_enabled): New function
	prototypes.
	* mmap_cache.c (use_mmap_cache): New file local variable.
	(mmap_cache_enable, mmap_cache_is_enabled): New functions.
	* syscall.c (syscall_exiting_decode): Use mmap_cache_is_enabled()
	instead of stack_trace_enabled.
	* unwind.c (unwind_init): Invoke mmap_cache_enable.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

	mmap_cache, unwind: lift up mmap_cache_delete invocation from unwind.c.
	mmap_cache_delete function used to be called by destructor of unwind
	related code.  Now that other parts can use mmap cache,
	mmap_cache_delete is called separately from unwind_tcb_fin.

	* unwind.c (unwind_tcb_fin): Move mmap_cache_delete invocation ...
	* strace.c (droptcb): ... here.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

	mmap_cache: record protection bits.
	To make mmap_cache reusable, records protection bits of mmap entries.

	* defs.h (mmap_cache_protection): New enum.
	* mmap_cache.c (build_mmpa_cache): Don't ignore entries that are not
	executable, just record the protection bits here.
	* unwind.c (print_stack_frame): Ignore entries that are not executable.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

	mmap_cache: move code for searching a mmap cache from unwind.
	print_stack_frame function in unwind.c searches a mmap entry in mmap
	cache.  The found entry is then used for unwinding.  However, a function
	searching for a mmap entry may be useful for other purposes than
	unwinding.

	This change re-factors the function; code for searching an entry is
	now defined as a stand-alone function named mmap_cache_search.

	* defs.h (mmap_cache_search): New function prototype.
	print_stack_frame.
	* mmap_cached.c (mmap_cache_search): New function derived from
	print_stack_frame.
	* unwind.c (print_stack_frame): Use it.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

	mmap_cache: new subsystem derived from unwind.c.
	For making mmap cache code reusable from other areas in strace than
	unwind, mmap cache related code and unwind related code should be
	separated.

	This change moves the most of mmap cache code from unwind.c
	to mmap_cache.c, a new file.

	* unwind.c: Move mmap_cache implementation ...
	* mmap_cache.c: ... to this new file.
	* Makefile.am (strace_SOURCES): add mmap_cache.c.
	* defs.h (struct tcb): Move mmap_cache, mmap_cache_size, and
	mmap_cache_generation fields out of [USE_LIBUNWIND] condition.
	(mmap_cache_invalidate, mmap_cache_delete,
	mmap_cache_rebuild_if_invalid): New function prototypes.
	(struct mmap_cache_t, enum mmap_cache_rebuild_result): Move from
	unwind.c.
	* syscall.c (syscall_exiting_decode): Replace unwind_cache_invalidate
	with mmap_cache_invalidate.

2018-02-26  Masatake YAMATO  <yamato@redhat.com>

	unwind: lift up unw_flush_cache from mmap cache management code.
	For making mmap cache code reusable from other areas in strace
	than unwind, mmap cache related code and unwind related code
	should be separated.

	This change is one of the steps for the separation.  It moves
	unw_flush_cache function call from the core of mmap cache code
	to upper level code.

	* unwind.c (mmap_cache_rebuild_result): New enum.
	(rebuild_cache_if_invalid): Return MMAP_CACHE_REBUILD_* instead of
	a bool value.
	(build_mmap_cache): Don't call unw_flush_cache here.
	(unwind_print_stacktrace, unwind_capture_stacktrace): Call
	unw_flush_cache here instead.

2018-02-25  Dmitry V. Levin  <ldv@altlinux.org>

	debian: sync with 4.21-1 package.
	Versioned dependency on debhelper is not updated for backwards
	compatibility.

	* debian/changelog.in: Fix ancient changelog entries.
	* debian/control (Build-Depends): Add dependency on libbluetooth-dev.
	(Standards-Version): Update to 4.1.3.
	(Vcs-Git, Vcs-Browser): Move from alioth to salsa.d.o.
	(strace, strace-udeb) <Architecture>: Change to linux-any.
	(strace64, strace-udeb) <Priority>: Change to optional.
	* debian/rules: Use /usr/share/dpkg/architecture.mk instead of manually
	setting build variables.
	(configure): New target.
	(build/Makefile, build-udeb/Makefile, build64/Makefile): Depend on it.
	(binary-arch): Use build64/strace.1 for strace64 subpackage.
	* debian/strace.manpages: Add build/ prefix.
	* debian/strace64.manpages: Add build64/ prefix.

2018-02-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	m4/mpers.m4: fix mpers name in comments added to config.h.
	* m4/mpers.m4 (st_MPERS_STRUCT_STAT): Use mpers_name instead of
	MPERS_NAME in comments generated by AC_DEFINE.

	Fixes: v4.14~169 ("mpers.m4: check for struct stat64, struct stat, and their members")

2018-02-24  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.awk: use stdint.h instead of inttypes.h.
	As <inttypes.h> is included in files generated by mpers.awk to obtain
	definitions of uintNN_t types provided by <stdint.h>, replace the former
	header with the latter.

	* mpers.awk: Use <stdint.h> instead of <inttypes.h>.
	* mpers_test.sh: Update expected output.

2018-02-23  Dmitry V. Levin  <ldv@altlinux.org>

	Wipe out references to defunct sourceforge.
	The old location of strace-devel mailing list is defunct, it used to
	lose email messages and sometimes did not deliver any mails for days.

	The mailing list has been moved to strace-devel@lists.strace.io.

	* CREDITS.in: Update the mailing list address.
	(Zhang Le): Update email address.
	* README: Update the mailing list address.
	* README.md: Likewise.
	* configure.ac (AC_INIT): Likewise.
	* strace.1.in (.SH REPORTING BUGS): Likewise.
	* strace-log-merge.1.in (.SH REPORTING BUGS): Likewise.
	* sched.c (SYS_FUNC(sched_getattr)): Update the mailing list reference.
	* tests/scno_tampering.sh: Likewise.
	* qemu_multiarch_testing/README: Update git repository address.
	* NEWS: Mention the change of the mailing list address.

	Closes: https://github.com/strace/strace/issues/38

2018-02-21  Dmitry V. Levin  <ldv@altlinux.org>

	m68k: fix build.
	When <sys/reg.h> is included after <linux/ptrace.h>, the build fails
	on m68k with the following diagnostics:

	  In file included from /usr/include/linux/ptrace.h:101:0,
	                   from ptrace.h:51,
	                   from sigreturn.c:2:
	  /usr/include/m68k-linux-gnu/sys/reg.h:26:3: error: expected identifier
	  before numeric constant
	     PT_D1 = 0,
	     ^

	Apparently, the only architecture where strace needs definitions
	provided by <sys/reg.h> is x86_64, other three (m68k, tile, and x86)
	are fine with definitions already provided by <linux/ptrace.h>.

	Fix the issue by getting rid of <sys/reg.h> and defining necessary
	macros in linux/x86_64/arch_regs.h file.

	* configure.ac (AC_CHECK_HEADERS): Remove sys/reg.h.
	* regs.h: Do not include <sys/reg.h>.
	* linux/x86_64/arch_regs.h (R15, R14, R13, R12, RBP, RBX, R11, R10,
	R9, R8, RAX, RCX, RDX, RSI, RDI, ORIG_RAX, RIP, CS, EFLAGS, RSP, SS,
	FS_BASE, GS_BASE, DS, ES, FS, GS): New macros.
	* NEWS: Mention this fix.

	Fixes: v4.21~21 ("Include <sys/ptrace.h> early")

2018-02-15  Dmitry V. Levin  <ldv@altlinux.org>

	Demote sourceforge.net.
	https://sourceforge.net/p/strace/code/ is defunct: it doesn't accept
	new commits for too long.
	Likewise, https://sourceforge.net/projects/strace/files/ doesn't accept
	new files for too long.

	* README.md: Remove sourceforge.net URL.
	* debian/copyright: Replace the sourceforge.net based strace project URL
	with a github based one.
	* strace.spec.in (Source): Likewise.

2018-02-15  Dmitry V. Levin  <ldv@altlinux.org>

	Update copyright headers.
	* COPYING: Update copyright year number range.
	* debian/copyright: Sync with COPYING.

2018-02-14  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.21-1.
	* strace.spec.in: Likewise.

2018-02-13  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.21 release.
	* NEWS: Update for 4.21 release.

2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/s390_sthyi.c: skip the test if s390_sthyi returns an error.
	tests/s390_sthyi.c (main): replace error_msg_and_fail with
	error_msg_and_skip if rc is non-zero.

2018-02-13  Dmitry V. Levin  <ldv@altlinux.org>

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Remove old and unused maintenance scripts.
	Firewell, last witnesses of bygone era.

	* linux/sparc/gen.pl: Remove.
	* linux/x86_64/gentab.pl: Likewise.
	* xlate.el: Likewise.
	* Makefile.am (EXTRA_DIST): Remove them.

	Suggested-by: Elvira Khabirova <lineprinter@altlinux.org>
	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-02-13  Dmitry V. Levin  <ldv@altlinux.org>

	Consistently use MAX_ERRNO_VALUE.
	* filter_qualify.c (parse_inject_token): Replace 4095
	with MAX_ERRNO_VALUE.
	* negated_errno.h (is_negated_errno): Likewise.  Remove redundant
	comment.

	Export SIZEOF_LONG and SIZEOF_KERNEL_LONG_T to tests.
	* configure.ac (AC_SUBST): Add SIZEOF_LONG and SIZEOF_KERNEL_LONG_T.
	* tests/Makefile.am (SIZEOF_LONG, SIZEOF_KERNEL_LONG_T): New variables.
	(AM_TEST_LOG_FLAGS): Pass them.
	* bootstrap: Substitute them.

2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: avoid ioctl_kvm_run test failure when built with gcc -O0.
	When built with -O0, gcc (rightfully) generates function prologue, which
	results in writing %rbp to the stack, causing premature KVM_EXIT_MMIO.
	It could be possible to avoid such problems by "naked" attribute but,
	unfortunately, the latter is not available on x86 with older GCC.
	A trick suggested in [1] is used instead: assembly is moved
	to the global scope.

	[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50242#c3

	* tests/ioctl_kvm_run.c (code): Remove function.
	Add globally scoped __asm__ with the function code and its size.
	(code, code_size): New extern symbols declarations.
	(run_kvm): Remove code_size definition and initialization.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/ioctl_kvm_run.c: add KVM_EXIT_MMIO diagnostics.
	As it has proven itself useful.

	* tests/ioctl_kvm_run.c (run_kvm) <case KVM_EXIT_MMIO:>: Fail
	on unexpected KVM_EXIT_MMIO, providing relevant diagnostics.

2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add compatibility layer for accept call.
	Recent glibc (since version 2.26) uses accept4 syscall for implementing
	accept call on sparc.  Unfortunately, it's impossible to simply fall
	back on raw syscall as it had not been wired up until linux commit
	v4.4-rc8~4^2~1.

	* tests/accept_compat.h: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/net-y-unix.c: Include accept_compat.h, use do_accept()
	instead of accept() calls.
	* tests/net-yy-inet.c: Likewise.
	* tests/net-yy-unix.c: Likewise.
	* tests/net.expected: Allow accept4.

2018-02-12  Dmitry V. Levin  <ldv@altlinux.org>

	debian: build strace-udeb separately.
	* debian/rules (extra_build_targets): Add build-udeb-stamp.
	(build-udeb/Makefile): New rule.
	(clean): Remove build-udeb.
	* debian/strace-udeb.install: Update.

	Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=826223

2018-02-12  Dmitry V. Levin  <ldv@altlinux.org>

	Enable symbol demangling in deb- and rpm-driven builds.
	* debian/control (Build-Depends) [amd64]: Add libiberty-dev.
	* strace.spec.in (buildrequires_libunwind_devel): Add binutils-devel.

2018-02-12  Dmitry V. Levin  <ldv@altlinux.org>

	debian: re-enable -k option on x86_64.
	This partially reverts commit v4.13~177.

	* debian/control (Build-Depends) [amd64]: Add libunwind-dev.

2018-02-12  Dmitry V. Levin  <ldv@altlinux.org>

	Add "strace -V" output to build log.
	* strace.spec.in (%check): Print "strace -V" output before
	running the test suite.
	* debian/rules (%-stamp): Likewise.

2018-02-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update NT_* constants.
	* xlat/nt_descriptor_types.in (NT_PPC_PKEY): New constant introduced
	by linux kernel commit v4.16-rc1~93^2~72.

	Update the list of PKEY_* constants.
	* xlat/pkey_access.in (PKEY_DISABLE_EXECUTE): New constant introduced
	by linux kernel commit v4.16-rc1~93^2~85.
	* tests/pkey_alloc.c: Update expected output.
	* NEWS: Mention it.

	powerpc, powerpc64: wire up pkey_* syscalls.
	* linux/powerpc/syscallent.h [384..386]: Add pkey_alloc,
	pkey_free, and pkey_mprotect syscalls introduced by linux kernel
	commits v4.16-rc1~93^2~70 and v4.16-rc1~93^2~69, respectively.
	* linux/powerpc64/syscallent.h: Likewise.
	* NEWS: Mention it.

	Update NEWS.

2018-02-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	linux/ia64: remove IA-32 mode support.
	There is no compat support in strace and there are no systems
	within reach that would allow to test it.

	* linux/ia64/arch_regs.c (IA64_PSR_IS, ia64_ia32mode): Remove.
	* linux/ia64/get_error.c (get_error): Remove ia64_ia32mode branch.
	* linux/ia64/get_scno.c (arch_get_scno): Likewise.
	* linux/ia64/get_syscall_args.c (get_syscall_args): Likewise.
	* linux/ia64/set_error.c (arch_set_error, arch_set_success): Likewise.
	* linux/ia64/set_scno.c (arch_set_scno): Likewise.

2018-02-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall.c: parse return code second time after injecting.
	In order to have the same view as tracee has, with regards to
	"never fail" syscalls.

	* syscall.c (tamper_with_syscall_exiting): Call get_error after the
	return value tampering to re-initialise u_rval and u_error fields
	of struct tcb.

2018-02-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sparc: mark as an architecture that has a dedicated error register.
	* linux/sparc/arch_defs_.h (HAVE_ARCH_DEDICATED_ERR_REG): New macro,
	define to 1.

	strace.1.in: ffix.

2018-02-11  Dmitry V. Levin  <ldv@altlinux.org>

	Include <sys/ptrace.h> early.
	Include "ptrace.h" before any header that can include <signal.h>
	because on some architectures the latter may include <asm/sigcontext.h>
	which in turn may include <asm/ptrace.h> with potentially devastating
	effect on <sys/ptrace.h>.

	* process.c: Include "ptrace.h" before "regs.h".
	* rt_sigframe.c: Likewise.
	* sigreturn.c: Include "ptrace.h" before "nsig.h".
	* syscall.c: Likewise.
	* wait.c: Include "ptrace.h" before <sys/wait.h>.
	* strace.c: Include "ptrace.h" before <signal.h>.
	* tests/ptrace.c: Likewise.
	* tests/test_ucopy.c: Include <sys/ptrace.h> before <signal.h>.

2018-02-11  Dmitry V. Levin  <ldv@altlinux.org>

	Include <limits.h> instead of <sys/param.h>
	Do not include <sys/param.h> unnecessarily as it includes <signal.h>.

	* pathtrace.c: Include <limits.h> instead of <sys/param.h>.
	* strace.c: Likewise.
	* syscall.c: Likewise.
	* util.c: Likewise.
	* tests/getcwd.c: Likewise.
	* tests/group_req.c: Likewise.
	* tests/inode_of_sockfd.c: Likewise.
	* tests/ip_mreq.c: Likewise.
	* tests/printpath-umovestr.c: Likewise.
	* tests/qual_fault.c: Likewise.
	* tests/test_printpath.c: Likewise.
	* tests/umovestr3.c: Likewise.
	* tests/net-y-unix.c: Do not include <sys/param.h>.
	* tests/net-yy-unix.c: Likewise.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	basic_filters.c: introduce scno_by_name.
	As it will be used elsewhere.

	* basic_filters.c (scno_by_name): New function.
	(qualify_syscall_name): Use it.
	* defs.h (scno_by_name): New declaration.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xstring.h: rephrase xappendstr description a bit.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat.c: return NULL in sprintflags if there are no flags.
	Otherwise the auxstr is rather ugly at times.

	* xlat.c (sprintflags): Return NULL if no flags were printed.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Change type of injected rval to kernel_long_t.
	* defs.h (struct inject_data): Change type of rval field to
	kernel_ulong_t.
	* filter_qualify.c (parse_inject_token): Use string_to_kulong instead of
	string_to_uint for rval parsing.  Warn if retval is clipped in compat
	personality.

	Mark architectures that indicate syscall error in a dedicated register.
	* linux/alpha/arch_defs_.h (HAVE_ARCH_DEDICATED_ERR_REG): New macro,
	define to 1.
	* linux/ia64/arch_defs_.h: Likewise.
	* linux/mips/arch_defs_.h: Likewise.
	* linux/powerpc/arch_defs_.h: Likewise.
	* linux/powerpc64/arch_defs_.h: Likewise.
	* linux/sparc64/arch_defs_.h: Likewise.
	* linux/arch_defs_.h [!HAVE_ARCH_DEDICATED_ERR_REG]
	(HAVE_ARCH_DEDICATED_ERR_REG): New macro, define to 0.
	* linux/nios2/arch_defs_.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Make string_to_uint_ex more universal.
	And add support for reading of various types.

	* string_to_uint.c (string_to_uint_ex): Change to work with long long.
	(string_to_uint): Move it...
	* string_to_uint.h (string_to_uint): ...here.
	(string_to_uint_upto): Accept long long as max_val, return long long.
	(string_to_ulong, string_to_kulong, string_to_ulonglong): New functions,
	for completeness.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add pure syscall flag.
	* basic_filters.c (lookup_class) <syscall_class>: Add "%pure" for
	TRACE_PURE.
	* sysent.h (TRACE_PURE): New syscall flag.
	* sysent_shorthand_defs.h (PU): New shorthand macro.
	* linux/32/syscallent.h ([172], [173], [174], [175], [176], [177],
	[178]): Add PU flag to getpid, getppid, getuid, geteuid, getgid,
	getegid, gettid syscalls.
	* linux/64/syscallent.h ([172], [173], [174], [175], [176], [177],
	[178]): Add PU flag to getpid, getppid, getuid, geteuid, getgid,
	getegid, gettid syscalls.
	* linux/aarch64/syscallent.h ([1060]): Add PU flag to getpgrp syscalls.
	* linux/alpha/syscallent.h ([20], [24], [47], [63], [64], [89],
	[378]): Add PU flag to getxpid, getxuid, getxgid, getpgrp, getpagesize,
	getdtablesize, gettid syscalls.
	* linux/arc/syscallent.h ([246]): Add PU flag to arc_gettls syscalls.
	* linux/arm/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
	[199], [200], [201], [202], [224], [ARM_FIRST_SHUFFLED_SYSCALL+1+6]):
	Add PU flag to getpid, getuid, getgid, geteuid, getegid, getppid,
	getpgrp, getuid32, getgid32, geteuid32, getegid32, gettid, get_tls
	syscalls.
	* linux/avr32/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
	[176]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
	getppid, getpgrp, gettid syscalls.
	* linux/bfin/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
	[199], [200], [201], [202], [224]): Add PU flag to getpid, getuid,
	getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
	geteuid32, getegid32, gettid syscalls.
	* linux/hppa/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
	[206]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
	getppid, getpgrp, gettid syscalls.
	* linux/i386/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
	[199], [200], [201], [202], [224]): Add PU flag to getpid, getuid,
	getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
	geteuid32, getegid32, gettid syscalls.
	* linux/ia64/syscallent.h ([1041], [1042], [1046], [1047], [1062],
	[1063], [1105], [1171]): Add PU flag to getpid, getppid, getuid,
	geteuid, getgid, getegid, gettid, getpagesize syscalls.
	* linux/m68k/syscallent.h ([20], [24], [47], [49], [50], [64],
	[65], [166], [199], [200], [201], [202], [221], [333]): Add PU flag
	to getpid, getuid, getgid, geteuid, getegid, getppid, getpgrp,
	getpagesize, getuid32, getgid32, geteuid32, getegid32, gettid,
	get_thread_area syscalls.
	* linux/metag/syscallent.h ([248]): Add PU flag to metag_get_tls
	syscalls.
	* linux/microblaze/syscallent.h ([20], [24], [47], [49], [50], [64],
	[65], [199], [200], [201], [202], [224]): Add PU flag to getpid,
	getuid, getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
	geteuid32, getegid32, gettid syscalls.
	* linux/powerpc64/syscallent.h ([20], [24], [47], [49], [50], [64],
	[65], [207]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
	getppid, getpgrp, gettid syscalls.
	* linux/powerpc/syscallent.h ([20], [24], [47], [49], [50], [64],
	[65], [207]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
	getppid, getpgrp, gettid syscalls.
	* linux/s390/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
	[199], [200], [201], [202], [236]): Add PU flag to getpid, getuid,
	getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
	geteuid32, getegid32, gettid syscalls.
	* linux/s390x/syscallent.h ([20], [64], [65], [199], [200], [201],
	[202], [236]): Add PU flag to getpid, getppid, getpgrp, getuid,
	getgid, geteuid, getegid, gettid syscalls.
	* linux/sh64/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
	[199], [200], [201], [202], [252]): Add PU flag to getpid, getuid,
	getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
	geteuid32, getegid32, gettid syscalls.
	* linux/sh/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
	[199], [200], [201], [202], [224]): Add PU flag to getpid, getuid,
	getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
	geteuid32, getegid32, gettid syscalls.
	* linux/sparc64/syscallent.h ([20], [24], [47], [49], [50], [64], [81],
	[143], [197], [340]): Add PU flag to getpid, getuid, getgid, geteuid,
	getegid, getpagesize, getpgrp, gettid, getppid, kern_features syscalls.
	* linux/sparc/syscallent.h ([20], [24], [44], [47], [49], [50], [53],
	[64], [69], [70], [81], [143], [197], [340]): Add PU flag to getpid,
	getuid, getuid32, getgid, geteuid, getegid, getgid32, getpagesize,
	geteuid32, getegid32, getpgrp, gettid, getppid, kern_features syscalls.
	* linux/x32/syscallent.h ([39], [102], [104], [107], [108], [110],
	[111], [186]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
	getppid, getpgrp, gettid syscalls.
	* linux/x86_64/syscallent.h ([39], [102], [104], [107], [108], [110],
	[111], [186]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
	getppid, getpgrp, gettid syscalls.
	* linux/xtensa/syscallent.h ([120], [127], [137], [139], [140], [141],
	[150], [151]): Add PU flag to getpid, gettid, getuid, getgid, geteuid,
	getegid, getppid, getpgrp syscalls.
	* strace.1.in (.SS Filtering): Document it.
	* NEWS: Mention it.

	syscall.c: warn if tampering failed.

	syscall.c: set errno if syscall is tampered.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/nsyscall-d.test: swap exp and log in diff calls.
	In line with the rest of the tests.

	* tests/nsyscalls-d.test: swap arguments of match_diff calls.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	linux/arm/get_scno.c: use debug_msg.
	* linux/arm/get_scno.c (arch_get_scno): replace if (debug_flag) {
	error_msg() } with debug_msg() call.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Do not shuffle scno inside syscall_name.
	This makes interface a bit irregular otherwise.

	* defs.h (syscall_name): Clarify description.
	* syscall.c (syscall_name): Do not call shuffle_scno.
	* printsiginfo.c (print_si_info) <case SIGSYS>: Use shuffle_scno.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Handle very special __ARM_NR_-prefixed syscalls.
	* linux/aarch64/nr_prefix.c: New file.
	* linux/arm/nr_prefix.c: Likewise.
	* linux/nr_prefix.c: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* printsiginfo.c: Include nr_prefix.c
	(print_si_info): Use nr_prefix.

	Make shuffle_scno globally available.
	* syscall.c (shuffle_scno): Move the declaration...
	* defs.h (shuffle_scno): ...here. Remove static qualifier.
	* linux/aarch64/shuffle_scno.c (shuffle_scno): Remove static qualifier.
	* linux/arm/shuffle_scno.c: Likewise.
	* linux/shuffle_scno.c: Likewise.
	* linux/x32/shuffle_scno.c: Likewise.
	* linux/x86_64/shuffle_scno.c: Likewise.

2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall.c: use shuffle_scno in syscall_name.
	syscall_name() is used only in printsiginfo.c:print_si_info currently,
	and is supplied with raw syscall number (that's why it has this ugly
	__X32_SYSCALL_BIT hack). But since it handled only __X32_SYSCALL_BIT and
	not shuffle_scno(), it was broken on ARM.  Let's replace it with shuffle_scno
	call, as it handles both the case of shuffled ARM syscalls and the
	__X32_SYSCALL_BIT.

	* syscall.c (syscall_name): Call shuffle_scno instead of custom
	__X32_SYSCALL_BIT handling.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Use shuffle_scno for x32 syscall numbers.
	This changes behaviour of printing of unknown syscall.

	* linux/x32/shuffle_scno.c: New file.
	* linux/x86_64/shuffle_scno.c: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* linux/x86_64/get_scno.c (arch_get_scno): Do not clear
	__X32_SYSCALL_BIT.
	* tests/nsyscalls.c: Update expected output.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Move shuffle_scno() invocation to get_scno.
	* linux/aarch64/get_scno.c (arch_get_scno): Remove shuffle_scno call.
	* linux/arm/get_scno.c (arch_get_scno): Remove shuffle_scno calls.
	* syscall.c (get_scno): Call shuffle_scno after arch_get_scno.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Move shuffle_scno to arch-specific file.
	While we are here, let's fix AArch64 by limiting scno shuffling
	to compat personality only.

	* syscall.c: Include shuffle_scno.c.
	(shuffle_scno): Move it to a...
	* linux/arm/shuffle_scno.c: New file.
	* linux/aarch64/shuffle_scno.c: New file, define arm's shuffle_scno
	as arm_shuffle_scno and call it only for personality 1.
	* linux/shuffle_scno.c: New file, fallback trivial shuffle_scno
	definition.
	* Makefile.am (EXTRA_DIST): Add them.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Print unknown syscall number in hexadecimal.
	* syscall.c (struct sysent_buf): Update buf field size.
	(get_scno): Print unknown syscall number in hexadecimal form.
	* tests/nsyscalls.c: Update expected output.
	* strace.1.in: Document it.
	* NEWS: Mention it.

	tests/accept.c: call accept syscall directly, if available.
	* tests/accept.c [__NR_accept && !TEST_SYSCALL_NAME]: Define a wrapper that
	calls accept directly.
	* tests/sockname.c [TEST_SYSCALL_STR]: Do not define TEST_SYSCALL_STR.

	printsiginfo.c: add a comment about personality detection for SIGSYS.
	Looks like it is not necessary, after all.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	linux/x86_64/set_error.c: update eax for compat personality.
	Since this is where get_error gets the return value from in the compat case.

	linux/x86_64/set_error.c (set_error, set_success): Update i386_regs.eax
	if tracee is in compat personality.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Mark various arch-specific syscalls with SYSCALL_NEVER_FAILS.
	* linux/alpha/syscallent.h (getpagesize, getdtablesize): Add NF flag.
	* linux/arc/syscallent.h (arc_gettls): Likewise.
	* linux/arm/syscallent.h (get_tls): Likewise.
	* linux/ia64/syscallent.h (getpagesize): Likewise.
	* linux/m68k/syscallent.h (getpagesize, get_thread_area): Likewise.
	* linux/sparc/syscallent.h (getpagesize): Likewise.
	* linux/sparc64/syscallent.h (getpagesize): Likewise.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add SYSCALL_NEVER_FAILS flag to getpgrp.
	As glibc, at least, treats it this way.

	* linux/aarch64/syscallent.h (getpgrp): Add NF flag.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	linux/x86_64/get_error.c: do not sign-extend if no error happened.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/membarrier.c: fix expected output on nohz_full systems.
	If nohz_full is enabled, MEMBARRIER_CMD_GLOBAL is not available.

	* tests/membarrier.c: check availability of MEMBARRIER_CMD_GLOBAL
	separately.

2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update MEMBARRIER_CMD_* constants.
	* xlat/membarrier_cmds.in: Add new constants, rename
	MEMBARRIER_CMD_SHARED to MEMBARRIER_CMD_GLOBAL.
	* NEWS: Mention this.
	* tests/membarrier.c (main): Update expected output.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-02-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	perf.c: print group_fd argument of perf_event_open syscall as fd.
	* perf.c (SYS_FUNC(perf_event_open)): Print 4th argument using printfd.

	syscall.c: print higher bits of syscall return value on x32 personality.
	* syscall.c (syscall_exiting_trace): Check for current_klongsize instead
	of current_wordsize to determine the size of tcp->u_rval.

	strace.1.in: history update.
	strace.1.in (.SH HISTORY): Some amendments based on
	https://github.com/strace/strace-talks/blob/master/2012-ossdevconf-obninsk-strace_from_upstream_PoV/ossdevconf_2012-slides-strace_from_upstream_PoV.tex

	strace.1.in: minor changes.
	* strace.1.in (.SH DESCRIPTION): s/a passion/passion/,
	s/Here the/Here, the/, s/Where traditional/Where the traditional/,
	s/output has proven/output is proven/, s/In all cases/In most cases,/¸
	embolden st_mode, lstat, SIGCHLD, and SIGTTOU mentions,
	s/In some cases /In some cases, /
	(.SS Output format) <-o>: de-italicize dot in "filename.pid", convert
	the sentence's voice to passive, some other rephrasing.  Mention
	incompatibility of output piping with -ff mode.
	(.SS Output options) <-t>: s/time of day/wall clock time/.
	(.SS Statistics) <-c>: Remove "on Linux" mention, -F option mention.

	README.md: add information about git repository location.
	* README.md: Mention URLs for SourceForge, GitHub, and GitLab
	repositories.

2018-02-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite net-accept-connect.c without strncpy.
	gcc8 -Wall -Werror rejects our method of struct sockaddr_un.sun_path
	initialization because the field lacks __nonstring__ attribute.

	As we calculate the length of the string being copied anyway,
	workaround this gcc+glibc bug by changing the code to use this
	pre-calculated length and get rid of strncpy completely.

	* tests/net-accept-connect.c (main): Use memcpy to initialize sun_path.

2018-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	Use kernel's fcntl.h header instead of libc's for open_mode_flags.
	As definitions of O_* macros provided by various libc implementations
	are usually less reliable than those provided by kernel headers, switch
	to use kernel's fcntl.h header.

	* open.c: Include <asm/fcntl.h> instead of <fcntl.h>.  Remove
	O_LARGEFILE fallback definitions assuming that the kernel headers
	provide them.
	* xlat/open_mode_flags.in: Add __O_SYNC after O_SYNC.  Add O_TMPFILE
	and __O_TMPFILE before O_DIRECTORY.  Remove "O_TMPFILE & ~O_DIRECTORY".
	* tests/open.c: Include <asm/fcntl.h> instead of <fcntl.h>.  Remove
	workarounds for libc O_TMPFILE implementations.
	* tests/openat.c: Include <asm/fcntl.h> instead of <fcntl.h>.
	(test_mode_flag): New function.
	(main): Use it to check decoding of all access modes and file flags.
	* tests/gen_tests.in (openat): Add -a option.

	Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update TCP_* constants.
	* xlat/socktcpoptions.in: Add TCP_FASTOPEN_KEY and
	TCP_FASTOPEN_NO_COOKIE introduced by linux kernel commits
	v4.15-rc1~84^2~387 and v4.15-rc1~84^2~339, respectively.
	* NEWS: Mention this.

	xlat: update IPV6_* constants.
	* xlat/sockipv6options.in: Add IPV6_FREEBIND introduced by linux kernel
	commit v4.15-rc1~84^2~601.
	* NEWS: Mention this.

	xlat: update MAP_* constants.
	* xlat/mmap_flags.in: Add MAP_SHARED_VALIDATE and MAP_SYNC introduced
	by linux kernel commits v4.15-rc1~71^2^2~23 and v4.15-rc1~71^2^2~12,
	respectively.
	* NEWS: Mention this.

2018-02-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: avoid triggering -Wstringop-truncation in ioctl_dm.c.
	* tests/ioctl_dm.c: Replace strncpy calls with memcpy as the character
	arrays being copied are not C strings.

	Makefile.am: minor EXTRA_DIST formatting changes.

	Move large file-related wrappers to a separate header.
	* strace.c [_LARGEFILE64_SOURCE]: Move the definitions under it to a...
	* largefile_wrappers.h: ... new file.
	* Makefile.am (strace_SOURCES): Add it.

2018-01-29  Dmitry V. Levin  <ldv@altlinux.org>

	strace.1: fix wording about setuid installation.
	* strace.1.in (SETUID INSTALLATION): Fix wording.

	Closes: https://github.com/strace/strace/issues/24

2018-01-29  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Add KVM_PPC_GET_CPU_CHAR ioctl definition from linux v4.15.
	* linux/powerpc/ioctls_arch0.h: Update from linux v4.15
	using ioctls_gen.sh.

2018-01-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.

	tests: check s390_pci_mmio_read and s390_pci_mmio_write decoders.
	* tests/s390_pci_mmio_read_write.c: New file.
	* tests/.gitignore: Add s390_pci_mmio_read_write.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (s390_pci_mmio_read_write): New test.

	Introduce s390_pci_mmio_read, s390_pci_mmio_write system call decoders.
	* linux/s390/syscallent.h ([352]): Change decoder to s390_pci_mmio_write.
	([353]): Change decoder to s390_pci_mmio_read.
	* linux/s390x/syscallent.h: Likewise.
	* s390.c (SYS_FUNC(s390_pci_mmio_write), SYS_FUNC(s390_pci_mmio_read)):
	New function.

	tests: check s390_runtime_instr system call decoder.
	* tests/s390_runtime_instr.c: New file.
	* tests/.gitignore: Add s390_runtime_instr.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (s390_runtime_instr): New test.

	Introduce s390_runtime_instr system call decoder.
	* linux/s390/syscallent.h ([342]): Change decoder to s390_runtime_instr.
	* linux/s390x/syscallent.h: Likewise.
	* s390.c (SYS_FUNC(s390_runtime_instr)): New function.
	* xlat/s390_runtime_instr_commands.in: New file.

	tests: check s390_guarded_storage system call decoder.
	* configure.ac (AC_CHECK_HEADERS): Add asm/guarded_storage.h.
	* tests/s390_guarded_storage-v.c: New file.
	* tests/s390_guarded_storage.c: Likewise.
	* tests/.gitignore: Add s390_guarded_storage, s390_guarded_storage-v.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (s390_guarded_storage, s390_guarded_storage-v):
	New tests.

	Introduce s390_guarded_storage system call decoder.
	* linux/s390/syscallent.h ([378]): Change decoder to s390_guarded_storage.
	* linux/s390x/syscallent.h: Likewise.
	* s390.c (struct guard_storage_control_block,
	struct guard_storage_event_parameter_list): New structure type
	definition.
	(guard_storage_print_gsepl, guard_storage_print_gscb,
	SYS_FUNC(s390_guarded_storage)): New function.
	(DIV_ROUND_UP): New macro.
	* xlat/s390_guarded_storage_commands.in: New file.

	tests: check s390_sthyi system call decoder.
	* configure.ac (AC_CHECK_FUNCS): Add iconv_open.
	(AC_CHECK_HEADERS): Add iconv.h.
	* tests/s390_sthyi-v.c: New file.
	* tests/s390_sthyi.c: Likewise.
	* tests/.gitignore: Add s390_sthyi, s390_sthyi-v.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (s390_sthyi, s390_sthyi): New tests.

	Introduce s390_sthyi system call decoder.
	* s390.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/s390/syscallent.h ([380]): Change decoder to s390_sthyi.
	* linux/s390x/syscallent.h: Likewise.
	* xlat/s390_sthyi_function_codes.in: New file.

	print_fields.h: add macro to print hexadecimal array field.
	* print_fields.h (PRINT_FIELD_HEX_ARRAY): New macro, prints target
	array with QUOTE_FORCE_HEX.

2018-01-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add print_quoted_string flag to generate comment.
	Because there are never enough print_quoted_string flags.

	* defs.h (QUOTE_EMIT_COMMENT): New quoting flag macro constant.
	* util.c (string_quote): Emit " /* " in the beginning and " */" in the
	end if QUOTE_EMIT_COMMENT is passed.
	(print_quoted_string): Increase alloc_size by 7 if QUOTE_EMIT_COMMENT is
	passed.

2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: make ioctl.test more flexible, use it for the rest of ioctl tests
	As the remaining non-generated ioctl tests differ from ioctl.test only
	in strace options, and since gen_tests.sh can pass arguments to sourced
	tests, replace the remaining non-generated ioctl tests with invocations
	of ioctl.test with appropriate parameters.

	* tests/ioctl.test: Pass script arguments to the strace invocation.
	* tests/gen_tests.in (ioctl_dm): New entry, invoke ioctl.test with -s9.
	(ioctl_dm-v): New entry, invoke ioctl.test with -v -s9.
	(ioctl_kvm_run): New entry, invoke ioctl.test with -a36 -y.
	(ioctl_loop-nv): New entry, invoke ioctl.test with -a22 -e verbose=none.
	(ioctl_nsfs): New entry, invoke ioctl.test with -esignal=none.
	(ioctl_sock_gifconf): New entry, invoke ioctl.test with -a28 -s1.
	(ioctl_evdev-v, ioctl_loop-v, ioctl_rtc-v): Invoke ioctl.test
	with -v option instead of ioctl-v.sh.
	* tests/ioctl_dm-v.test: Remove.
	* tests/ioctl_dm.test: Likewise.
	* tests/ioctl_kvm_run.test: Likewise.
	* tests/ioctl_loop-nv.test: Likewise.
	* tests/ioctl_nsfs.test: Likewise.
	* tests/ioctl_sock_gifconf.test: Likewise.
	* tests/ioctl-v.sh: Likewise.
	* tests/Makefile.am (DECODER_TESTS, EXTRA_DIST): Remove them.

2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/gen_tests.sh: enable passing arguments to sourced tests.
	* tests/gen_tests.sh: Read first argument separately, put it in $arg0,
	and the rest of the arguments in $args.
	(case "$arg0" in) <+*)>: Set command line to $args and source $arg0.

	xlat/gen.sh: add some rudimentary support for comments.
	* xlat/gen.sh: Trim parts of the string abbreviated in "/*" and "*/"

	configure.ac: sort architectures in lexicographical order.
	* configure.ac (case "$host_cpu"): sort architectures in alphabetical
	order.

2018-01-25  Dmitry V. Levin  <ldv@altlinux.org>

	Drop non-functional CRIS architecture support.
	From the very first commit when CRIS architecture support was introduced
	and up to this comment that ends the agony of this non-functional code,
	this support was incomplete and could never be compiled.

	* Makefile.am (EXTRA_DIST): Remove linux/crisv*.
	* clone.c: Remove CRISV* checks.
	* configure.ac ($host_cpu == cris*): Remove.
	* linux/crisv10: Remove.
	* linux/crisv32: Likewise.

	Fixes: v4.5.18-77-gea0e6e8 ("CRIS support by Hinko Kocevar ...")

2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update futex test in accordance with kernel's v4.15-rc7-202-gfbe0e83.
	* futex.c (VALP, VALP_PR, VAL2P, VAL2P_PR): New macro definitions.
	(main): Allow EINVAL on *REQUEUE* checks with VAL/VAL2 with higher bit
	being set, check that the existing behaviour preserved with VALP/VAL2P
	where higher bit is unset.

	tests/futex.c: improve error diagnostics.
	* tests/futex.c (futex_error): Add func and line arguments, print them.
	(CHECK_FUTEX_GENERIC): Pass __func__ and __LINE__ to futex_error.

	Add syscall entry for ARM-specific get_tls syscall.
	* linux/arm/syscallent.h ([ARM_FIRST_SHUFFLED_SYSCALL+1+6]): New entry.
	(ARM_LAST_SPECIAL_SYSCALL): Update to 6.
	* NEWS: Mention it.

2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Fix syscall descriptions for ARM-specific system calls.
	Based on an analysis of arm_syscall in arch/arm/kernel/traps.c.

	* linux/arm/syscallent.h ([ARM_FIRST_SHUFFLED_SYSCALL+1+2]): Update
	argument number, add TM flag.
	([ARM_FIRST_SHUFFLED_SYSCALL+1+1], [ARM_FIRST_SHUFFLED_SYSCALL+1+3],
	[ARM_FIRST_SHUFFLED_SYSCALL+1+4], [ARM_FIRST_SHUFFLED_SYSCALL+1+5]):
	Update argument number.

2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check riscv_flush_icache syscall decoder.
	* tests/riscv_flush_icache.c: New file.
	* tests/.gitignore: Add riscv_flush_icache.
	* tests/gen_tests.in: Likewise.
	* tests/pure_executables.list: Likewise.

	Implement decoding of riscv_flush_icache syscall.
	* linux/riscv/syscallent.h ([259]): Add riscv_flush_icache entry.
	* riscv.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* xlat/riscv_flush_icache_flags.in: New file.
	* NEWS: Mention it.

2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Workaround stray PTRACE_EVENT_EXEC.
	We (apparently) had a long-standing test failure inside strace-ff.test
	with the symptom that it misses exit_group call.  As it turned out, it
	was PTRACE_EVENT_EXEC followed by execve syscall exiting stop.  That
	behaviour indeed screwed all the syscall state tracking for the tracee.
	Let's try to patch it up by calling trace_syscall when we receive
	PTRACE_EVENT_EXEC outside syscall.

	* defs.h (TCB_RECOVERING): New tcb flag.
	* strace.c (dispatch_event) <case TE_STOP_BEFORE_EXECVE>: Invoke
	trace_syscall with TCB_RECOVERING flag being set for the current_tcp
	if the tracee is not on exiting syscall.
	* syscall.c (get_scno): Set QUAL_RAW if we are recovering.
	(tamper_with_syscall_entering): Do not perform actual tampering during
	recovery as it's already too late.
	* NEWS: Mention it.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-01-24  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify set_ptracer_any.
	* tests/set_ptracer_any.c (main) [HAVE_PRCTL]: Provide fallback
	definitions for PR_SET_PTRACER and PR_SET_PTRACER_ANY constants,
	set all unused prctl arguments to 0.

2018-01-24  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: do not bail out in get_syscall_args if umove fails with EPERM.
	If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3,
	both PTRACE_PEEKDATA and process_vm_readv become unavailable when the
	process dumpable flag is cleared, on ia64 this results to all syscall
	arguments being unavailable.

	Recognize this situation and do not treat it as get_syscall_args error
	because the latter leaves the tracee in a ptrace stop.

	This condition used to be triggered by prctl-dumpable test that caused
	strace to hang indefinitely.

	* linux/ia64/get_syscall_args.c (get_syscall_args): Do not bail out
	if umove fails.
	* tests/prctl-dumpable.c [__ia64__]: Skip the test.

2018-01-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.c: reset printing_tcp on print_event_exit.
	print_event_exit should have printing_tcp setup analogous to printleader and
	syscall_exit_trace before printing its part, otherwise it spuriously resets
	curcol in line_ended for the stale printing_tcp if followfork == 2.

	* strace.c (print_event_exit): Set printing_tcp to tcp before printing
	exiting event line and calling line_ended.

2018-01-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check path tracing of old select syscall.
	* tests/xselect.c [xselect] (xselect): Turn into prototype.
	* tests/oldselect-P.c: New file.
	* tests/oldselect-efault-P.c: Likewise.
	* tests/oldselect-efault.c: Likewise.
	* tests/oldselect.c: Use xselect.c
	* tests/pure_executables.list: Add oldselect-efault.
	* tests/gen_tests.in (oldselect, oldselect-P, oldselect-efault,
	oldselect-efault-P): New entries.
	* tests/oldselect.expected: Remove.
	* tests/oldselect.test: Remove.
	* tests/Makefile.am (check_PROGRAMS): Add oldselect-P
	and oldselect-efault-P.
	(DECODER_TESTS): Remove oldselect.test.
	(EXTRA_DIST): Remove oldselect.expected.
	* tests/.gitignore: Add oldselect-P, oldselect-efault,
	and oldselect-efault-P.

	tests: check path tracing of select/_newselect syscalls.
	* tests/xselect.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/
	is not available.  Add test calls that use PATH_TRACING_FD.
	(main): Conditionalize expected output for those calls
	that do not use PATH_TRACING_FD with [!PATH_TRACING_FD].
	* tests/_newselect-P.c: New file.
	* tests/select-P.c: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add _newselect-P and select-P.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (_newselect-P, select-P): New entries.

	tests: extend the check of select/_newselect syscalls decoding.
	* tests/xselect.c: Rewrite for better coverage.

2018-01-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: redirect stdin to /dev/null.
	Ensure that stdin descriptor is not available for output
	by reopening it to input from /dev/null.

	* tests/run.sh: Redirect test's stdin to /dev/null.

2018-01-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add file:line to perror_msg_and_fail/error_msg_and_fail output.
	* tests/tests.h [!perror_msg_and_fail] (perror_msg_and_fail): New macro
	wrapper around the homonymous function.
	[!error_msg_and_fail] (error_msg_and_fail): Likewise.
	* tests/error_msg.c (perror_msg_and_fail, error_msg_and_fail): New
	macros defined to themselves.

	Rework decoding and pathtrace of old select syscall.
	* linux/arch_defs_.h [!HAVE_ARCH_OLD_SELECT] (HAVE_ARCH_OLD_SELECT): New
	macro.
	* linux/aarch64/arch_defs_.h (HAVE_ARCH_OLD_SELECT): Likewise.
	* linux/arm/arch_defs_.h: Likewise.
	* linux/bfin/arch_defs_.h: Likewise.
	* linux/i386/arch_defs_.h: Likewise.
	* linux/m68k/arch_defs_.h: Likewise.
	* linux/microblaze/arch_defs_.h: Likewise.
	* linux/powerpc64/arch_defs_.h: Likewise.
	* linux/sh/arch_defs_.h: Likewise.
	* linux/x32/arch_defs_.h: Likewise.
	* linux/x86_64/arch_defs_.h: Likewise.
	* linux/powerpc/arch_defs_.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* desc.c (SYS_FUNC(oldselect)): Rewrite using
	fetch_indirect_syscall_args, move under [HAVE_ARCH_OLD_SELECT].
	* pathtrace.c (match_xselect_args): New function.
	(pathtrace_match_set): Use it.

2018-01-23  Dmitry V. Levin  <ldv@altlinux.org>

	Transform fetch_old_mmap_args into fetch_indirect_syscall_args.
	As there are more than one old style syscall that take their arguments
	via array, generalize fetch_old_mmap_args into a function that could
	fetch variable number of arguments.

	* mem.c (fetch_old_mmap_args): Transform into ...
	* fetch_indirect_syscall_args.c: ... fetch_indirect_syscall_args
	in this new file.
	* Makefile.am (libstrace_a_SOURCES): Add it.
	* defs.h [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): Remove.
	(fetch_indirect_syscall_args): New prototype.
	* pathtrace.c (pathtrace_match_set) [HAVE_ARCH_OLD_MMAP]: Use
	fetch_indirect_syscall_args instead of fetch_old_mmap_args.

2018-01-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	signal.c: remove excess semicolon after the end of the function.
	* signal.c (rt_sigtimedwait): Remove semicolon after the function body.

	Use char * for pointer arithmetics.
	* netlink_inet_diag.c (decode_inet_diag_req_compat,
	decode_inet_diag_req_v2, decode_inet_diag_msg): Cast to char *
	instead of void *.
	* netlink_netlink_diag.c (decode_netlink_diag_req,
	decode_netlink_diag_msg): Likewise.
	* netlink_packet_diag.c (decode_packet_diag_req,
	decode_packet_diag_msg): Likewise.
	* netlink_unix_diag.c (decode_unix_diag_req, decode_unix_diag_msg):
	Likewise.
	* rtnl_addr.c (decode_ifaddrmsg): Likewise.
	* rtnl_addrlabel.c (decode_ifaddrlblmsg): Likewise.
	* rtnl_dcb.c (decode_dcbmsg): Likewise.
	* rtnl_link.c (decode_ifinfomsg): Likewise.
	* rtnl_mdb.c (decode_br_port_msg): Likewise.
	* rtnl_neigh.c (decode_ndmsg): Likewise.
	* rtnl_route.c (decode_rtmsg): Likewise.
	* rtnl_rule.c (decode_fib_rule_hdr): Likewise.
	* rtnl_tc.c (decode_tcmsg): Likewise.

2018-01-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	netlink_inet_diag.c: remove unnecessary return.
	decode_inet_diag_req, as well as the functions it calls, returns void.

	* netlink_inet_diag.c (decode_inet_diag_req): Do not return anything.

2018-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	Move decoder of getpagesize syscall to libstrace.
	As only five architectures have getpagesize syscall, moving the decoder
	to libstrace allows to get rid of getpagesize related ifdefs and check
	build of getpagesize decoder on other architectures.

	* mem.c (SYS_FUNC(getpagesize)): Move ...
	* getpagesize.c: ... to this new file.
	* Makefile.am (libstrace_a_SOURCES): Add it.

2018-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mpers: implement gawk 3 support.
	Some old systems that still make some sense to be supported have only
	gawk 3, so let's support them for now.

	In order to achieve that, multiple changes have been implemented:
	 - Multidimensional arrays are replaced with single-dimensional ones.
	   In most places it's a "][" -> ", " replacement, as awk allows some
	   kind of emulation of multidimensional arrays that way, but in several
	   occasions (specifically for storing name and special fields) we have
	   to iterate over them later, so we store that information in
	   additional arrays in order to get the keys.
	 - "switch" statements are replaced with sets of "if ... else if ...
	   else" statements.  This change is trivial, except we've added
	   a temporary variable in what_is order to store expression value, for
	   readability purposes.
	 - No support for array iteration ordering.  This one is most ugly of
	   them all.  Luckily, not that ugly, we've just had to process index a
	   bit in order to make it lexicographically sortable and add two
	   temporary arrays containing sorted indices in order to sort over them
	   instead of those two arrays that we've added in order to work around
	   lack of multidimensional array support.

	* mpers.awk (compare_indices): Remove unused function.
	(array_get, update_upper_bound, /^DW_AT_data_member_location/,
	/^DW_AT_byte_size/, /^DW_AT_encoding/): Replace multidimensional array
	access with comma-concatenated index.
	(norm_idx): New function.
	(array_seq): Replace multidimensional array access with
	comma-concatenated index.  Use comma-concatenated pair of (array_idx,
	"seq") in order to check presence of the item in an array.
	(what_is): Add enc and i local variables.  Store the value of
	array[what_idx, "encoding"] in it.  Replace "switch" statements with
	sets of "if ... else if ... else" statements.  Replace multidimensional
	array access with comma-concatenated index. Use for (... ; ...; ...)
	iteration over aparents_keys instead of iteration over array.
	(/^<[[:xdigit:]]+>/): Store idx as norm_idx(matches[2]).  Replace
	multidimensional array access with comma-concatenated index.  Store an
	additional flag in array_names array.
	(/^DW_AT_name/): Replace multidimensional array access with
	comma-concatenated index.  Add a flag to array_names for that idx.
	(/^DW_AT_type/): Do not capture "0x" as a part of a group, normalise
	the captured group.  Replace multidimensional array access with
	comma-concatenated index.
	(/^Abbrev Number:[^(]+\(DW_TAG_/): Replace multidimensional array access
	with comma-concatenated index.  Store additional flags in
	array_special and array_parents arrays.
	(END): Remove PROCINFO["sorted_in"] setup.  Sort array_parents.  Replace
	multidimensional array access with comma-concatenated index.  Iterate
	over array_special to go over all the items that have "special" field.
	Iterate over array_names to go over all items that have "name" field.
	* NEWS: Mention it.

2018-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	dm: add support for event_nr in DM_LIST_DEVICES result.
	Commit v4.13-rc1~137^2~13 (and a follow-up fix v4.14-rc4~20^2~3
	that changed alignment) introduced an additional hidden field
	in the structure returned by DM_LIST_DEVICES ioctl command
	that contains event_nr information.

	Unfortunately, we can't test it for now, but looks like it kinda works:

	  # ./strace -v -eioctl -y dmsetup ls
	  ioctl(3</dev/mapper/control>, DM_VERSION, {version=4.0.0,
	  data_size=16384, flags=DM_EXISTS_FLAG} => {version=4.37.0,
	  data_size=16384, flags=DM_EXISTS_FLAG}) = 0
	  ioctl(3</dev/mapper/control>, DM_LIST_DEVICES, {version=4.0.0,
	  data_size=16384, data_start=312, flags=DM_EXISTS_FLAG} =>
	  {version=4.37.0, data_size=408, data_start=312, flags=DM_EXISTS_FLAG,
	  {dev=makedev(253, 1), name="fedoratesting--30-swap", event_nr=0},
	  {dev=makedev(253, 0), name="fedoratesting--30-root"}}) = 0
	  fedoratesting--30-swap	(253:1)
	  fedoratesting--30-root	(253:0)

	* dm.c (dm_decode_dm_name_list): Obtain the amount of bytes copied
	during printing device name, print event number if there's a suitable
	gap present and the DM version is high enough.
	* NEWS: Mention it.

2018-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Move definition of personality macros to arch_defs_.h.
	* supported_personalities.h: Remove.
	* defs.h: Do not include it.
	* linux/arch_defs_.h [!DEFAULT_PERSONALITY] (DEFAULT_PERSONALITY): New
	macro.
	[!SUPPORTED_PERSONALITIES] (SUPPORTED_PERSONALITIES): Likewise.
	* linux/aarch64/arch_defs_.h (SUPPORTED_PERSONALITIES): New macro.
	* linux/riscv/arch_defs_.h: Likewise.
	* linux/s390x/arch_defs_.h: Likewise.
	* linux/sparc64/arch_defs_.h: Likewise.
	* linux/x32/arch_defs_.h: Likewise.
	* linux/x86_64/arch_defs_.h: Likewise.
	* linux/powerpc64/arch_defs_.h: New file.
	* linux/tile/arch_defs_.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	(strace_SOURCES): Remove supported_personalities.h.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Introduce HAVE_ARCH_SA_RESTORER.
	In order to simplify HAVE_SA_RESTORER logic a bit.

	* linux/ia64/arch_defs_.h (HAVE_ARCH_SA_RESTORER): New macro.
	* linux/m68k/arch_defs_.h: Likewise.
	* linux/sparc/arch_defs_.h: Likewise.
	* linux/sparc64/arch_defs_.h: Likewise.
	* linux/hppa/arch_defs_.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* signal.c [HAVE_ARCH_SA_RESTORER]: Define HAVE_SA_RESTORER to it.
	[!HAVE_ARCH_SA_RESTORER && SA_RESTORER]: Define HAVE_SA_RESTORER to 1.
	[!HAVE_ARCH_SA_RESTORER && !SA_RESTORER]: Define HAVE_SA_RESTORER to 0.

2018-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	Replace NEED_UID16_PARSERS with HAVE_ARCH_UID16_SYSCALLS.
	* linux/arch_defs_.h [!HAVE_ARCH_UID16_SYSCALLS]
	(HAVE_ARCH_UID16_SYSCALLS): New macro.
	* linux/aarch64/arch_defs_.h (HAVE_ARCH_UID16_SYSCALLS): New macro.
	* linux/arm/arch_defs_.h: Likewise.
	* linux/i386/arch_defs_.h: Likewise.
	* linux/ia64/arch_defs_.h: Likewise.
	* linux/m68k/arch_defs_.h: Likewise.
	* linux/s390/arch_defs_.h: Likewise.
	* linux/s390x/arch_defs_.h: Likewise.
	* linux/sh/arch_defs_.h: Likewise.
	* linux/sparc/arch_defs_.h: Likewise.
	* linux/sparc64/arch_defs_.h: Likewise.
	* linux/syscall.h: Likewise.
	* linux/x32/arch_defs_.h: Likewise.
	* linux/x86_64/arch_defs_.h: Likewise.
	* linux/bfin/arch_defs_.h: New file.
	* linux/microblaze/arch_defs_.h: Likewise.
	* linux/riscv/arch_defs_.h: Likewise.
	* linux/sh64/arch_defs_.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* defs.h (NEED_UID16_PARSERS): Remove.
	* linux/syscall.h: Check for HAVE_ARCH_UID16_SYSCALLS instead of
	NEED_UID16_PARSERS.
	* uid.c: Likewise.

	Replace HAVE_GETRVAL2 with HAVE_ARCH_GETRVAL2.
	* linux/arch_defs_.h [!HAVE_ARCH_GETRVAL2] (HAVE_ARCH_GETRVAL2): New
	macro.
	* linux/alpha/arch_defs_.h: New file.
	* linux/ia64/arch_defs_.h: Likewise.
	* linux/mips/arch_defs_.h: Likewise.
	* linux/sh/arch_defs_.h: Likewise.
	* linux/sparc/arch_defs_.h: Likewise.
	* linux/sparc64/arch_defs_.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* defs.h (HAVE_GETRVAL2): Remove.
	(getrval2): Check for HAVE_ARCH_GETRVAL2 instead of arch checks.
	* net.c (SYS_FUNC(pipe)): Check for HAVE_ARCH_GETRVAL2 instead of
	HAVE_GETRVAL2.
	* syscall.c: Likewise.

	Use #if idiom instead of #ifdef for HAVE_ARCH_* macros.
	* linux/arch_defs_.h [!HAVE_ARCH_OLD_MMAP] (HAVE_ARCH_OLD_MMAP): New
	macro.
	[!HAVE_ARCH_OLD_MMAP_PGOFF] (HAVE_ARCH_OLD_MMAP_PGOFF): Likewise.
	* defs.h: Use #if instead of #ifdef to check HAVE_ARCH_OLD_MMAP.
	* mem.c: Use #if instead of #ifdef to check HAVE_ARCH_OLD_MMAP
	and HAVE_ARCH_OLD_MMAP_PGOFF
	* pathtrace.c: Likewise.

2018-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	Rename arch-specific arch_defs.h files to arch_defs_.h.
	Introduce a new arch_defs.h header that includes the corresponding
	arch-specific arch_defs_.h file followed by generic arch_defs_.h file.

	* linux/arch_defs.h: Rename to linux/arch_defs_.h.
	* linux/aarch64/arch_defs.h: Rename to linux/aarch64/arch_defs_.h.
	* linux/arm/arch_defs.h: Rename to linux/arm/arch_defs_.h.
	* linux/i386/arch_defs.h: Rename to linux/i386/arch_defs_.h.
	* linux/m68k/arch_defs.h: Rename to linux/m68k/arch_defs_.h.
	* linux/s390/arch_defs.h: Rename to linux/s390/arch_defs_.h.
	* linux/s390x/arch_defs.h: Rename to linux/s390x/arch_defs_.h.
	* linux/x32/arch_defs.h: Rename to linux/x32/arch_defs_.h.
	* linux/x86_64/arch_defs.h: Rename to linux/x86_64/arch_defs_.h.
	* arch_defs.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	(EXTRA_DIST): Rename linux/*/arch_defs.h to linux/*/arch_defs_.h.

2018-01-19  Dmitry V. Levin  <ldv@altlinux.org>

	Fix ANY_WORDSIZE_LESS_THAN_KERNEL_LONG definition.
	* defs.h (ANY_WORDSIZE_LESS_THAN_KERNEL_LONG): Rewrite without undefined
	behaviour.

	Fixes: f916793 ("Introduce ANY_WORDSIZE_LESS_THAN_KERNEL_LONG macro")

2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: return string size in printstr.
	As umovestr now returns something useful, let's propagate it further.

	* defs.h (printstr_ex, printpathn, printpath): Change return type from
	void to int.
	(printstrn, printstr): Change return type from void to int, return
	printstr_ex result.
	* util.c (printpathn): Return -1 on NULL addr, nul_seen (exit code of
	umovestr) on success.
	(printpath): Return printpathn result.
	(printstr_ex): Return -1 on NULL addr, umoven/umovestr result otherwise.

2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ucopy: return string size in umovestr.
	We return the size that includes \0 in order to preserve existing
	behaviour (return 0 when \0 haven't been seen, return positive number
	when it has been seen).

	* ucopy.c (umovestr_peekdata, umovestr): Return string length
	including \0 instead of 1 when \0 is found.

2018-01-19  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.awk: avoid redefinition of mpers_ptr_t.
	Older versions of gcc like those found in RHEL6 fail with the following
	diagnostics:

	  In file included from block.c:32:
	  ./mpers-m32/struct_blk_user_trace_setup.h:2: error: redefinition of typedef ‘mpers_ptr_t’
	  mpers_type.h:44: note: previous declaration of ‘mpers_ptr_t’ was here

	* mpers.awk (END): Add #ifndef guard to mpers_ptr_t typedef.
	* mpers_test.sh: Update expected output.

2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add support for --enable-mpers=m32|mx32.
	* configure.ac (AC_ARG_ENABLE([mpers])): Allow m32 and mx32 values
	for --enable-mpers option.
	* m4/mpers.m4 (st_MPERS): Check for personality support if personality
	name is provided as an option.  Fail if the requested personality
	support is not available.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: improve setugid error diagnostics a bit.
	* tests/setugid.c (main): Print unexpected code returned by syscall.

2018-01-19  Dmitry V. Levin  <ldv@altlinux.org>

	v4l2: do not mpersify struct v4l2_create unless it is used by other code
	This fixes build with mpers support on older systems that lack
	definition of struct v4l2_create.

	* v4l2.c: Wrap references to struct v4l2_create with
	[VIDIOC_CREATE_BUFS].

2018-01-18  Dmitry V. Levin  <ldv@altlinux.org>

	btrfs: use uint32_t instead of __u32.
	* btrfs.c (btrfs_ioctl) [!HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE]:
	Replace __u32 with uint32_t.  Remove useless cast.

2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: clarify mpers flags in strace -V output.
	The previous description was a bit dated.

	* strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Remove "no-m32" and
	"no-mx32", describe the situation when some of mpers flags are not
	present in strace -V output.

2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add compat support for s390x.
	By very popular demand.

	While we are here, let's refactor the condition for old_mmap_pgoff into
	an arch-specific one, as it is used more than in one place.

	* NEWS: Mention this.
	* strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Likewise.
	* configure.ac (case "$host_cpu" in) <s390x>: Set arch_m32 to s390, set
	cc_flags_m32 to -m31.
	(st_MPERS([m32])): Add s390x.
	* defs.h [S390X]: Define NEED_UID16_PARSERS.
	* linux/s390/arch_sigreturn.c [!S390_FRAME_PTR] (S390_FRAME_PTR): New
	macro, define to s390_frame_ptr.
	[!SIGNAL_FRAMESIZE] (SIGNAL_FRAMESIZE): New macro, define to
	__SIGNAL_FRAMESIZE.
	[!PTR_TYPE] (PTR_TYPE): New macro, define to unsigned long.
	(arch_sigreturn): Use S390_FRAME_PTR, SIGNAL_FRAMESIZE, and PTR_TYPE
	instead of s390_frame_ptr, __SIGNAL_FRAMESIZE, and pointer-sized type,
	respectively.
	* linux/s390/get_error.c [!ARCH_REGSET] (ARCH_REGSET): New macro, define
	* to s390_regset.
	(get_error): Use it instead of s390_regset.
	* linux/s390/get_scno.c (arch_get_scno): Likewise.
	* linux/s390/get_syscall_args.c (get_syscall_args): Likewise.
	* linux/s390/set_error.c (arch_set_error, arch_set_success): Likewise.
	* linux/s390/set_scno.c (arch_set_scno): Likewise.
	* linux/s390x/arch_regs.c (psw_compat_t, s390_compat_regs,
	s390x_regs_union, s390_frame_ptr, s390x_frame_ptr, s390x_io): New
	variables.
	(s390_regset, s390x_regset, ARCH_REGS_FOR_GETREGSET,
	ARCH_IOVEC_FOR_GETREGSET, ARCH_PC_REG, ARCH_PERSONALITY_0_IOV_SIZE,
	ARCH_PERSONALITY_1_IOV_SIZE): New macros.
	* linux/s390x/arch_regs.h (s390_frame_ptr, s390x_frame_ptr): New
	prototypes.
	* linux/s390x/arch_rt_sigframe.c: Conditionalize on tcp->currpers.
	* linux/s390x/arch_sigreturn.c: Likewise.
	* linux/s390x/get_error.c: Likewise.
	* linux/s390x/get_scno.c: Likewise.
	* linux/s390x/get_syscall_args.c: Likewise.
	* linux/s390x/set_error.c: Likewise.
	* linux/s390x/set_scno.c: Likewise.
	* linux/s390x/errnoent1.h: New file.
	* linux/s390x/ioctls_arch1.h: Likewise.
	* linux/s390x/ioctls_inc1.h: Likewise.
	* linux/s390x/signalent1.h: Likewise.
	* linux/s390x/syscallent1.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add new files added to linux/s390x.
	* supported_personalities.h [S390X] (SUPPORTED_PERSONALITIES): Define
	to 2.
	* tests/strace-V.test: Add s390 to the list of architectures that have
	m32 personality.
	* linux/s390/arch_defs.h (HAVE_ARCH_OLD_MMAP_PGOFF): New macro.
	* linux/s390x/arch_defs.h: Likewise.
	* mem.c: Replace #ifdef S390 with #ifdef HAVE_ARCH_OLD_MMAP_PGOFF.
	* pathtrace.c: Likewise.

2018-01-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.

2018-01-17  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check path tracing of ppoll syscall.
	* tests/ppoll.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/
	is not available.  Add a test call that use PATH_TRACING_FD.
	(main): Conditionalize expected output for those calls
	that do not use PATH_TRACING_FD with [!PATH_TRACING_FD].
	* tests/ppoll-P.c: New file.
	* tests/pure_executables.list: Add ppoll-P.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (ppoll-P): New entry.

	tests: check path tracing of poll syscall.
	* tests/poll.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/
	is not available.  Add tests calls that use PATH_TRACING_FD.
	(main): Conditionalize expected output for those calls
	that do not use PATH_TRACING_FD with [!PATH_TRACING_FD].
	* tests/poll-P.c: New file.
	* tests/pure_executables.list: Add poll-P.
	* tests/.gitignore: Likewise.
	* tests/poll-P.test: New test.
	* tests/Makefile.am (DECODER_TESTS): Add poll-P.test.

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: enable old_mmap-P.test on s390x.
	As s390x is the only 64-bit architecture that has old_mmap,
	the test needs some adjustments there.

	* tests/old_mmap.c: Update condition.
	(main): Change int types to long, extend numerals to 64 bit, change
	printing format qualifiers to corresponding long types.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check path tracing of old mmap syscall.
	* tests/old_mmap.c [!TEST_FD]: Define TEST_FD.
	(main) <args1_c>: Replace 5th argument with TEST_FD.
	(main): Wrap the output for the calls that do not use TEST_FD
	with #ifndef PATH_TRACING.
	* tests/old_mmap-P.c: New file.
	* tests/pure_executables.list: Add old_mmap-P.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in: Add old_mmap-P test.

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Fix pathtrace for old_mmap/old_mmap_pgoff.
	As these system calls have only one argument that points to the
	location in memory containing actual arguments, current path tracing
	implementation is incorrect.  In order to fix this, let's use recently
	introduced fetch_old_mmap_args in order to get actual arguments suitable
	for path matching.

	* pathtrace.c [HAVE_ARCH_OLD_MMAP] <case SEN_old_mmap,
	case SEN_old_mmap_pgoff>: Retrieve actual old_mmap arguments with
	fetch_old_mmap_args, pass the value from the retrieved args if it's
	available.

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Test non-verbose old_mmap output.
	* tests/old_mmap-v-none.c: New file.  Include old_mmap.c.
	* tests/pure_executables.list: Add old_mmap-v-none.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (old_mmap-v-none): New entry.

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mem.c: use runtime check in fetch_old_mmap_args.
	This makes code a bit cleaner and makes it compatible with the upcoming
	s390x compat support.

	* mem.c [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): Replace
	ANY_WORDSIZE_LESS_THAN_KERNEL_LONG check with current_wordsize == 4
	check.

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mem.c: introduce fetch_old_mmap_args.
	Move common old_mmap/old_mmap_pgoff argument fetching code into a
	separate function.

	As it is, it also fixes the case of non-verbose printing of old_mmap
	arguments (see the new test in the next commit).  Also, it is a
	preparation for the fix of path tracing for these syscalls.

	* defs.h [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): New prototype.
	* mem.c [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): New function.
	[HAVE_ARCH_OLD_MMAP] (old_mmap, old_mmap_pgoff): Use it.

	Fixes: 3db07f11 "Fix old_mmap output when mmap arguments are unfetchable"
	Suggested-by: Dmitry V. Levin <ldv@altlinux.org>

2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Introduce arch-specific define HAVE_ARCH_OLD_MMAP.
	* linux/arch_defs.h: New file.
	* linux/aarch64/arch_defs.h: New file.  Define HAVE_ARCH_OLD_MMAP.
	* linux/arm/arch_defs.h: Likewise.
	* linux/i386/arch_defs.h: Likewise.
	* linux/m68k/arch_defs.h: Likewise.
	* linux/s390/arch_defs.h: Likewise.
	* linux/s390x/arch_defs.h: Likewise.
	* linux/x32/arch_defs.h: Likewise.
	* linux/x86_64/arch_defs.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* defs.h: Include "arch_defs.h"
	* mem.c: Replace condition for SYS_FUNC(old_mmap) with #ifdef
	HAVE_ARCH_OLD_MMAP.

	Suggested-by: Dmitry V. Levin <ldv@altlinux.org>

2018-01-17  Dmitry V. Levin  <ldv@altlinux.org>
	    Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

	tests: improve descriptor set syntax testing.
	* tests/filtering_fd-syntax.test: New file.
	* tests/options-syntax.test: Move descriptor set syntax testing
	to filtering_fd-syntax.test.
	* tests/Makefile.am (MISC_TESTS): Add filtering_fd-syntax.test.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.c: print correct out file name in error messages in case of -ff.
	* strace.c (outf_perror): New function.
	(tvprintf, tprints, flush_tcp_output): Use it.

	aarch64: use ARCH_SET_PERSONALITY_FROM_IOV_SIZE.
	* linux/aarch64/arch_regs.c (ARCH_PERSONALITY_0_IOV_SIZE,
	ARCH_PERSONALITY_1_IOV_SIZE): New macros.
	* linux/aarch64/get_scno.c (arch_get_scno): Do not call
	update_personality as it is handled by the generic get_regs code now.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall.c: add ability to set personality based on GETREGSET iov size.
	Some architectures (aarch64, s390x) use only PTRACE_GETREGSET interface
	and use its size to detect current personality. Let's generalise this
	approach and also avoid subtle errors when we get register but forget to
	update personality, at least for those architectures.

	Note that in order to employ this behaviour, architecture has to use
	PTRACE_GETREGSET exclusively (no HAVE_GETREGS_OLD) and should declare
	appropriate ARCH_PERSONALITY_*_IOV_SIZE macros.

	* syscall.c (get_regs) [ptrace_getregset_or_getregs &&
	!HAVE_GETREGS_OLD]: Call update_personality based on the value returned
	in the iov_len field by PTRACE_GETREGSET.  Warn once if the returned
	iov_len is unknown.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall.c: add sanity check for the target personality number.
	We can never be cautious enough.

	* defs.h (set_personality): Change argument type to unsigned int.
	* syscall.c (set_personality): Change argument type to unsigned int,
	check whether requested personality is sane, die otherwise.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall.c: move current_personality check to set_personality.
	As all the personality-dependent entries are initially in sync, we can
	move the check whether we are setting the same personality as we
	currently are inside set_personality out of update_personality.

	* syscall.c (current_wordsize, current_klongsize): Initialise to 0'th
	personality value in order to make the statement about "all the
	personality-dependent entries are initially in sync" true.
	(set_personality): Check whether requested personality differs from
	current_personality.
	(update_personality): Call set_personality unconditionally.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall.c: always update tcp->currpers in update_personality.
	Sometimes (for example, switching from a process with one personality
	to a process that previously had different personality but returning
	from execve to that same personality into) it is possible that
	current_personality is not changed, but tcp->currpers is different.
	So, let's not return from update_personality and always update
	tcp->currpers if it differs from the target personality.

	* syscall.c (update_personality): Do not exit early if personality ==
	current_personality.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update current_personality on tcb switch.
	* strace.c (set_current_tcp): New function.
	(printleader, droptcb, print_event_exit, next_event, dispatch_event):
	Call set_current_tcp instead of setting current_tcp manually.

2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add support for specifying compiler options for mpers builds.
	Because some architectures are very, very special.

	* configure.ac (cc_flags_m32, cc_flags_mx32): New variables. AC_SUBST
	them.
	* m4/mpers.m4 (MPERS_CFLAGS): Use instead of CFLAG, pushdef as
	$cc_flags_$1.
	Use mpers_name instead of CFLAG in AC_CACHE_CHECK messages.
	Pass MPERS_CFLAGS as the second argument to mpers_test.sh
	* mpers.sh: Add CC_ARCH_FLAGS as the second argument (PARSER_FILE
	is moved to the third one). Do not expect leading dash in ARCH_FLAG
	anymore.
	* mpers_test.sh (mpers_cc_flags): New variable, initialise to the second
	command line argument.
	Pass $mpers_name without leading dash to mpers.sh.
	Pass $mpers_cc_flags as the second argument to mpers.sh ($sample is
	the third argument now).
	* Makefile.am (mpers-m%.stamp:): Pass $(mpers_CC_FLAGS) as the second
	argument to mpers.sh ($$f is now the third argument).
	($(mpers_m32_targets)): Define target variable mpers_CC_FLAGS with the
	value of @cc_flags_m32@
	($(mpers_mx32_targets)): Define target variable mpers_CC_FLAGS with the
	value of @cc_flags_mx32@
	* tests/Makefile.am (MERS_CC_FLAGS): New variable.
	* bootstrap: Append @cc_flags_$1@ to MPERS_CC_FLAGS. Append
	$(MPERS_CC_FLAGS) to ARCH_MFLAGS.

2018-01-16  Dmitry V. Levin  <ldv@altlinux.org>
	    Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

	tests: improve syscall set syntax testing.
	* tests/filtering_syscall-syntax.test: New file.
	* tests/options-syntax.test: Move syscall set syntax testing
	to filtering_syscall-syntax.test.
	* tests/qual_fault-syntax.test: Likewise.
	* tests/qual_inject-syntax.test: Likewise.
	* tests/Makefile.am (MISC_TESTS): Add filtering_syscall-syntax.test.

2018-01-16  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance error diagnostics about invalid syscalls in fault injection syntax
	Validate syscall set before the whole fault injection syntax.

	* filter_qualify.c (parse_inject_expression): Add const qualifier to
	return type.  Return an empty string when no syscall set is specified.
	(qualify_inject_common): Add const qualifier to "name".  Move
	qualify_syscall_tokens invocation right after parse_inject_expression.
	* tests/qual_fault-syntax.test: Update expected output.
	* tests/qual_inject-syntax.test: Likewise.

2018-01-16  Dmitry V. Levin  <ldv@altlinux.org>

	basic_filters: use loop initial declarations.
	* basic_filters.c (qualify_syscall_number, qualify_syscall_regex,
	lookup_class, qualify_syscall_class, qualify_syscall_tokens,
	qualify_tokens): Use "for" loop initial declarations.

	filter_qualify: use loop initial declarations.
	* filter_qualify.c (sigstr_to_uint, find_errno_by_name,
	parse_inject_expression, qualify_inject_common, qualify): Use "for" loop
	initial declarations.

	configure: try to set the C compiler mode to accept ISO Standard C.
	* configure.ac: Use AC_PROG_CC_STDC.
	* NEWS: Mention this.

2018-01-15  Dmitry V. Levin  <ldv@altlinux.org>

	pathtrace: update the list of unrelated syscalls.
	* pathtrace.c (pathtrace_match_set) <SEN_accept4, SEN_accept,
	SEN_signalfd4, SEN_signalfd>: Skip matching.

	basic_filters: move legacy tracing class names to the end of table.
	* basic_filters.c (lookup_class) <syscall_class>: Move names that do not
	start with % to the end of table.

	Enhance decoding of mq_* syscalls.
	* mq.c (SYS_FUNC(mq_open)): Add RVAL_FD to return value.
	(SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive), SYS_FUNC(mq_notify),
	SYS_FUNC(mq_getsetattr)): Print the first argument using printfd.
	* NEWS: Mention this change.
	* pathtrace.c (pathtrace_match_set) <SEN_mq_getsetattr, SEN_mq_notify,
	SEN_mq_open, SEN_mq_timedreceive, SEN_mq_timedsend>: Skip matching.
	* linux/32/syscallent.h (mq_getsetattr, mq_notify, mq_open,
	mq_timedreceive, mq_timedsend): Add TD flag.
	* linux/64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Enhance error diagnostics about invalid syscalls in fault injection syntax
	* basic_filters.c (qualify_syscall_tokens): Remove "name" argument,
	assume its value is "system call".
	* filter.h (qualify_syscall_tokens): Remove "name" argument.
	All callers updated.
	* tests/qual_fault-syntax.test: Update expected output.

	basic_filters: handle "all" in a more readable way.
	* basic_filters.c (qualify_syscall_tokens, qualify_tokens): Remove
	handle_inversion label, handle "all" by invoking invert_number_set_array
	directly.

	filter: remove redundant braces around single line expressions.
	* basic_filters.c (qualify_syscall_class, qualify_syscall_name):
	Rearrange the inner loop body.
	(qualify_syscall_number, lookup_class, qualify_syscall_tokens,
	qualify_tokens): Remove redundant braces around single line expressions.
	* filter_qualify.c (qualify_inject_common): Likewise.

	filter_qualify: move memory allocation from parse_inject_expression.
	* filter_qualify.c (parse_inject_expression): Replace "s" and "buf"
	arguments with "str" argument, use it instead of "s" and "*buf".
	(qualify_inject_common): Rename "buf" to "copy", initialize it to a copy
	of "str", pass "copy" to parse_inject_expression instead of "str" and
	"buf".

2018-01-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update NT_* constants.
	Update NT_* descriptor types with the values borrowed from
	kernel's include/uapi/linux/elf.h and glibc's elf.h.

	* xlat/nt_descriptor_types.in (NT_PRSTATUS, NT_FPREGSET, NT_PRPSINFO,
	NT_PRXREG, NT_TASKSTRUCT, NT_PLATFORM, NT_AUXV, NT_GWINDOWS, NT_ASRS,
	NT_PSTATUS, NT_PSINFO, NT_PRCRED, NT_UTSNAME, NT_LWPSTATUS,
	NT_LWPSINFO, NT_PRFPXREG, NT_PRXFPREG, NT_PPC_VMX, NT_PPC_SPE,
	NT_PPC_VSX, NT_386_TLS, NT_386_IOPERM, NT_X86_XSTATE): Add fallback
	definitions.
	(NT_SIGINFO, NT_FILE, NT_PPC_*, NT_S390_*, NT_ARM_*, NT_METAG_*,
	NT_ARC_V2): New constants.
	* NEWS: Mention this.

2018-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	configure: use AC_MSG_ERROR and AC_MSG_FAILURE consistently.
	* configure.ac [$arch = mips]: Use AC_MSG_FAILURE instead of
	AC_MSG_ERROR when _MIPS_SIM cannot be determined.  Use AC_MSG_ERROR
	instead of AC_MSG_FAILURE when syscallent stubs cannot be generated.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	configure: add --disable-mpers and --enable-mpers=check options.
	On architectures supporting multiple personalities, multiple
	personalities support in strace is required for proper decoding of
	structures used by tracees with personalities that differ from the
	personality of strace.

	New configure options control whether multiple personalities support
	in strace is mandatory, optional, or disabled.

	The default is changed from what is now equivalent of
	--enable-mpers=check (automatically detect whether required mpers
	support could be enabled) to --enable-mpers (terminate the build
	if required mpers support could not be enabled).

	* configure.ac (AC_ARG_ENABLE([mpers])): New option.
	* m4/mpers.m4 (st_MPERS): Use enable_mpers.  Terminate the build
	if mpers could not be enabled and enable_mpers==yes.
	* strace.spec.in: Specify --enable-mpers=check to %configure.
	* debian/rules (build/Makefile, build64/Makefile): Specify
	--enable-mpers=check to configure.

	Suggested-by: DJ Delorie <dj@redhat.com>

2018-01-11  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v4.15-rc7.
	* linux/32/ioctls_inc_align16.h: Update from linux v4.15-rc7 using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* NEWS: Mention this.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Issue a warning when strace lacks tracee personality support.
	* defs.h (HAVE_PERSONALITY_1_MPERS, HAVE_PERSONALITY_2_MPERS): New
	macros.
	* syscall.c (update_personality): Add need_mpers_warning array
	initialized with mpers support data.  Use it for printing the mpers
	unavailability warning once per personality.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add more checks of reboot syscall decoding.
	In particular, check for the recent fixes in reboot syscall decoder.

	* tests/gen_tests.in (reboot): Provide -s 256 option.
	* tests/reboot.c (STR32, STR128): New macros.
	(main): Add more checks.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: use sprintrc in reboot.test.
	* test/reboot.c (main): Use sprintrc instead of old-style manual
	printing of return code.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	reboot.c: limit printing of the fourth argument to 255 bytes.
	The size of kernel buffer is 256 bytes and the last byte is always zero.

	* reboot.c (SYS_FUNC(reboot)): Replace printstr call with printstr_ex
	with size of 255 and style flag QUOTE_0_TERMINATED.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	reboot.c: use printxval instead of printflags.
	Numeric arguments of reboot syscall are not flags but magic values.

	* reboot.c (SYS_FUNC(reboot)): Replace printflags with printxval.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Search for <libiberty/demangle.h> in addition to <demangle.h>
	This is the location where this header is installed on Debian-based
	systems.

	* configure.ac: Check for libiberty/demangle.h in addition to
	demangle.h.
	* unwind.c [USE_DEMANGLE]: Include either <demangle.h> or
	<libiberty_demangle.h> based on the presence of HAVE_DEMANGLE_H and
	HAVE_LIBIBERTY_DEMANGLE_H macros.

2018-01-11  Dmitry V. Levin  <ldv@altlinux.org>

	strace.1: fix typo.
	* strace.1.in (.SH NOTES): Replace prlimit with prlimit64.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Document multiple personalities support.
	* strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): New section.

	Add indication of mpers support to strace -V output.
	* strace.c (print_version): Append information about m32 and mx32
	decoding support.
	* tests/strace-V.test: Update expected output.

	Provide strace's native arch to the test framework.
	* configure.ac (arch_native): New variable, set to arch.
	* tests/Makefile.am (NATIVE_ARCH): New variable, set to @arch_native@.
	(AM_TEST_LOG_FLAGS): Pass NATIVE_ARCH as STRACE_NATIVE_ARCH environment
	variable.

	Add indication of optional demangle feature strace -V output.
	* strace.c (print_version) [USE_DEMANGLE]: Append " stack-demangle"
	to the features string.
	* tests/strace-V.test: Update expected output.

	configure.ac: check for mpers support on RISC-V.
	* confgure.ac (st_MPERS([m32])): Add riscv.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Use xappendstr instead of xsnprintf where suitable.
	Replace occurrences of

	    outptr += xsnprintf(outptr, sizeof(outstr) - (outptr - outstr), ...)

	with much more sleek

	    outptr = xappendstr(outstr, outptr, ...)

	* desc.c (decode_select): Replace xsnprintf with xappendstr.
	* open.c (sprint_open_modes): Likewise.
	* poll.c (decode_poll_exiting): Likewise.
	* signal.c (sprintsigmask_n): Likewise.
	* xlat.c (sprintflags): Likewise.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xstring.h: add xappendstr.
	Introduce a macro for handling common case of partial writes
	to a character array.

	* xstring.h (get_pos_diff_): New function.
	(xappendstr): New macro.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update perf-related flags.
	 - PERF_SAMPLE_BRANCH_TYPE_SAVE, added in v4.14-rc1~173^2~33^2~6
	 - PERF_SAMPLE_PHYS_ADDR, added in v4.14-rc1~173^2~2

	* xlat/perf_branch_sample_type.in (PERF_SAMPLE_BRANCH_TYPE_SAVE): New
	flag.
	* xlat/perf_event_sample_format.in (PERF_SAMPLE_PHYS_ADDR): Likewise.
	* tests/perf_event_open.c: Update expected output.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	perf.c: add support for struct perf_event_attr.namespaces.
	This field was introduced by linux kernel commit v4.12-rc1~152^2~42^2~10.

	* configure.ac (AC_CHECK_MEMBERS): Add  perf_event_attr.namespaces.
	* perf_event_struct.h (struct perf_event_attr): Add namespaces field.
	* perf.c (print_perf_event_attr): Print namespaces field.
	Update comment for __reserved_1 field.
	* tests/perf_event_open.c (struct pea_flags): Add namespaces field.
	(print_event_attr): Update expected output.

2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of [gs]et_thread_area syscalls on x86.
	* tests/xet_thread_area_x86.c: New file.
	* tests/xet_thread_area_x86.test: New test.
	* tests/Makefile.am (DECODER_TESTS): Add it.
	* tests/.gitignore: Add xet_thread_area_x86.
	* tests/pure_executables.list: Likewise.

2018-01-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of modify_ldt with for 4-byte-available user_desc.
	Since there is possibility now that strace read only entry_number field
	of the user_desc struct, let's check that it doesn't do it with
	modify_ldt syscall.

	* tests/modify_ldt.c (main): Add 4-byte-sized tail_alloc'ed variable.
	Try to provide it as an argument to modify_ldt.

2018-01-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Allow separate printing of struct user_desc.entry_number.
	Kernel reads only entry_number field in the beginning of the
	get_thread_area syscall handler.  Let's replicate this behaviour.

	* defs.h (enum user_desc_print_filter): New enumeration.
	(print_user_desc): Add an argument for signalling which part of the
	structure should be printed.
	* clone.c (print_tls_arg): Update print_user_desc call.
	* ldt.c (print_user_desc): Add filter argument.  Print entry_number on
	entering and the rest on exiting. Store entering value of the
	entry_number field in order to print the updated value in the impossible
	case of changed entry_number value.
	(SYS_FUNC(modify_ldt), SYS_FUNC(set_thread_area)): Update
	print_user_desc call.
	(SYS_FUNC(get_thread_area)): Call print_user_desc with
	USER_DESC_ENTERING format argument on entering and with
	USER_DESC_EXITING on exiting.

2018-01-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: move struct user_desc printing function into a separate file.
	As part of preparation for the introduction of [gs]et_thread_area test.

	* tests/modify_ldt.c (print_user_desc): Move it ...
	* tests/print_user_desc.c: ... to new file.
	* tests/Makefile.am (EXTRA_DIST): Add print_user_desc.c.

2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of modify_ldt syscall.
	* tests/modify_ldt.c: New file.
	* tests/gen_tests.in: Add modify_ldt test.
	* tests/pure_executables.list: Add modify_ldt.
	* tests/.gitignore: Likewise.

	ldt.c: manually set modify_ldt's error code.
	* ldt.c (modify_ldt): Move parsing under entering(tcp). Check whether
	return code is erroneous and set tcp->u_error appropriately along with
	RVAL_PRINT_ERR_VAL flag.

2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall.c: add support for printing return value and error code.
	Some weird syscalls (like modify_ldt) return value that doesn't indicate
	an error (less than -4096), but it is, in fact, erroneous (because they
	decide to clip the return value to 32-bit, for example).

	Add a flag to print decoded error code along with syscall return value.

	* defs.h (RVAL_PRINT_ERR_VAL): New rval flag.
	* syscall.c (syscall_exiting_trace): Handle it.

2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ldt.c: print the first argument of modify_ldt as int.
	* ldt.c (SYS_FUNC(modify_ldt)): Print the first argument as %d.

	ldt.c: print lm field for 64-bit tracees.
	* configure.ac (AC_CHECK_MEMBERS): Add struct user_desc.lm.
	* ldt.c (print_user_desc) [HAVE_STRUCT_USER_DESC_LM]: Print lm field
	for non-compat tracees (it is ignored for compat ones).

2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ldt.c: make struct user_desc output more structured.
	Also, while we are here, let's fix print qualifiers (which should be %u
	and not %d).

	* ldt.c (print_user_desc): Use PRINT_FIELD_* macros for printing
	structure.
	(SYS_FUNC(set_thread_area)): Change field key-value separator from ":"
	to "=", change print format qualifier from %d to %u.

2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_fields.h: add PRINT_FIELD_U_CAST.
	Add a macro for printing fields explicitly casted to specific type.
	This is useful for bit fields, as otherwise the magic of *_extend_to_*
	macros breaks.

	* print_field.h (PRINT_FIELD_U_CAST): New macro.

2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_fields.h: rename PRINT_FIELD_UID to PRINT_FIELD_ID.
	As uid is not the only thing that has a special treatment of the -1
	value (and, as a result, needs special care), let's rename
	PRINT_FIELD_UID to PRINT_FIELD_ID and make PRINT_FIELD_UID its alias.

	* print_fields.h (PRINT_FIELD_ID): Rename from PRINT_FIELD_UID.
	(PRINT_FIELD_UID): Define to PRINT_FIELD_ID.

2018-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build on systems without linux/genetlink.h.
	* socketutils.c [!HAVE_LINUX_GENETLINK_H] (genl_families_xlat): Add
	tcp argument.

	Fixes: v4.20-134-gc46fefc ("Add tcp arguments to netlink calls")

2018-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count.c: whitespace.

	count.c: cleanup types and sizeof usage.
	* count.c (call_summary_pers): Change the type of sorted_count
	to "unsigned int *".  Replace sizeof(int) with  sizeof(sorted_count[0]).
	Change the type of idx to unsigned int.

2018-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count.c: collect definitions of format strings in one place.
	In an attempt to make it more readable.

	* count.c (call_summary_pers): Put all format strings in static
	constants. Use them.

2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>

	Add tcp arguments to netlink calls.
	Since they call tracee-specific socket/sendmsg/recvmsg, we'd like to
	pass tcp there.

	* defs.h (genl_families_xlat): Add tcp argument.
	* netlink.c (decode_nlmsg_type_default, decode_nlmsg_type_generic,
	decode_nlmsg_type_netfilter, typedef nlmsg_types_decoder_t): Likewise.
	(decode_nlmsg_type): Add tcp argument. Pass tcp to decoder call.
	(print_nlmsghdr): Pass tcp to the decode_nlmsg_type call.
	* socketutils.c (send_query, receive_responses): Add tcp argument.
	(inet_send_query, unix_send_query, netlink_send_query, ): Add tcp argument.
	Pass tcp to the send_query call.
	(unix_get): Add tcp argument. Pass tcp to the unix_send_query and
	receive_responses calls.
	(inet_get): Add tcp argument. Pass tcp to the inet_send_query and
	receive_responses calls.
	(tcp_v4_get, udp_v4_get, tcp_v6_get, udp_v6_get): Add tcp argument. Pass
	tcp to the inet_get call.
	(netlink_get): Add tcp argument. Pass tcp to the netlink_send_query and
	receive_responses calls.
	(protocols): Add tcp argument to the get field.
	(get_sockaddr_by_inode_uncached): Add tcp argument. Pass tcp to
	the protocols[].get calls.
	(print_sockaddr_by_inode_uncached): Add tcp argument. Pass tcp to
	the get_sockaddr_by_inode_uncached call.
	(get_sockaddr_by_inode): Pass tcp to the get_sockaddr_by_inode_uncached
	call.
	(print_sockaddr_by_inode): Pass tcp to the
	print_sockaddr_by_inode_uncached call.
	(genl_send_dump_families): Add tcp argument. Pass tcp to the send_query
	call.
	(genl_families_xlat): Add tcp argument. Pass tcp to the
	genl_send_dump_families and receive_responses calls.

2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>

	Add tcp argument to clear_regs.
	* defs.h (clear_regs): Add argument struct tcb *tcp.
	* syscall.c (clear_regs): Likewise.
	* strace.c (next_event): Pass tcp to clear_regs() call.

2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>

	Pass tcp argument to get_optmem_max/read_int_from_file.
	In preparation to passing tcp to all tracee-related syscalls.

	* defs.h (read_int_from_file): Add "struct tcb *" as the first argument.
	* util.c (read_int_from_file): Likewise.
	* msghdr.c (get_optmem_max): Add "struct tcb *tcp" as the first
	argument, pass it to read_int_from_file call.
	(decode_msg_control): Pass tcp to get_optmem_max.

2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>

	Include paths.h if it is available.
	Use the OS definition of _PATH_BSHELL macro if it is available.

	* configure.ac (AC_CHECK_HEADERS): Add paths.h.
	* strace.c [HAVE_PATHS_H]: Include paths.h.

2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>

	strace.c: avoid duplication of a format string in attach_tcb.
	* strace.c (attach_tcb): Add task_path variable with the output format.
	Use it for the procdir declaration and xsprintf format string argument.

2018-01-07  Elvira Khabirova  <lineprinter@altlinux.org>

	Move syscall_tampered to defs.h.
	* syscall.c (syscall_tampered): Move ...
	* defs.h: ... here.

2018-01-07  Elvira Khabirova  <lineprinter@altlinux.org>

	strace.c: rename set_sigaction to set_sighandler.
	Since set_sigaction() actually specifies sa_handler and not sa_sigaction,
	rename set_sigaction() to set_sighandler() for future definition of
	set_sigaction() function as specifying sa_sigaction.

	* strace.c (set_sigaction): Rename to set_sighandler.
	All callers updated.

2018-01-07  Elvira Khabirova  <lineprinter@altlinux.org>

	.gitignore: ignore "gnu" directory created by st_MPERS m4 macro.

	Update .mailmap.
	* .mailmap (Elvira Khabirova): Add @altlinux.org.

2018-01-07  Chen Jingpiao  <chenjingpiao@gmail.com>

	.mailmap: add canonical name for Chen Jingpiao.
	* .mailmap: Add canonical name for Chen Jingpiao.

2018-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	personality.c: use sprintxval.
	* personality.c (SYS_FUNC(personality)): Use sprintxval instead of local
	implementation.

2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>

	xlat.c: add sprintxval for printing xval to string.
	* defs.h (sprintxval): New declaration.
	(sprintxval): New function.

2018-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	desc.c: use xsnprintf instead of sprintf.
	* desc.c: Include "xstring.h".
	(decode_select): Replace sprintf with xsnprintf.

	xlat.c: use xsnprintf instead of sprintf.
	* xlat.c: Include "xstring.h".
	(sprintflags): Replace sprintf with xsnprintf.

	open.c: use xsnprintf instead of sprintf.
	* open.c: Include "xstring.h".
	(sprint_open_modes): Replace sprintf with xsnprintf.

	poll.c: use xs*printf instead of sprintf.
	* poll.c: Include "xstring.h".
	(decode_poll_exiting): Replace sprintf with xsnprintf and xsprintf.

	signal.c: use xs*printf instead of sprintf.
	* signal.c: Include "xstring.h".
	(signame): Replace sprintf with xsprintf.
	(sprintsigmask_n): Replace sprintf with xsnprintf.

	print_timeval.c: use xsprintf instead of snprintf.
	* print_timeval.c: Include "xstring.h".
	(sprint_timeval, sprint_timeval32): Replace snprintf with xsprintf.

	print_timespec.c: use xsprintf instead of snprintf.
	* print_timespec.c: Include "xstring.h".
	(sprint_timespec): Replace snprintf with xsprintf.

	mmsghdr.c: use xsprintf instead of snprintf.
	* mmsghdr.c: Include "xstring.h".
	(SYS_FUNC(recvmmsg)): Replace snprintf with xsprintf.

	socketutils.c: use xsprintf instead of snprintf.
	* socketutils.c: Include "xstring.h".
	(unix_parse_response): Replace snprintf with xsprintf.

	alpha.c: use xsprintf instead of snprintf.
	* alpha.c: Include "xstring.h".
	(decode_getxxid): Replace snprintf with xsprintf.

	v4l2.c: use xsprintf instead of sprintf.
	* v4l2.c: Include "xstring.h".
	(print_v4l2_create_buffers): Replace sprintf with xsprintf.

	util.c: use x*sprintf instead of s*printf.
	* util.c: Include "xstring.h".
	(sprinttime_ex): Replace snprintf with xsnprintf.
	(getfdproto): Replace sprintf with xsprintf.

	unwind.c: use xsprintf instead of sprintf.
	* unwind.c: Include "xstring.h".
	(build_mmap_cache): Replace sprintf with xsprintf.

	syscall.c: use xsprintf instead of sprintf.
	* syscall.c: Include "xstring.h".
	(get_scno): Replace sprintf with xsprintf.

	resource.c: use xsprintf instead of sprintf.
	* resource.c: Include "xstring.h".
	(sprint_rlim64, sprint_rlim32): Replace sprintf with xsprintf.

	pathtrace.c: use xsprintf instead of sprintf.
	* pathtrace.c: Include "xstring.h".
	(getfdpath): Replace sprintf with xsprintf.

2018-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ldt.c: replace sprintf with xsprintf.
	* ldt.c: Include "xstring.h".
	(SYS_FUNC(set_thread_area)): Replace sprintf with xsprintf.

2018-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	strace.c: use xsprintf instead of sprintf.
	* strace.c: Include "xstring.h".
	(strerror, newoutf, attach_tcb, print_debug_info): Replace sprintf
	with xsprintf.

2018-01-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ioprio.c: use xsprintf instead of sprintf.
	* ioprio.c: Include "xstring.h".
	(sprint_ioprio): Replace sprintf with xsprintf.

2018-01-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Introduce hardened xsprintf/xsnprintf macros.
	Let's try to future/fool-proof code a bit by introducing variants
	of sprintf/snprintf that die if an overflow (or an error) occurs.
	They are deemed to be the default choice for printing to some local
	string buffer where no sensible error handling is implemented.

	* xstring.h: New file.
	* Makefile.am (strace_SOURCES): Add it.

2018-01-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count.c: use %9.u conversion specification.
	Instead of printing to a temporary string.  This also fixes a subtle bug
	when the output for a billion errors and more is cut and shown
	incorrectly.

	* count.c (struct call_counts): Change type of calls and errors fields
	to unsigned int since they are used and printed as unsigned anyway.
	(call_summary_pers): Remove error_str.  Print cc->errors
	and error_cum using %9.u conversion specification.

2018-01-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	count.c: use personality_names in call_summary report caption.
	Otherwise the title is quite misleading for x32 personality.

	* count.c (call_summary): Use personality_names.

2018-01-05  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

	Move personality names to a global variable.
	This is a part of "Prepare for adding support for Lua scripting"
	commit.

	* defs.h (personality_names): New external constant declaration.
	* syscall.c: (personality_names): New global variable.
	(update_personality): Use personality_names for reporting personality
	name.

	Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2018-01-04  Lubomir Rintel  <lkundrak@v3.sk>

	strace.spec.in: include Bluetooth headers for AF_BLUETOOTH sockets decoding
	* strace.spec.in (BuildRequires): Add pkgconfig(bluez).

2018-01-04  Dmitry V. Levin  <ldv@altlinux.org>

	Lift artificial limit on output file names in -ff mode.
	Starting with commit v4.5.19~88 strace imposed an artificial limit
	on output file names in -ff mode, leading to the following absurd
	behaviour:

	$ strace -ff -o"$(perl -e 'print "/" x 510')/$PWD/log" /bin/true
	strace: Can't fopen '////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////.12345': Permission denied

	* strace.c (newoutf): Raise buffer size to PATH_MAX.
	(init) <followfork >= 2>: Check output file name prefix length.
	* tests/options-syntax.test: Check it.

2018-01-04  Dmitry V. Levin  <ldv@altlinux.org>

	configure.ac: fix typo.
	* configure.ac: Replace CPPFALGS with CPPFLAGS.

	Fixes: v4.20-85-gf9c8e8a ("unwind: demangle symbol names")

2018-01-03  Eugene Syromiatnikov  <esyr@redhat.com>

	Change the first argument of upeek from pid to tcp.
	All users were changed automatically by:

		for i in `git grep -l 'upeek(tcp->pid'`; do \
			sed -i 's/upeek(tcp->pid/upeek(tcp/g' "$i"; \
		done

	* upeek.c (upeek): Change the first argument from pid_t pid to struct
	tcb *tcp. Use tcp->pid instead of pid in the function's body.
	* defs.h (upeek): Update declaration.
	* linux/alpha/arch_getrval2.c: Pass tcp instead of tcp->pid to the
	upeek calls.
	* linux/alpha/arch_rt_sigframe.c: Likewise.
	* linux/alpha/arch_sigreturn.c: Likewise.
	* linux/alpha/get_scno.c: Likewise.
	* linux/alpha/get_syscall_args.c: Likewise.
	* linux/alpha/get_syscall_result.c: Likewise.
	* linux/bfin/arch_rt_sigframe.c: Likewise.
	* linux/bfin/get_scno.c: Likewise.
	* linux/bfin/get_syscall_args.c: Likewise.
	* linux/bfin/get_syscall_result.c: Likewise.
	* linux/crisv10/arch_rt_sigframe.c: Likewise.
	* linux/crisv10/get_scno.c: Likewise.
	* linux/crisv10/get_syscall_args.c: Likewise.
	* linux/crisv10/get_syscall_result.c: Likewise.
	* linux/hppa/arch_rt_sigframe.c: Likewise.
	* linux/hppa/get_scno.c: Likewise.
	* linux/hppa/get_syscall_args.c: Likewise.
	* linux/hppa/get_syscall_result.c: Likewise.
	* linux/microblaze/arch_rt_sigframe.c: Likewise.
	* linux/microblaze/arch_sigreturn.c: Likewise.
	* linux/microblaze/get_scno.c: Likewise.
	* linux/microblaze/get_syscall_args.c: Likewise.
	* linux/microblaze/get_syscall_result.c: Likewise.
	* linux/powerpc/getregs_old.c: Likewise.
	* linux/sh/arch_getrval2.c: Likewise.
	* linux/sh/arch_rt_sigframe.c: Likewise.
	* linux/sh/get_scno.c: Likewise.
	* linux/sh/get_syscall_args.c: Likewise.
	* linux/sh/get_syscall_result.c: Likewise.
	* linux/sh64/get_scno.c: Likewise.
	* linux/sh64/get_syscall_args.c: Likewise.
	* linux/sh64/get_syscall_result.c: Likewise.
	* linux/xtensa/arch_rt_sigframe.c: Likewise.
	* linux/xtensa/get_scno.c: Likewise.
	* linux/xtensa/get_syscall_args.c: Likewise.
	* linux/xtensa/get_syscall_result.c: Likewise.
	* syscall.c: Likewise.

2018-01-03  Eugene Syromiatnikov  <esyr@redhat.com>

	Change argument of getregs_old from pid to tcp.
	* linux/powerpc/getregs_old.c (getregs_old): Change the first argument
	from pid_t pid to struct tcb *tcp. Replace all instances of pid with
	tcp->pid.
	* linux/x86_64/getregs_old.c (getregs_old): Likewise.
	* linux/x86_64/getregs_old.h (getregs_old): Update declaration.
	* syscall.c (get_regs) [HAVE_GETREGS_OLD]: Pass tcp to the getregs_old
	call instead of tcp->pid.

2018-01-03  Eugene Syromiatnikov  <esyr@redhat.com>

	Change the first argument of upoke from pid to tcp.
	Users were updated automatically by:

		for i in `git grep -l 'upoke(tcp->pid'`; do \
			sed -i 's/upoke(tcp->pid/upoke(tcp/g' "$i"; \
		done

	* upoke.c (upoke): Change the first argument from pid_t pid to struct
	tcb *tcp. Use tcp->pid instead of pid in the function's body.
	* defs.h (upoke): Update declaration.
	* linux/alpha/set_error.c (arch_set_error, arch_set_success): Provide
	tcp in the first argument of the upoke call instead of tcp->pid.
	* linux/alpha/set_scno.c (arch_set_scno): Likewise.
	* linux/bfin/set_error.c (arch_set_error, arch_set_success): Likewise.
	* linux/bfin/set_scno.c (arch_set_scno): Likewise.
	* linux/crisv10/set_error.c (arch_set_error, arch_set_success):
	Likewise.
	* linux/crisv10/set_scno.c (arch_set_scno): Likewise.
	* linux/hppa/set_error.c (arch_set_error, arch_set_success): Likewise.
	* linux/hppa/set_scno.c (arch_set_scno): Likewise.
	* linux/i386/set_error.c (arch_set_error, arch_set_success): Likewise.
	* linux/i386/set_scno.c (arch_set_scno): Likewise.
	* linux/microblaze/set_error.c (arch_set_error, arch_set_success):
	Likewise.
	* linux/microblaze/set_scno.c (arch_set_scno): Likewise.
	* linux/powerpc/set_error.c (arch_set_error, arch_set_success):
	Likewise.
	* linux/powerpc/set_scno.c (arch_set_scno): Likewise.
	* linux/sh/set_error.c (arch_set_error, arch_set_success): Likewise.
	* linux/sh/set_scno.c (arch_set_scno): Likewise.
	* linux/sh64/set_error.c (arch_set_error, arch_set_success): Likewise.
	* linux/sh64/set_scno.c (arch_set_scno): Likewise.
	* linux/x86_64/set_error.c (arch_set_error, arch_set_success): Likewise.
	* linux/x86_64/set_scno.c (arch_set_scno): Likewise.
	* linux/xtensa/set_error.c (arch_set_error, arch_set_success): Likewise.
	* linux/xtensa/set_scno.c (arch_set_scno): Likewise.

2018-01-03  Eugene Syromiatnikov  <esyr@redhat.com>

	Move enum trace_event into a separate header.
	As it will have users outside strace.c in the future.

	* trace_event.h (enum trace_event): Move it from...
	* strace.c (enum trace_event): ...here.
	(#include "trace_event.h"): New header, for enum trace_event.
	* Makefile.am (strace_SOURCES): Add trace_event.h.

2018-01-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Call get_scno during startup_tcb only for forcibly attached processes.
	Otherwise it makes little sense on most arches to try to get syscall
	number.

	* defs.h (TCB_GRABBED): New tcb flag.
	* strace.c (attach_tcb): Set TCB_GRABBED for the tcb.
	(startup_tcb): Call get_scno() only if process is grabbed and its
	registers may contain syscall number information.

	Reported-by: Dmitry V. Levin <ldv@altlinux.org>
	Closes: https://github.com/strace/strace/issues/22

2018-01-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.c: sort getopt switch branches alphabetically.
	There's no reason to have them out of order. This also (almost) matches
	their order in the getopt call argument, introduced in
	v4.20-64-g61c03be.

	* strace.c (init): Sort branches in the getopt switch routine.

2018-01-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.c: check for (non)zero argc instead of argv[0]
	Since we can never be sure that we have NULL behind the last entry of
	the argv array.

	* strace.c (init): Check for non-zero argc before/instead of argv[0].

2018-01-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1: advertise strace-log-merge.
	In order to raise awareness about strace-log-merge, mention it in
	SEE ALSO section and -ff option description.

	* strace.1.in (.SS Filtering) <.TP .B \-ff>: Mention strace-log-merge.
	(.SH "SEE ALSO"): Likewise.

2017-12-29  Dmitry V. Levin  <ldv@altlinux.org>

	unwind: demangle function arguments.
	* unwind.c (print_stack_frame): Specify demangling style.
	* tests/strace-k.test (result): Update regexp.
	* tests/strace-k-demangle.test (expected): Update expected output.

	tests: check strace -k symbol names demangling.
	* tests/strace-k-demangle.test: New test.
	* tests/stack-fcall-mangled.c: New file.
	* tests/stack-fcall-mangled-0.c: Likewise.
	* tests/stack-fcall-mangled-1.c: Likewise.
	* tests/stack-fcall-mangled-2.c: Likewise.
	* tests/stack-fcall-mangled-3.c: Likewise.
	* tests/stack-fcall.h [MANGLE] (f0, f1, f2, f3): New macros.
	* tests/.gitignore: Add stack-fcall-mangled.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(stack_fcall_mangled_SOURCES): New variable.
	(EXTRA_DIST): Add strace-k-demangle.test.
	[USE_LIBUNWIND && USE_DEMANGLE] (LIBUNWIND_TESTS): Likewise.

2017-12-29  Dmitry V. Levin  <ldv@altlinux.org>

	tests: parametrize strace-k.test.
	Prepare for the check of strace -k symbol names demangling.

	* tests/strace-k.test: Parametrize $test_prog and $expected.
	* tests/stack-fcall.h: New file.
	* tests/stack-fcall.c: Include "stack-fcall.h"
	* tests/stack-fcall-0.c: Likewise.
	* tests/stack-fcall-1.c: Likewise.
	* tests/stack-fcall-2.c: Likewise.
	* tests/stack-fcall-3.c: Likewise.
	* tests/Makefile.am (EXTRA_DIST): Add stack-fcall.h.

2017-12-26  Masatake YAMATO  <yamato@redhat.com>

	unwind: demangle symbol names.
	Implement demangling of C++ symbol names in stack trace
	using cplus_demangle function from GNU libiberty library.

	This is an example demangled stack trace output:

	fstat(5, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
	 > /usr/lib64/libc-2.25.so(__fxstat64+0x12) [0xffd62]
	 > /usr/lib64/libc-2.25.so(_IO_file_doallocate+0x5f) [0x717ff]
	 > /usr/lib64/libc-2.25.so(_IO_doallocbuf+0x79) [0x81699]
	 > /usr/lib64/libc-2.25.so(_IO_file_overflow+0x198) [0x807b8]
	 > /usr/lib64/libc-2.25.so(_IO_file_xsputn+0xbd) [0x7ed5d]
	 > /usr/lib64/libc-2.25.so(fwrite_unlocked+0x60) [0x7d800]
	 > /usr/lib64/libleveldb.so.1.18(leveldb::EnvWrapper::StartThread+0x3b6) [0x48656]
	 > /usr/lib64/libleveldb.so.1.18(leveldb::log::Writer::EmitPhysicalRecord+0x89) [0x28bc9]
	 > /usr/lib64/libleveldb.so.1.18(leveldb::log::Writer::AddRecord+0x9e) [0x28d9e]
	 > /usr/lib64/libleveldb.so.1.18(leveldb::DBImpl::Write+0x208) [0x1ce18]
	 > /usr/lib64/libleveldb.so.1.18(leveldb::DB::Put+0x59) [0x192b9]
	 > /usr/lib64/libleveldb.so.1.18(leveldb::DBImpl::Put+0x1d) [0x1931d]
	 > /home/yamato/var/leveldb/doc/a.out(main+0x120) [0x1107]
	 > /usr/lib64/libc-2.25.so(__libc_start_main+0xea) [0x2088a]
	 > /home/yamato/var/leveldb/doc/a.out(_start+0x2a) [0xf3a]

	* Makefile.am [USE_DEMANGLE] (strace_CPPFLAGS, strace_LDFLAGS,
	libiberty_LDADD): Append libiberty_CPPFLAGS, strace_LDFLAGS, and
	libiberty_LIBS, respectively.
	* configure.ac: Add --with-libiberty option.  Check cplus_demangle
	support in libiberty.
	* unwind.c [USE_DEMANGLE]: Include <demangle.h>.
	(print_stack_frame) [USE_DEMANGLE]: Use cplus_demangle.

2017-12-26  Masatake YAMATO  <yamato@redhat.com>

	Define macros for renaming xmalloc and xcalloc.
	I'm planning to link strace with libiberty for mangling C++
	symbol names in stack trace enabled with -k option.

	Both names, xmalloc and xcalloc, are already defined and used
	in libiberty, and they conflict with functions in strace.
	Rename xmalloc and xcalloc functions defined in strace
	to strace_xmalloc and strace_xcalloc, respectively,
	to avoid this conflict.

	* xmalloc.h (xcalloc, xmalloc): New macros.

2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>

	syscall: move a sparc specific include to an arch specific file.
	* syscall.c [SPARC64]: Do not include <asm/psrcompat.h>.
	[SPARC]: Do not include <asm/psr.h>.
	* linux/sparc/get_error.c: Include <asm/psr.h>.

	syscall: move all ia64 specific includes to an arch specific file.
	* syscall.c [IA64]: Remove.
	* linux/ia64/get_syscall_args.c: Include <asm/rse.h>.

	syscall: simplify get_syscall_result.
	* syscall.c [ptrace_getregset_or_getregs] (get_syscall_result_regs):
	Define to get_regs.
	(get_syscall_result): Use get_syscall_result_regs unconditionally.

2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>

	syscall: change get_regs argument type.
	This opens the way for future changes related to get_regs.

	* syscall.c (get_regs): Change argument type from "pid_t"
	to "struct tcb *", all callers changed.

2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>

	syscall: move get_regs call from syscall_exiting_decode to get_syscall_result
	This make the code less confusing and opens the way for future changes
	related to get_regs.

	* syscall.c (syscall_exiting_decode): Move get_regs invocation ...
	(get_syscall_result) [ptrace_getregset_or_getregs]: ... here.

2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>

	syscall: rework subcall decoding on mips o32.
	Move syscall subcall handling to the same switch statement that
	handles ipc and socket subcalls.

	* linux/mips/syscallent-o32.h [LINUX_MIPSO32] (SYS_syscall_subcall):
	Define.
	* syscall.c (decode_mips_subcall): Rename to decode_syscall_subcall,
	conditionalize on SYS_syscall_subcall instead of LINUX_MIPSO32.
	(syscall_entering_decode) [LINUX_MIPSO32]: Remove.
	(syscall_entering_decode) [SYS_syscall_subcall]: Handle SEN_syscall
	using decode_syscall_subcall.

2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>

	syscall: tweak shuffle_scno ifdefery.
	* syscall.c (shuffle_scno): Check for ARM_FIRST_SHUFFLED_SYSCALL
	instead of ARM || AARCH64.  This does not result to any code change
	but looks more comprehensible.

	syscall: change get_regs to return an error code.
	* syscall.c (get_regs_error) [!ptrace_getregset_or_getregs]: Do not
	define.
	(clear_regs) [!ptrace_getregset_or_getregs]: Do not set get_regs_error.
	(get_regs) [ptrace_getregset_or_getregs]: Return get_regs_error, all
	callers changed to test get_regs return code instead of get_regs_error
	static variable, which is now internally used by get_regs() and
	clear_regs() only.
	(USE_GET_SYSCALL_RESULT_REGS): Do not define.
	Use "#ifndef ptrace_getregset_or_getregs"
	instead of "#ifdef USE_GET_SYSCALL_RESULT_REGS".

2017-12-24  Harsha Sharma  <harshasharmaiitr@gmail.com>

	tests: enhance run.sh usage error diagnostics.
	* tests/run.sh: Execute timeout command only when invoked with
	an argument, otherwise print an error message.

2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip nsyscalls-d.test on mips o32.
	On mips o32, nsyscalls test is implemented using syscall #4000,
	so nsyscalls-d cannot work there.

	* tests/nsyscalls-d.test: Skip on mips o32.

2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	Remove linux/ptp_clock.h.
	As linux kernel provides a compatible linux/ptp_clock.h header since
	commit v3.8-rc1~139^2~514, there is no need for a local copy.

	* linux/ptp_clock.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* configure.ac (AC_CHECK_TYPES): Check for struct ptp_sys_offset
	in <linux/ptp_clock.h>.
	* ioctl.c (ioctl_decode) <case '='>: Conditionalize
	on [HAVE_STRUCT_PTP_SYS_OFFSET].
	* ptp.c: Likewise.

2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	Remove linux/ubi-user.h.
	As linux kernel provides a compatible mtd/ubi-user.h header since
	commit v3.7-rc1~85^2~17, there is no need for a local copy.

	* linux/ubi-user.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* configure.ac (AC_CHECK_MEMBERS): Check
	for struct ubi_attach_req.max_beb_per1024 in <mtd/ubi-user.h>.
	* ioctl.c (ioctl_decode) <case 'o', case 'O'>: Conditionalize
	on HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024.
	* ubi.c: Likewise.

2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	Remove linux/mtd-abi.h.
	As linux kernel provides a compatible mtd/mtd-abi.h header since
	commit v3.2-rc1~14^2~33, there is no need for a local copy.

	* linux/mtd-abi.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* configure.ac (AC_CHECK_TYPES): Check for struct mtd_write_req
	in <mtd/mtd-abi.h>.
	* ioctl.c (ioctl_decode) <case 'M'>: Conditionalize
	on [HAVE_STRUCT_MTD_WRITE_REQ].
	* mtd.c: Likewise.
	* tests/ioctl_mtd.c: Likewise.
	* tests/ioctl.c (main): Likewise.

2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	Remove linux/personality.h.
	* linux/personality.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* personality.c: Do not include <linux/personality.h>, include
	"xlat/personality_flags.h" before "xlat/personality_types.h".
	* xlat/personality_flags.in: Provide fallback definitions.
	* xlat/personality_types.in: Likewise.

2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	travis: switch from clang-3.8 to clang.
	As travis provides a relatively fresh clang by default nowadays,
	it makes sense to use default clang in clang-based test builds.

	* .travis.yml (matrix): Change clang-3.8 to clang.

2017-12-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1.in: mention perf and ftrace in SEE ALSO.
	* strace.1.in (.SH SEE ALSO): Add references to perf-trace(1) and
	trace-cmd(1).

	strace.1.in: clarify -F option behaviour.
	* strace.1.in <.TP \-F>: Extend deprecation warning.  Describe behaviour
	of multiple instances of -F and interoperability of -F and -f.

2017-12-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: consistently use $STRACE_EXE instead of local alternatives.
	* tests/get_regs.test: Replace "${STRACE##* }" with "$STRACE_EXE".
	* tests/options-syntax.test: Replace "$strace_exp" with "$STRACE_EXE".
	* tests/syntax.sh: Likewise.

2017-12-20  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	strace.c: inform the user about -F option obsolescence.
	* strace.c (init): Print an error message if the option is used.

2017-12-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.c: sort option arguments alphabetically.
	Except for the ones that enabled by configure options.

	While we are here, let's also change the indentation of while expression
	continuation in order to separate it from the following switch clause.

	* strace.c (init): Reorder options in getopt() call.

2017-12-20  Eugene Syromiatnikov  <esyr@redhat.com>

	strace.c: use _exit() instead of exit() in child's die()
	Let's keep child's death routine as minimalistic as possible for the
	cases when vfork() is used instead of fork() on systems that lack MMU.

	* strace.c (die) <!(strace_tracer_pid == getpid())>: Call _exit().

2017-12-20  Harsha Sharma  <harshasharmaiitr@gmail.com>

	syscall: replace if (debug_flag) ... with debug_msg macro.
	* syscall.c (get_scno): Use debug_msg instead of
	"if (debug_flag) error_msg".

2017-12-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check (some) debugging output generated during nsyscalls test.
	* tests/nsyscalls-d.c: New file.
	* tests/.gitignore: Add it.
	* tests/nsyscalls-d.test: New test, variant of nsyscalls.test with debug
	output check.
	* tests/nsyscalls-nd.test: Likewise.
	* tests/nsyscalls.c: Add expected debug output.
	* tests/Makefile.am (check_PROGRAMS): Add nsyscalls-d.
	(DECODER_TESTS): Add nsyscalls-d.test and nsyscalls-nd.test.

2017-12-20  Eugene Syromiatnikov  <esyr@redhat.com>

	pathtrace.c: use xgrowarray.
	* defs.h <struct path_set>: Change type of num_selected field to size_t.
	Add size field.
	* pathtrace.c (storepath): Rewrite to utilise xgrowarray.

2017-12-14  Dmitry V. Levin  <ldv@altlinux.org>

	dyxlat: use xgrowarray.
	* dyxlat.c (dyxlat_alloc): Use xgrowarray instead of xcalloc.
	(dyxlat_add_pair): Use xgrowarray instead of xreallocarray.

	unwind: use xgrowarray.
	* unwind.c (get_symbol_name): Use xgrowarray instead of manual
	dynamic array management using xreallocarray.

2017-12-14  Eugene Syromiatnikov  <esyr@redhat.com>

	strace.c: use xgrowarray.
	* strace.c (tcbtabsize): Change type to size_t.
	(expand_tcbtab): Rewrite in order to utilise xgrowarray
	instead of manual dynamic array management.

	unwind: use xgrowarray.
	* unwind.c (build_mmap_cache): Use xgrowarray instead of manual dynamic
	array management.

2017-12-14  Eugene Syromiatnikov  <esyr@redhat.com>

	xmalloc.c: introduce xgrowarray helper function.
	In order to simplify dynamic array management code.

	* xmalloc.h (xgrowarray): New declaration.
	* xmalloc.c (xgrowarray): New function.

2017-12-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check error diagnostics when exec file name is too long.
	* tests/options-syntax.test: Check error diagnostics when
	exec file name length equals to PATH_MAX.

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

	strace.c: minor style fixes.
	* strace.c (test_ptrace_seize): Remove excess braces.
	(init): Wrap overly long string literal.  Add braces
	to the else if branch.

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

	strace.c: use *_func_* message printing macros where appropriate.
	In order to provide some additional bits of information in weird error
	cases or just replace existing usages of __func__/literal function name.

	* strace.c (detach): Use perror_func_msg() instead of perror_msg().
	(startup_attach, open_dummy_desc, startup_child, test_ptrace_seize): Use
	perror_func_msg_and_die() instead of perror_msg_and_die().
	(test_ptrace_seize): Use error_func_msg_and_die() instead of
	error_msg_and_die().

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

	unwind.c: more verbose mapping overlapping diagnostic message.
	* unwind.c (build_mmap_cache): Change error_msg() to debug_msg(), add
	information about region names and the respective start and end
	addresses.

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

	unwind.c: non-fatal handling of asprintf error.
	An error returned by asprintf is a poor excuse for dying.

	* unwind.c (asprintf_error_str): New string constant.
	(sprint_call_or_error): Replace error_msg_and_die() with
	perror_func_msg() and usage of asprintf_error_str for a return value.
	(queue_print): Free tmp->output line only if it is not
	asprintf_error_str.

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

	unwind.c: eliminate DPRINTF.
	Since DPRINTF is simply a macro that provides debugging information
	along with some information about printing routine call site, now standard
	debug_func_* macros are deemed to be a suitable replacement.

	* unwind.c (DPRINTF): Remove.
	(build_mmap_cache, delete_mmap_cache, unwind_cache_invalidate,
	unwind_print_stacktrace, unwind_captiure_stacktrace): Replace
	DPRINTF(fmt, str, ...) with debug_func_msg(fmt, ...)/

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

	strace.c: replace if (debug_flag) ... with suitable debug printing macros
	* strace.c (alloc_tcb, droptcb, detach, attach_tcb, test_ptrace_seize,
	init, startup_tcb): Replace if (debug_flag) error_msg(...) occurrences
	with debug_error_msg(...).
	(attach_tcb): Replace if (debug_flag) perror_msg(...) with
	debug_perror_msg(...).
	(cleanup, startup_tcb): Replace if (debug_flag) error_msg(...)
	occurrences with debug_func_msg() in attempt to provide additional
	information.

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

	error_prints.h: add *_func_* printing macros.
	In order to reduce boilerplate for the cases when __func__ is desired
	to be printed.

	* error_prints.h (error_func_msg, perror_func_msg, debug_func_msg,
	debug_func_perror_msg, error_func_msg_and_die, perror_func_msg_and_die):
	New macro definitions.

2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>

	error_prints.h: add debug print macros.
	* defs.h (debug_flag): Move the declaration...
	* error_prints.h (debug_flag): ... here.
	(debug_msg, debug_perror_msg): New macro definitions.
	Include <stdbool.h> for the debug_flag declaration.

2017-12-04  Masatake YAMATO  <yamato@redhat.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of KVM ioctl commands.
	* tests/ioctl_kvm_run.c: New file.
	* tests/ioctl_kvm_run.test: New test.
	* tests/Makefile.am (DECODER_TESTS): Add ioctl_kvm_run.test.
	* tests/pure_executables.list: Add ioctl_kvm_run.
	* tests/.gitignore: Likewise.

2017-12-04  Masatake YAMATO  <yamato@redhat.com>

	kvm: decode the argument of KVM_{SET, GET}_SREGS ioctl command.
	* configure.ac (AC_CHECK_TYPES): Add struct kvm_sregs.
	* kvm.c [HAVE_STRUCT_KVM_SREGS] (kvm_ioctl_decode_sregs): New function.
	(kvm_ioctl) [HAVE_STRUCT_KVM_SREGS] <KVM_SET_SREGS, KVM_GET_SREGS>:
	Use it.
	* linux/arch_kvm.c (arch_print_kvm_sregs): New function.
	* linux/x86_64/arch_kvm.c (PRINT_FIELD_KVM_SREGS_STRUCT): New macro.
	(kvm_ioctl_decode_regs_dtable, kvm_ioctl_decode_regs_segment,
	arch_print_kvm_sregs): New functions.

	kvm: decode the argument of KVM_{SET, GET}_REGS ioctl command.
	* configure.ac (AC_CHECK_TYPES): Add struct kvm_regs.
	* linux/arck_kvm.c: New file.
	* linux/x86_64/arch_kvm.c: Likewise.
	* linux/i386/arch_kvm.c: Likewise.
	* linux/x32/arch_kvm.c: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* kvm.c: Include "arch_kvm.c".
	[HAVE_STRUCT_KVM_REGS] (kvm_ioctl_decode_regs): New function.
	(kvm_ioctl) [HAVE_STRUCT_KVM_REGS] <KVM_SET_REGS, KVM_GET_REGS>: Use it.

	kvm: decode the argument of KVM_SET_USER_MEMORY_REGION ioctl command.
	* configure.ac (AC_CHECK_TYPES): Add struct kvm_userspace_memory_region.
	* xlat/kvm_mem_flags.in: New file.
	* kvm.c: Include print_fields.h.
	[HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION]: Include xlat/kvm_mem_flags.h,
	(kvm_ioctl_set_user_memory_region): New function.
	(kvm_ioctl) [HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION]
	<KVM_SET_USER_MEMORY_REGION>: Use it.

2017-12-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add strace mascot.
	* strace.svg: New file.

	Co-Authored-by: Vitaly Chaykovsky <mgspeker@gmail.com>

2017-12-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify attach-p-cmd.test against buggy kernels.
	From time to time various kernels, old and new, just go nuts
	and fail attach-p-cmd.test with the following diagnostics:

	 12345 --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
	-12345 chdir("attach-p-cmd.test -p") = -1 ENOENT (No such file or directory)
	+12345 syscall_4294967295(0xffe60934, 0x1c0, 0xffe60934, 0x1, 0xffe609b4, 0xffe60a58) = -1 (errno 38)
	+12345 chdir("attach-p-cmd.test -p") = -1 ENOSYS (Function not implemented)

	Let's workaround this kernel madness by rewriting the test
	without use of SIGALRM.

	* tests/attach-p-cmd.h: New file.
	* tests/Makefile.am (EXTRA_DIST): Add attach-p-cmd.h.
	* tests/attach-p-cmd-cmd.c: Include "attach-p-cmd.h".
	(write_pidfile, wait_for_peer_invocation): New functions.
	(main): Use them.
	* tests/attach-p-cmd-p.c: Include <time.h> and "attach-p-cmd.h".
	(wait_for_peer_invocation, wait_for_peer_termination): New functions.
	(main): Use them.  Do not raise SIGALRM, use nanosleep after peer
	termination.

2017-12-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify ipc_msgbuf.test against broken libc.
	glibc between commits glibc-2.25~130 and glibc-2.26~740 had broken
	msgctl(IPC_RMID) on hppa: this operation always failed with EINVAL
	because of inappropriate use of IPC_64 flag.  Similar issues were
	fixed on other niche architectures.  Let's workaround these issues
	by skipping the test in case of msgctl(IPC_RMID) failure.

	* tests/ipc_msgbuf.c (cleanup): Change return type to int,
	return 77 in case of msgctl(IPC_RMID) failure.
	(main): Explicitly invoke cleanup() at the end.

2017-12-01  Masatake YAMATO  <yamato@redhat.com>

	kvm: decode the argument of KVM_CREATE_VCPU ioctl command.
	* kvm.c (kvm_ioctl_create_vcpu): New function.
	(kvm_ioctl) <KVM_CREATE_VCPU>: Use it.

	kvm: handle KVM_CREATE_VM ioctl command.
	* kvm.c (kvm_ioctl): Handle KVM_CREATE_VM command.

	kvm: handle KVM_RUN, KVM_GET_VCPU_MMAP_SIZE, and KVM_GET_API_VERSION ioctl commands
	* kvm.c (kvm_ioctl): Handle KVM_RUN, KVM_GET_VCPU_MMAP_SIZE,
	and KVM_GET_API_VERSION commands.

	ioctl: add a stub for decoding kvm related ioctls.
	* kvm.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* configure.ac (AC_CHECK_HEADERS): Add linux/kvm.h.
	* defs.h (kvm_ioctl): New prototype.
	* ioctl.c (ioctl_decode) HAVE_LINUX_KVM_H]: Use kvm_ioctl.

2017-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace-log-merge: work around corner cases of strace -ttt parsing.
	Employing strace -ttt for the logs destined to be fed to
	strace-log-merge is ultimately the best solution except for the logs
	that pass the following dates:

	Thu Jan  1 00:00:09 UTC 1970
	Thu Jan  1 00:01:39 UTC 1970
	Thu Jan  1 00:16:39 UTC 1970
	Thu Jan  1 02:46:39 UTC 1970
	Fri Jan  2 03:46:39 UTC 1970
	Mon Jan 12 13:46:39 UTC 1970
	Sun Apr 26 17:46:39 UTC 1970
	Sat Mar  3 09:46:39 UTC 1973
	Sun Sep  9 01:46:39 UTC 2001
	Sat Nov 20 17:46:39 UTC 2286
	Wed Nov 16 09:46:39 UTC 5138
	Fri Sep 27 01:46:39 UTC 33658
	Sun May 20 17:46:39 UTC 318857
	Sat Nov  7 09:46:39 UTC 3170843
	Sun Jul  5 01:46:39 UTC 31690708
	Sat Jan 25 17:46:39 UTC 316889355

	Let's lift this limitation.

	* strace-log-merge: Generate numeric-only key for sorting, use sort -n
	option.

2017-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	debian: add strace-log-merge to the list of installed files.
	* debian/strace.install: Add strace-log-merge.

	Add strace-log-merge man page.
	* strace-log-merge.1.in: New file.
	* NEWS: Mention this.
	* .gitignore: Add strace-log-merge.1.
	* Makefile.am (man_MANS): Likewise.
	* configure.ac (AC_CONFIG_FILES): Likewise.
	* debian/strace.manpages: Likewise.

	strace-log-merge: add copyright header.

2017-11-29  Dmitry V. Levin  <ldv@altlinux.org>

	Add initial GitLab CI support.
	* .gitlab-ci.yml: New file.
	* travis-build.sh: Print $CC -print-multi-lib.  Print config.log
	in case of configure failure.
	* travis-install.sh: Check sudo availability.  Install autoconf,
	automake, file, gawk, gcc-multilib, git, gzip, make, and xz-utils
	for all targets.
	(musl-gcc): Install ca-certificates.

2017-11-25  Dmitry V. Levin  <ldv@altlinux.org>

	mpers: fix cross-compiling.
	In cross builds, a target version of readelf has to be used
	instead of a native one.

	* configure.ac (AC_CHECK_TOOL): Add readelf.
	* Makefile.am (READELF): New variable.
	(mpers-m%.stamp): Pass it to $(srcdir)/mpers.sh.
	* m4/mpers.m4 (st_MPERS): Pass READELF environment variable
	to $srcdir/mpers_test.sh.
	* mpers.sh (READELF): New variable.
	Use it instead of readelf.
	* maint/ioctls_sym.sh: Likewise.
	* NEWS: Mention this fix.

	Reported-by: Rolf Eike Beer <eb@emlix.com>

2017-11-22  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix llseek test.
	* tests/llseek.test: Fix typo.

	INSTALL-git.md: fix typo.

	tests: simplify bpf test a bit.
	* tests/bpf.c (DEF_BPF_INIT_FIRST): New macro.
	(init_BPF_MAP_CREATE_first, init_BPF_MAP_LOOKUP_ELEM_first,
	init_BPF_PROG_LOAD_first, init_BPF_OBJ_PIN_first,
	init_BPF_PROG_ATTACH_first, init_BPF_PROG_TEST_RUN_first,
	init_BPF_PROG_GET_NEXT_ID_first, init_BPF_OBJ_GET_INFO_BY_FD_first):
	Use it.

2017-11-21  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of BPF_OBJ_GET_INFO_BY_FD command of bpf syscall.
	* configure.ac (AC_CHECK_MEMBERS): Add union bpf_attr.info.info.
	* bpf.c (decode_BPF_OBJ_GET_INFO_BY_FD): New function.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders>: Use it.
	* NEWS: Mention this.
	* tests/bpf.c: Add macro guard for BPF_OBJ_GET_INFO_BY_FD decoder test.
	[HAVE_UNION_BPF_ATTR_INFO_INFO] (sample_BPF_OBJ_GET_INFO_BY_FD_attr):
	New variable.
	[HAVE_UNION_BPF_ATTR_INFO_INFO] (init_BPF_OBJ_GET_INFO_BY_FD_first,
	print_BPF_OBJ_GET_INFO_BY_FD_first, init_BPF_OBJ_GET_INFO_BY_FD_attr,
	print_BPF_OBJ_GET_INFO_BY_FD_attr): New functions.
	(main) [HAVE_UNION_BPF_ATTR_INFO_INFO]: Use them.

	Simplify union bpf_attr field checks.
	* configure.ac: Use AC_CHECK_MEMBERS instead of st_CHECK_UNION_BPF_ATTR
	for union bpf_attr field checks as the former seems to be enough
	for the case.
	* m4/st_bpf.m4: Remove.

	Implement decoding of BPF_*_GET_*_ID commands of bpf syscall.
	* configure.ac: Check for union bpf_attr.next_id.
	* bpf.c (decode_BPF_PROG_GET_NEXT_ID, decode_BPF_PROG_GET_FD_BY_ID,
	* decode_BPF_MAP_GET_FD_BY_ID): New functions.
	(decode_BPF_MAP_GET_NEXT_ID): New macro.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders>: Use them.
	* NEWS: Mention this.
	* tests/bpf.c: Add macro guard for BPF_*_GET_*_ID decoder tests.
	[HAVE_UNION_BPF_ATTR_NEXT_ID] (init_BPF_PROG_GET_NEXT_ID_first,
	print_BPF_PROG_GET_NEXT_ID_first, init_BPF_PROG_GET_NEXT_ID_attr,
	print_BPF_PROG_GET_NEXT_ID_attr, print_BPF_PROG_GET_FD_BY_ID_first,
	print_BPF_PROG_GET_FD_BY_ID_attr, print_BPF_MAP_GET_NEXT_ID_first,
	print_BPF_MAP_GET_NEXT_ID_attr): New functions.
	(init_BPF_MAP_GET_NEXT_ID_first, print_BPF_MAP_GET_NEXT_ID_first,
	init_BPF_MAP_GET_NEXT_ID_attr, print_BPF_MAP_GET_NEXT_ID_attr,
	init_BPF_PROG_GET_FD_BY_ID_first, init_BPF_PROG_GET_FD_BY_ID_attr,
	init_BPF_MAP_GET_FD_BY_ID_first, init_BPF_MAP_GET_FD_BY_ID_attr):
	New macros.
	(main) [HAVE_UNION_BPF_ATTR_NEXT_ID]: Use them.

2017-11-20  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of BPF_PROG_TEST_RUN command of bpf syscall.
	* configure.ac: Check for union bpf_attr.test.duration.
	* bpf.c (decode_BPF_PROG_TEST_RUN): New function.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders>: Use it.
	* NEWS: Mention this.
	* tests/bpf.c: Include "print_fields.h".
	Add macro guard for BPF_PROG_TEST_RUN decoder test.
	[HAVE_UNION_BPF_ATTR_TEST_DURATION] (sample_BPF_PROG_TEST_RUN_attr):
	New variable.
	[HAVE_UNION_BPF_ATTR_TEST_DURATION] (init_BPF_PROG_TEST_RUN_first,
	print_BPF_PROG_TEST_RUN_first, init_BPF_PROG_TEST_RUN_attr,
	print_BPF_PROG_TEST_RUN_attr): New functions.
	(main) [HAVE_UNION_BPF_ATTR_TEST_DURATION]: Use them.

2017-11-20  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: update BPF_MAP_CREATE decoding.
	Implement decoding of union bpf_attr.numa_node field for BPF_MAP_CREATE
	command introduced by linux kernel commit v4.14-rc1~130^2~196^2~1.

	* configure.ac: Check for numa_node member of union bpf_attr
	instead of inner_map_fd.
	(decode_BPF_MAP_CREATE): Add numa_node field to the structure, print it.
	* NEWS: Mention this.
	* tests/bpf.c: Update macro guards of BPF_MAP_CREATE decoder test.
	(init_BPF_MAP_CREATE_first, print_BPF_MAP_CREATE_attr): Update expected
	output.
	(init_BPF_MAP_CREATE_attr): Initialize numa_node field, update offset.

2017-11-20  Eugene Syromiatnikov  <esyr@redhat.com>

	unwind.c: cleanup.
	* unwind.c (rebuild_cache_if_invalid): Simplify return statement.

	unwind.c: fix typo in comment.
	* unwind.c (unwind_cache_invalidate, unwind_print_stacktrace,
	unwind_capture_stacktrace): Replace strack with stack.

2017-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	ipc_shm: decode hugetlb page size in shmget flags.
	Decode alternative hugetlb page sizes introduced by kernel commit
	v3.8-rc1~175^2~36.

	* ipc_shm.c [!SHM_HUGE_SHIFT] (SHM_HUGE_SHIFT): New macro.
	[!SHM_HUGE_MASK] (SHM_HUGE_MASK): Likewise.
	(SYS_FUNC(shmget)): Print hugetlb page size.
	* tests/ipc_shm.c: Check it.

2017-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	memfd_create: decode hugetlb page size.
	Decode alternative hugetlb page sizes introduced by kernel commit
	v4.14-rc1~126^2~17.

	* configure.ac (AC_CHECK_HEADERS): Add linux/memfd.h.
	* memfd_create.c [HAVE_LINUX_MEMFD_H]: Include it.
	[!MFD_HUGE_SHIFT] (MFD_HUGE_SHIFT): New macro.
	[!MFD_HUGE_MASK] (MFD_HUGE_MASK): Likewise.
	(SYS_FUNC(memfd_create)): Print hugetlb page size.
	* tests/memfd_create.c: Check it.

2017-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	Print the first argument of memfd_create syscall as a path.
	The limit imposed by the kernel on the length of memfd_create first
	argument is NAME_MAX - strlen("memfd:").

	* memfd_create.c (SYS_FUNC(memfd_create)): Print the first argument
	using printpathn.
	* tests/memfd_create.c: Check it.

2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>

	mem: decode hugetlb page size in mmap flags.
	Decode alternative hugetlb page sizes introduced by kernel commit
	v3.8-rc1~175^2~36.

	* mem.c [!MAP_HUGE_SHIFT] (MAP_HUGE_SHIFT): New macro.
	[!MAP_HUGE_MASK] (MAP_HUGE_MASK): Likewise.
	(print_mmap_flags): Print hugetlb page size.
	* NEWS: Mention it.
	* tests/remap_file_pages.c: Check it.

2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>

	mem: assume that MAP_TYPE is defined.
	Since linux kernel provided a definition of MAP_TYPE in <asm/mman.h>
	as long ago as in v2.4.0, it's safe to assume that MAP_TYPE is defined.

	* mem.c (print_mmap_flags) [!MAP_TYPE]: Remove.

2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>

	mem: move printing of mmap_flags to a separate function.
	* mem.c (print_mmap_flags): New function.
	(print_mmap, SYS_FUNC(remap_file_pages)): Use it.

2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>

	Provide fallback definitions for SHM_EXEC constant.
	Although SHM_EXEC is available in <linux/shm.h> since kernel commit
	v2.6.9-rc2~23^2~93^2~78, the glibc version of <sys/shm.h> did not
	provide SHM_EXEC until commit glibc-2.10~238.

	* xlat/shm_flags.in (SHM_EXEC): Add fallback definition.
	* tests/shmxt.c (SHM_EXEC): Likewise.

2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>

	Update SHM_* constants.
	* xlat/shm_flags.in: Add SHM_EXEC introduced by kernel commit
	v2.6.9-rc2~23^2~93^2~78.
	* xlat/shm_resource_flags.in: Add SHM_NORESERVE introduced by kernel
	commit v2.6.15-rc1~622.
	* NEWS: Mention this.
	* tests/ipc_shm.c (main): Update expected output.
	* tests/shmxt.c (main): Update expected output, check SHM_EXEC decoding.

2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>

	Remove fallback definitions for SHM_STAT and SHM_INFO constants.
	These constants are universally available for quite a long time
	and are used unconditionally in tests without any complaints.

	* xlat/shmctl_flags.in: Remove fallback definitions.

2017-11-16  Dmitry V. Levin  <ldv@altlinux.org>

	net: fix SOL_NETLINK NETLINK_LIST_MEMBERSHIPS decoding.
	NETLINK_LIST_MEMBERSHIPS, unlike all other SOL_NETLINK options, requests
	not just a single integer but an array of integers.  The kernel also
	supports a zero optlen NETLINK_LIST_MEMBERSHIPS request.

	* net.c (print_uint32): New function.
	(print_getsockopt): Add ulen argument, rename len argument to rlen,
	<SOL_NETLINK> Handle NETLINK_LIST_MEMBERSHIPS using print_array
	and print_uint32.
	(SYS_FUNC(getsockopt)): Pass ulen to print_getsockopt.
	* tests/sockopt-sol_netlink.c (main): Check NETLINK_LIST_MEMBERSHIPS
	decoding.

2017-11-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check [gs]etsockopt SOL_NETLINK decoding.
	* tests/sockopt-sol_netlink.c: New file.
	* tests/gen_tests.in (sockopt-sol_netlink): New entry.
	* tests/pure_executables.list: Add sockopt-sol_netlink.
	* tests/.gitignore: Likewise.

2017-11-16  Dmitry V. Levin  <ldv@altlinux.org>

	net: fix decoding of optval argument of [gs]etsockopt SOL_NETLINK.
	Tweak the parser to follow the kernel behaviour.

	* net.c (print_getsockopt, print_setsockopt) <SOL_NETLINK>: Fetch and
	print returned value as integer iff the length is >= sizeof(int),
	otherwise print the address.
	* NEWS: Mention this.

2017-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	net: decode optname argument of [gs]etsockopt for SOL_NETLINK level.
	* xlat/socknetlinkoptions.in: New file.
	* net.c: Include "xlat/socknetlinkoptions.h".
	(print_sockopt_fd_level_name) <SOL_NETLINK>: Print name using
	socknetlinkoptions.
	* NEWS: Metnion this.

	Update MSG_* constants.
	* xlat/msg_flags.in: Add MSG_ZEROCOPY introduced by kernel commit
	v4.14-rc1~130^2~376^2~6.
	* NEWS: Mention this.

	netlink: print descriptor attributes using printfd.
	* nlattr.h (DECL_NLA(fd)): New prototype.
	* nlattr.c (decode_nla_fd): New function.
	* rtnl_link.c (ifla_xdp_nla_decoders) <IFLA_XDP_FD>: Use it.
	(ifinfomsg_nla_decoders) <IFLA_NET_NS_FD>: Likewise.
	* rtnl_nsid.c (rtgenmsg_nla_decoders) <NETNSA_FD>: Likewise.
	* NEWS: Mention this.

2017-11-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

	maint/update_copyright_years.sh: implement concurrent execution.
	Analogous to the way it is done in xlat/gen.sh.

	* maint/update_copyright_years.sh (MAX_JOBS): New variable, initialize
	it to double the CPU count.
	<while [ -n "${1:-}" ]; do case "$1" in>: Add -j option parsing.
	(jobs, pids): New variables.
	<git ls-files -- "$@" | grep -vFx "$IGNORED_FILES" | while read f; do>:
	Execute process_file in background, count background jobs and wait
	if there are too many.

2017-11-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

	maint/update_copyright_years.sh: use -efu shell mode.
	* maint/update_copyright_years.sh: Add -efu to shebang.  Adjust
	the script for -efu shell mode.

2017-11-14  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.20-1.
	* strace.spec.in: Likewise.

2017-11-13  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.20 release.
	* NEWS: Update for 4.20 release.

	CREDITS.in: remove entries listed by maint/gen-contributors-list.sh.

2017-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Makefile.am: use gen-contributors-list.sh for CREDITS.
	* Makefile.am ($(srcdir)/CREDITS): Employ maint/gen-contributors-list.sh
	for the contributor list generation.

2017-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	maint: make gen-contributors-list.sh suitable for generation of CREDITS.
	Implement various features in order to make it suitable for the
	generation of the CREDITS file:
	- add an option for including contributor e-mail;
	- add an option to read additional list of contributors from stdin;
	- add shorthand for referring to the initial commit of the branch;
	- document all of the above in a help message.

	* maint/gen-contributors-list.sh (print_help): New function.
	(script): Rename to SCRIPT.
	(SCRIPT_NORM_EMAILS, MATCH_OUT, OUT_EMAILS, OUT_NO_EMAILS, read_stdin,
	include_email): New variables.
	Add parsing of options, rewrite input processing.

2017-11-13  Dmitry V. Levin  <ldv@altlinux.org>

	.mailmap: add more entries to avoid duplication in CREDITS.

	.mailmap: sort entries.

2017-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	.mailmap: more deduplication.
	Of course there are no two persons in the whole world that share
	the same name.

2017-11-13  Dmitry V. Levin  <ldv@altlinux.org>

	CREDITS.in: use UTF-8 consistently.
	In particular, do not use " symbols in names.

2017-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	CREDITS.in: add Jiri Slaby as a contributor.
	Unfortunately, he wasn't mentioned in the message of the commit
	v4.19-68-g48cb633, so let's fix that omission.

	References: https://github.com/strace/strace/pull/16

2017-11-13  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	s390, s390x: update ioctl entries from linux 4.14.
	* linux/s390/ioctls_arch0.h: Update from linux v4.14 using ioctls_gen.sh.
	* linux/s390x/ioctls_arch0.h: Likewise.

	s390x: remove some of non-s390 KVM ioctls.
	* linux/s390x/ioctls_arch0.h: Regenerate.

	maint: remove KVM_PPC_CONFIGURE_V3_MMU ioctl from non-powerpc arches.
	* maint/ioctls_sym.sh (ppc_list): Update.

2017-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	Update copyright headers.
	Headers updated semi-automatically using
	maint/update_copyright_years.sh script.

	* m4/mpers.m4: Update copyright years.
	* tests/kcmp.c: Likewise.
	* tests/membarrier.c: Likewise.

2017-11-11  Dmitry V. Levin  <ldv@altlinux.org>

	maint/update_copyright_years.sh: fix typo in help output.
	* maint/update_copyright_years.sh (print_help): Fix typo, disable
	here-document expansion.

2017-11-10  Eugene Syromiatnikov  <esyr@redhat.com>

	Move MIN, MAX, and CLAMP to macros.h.
	We shouldn't have to include the whole defs.h to get them.

	* defs.h (MIN, MAX, CLAMP): Move ...
	* macros.h: ... here.

2017-11-10  Eugene Syromiatnikov  <esyr@redhat.com>

	Update .mailmap.
	* .mailmap (Eugene Syromyatnikov): Add work address.

2017-11-07  Steve McIntyre  <steve@einval.com>

	debian: update debhelper compat level to 10, replace -s with -a in some calls

	debian: update Standards-Version to 3.9.8.

2017-11-06  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.m4: check for size of long and kernel_long_t.
	The primary purpose of this new check is diagnostics.

	* m4/mpers.m4 (st_MPERS): Check for size of long and kernel_long_t.

2017-11-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat/gen.sh: speedup xlat generation.
	This commit implements the following changes:
	- increases the number of concurrent jobs to twice the CPU count;
	- creates a circular buffer, so instead of running multiple jobs
	  at once, the generator tries to keep about the same number of jobs
	  being run concurrently;
	- runs gen_git and gen_make concurrently in order to squeeze in
	  one more bit of concurrency.

	With my deeply scientific measurements, this approach achieves
	up to 15% speedup with dash and about 30-40% with bash as /bin/sh
	on a 4-core machine.

	* xlat/gen.sh (main): Declare pids local variable, append pid of every
	run job to it; increase the limit of jobs to ncpus * 2; when the limit
	is reached, wait for the first pid in pids instead of resetting jobs
	to zero and waiting for all the run jobs; put gen_git and gen_make
	into background.

2017-11-05  Dmitry V. Levin  <ldv@altlinux.org>

	hppa: wire up statx syscall.
	* linux/hppa/syscallent.h [349]: Add statx entry.

2017-11-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check signal mask transparency.
	Starting with commit v4.17-5-gf83b49b strace is expected
	to forward the signal mask to tracees unchanged.

	* tests/check_sigblock.c: New file.
	* tests/set_sigblock.c: Likewise.
	* tests/sigblock.test: New test.
	* tests/.gitignore: Add check_sigblock and set_sigblock.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add sigblock.test.

2017-11-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check signal disposition transparency.
	Starting with commit v4.17-8-ge97a66f strace is expected
	to forward the signal disposition to tracees unchanged.

	* tests/check_sigign.c: New file.
	* tests/list_sigaction_signum.c: Likewise.
	* tests/set_sigign.c: Likewise.
	* tests/sigign.test: New test.
	* tests/.gitignore: Add check_sigign, list_sigaction_signum,
	and set_sigign.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add sigign.test.

2017-11-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: update futex test to accommodate the recent kernel change.
	Kernel commit v4.14-rc1~162^2~8 refactored futex implementation and
	introduced checks for invalid shift sizes.  Accommodate this change
	by allowing EINVAL in the corresponding futex checks.

	* tests/futex.c (CHECK_FUTEX_GENERIC): Reset errno before the syscall.
	(main) <wake_ops>: Add err2 field, describe err/err2 fields.
	Add EINVAL as a possible errno to the checks that contain invalid
	shift values.
	Update return value check so it checks that values are strictly
	as expected.

	Closes: https://github.com/strace/strace/pull/16

2017-11-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: cleanup futex test.
	* tests/futex.c (main) <wake_ops>: Remove unused errstr field
	from the structure type definition.

2017-11-02  Dmitry V. Levin  <ldv@altlinux.org>

	seccomp: decode SECCOMP_GET_ACTION_AVAIL operation.
	* defs.h (seccomp_ret_action): New xlat prototype.
	* seccomp.c (decode_seccomp_set_mode_strict): Remove.
	(SYS_FUNC(seccomp)): Decode SECCOMP_GET_ACTION_AVAIL operation.
	* NEWS: Mention this.
	* tests/seccomp_get_action_avail.c: New file.
	* tests/gen_tests.in (seccomp_get_action_avail): New entry.
	* tests/pure_executables.list: Add seccomp_get_action_avail.
	* tests/.gitignore: Likewise.

2017-11-01  Dmitry V. Levin  <ldv@altlinux.org>

	Add SECCOMP_RET_KILL_PROCESS decoding support.
	* bpf_seccomp_filter.c [!SECCOMP_RET_ACTION]: Remove.
	[!SECCOMP_RET_ACTION_FULL] (SECCOMP_RET_ACTION_FULL): Define.
	(print_seccomp_filter_k): Use SECCOMP_RET_ACTION_FULL
	instead of SECCOMP_RET_ACTION.
	* xlat/seccomp_ret_action.in: Add SECCOMP_RET_KILL_PROCESS introduced
	by linux kernel commit v4.14-rc2~15^2~3.

2017-11-01  Dmitry V. Levin  <ldv@altlinux.org>

	Rename SECCOMP_RET_KILL to SECCOMP_RET_KILL_THREAD.
	Follow linux kernel commit v4.14-rc2~15^2~4 and rename SECCOMP_RET_KILL
	to SECCOMP_RET_KILL_THREAD.

	* xlat/seccomp_ret_action.in (SECCOMP_RET_KILL): Rename
	to SECCOMP_RET_KILL_THREAD.
	* tests/prctl-seccomp-filter-v.c (main): Update expected output.
	* tests/seccomp-filter-v.c (main): Likewise.

2017-11-01  Dmitry V. Levin  <ldv@altlinux.org>

	Update SECCOMP_* constants.
	* xlat/seccomp_filter_flags.in: Add SECCOMP_FILTER_FLAG_LOG introduced
	by kernel commit v4.14-rc2~15^2~6.
	* xlat/seccomp_ops.in: Add SECCOMP_GET_ACTION_AVAIL introduced
	by kernel commit v4.14-rc2~15^2~9.
	* xlat/seccomp_ret_action.in: Add SECCOMP_RET_LOG introduced
	by kernel commit v4.14-rc2~15^2~5.
	* NEWS: Mention this.
	* tests/seccomp-filter.c (main): Update expected output.
	* tests/seccomp-filter-v.c (main): Likewise.

	Provide fallback definitions for SECCOMP_RET_* constants.
	* xlat/seccomp_ret_action.in: Add fallback definitions.

2017-11-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify options-syntax.test against inquisitive musl.
	Workaround musl >= 1.1.17 ability to use AT_EXECFN during
	program_invocation_name initialization.

	* tests/options-syntax.test: Check for two valid variants
	of "zeroargc strace" expected output.

2017-11-01  Dmitry V. Levin  <ldv@altlinux.org>

	Update MEMBARRIER_CMD_* constants.
	* xlat/membarrier_cmds.in: Add MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED
	introduced by kernel commit v4.14-rc6~26.
	* tests/membarrier.c (main): Update expected output.

2017-10-31  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NFNL_SUBSYS_NFT_COMPAT netlink message flags.
	* tests/nfnetlink_nft_compat.c (test_nlmsg_flags): New function.
	(main): Use it.

	tests: check decoding of NFNL_SUBSYS_NFTABLES netlink message flags.
	* tests/nfnetlink_nftables.c (test_nlmsg_flags): New function.
	(main): Use it.

	tests: check decoding of NFNL_SUBSYS_CTHELPER netlink message flags.
	* tests/nfnetlink_cthelper.c (test_nlmsg_flags): New function.
	(main): Use it.

	tests: check decoding of NFNL_SUBSYS_CTNETLINK_TIMEOUT netlink message flags
	* tests/nfnetlink_cttimeout.c (test_nlmsg_flags): New function.
	(main): Use it.

	tests: check decoding of NFNL_SUBSYS_ACCT netlink message flags.
	* tests/nfnetlink_acct.c (test_nlmsg_flags): New function.
	(main): Use it.

	tests: check decoding of NFNL_SUBSYS_CTNETLINK_EXP netlink message flags
	* tests/nfnetlink_ctnetlink_exp.c (test_nlmsg_flags): New function.
	(main): Use it.

	tests: check decoding of NFNL_SUBSYS_CTNETLINK netlink message flags.
	* tests/nfnetlink_ctnetlink.c (test_nlmsg_flags): New function.
	(main): Use it.

2017-10-26  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: decode NETLINK_NETFILTER netlink message flags.
	* netlink.c (decode_nlmsg_flags_netfilter): New function.
	(nlmsg_flags): Add NETLINK_NETFILTER.
	* NEWS: Mention this.

	netlink: decode netlink message delete flags.
	* netlink.c: Include "xlat/netlink_delete_flags.h".
	(decode_nlmsg_flags_crypto, decode_nlmsg_flags_route,
	decode_nlmsg_flags_xfrm): Decode delete flags.
	* netlink.h (NLM_F_NONREC): New macro.
	* xlat/netlink_delete_flags.in: New file.
	* tests/netlink_crypto.c (test_nlmsg_flags): Check this.
	* tests/netlink_route.c (test_nlmsg_flags): Likewise.
	* tests/netlink_xfrm.c (test_nlmsg_flags): Likewise.

2017-10-26  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: refactor decode_nlmsg_flags.
	Refactor decode_nlmsg_flags to make it family-specific, just like
	decode_nlmsg_type and decode_payload.

	* netlink.c (decode_nlmsg_flags_crypto, decode_nlmsg_flags_route,
	decode_nlmsg_flags_sock_diag, decode_nlmsg_flags_xfrm): New functions.
	(nlmsg_flags_decoder_t): New typedef.
	(nlmsg_flags): New array.
	(decode_nlmsg_flags): Use it.

2017-10-14  JingPiao Chen  <chenjingpiao@gmail.com>

	Workaround historic linux/netfilter/xt_osf.h deficiencies.
	When using linux kernel headers without commit v4.5-rc1~128^2~115^2~22
	("netfilter: fix include files for compilation"), both <linux/ip.h>
	and <linux/tcp.h> have to be included before <linux/netfilter/xt_osf.h>.

	* configure.ac (AC_CHECK_HEADERS): Include <linux/ip.h>
	and <linux/tcp.h> when checking for linux/netfilter/xt_osf.h header.
	* tests/nfnetlink_osf.c: Include <linux/ip.h> and <linux/tcp.h>
	before <linux/netfilter/xt_osf.h>.

2017-09-24  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NFNL_SUBSYS_NFT_COMPAT netlink message types.
	* configure.ac (AC_CHECK_HEADERS): Add
	linux/netfilter/nf_tables_compat.h.
	* tests/nfnetlink_nft_compat.c: New file.
	* tests/gen_tests.in (nfnetlink_nft_compat): New entry.
	* tests/pure_executables.list: Add nfnetlink_nft_compat.
	* tests/.gitignore: Likewise.

	tests: check decoding of NFNL_SUBSYS_NFTABLES netlink message types.
	* configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/nf_tables.h.
	* tests/nfnetlink_nftables.c: New file.
	* tests/gen_tests.in (nfnetlink_nftables): New entry.
	* tests/pure_executables.list: Add nfnetlink_nftables.
	* tests/.gitignore: Likewise.

	tests: check decoding of NFNL_SUBSYS_CTHELPER netlink message types.
	* configure.ac (AC_CHECK_HEADERS): Add
	linux/netfilter/nfnetlink_cthelper.h.
	* tests/nfnetlink_cthelper.c: New file.
	* tests/gen_tests.in (nfnetlink_cthelper): New entry.
	* tests/pure_executables.list: Add nfnetlink_cthelper.
	* tests/.gitignore: Likewise.

	tests: check decoding of NFNL_SUBSYS_CTNETLINK_TIMEOUT netlink message types
	* configure.ac (AC_CHECK_HEADERS): Add
	linux/netfilter/nfnetlink_cttimeout.h.
	* tests/nfnetlink_cttimeout.c: New file.
	* tests/gen_tests.in (nfnetlink_cttimeout): New entry.
	* tests/pure_executables.list: Add nfnetlink_cttimeout.
	* tests/.gitignore: Likewise.

	tests: check decoding of NFNL_SUBSYS_ACCT netlink message types.
	* configure.ac (AC_CHECK_HEADERS): Add
	linux/netfilter/nfnetlink_acct.h.
	* tests/nfnetlink_acct.c: New file.
	* tests/gen_tests.in (nfnetlink_acct): New entry.
	* tests/pure_executables.list: Add nfnetlink_acct.
	* tests/.gitignore: Likewise.

	tests: check decoding of NFNL_SUBSYS_IPSET netlink message types.
	* configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/ipset/ip_set.h.
	* tests/nfnetlink_ipset.c: New file.
	* tests/gen_tests.in (nfnetlink_ipset): New entry.
	* tests/pure_executables.list: Add nfnetlink_ipset.
	* tests/.gitignore: Likewise.

	tests: check decoding of NFNL_SUBSYS_OSF netlink message types.
	* configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/xt_osf.h.
	* tests/nfnetlink_osf.c: New file.
	* tests/gen_tests.in (nfnetlink_osf): New entry.
	* tests/pure_executables.list: Add nfnetlink_osf.
	* tests/.gitignore: Likewise.

	tests: check decoding of NFNL_SUBSYS_ULOG netlink message types.
	* configure.ac (AC_CHECK_HEADERS): Add
	linux/netfilter/nfnetlink_log.h.
	* tests/nfnetlink_ulog.c: New file.
	* tests/gen_tests.in (nfnetlink_ulog): New entry.
	* tests/pure_executables.list: Add nfnetlink_ulog.
	* tests/.gitignore: Likewise.

	tests: check decoding of NFNL_SUBSYS_QUEUE netlink message types.
	* configure.ac (AC_CHECK_HEADERS): Add
	linux/netfilter/nfnetlink_queue.h.
	* tests/nfnetlink_queue.c: New file.
	* tests/gen_tests.in (nfnetlink_queue): New entry.
	* tests/pure_executables.list: Add nfnetlink_queue.
	* tests/.gitignore: Likewise.

	tests: check decoding of NFNL_SUBSYS_CTNETLINK_EXP netlink message types
	* tests/nfnetlink_ctnetlink_exp.c: New file.
	* tests/gen_tests.in (nfnetlink_ctnetlink_exp): New entry.
	* tests/pure_executables.list: Add nfnetlink_ctnetlink_exp.
	* tests/.gitignore: Likewise.

	tests: check decoding of NFNL_SUBSYS_CTNETLINK netlink message types.
	* configure.ac (AC_CHECK_HEADERS): Add
	linux/netfilter/nfnetlink_conntrack.h.
	* tests/nfnetlink_ctnetlink.c: New file.
	* tests/gen_tests.in (nfnetlink_ctnetlink): New entry.
	* tests/pure_executables.list: Add nfnetlink_ctnetlink.
	* tests/.gitignore: Likewise.

	netlink: decode NETLINK_NETFILTER netlink message types.
	* netlink.c: Include "xlat/nf_acct_msg_types.h",
	"xlat/nf_cthelper_msg_types.h", "xlat/nf_ctnetlink_exp_msg_types.h",
	"xlat/nf_ctnetlink_msg_types.h", "xlat/nf_cttimeout_msg_types.h",
	"xlat/nf_ipset_msg_types.h", "xlat/nf_nft_compat_msg_types.h",
	"xlat/nf_nftables_msg_types.h", "xlat/nf_osf_msg_types.h",
	"xlat/nf_queue_msg_types.h", and "xlat/nf_ulog_msg_types.h".
	(nf_nlmsg_types): New array.
	(decode_nlmsg_type_netfilter): Use it.
	* NEWS: Mention this.
	* xlat/nf_acct_msg_types.in: New file.
	* xlat/nf_cthelper_msg_types.in: Likewise.
	* xlat/nf_ctnetlink_exp_msg_types.in: Likewise.
	* xlat/nf_ctnetlink_msg_types.in: Likewise.
	* xlat/nf_cttimeout_msg_types.in: Likewise.
	* xlat/nf_ipset_msg_types.in: Likewise.
	* xlat/nf_nft_compat_msg_types.in: Likewise.
	* xlat/nf_nftables_msg_types.in: Likewise.
	* xlat/nf_osf_msg_types.in: Likewise.
	* xlat/nf_queue_msg_types.in: Likewise.
	* xlat/nf_ulog_msg_types.in: Likewise.
	* tests/netlink_netfilter.c (test_nlmsg_type): Update expected output.

2017-09-20  Dmitry V. Levin  <ldv@altlinux.org>

	ppc64: fix sigreturn parser for ppc personality.
	* linux/powerpc/arch_sigreturn.c (arch_sigreturn) [POWERPC64]: Rewrite.

	ppc64: truncate syscall args for 32-bit personality tracees.
	* linux/powerpc/get_syscall_args.c (get_syscall_args): Clear upper
	32 bits of syscall args for 32-bit personality tracees.
	* NEWS: Mention this fix.

	ppc64: fix PRI__64 macro definition when compiled with -m32.
	* kernel_types.h [SIZEOF_LONG != 4]: Check for __powerpc64__ instead
	of POWERPC to handle -m32 case properly.

2017-09-19  Dmitry V. Levin  <ldv@altlinux.org>

	loop: decode LOOP_SET_BLOCK_SIZE.
	* loop.c (loop_ioctl) <LOOP_SET_BLOCK_SIZE>: Handle LOOP_SET_BLOCK_SIZE.
	* tests/ioctl_loop.c (main): Check it.

	Update ioctl entries from linux v4.14-rc1.
	* linux/32/ioctls_inc_align16.h: Update from linux v4.14-rc1
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* xlat/loop_cmds.in: Add LOOP_SET_BLOCK_SIZE introduced
	by kernel commit v4.13-rc7-176-g89e4fde.
	* NEWS: Mention this.
	* tests/ioctl_loop.c (main): Update.

2017-09-19  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	maint: generate ioctl entries without target architecture code execution
	ioctls_sym.sh used to generate and invoke target architecture
	executables that limited its applicability.
	After this change, the generated code is just compiled to the target
	architecture object files and all required information is obtained
	from the dwarf sections.
	This approach allows to generate ioctl entries for any target
	architecture supported by compiler.

	* maint/ioctls_sym.awk: New file.
	* maint/ioctls_sym.sh (LC_ALL): Define to C and export.
	(uname_m): Make configurable.
	(CFLAGS): Add -gdwarf-2.
	(LDFLAGS): Remove.
	Do not use print_ioctlent.c.
	Change asm-generic/ioctl.h and asm/ioctl.h hook.
	Dump and process dwarf sections of generated object files.
	* maint/print_ioctlent.c: Remove.

2017-09-18  Dmitry V. Levin  <ldv@altlinux.org>

	Remove KVM_S390_* ioctls from non-s390 architectures.
	* maint/ioctls_sym.sh <linux/kvm.h> (s390_list): New variable.
	Use it to exclude KVM_S390_* ioctls on non-s390 architectures.
	* linux/arm/ioctls_arch0.h: Regenerate.
	* linux/i386/ioctls_arch0.h: Likewise.
	* linux/powerpc/ioctls_arch0.h: Likewise.
	* linux/s390/ioctls_arch0.h: Likewise.
	* linux/x86_64/ioctls_arch0.h: Likewise.

2017-09-17  Dmitry V. Levin  <ldv@altlinux.org>

	Remove some of arch-specific KVM ioctls from non-matching architectures.
	* maint/ioctls_sym.sh (arm_list, ppc_list, x86_list): Use bracket
	expressions to generalize arch-specific regular expressions.
	* linux/arm/ioctls_arch0.h: Regenerate.
	* linux/i386/ioctls_arch0.h: Likewise.
	* linux/powerpc/ioctls_arch0.h: Likewise.
	* linux/s390/ioctls_arch0.h: Likewise.
	* linux/x86_64/ioctls_arch0.h: Likewise.

2017-09-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	dm: add support for DM_DEV_ARM_POLL.
	Added in Linux commit v4.13-rc1~137^2~14.

	* dm.c [!DM_LIST_VERSIONS] (DM_LIST_VERSIONS): Add leading zero.
	[!DM_TARGET_MSG] (DM_TARGET_MSG): Likewise.
	[!DM_DEV_SET_GEOMETRY_CMD] (DM_DEV_SET_GEOMETRY_CMD): Likewise.
	[!DM_DEV_ARM_POLL] (DM_DEV_ARM_POLL): New macro.
	(dm_ioctl_has_params, dm_ioctl): Handle DM_DEV_ARM_POLL.
	* tests/ioctl_dm.c [!DM_DEV_ARM_POLL] (DM_DEV_ARM_POLL): New macro.
	(main) <dummy_check_cmds>: Add DM_DEV_ARM_POLL.

2017-09-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	kcmp: add KCMP_EPOLL_TFD support.
	* configure.ac (AC_CHECK_TYPES): Add check for struct kcmp_epoll_slot.
	* kcmp.c (SYS_FUNC(kcmp)) <case KCMP_EPOLL_TFD>: Implement idx1/idx2
	argument parsing.
	* tests/kcmp.c: Update test.
	* xlat/kcmp_types.in (KCMP_EPOLL_TFD): New entry.

2017-09-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add kcmp-y test.
	It is not very useful as of now, but it will allow tracking changes
	in fd output once they are implemented.

	* tests/gen_tests.in (kcmp-y): New test.
	* tests/kcmp-y.c: New file, wrapper for kcmp.c
	* tests/kcmp.c: Add opening of some files for which info may be printed
	in the future.
	* tests/pure_executables.list: Add kcmp-y.
	* tests/.gitignore: Likewise.

2017-09-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	kcmp: output fds using a separate function.
	This is a preparation for the future introduction of cross-NS PID
	derivation, which would enable us to print fd information for fds
	related to all processes, not just traced ones.

	Note the change in output type for idx1/idx2 in KCMP_FILE command from
	unsigned to int, it follows printfd output format.

	* kcmp.c (printpidfd): New function.
	(PRINT_FIELD_PIDFD): New macro.
	(SYS_FUNC(kcmp)) <case KCMP_FILE>: Use printpidfd for printing
	idx1/idx2, as they are fds, after all.

2017-09-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/kcmp: add more checks.
	Let's check all kcmp commands that they indeed do not print idx1/idx2.
	Also, check that upper bits of pid arguments are ignored.

	* tests/gen_tests.in (kcmp): Decrease -a argument's value from 27 to 22.
	* tests/kcmp.c: Add checks for upper bits of pid1/pid2 and for all
	kcmp types not tested before.

2017-09-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/kcmp: use <linux/kcmp.h> if it is available.
	I see it as a good idea to stick to system headers whenever possible
	in order to also check for possible discrepancies between strace's
	internal definitions and definitions present in the system headers.

	* configure.ac (AC_CHECK_HEADERS): Add linux/kcmp.h.
	* tests/kcmp.h [HAVE_LINUX_KCMP_H]: Include <linux/kcmp.h>,
	do not define KCMP_FILE and KCMP_SYSVSEM.

2017-09-17  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of MDBA_ROUTER_PORT netlink attribute.
	* tests/nlattr_mdba_router_port.c: New file.
	* tests/gen_tests.in (nlattr_mdba_router_port): New entry.
	* tests/pure_executables.list: Add nlattr_mdba_router_port.
	* tests/.gitignore: Likewise.

	tests: check decoding of MDBA_MDB_ENTRY_INFO netlink attributes.
	* tests/nlattr_mdba_mdb_entry.c: New file.
	* tests/gen_tests.in (nlattr_mdba_mdb_entry): New entry.
	* tests/pure_executables.list: Add nlattr_mdba_mdb_entry.
	* tests/.gitignore: Likewise.

2017-09-17  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: extend TEST_NESTED_NLATTR_OBJECT macro.
	Extend TEST_NESTED_NLATTR_OBJECT macro for multi-nested netlink
	attributes, such as

		[MDBA_MDB] = {
			[MDBA_MDB_ENTRY] = {
				[MDBA_MDB_ENTRY_INFO] {
					struct br_mdb_entry
					[MDBA_MDB_EATTR attributes]
				}
			}
		}

	* tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT_EX_,
	TEST_NESTED_NLATTR_OBJECT_EX): New macros.
	(TEST_NESTED_NLATTR_OBJECT): Use TEST_NESTED_NLATTR_OBJECT_EX_.

2017-09-17  JingPiao Chen  <chenjingpiao@gmail.com>

	rtnl_mdb: decode br_port_msg netlink attributes.
	* configure.ac (AC_CHECK_TYPES): Check for struct br_mdb_entry
	in <linux/if_bridge.h>.
	(AC_CHECK_MEMBERS): Check for flags and vid fields in struct br_mdb_entry.
	* rtnl_mdb.c: Include "xlat/mdb_flags.h", "xlat/mdb_states.h",
	"xlat/rtnl_mdba_mdb_attrs.h", "xlat/rtnl_mdba_mdb_eattr_attrs.h",
	"xlat/rtnl_mdba_mdb_entry_attrs.h" ,"xlat/rtnl_mdba_router_attrs.h"
	and "xlat/rtnl_mdba_router_pattr_attrs.h".
	(decode_mdba_mdb_entry_info, decode_mdba_mdb_entry,
	decode_mdba_mdb, decode_multicast_router_type,
	decode_mdba_router_port, decode_mdba_router): New functions.
	(mdba_mdb_eattr_nla_decoders, mdba_mdb_entry_nla_decoders,
	mdba_mdb_nla_decoders, mdba_router_pattr_nla_decoders,
	mdba_router_nla_decoders, br_port_msg_nla_decoders): New arrays.
	(decode_br_port_msg): Use br_port_msg_nla_decoders.
	* xlat/mdb_flags.in: New file.
	* xlat/mdb_states.in: Likewise.
	* xlat/multicast_router_types.in: Likewise.
	* xlat/rtnl_mdba_mdb_attrs.in: Likewise.
	* xlat/rtnl_mdba_mdb_eattr_attrs.in: Likewise.
	* xlat/rtnl_mdba_mdb_entry_attrs.in: Likewise.
	* xlat/rtnl_mdba_router_attrs.in: Likewise.
	* xlat/rtnl_mdba_router_pattr_attrs.in: Likewise.

2017-09-17  Dmitry V. Levin  <ldv@altlinux.org>

	netlink: implement decoding of INET_DIAG_CLASS_ID attribute.
	This is a new netlink attribute introduced by linux kernel commit
	v4.14-rc1~130^2~207.

	* linux/inet_diag.h (INET_DIAG_CLASS_ID): New enum.
	* netlink_inet_diag.c (inet_diag_msg_nla_decoders): Add
	INET_DIAG_CLASS_ID.
	* xlat/inet_diag_attrs.in: Add INET_DIAG_CLASS_ID.
	* xlat/inet_diag_extended_flags.in: Add 1<<(INET_DIAG_CLASS_ID-1).
	* tests/nlattr_inet_diag_msg.c (main): Check INET_DIAG_CLASS_ID
	decoding.

2017-09-17  Dmitry V. Levin  <ldv@altlinux.org>

	Update MEMBARRIER_CMD_* constants.
	* xlat/membarrier_cmds.in: Add MEMBARRIER_CMD_PRIVATE_EXPEDITED
	introduced by kernel commit v4.14-rc1~174^2^2^4.
	* NEWS: Mention this.
	* tests/membarrier.c (main): Update expected output.

	Update UFFD_FEATURE_* constants.
	* xlat/memfd_create_flags.in: Remove UFFD_FEATURE_EVENT_EXIT removed
	by kernel commit v4.11-rc2~15^2~18.
	Add UFFD_FEATURE_SIGBUS and UFFD_FEATURE_THREAD_ID introduced by kernel
	commits v4.14-rc1~126^2~28 and v4.14-rc1~126^2~23, repsectively.
	* NEWS: Mention this.

	Update MFD_* constants.
	* xlat/memfd_create_flags.in: Add MFD_HUGETLB introduced
	by kernel commit v4.14-rc1~126^2~17.
	* NEWS: Mention this.
	* tests/memfd_create.c (main): Update expected output.

	Update ETH_P_* constants.
	* xlat/ethernet_protocols.in: Add ETH_P_ERSPAN, ETH_P_NSH, ETH_P_IFE,
	and ETH_P_MAP introduced by kernel commits v4.14-rc1~130^2~164,
	v4.14-rc1~130^2~89^2~3, v4.14-rc1~130^2~90^2~2, and
	v4.14-rc1~130^2~78^2~2, respectively.
	* NEWS: Mention this.

	Update ARPHRD_* constants.
	* xlat/arp_hardware_types.in: Add ARPHRD_RAWIP introduced
	by kernel commit v4.14-rc1~130^2~78^2~1.
	* NEWS: Mention this.

	Update BPF_* constants.
	* xlat/bpf_attach_type.in: Add BPF_SK_SKB_STREAM_PARSER
	and BPF_SK_SKB_STREAM_VERDICT introduced by kernel commit
	v4.14-rc1~130^2~123^2~8.
	* xlat/bpf_map_flags.in: Add BPF_F_NO_COMMON_LRU and BPF_F_NUMA_NODE
	introduced by kernel commits v4.10-rc1~202^2~271^2~2
	and v4.14-rc1~130^2~196^2~1, respectively.
	* xlat/bpf_map_types.in: Add BPF_MAP_TYPE_DEVMAP
	and BPF_MAP_TYPE_SOCKMAP introduced by kernel commits
	v4.14-rc1~130^2~497^2~4 and v4.14-rc1~130^2~234^2~4,
	respectively.
	* xlat/bpf_op_jmp.in: Add BPF_JLT, BPF_JLE, BPF_JSLT, and BPF_JSLE
	introduced by kernel commit v4.14-rc1~130^2~309^2~8.
	* xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_SK_SKB introduced
	by kernel commit v4.14-rc1~130^2~234^2~6.
	* NEWS: Mention this.

	Update SO_* constants.
	* xlat/sockoptions.in: Add SO_ZEROCOPY introduced by kernel commit
	v4.14-rc1~130^2~376^2~5.
	* NEWS: Mention this.

	Update MADV_* constants.
	* xlat/madvise_cmds.in: Add MADV_WIPEONFORK and MADV_KEEPONFORK
	introduced by kernel commit v4.14-rc1~126^2.
	* NEWS: Mention this.

2017-09-08  Baruch Siach  <baruch@tkos.co.il>

	error_prints: fix potential program_invocation_name type conflict.
	uClibc-ng declares program_invocation_name as const.
	This causes the build failure below:

	error_prints.c:40:14: error: conflicting types for ‘program_invocation_name’
	 extern char *program_invocation_name;
	              ^~~~~~~~~~~~~~~~~~~~~~~
	In file included from error_prints.c:32:0:
	.../output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/errno.h:54:20: note: previous declaration of ‘program_invocation_name’ was here
	 extern const char *program_invocation_name, *program_invocation_short_name;
	                    ^~~~~~~~~~~~~~~~~~~~~~~

	* error_prints.c (program_invocation_name): Declare only in case
	of [!HAVE_PROGRAM_INVOCATION_NAME].

2017-09-07  JingPiao Chen  <chenjingpiao@gmail.com>

	rtnl_tc_action: decode tcamsg netlink attributes.
	* rtnl_tc_action.c (tcamsg_nla_decoders): New array.
	(decode_tcamsg): Use it.

	tests: check decoding of TCA_STAB netlink attribute of tcmsg.
	* tests/test_nlattr.h (TEST_NESTED_NLATTR_ARRAY): New macro.
	* tests/nlattr_tca_stab.c: New file.
	* tests/gen_tests.in (nlattr_tca_stab): New entry.
	* tests/pure_executables.list: Add nlattr_tca_stab.
	* tests/.gitignore: Likewise.

	tests: check decoding of TCA_STATS2 netlink attribute of tcmsg.
	* tests/nlattr_tc_stats.c: New file.
	* tests/gen_tests.in (nlattr_tc_stats): New entry.
	* tests/pure_executables.list: Add nlattr_tc_stats.
	* tests/.gitignore: Likewise.

	tests: check decoding of tcmsg netlink attributes.
	* tests/nlattr_tcmsg.c: Include <stddef.h> and <linux/pkt_sched.h>.
	(main): Check decoding of TCA_STATS and TCA_RATE.

	rtnl_tc: decode tcmsg netlink attributes.
	* configure.ac (AC_CHECK_TYPES): Check for gnet_stats_basic,
	gnet_stats_queue, gnet_stats_rate_est,
	and gnet_stats_rate_est64 structures in <linux/gen_stats.h>.
	And check for struct tc_sizespec in <linux/pkt_sched.h>.
	* nlattr.h (tc_stats): New prototype.
	* rtnl_tc.c: Include <linux/gen_stats.h>, <linux/pkt_sched.h>,
	"xlat/rtnl_tca_stab_attrs.h" and "xlat/rtnl_tca_stats_attrs.h".
	(decode_tc_stats, decode_tc_estimator, decode_gnet_stats_basic,
	decode_gnet_stats_rate_est, decode_gnet_stats_queue,
	decode_gnet_stats_rate_est64, decode_nla_tc_stats,
	decode_tc_sizespec, print_stab_data, decode_tca_stab_data,
	decode_tca_stab): New functions.
	(tca_stats_nla_decoders, tca_stab_nla_decoders,
	tcmsg_nla_decoders): New arrays.
	(decode_tcmsg): Use tcmsg_nla_decoders.
	* xlat/rtnl_tca_stab_attrs.in: New file.
	* xlat/rtnl_tca_stats_attrs.in: Likewise.

2017-09-07  Dmitry V. Levin  <ldv@altlinux.org>

	Update TCP_* constants.
	* xlat/socktcpoptions.in: Add TCP_ULP and TCP_MD5SIG_EXT.
	* NEWS: Mention this.

	Update SOL_* constants.
	* xlat/socketlayers.in: Add SOL_TLS.
	* NEWS: Mention this.

2017-09-06  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.19-1.
	* strace.spec.in: Likewise.

2017-09-05  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.19 release.
	* NEWS: Update for 4.19 release.

	.mailmap: add canonical name and address of Edgar Kaziakhmedov.
	* .mailmap: Add canonical name and address of Edgar Kaziakhmedov here
	to avoid duplications in CREDITS file.

	maint: add gen-tag-message.sh script.
	* maint/gen-tag-message.sh: New file.

	maint: add gen-contributors-list.sh script.
	* maint/gen-contributors-list.sh: New file.

2017-09-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update copyright headers.
	Headers updated automatically with

	    maint/update_copyright_headers.sh -c

2017-09-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	update_copyright_years.sh: add ability to automatically commit results.
	* maint/update_copyright_years.sh (DEFAULT_GIT_COMMIT_MESSAGE,
	GIT_COMMIT_MESSAGE): New variables.
	<-c>: New option, implies -a, calls git commit with GIT_COMMIT_TEMPLATE string
	as a template.

2017-09-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	configure.ac: specify minimal GNU Automake version.
	In order to provide better diagnostics.

	* configure.ac (AM_INIT_AUTOMAKE): Specify minimal GNU Automake version as
	1.13 due to usage of AM_EXTRA_RECURSIVE_TARGETS macro.

	Closes: https://github.com/strace/strace/issues/11

2017-09-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.

2017-09-03  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of IFLA_XDP netlink attribute of ifinfomsg.
	* tests/nlattr_ifla_xdp.c: New file.
	* tests/gen_tests.in (nlattr_ifla_xdp): New entry.
	* tests/pure_executables.list: Add nlattr_ifla_xdp.
	* tests/.gitignore: Likewise.

	tests: check decoding of IFLA_PORT_SELF netlink attribute of ifinfomsg.
	* tests/nlattr_ifla_port.c: New file.
	* tests/gen_tests.in (nlattr_ifla_port): New entry.
	* tests/pure_executables.list: Add nlattr_ifla_port.
	* tests/.gitignore: Likewise.

	tests: check decoding of more ifinfomsg netlink attributes.
	* tests/nlattr_ifinfomsg.c (IFLA_LINKINFO, IFLA_VF_PORTS,
	IFLA_INFO_KIND, IFLA_VF_PORT): New macros.
	(main): Check decoding of IFLA_LINKINFO and IFLA_VF_PORTS.

	rtnl_link: decode more ifinfomsg netlink attributes.
	* configure.ac (AC_CHECK_TYPES): Check for struct ifla_port_vsi
	in <linux/if_link.h>.
	* rtnl_link.c: Include "xlat/rtnl_ifla_info_attrs.h",
	"xlat/rtnl_ifla_port_attrs.h", "xlat/rtnl_ifla_port_attrs.h",
	"xlat/rtnl_ifla_xdp_attrs.h", and "xlat/xdp_flags.h".
	(decode_ifla_linkinfo, decode_ifla_port_vsi,
	decode_ifla_port, decode_ifla_vf_ports,
	decode_ifla_xdp_flags, decode_ifla_xdp): New functions.
	(ifla_linkinfo_nla_decoders, ifla_port_nla_decoders,
	ifla_vf_port_nla_decoders, ifla_xdp_nla_decoders): New arrays.
	(ifinfomsg_nla_decoders) <IFLA_LINKINFO>: Use decode_ifla_linkinfo.
	<IFLA_VF_PORTS>: Use decode_ifla_vf_ports.
	<IFLA_PORT_SELF>: Use decode_ifla_port.
	<IFLA_XDP>: Use decode_ifla_xdp.
	* xlat/rtnl_ifla_info_attrs.in: New file.
	* xlat/rtnl_ifla_port_attrs.in: Likewise.
	* xlat/rtnl_ifla_vf_port_attrs.in: Likewise.
	* xlat/rtnl_ifla_xdp_attrs.in: Likewise.
	* xlat/xdp_flags.in: Likewise.

2017-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	keyctl: add support for KDF parameters decoding in KEYCTL_DH_COMPUTE.
	* fetch_struct_keyctl_kdf_params.c: New file.
	* keyctl_kdf_params.h: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* configure.ac: Add check for struct keyctl_kdf_params presence in
	<linux/keyctl.h>.
	* defs.h (struct strace_keyctl_kdf_params): Add forward declaration.
	* keyctl.c (keyctl_dh_compute): Add new parameter kdf_addr, print it
	on exiting.
	(SYS_FUNC(keyctl)) <case KEYCTL_DH_COMPUTE>: Pass arg5 to
	keyctl_dh_compute.
	* tests/keyctl.c: Include assert.h.
	(struct keyctl_kdf_params) [!HAVE_STRUCT_KEYCTL_KDF_PARAMS]: New
	definition.
	(STR32): New definition, copied from ioctl_dm.c.
	(append_str, kckdfp_to_str): New functions.
	(main): Update expected output, add checks for struct keyctl_kdf_params
	decoding.

	tests/keyctl: improve readability.
	* tests/keyctl.c: Since do_keyctl() has so convoluted calling convention
	and keyctl test is so complex, let's try to improve readability a bit
	with some conventions regarding do_keyctl() call formatting: arguments
	representing single keyctl argument should be put on the separate line,
	continuations of arguments related to the same keyctl argument should
	have additional indentation and termination 0UL should always be
	on a separate line.  Also, while we are here, let's add spaces
	to two type casts that are missing them.

2017-09-01  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	s390: update ioctl entries from linux 4.13.
	* linux/s390/ioctls_arch0.h: Update from linux v4.13-rc7 using ioctls_gen.sh.

2017-09-01  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.awk: fix regression introduced by the previous cleanup.
	* mpers.awk (what_is): Remove returned_size from local variables.

	Fixes: v4.18-308-gfd3447b5 ("mpers.awk: declare local variables consistently")

2017-09-01  Dmitry V. Levin  <ldv@altlinux.org>

	rtnl_link: enhance decoding of struct rtnl_link_stats{,64}
	Enhance runtime detection of struct rtnl_link_stats.rx_nohandler
	and struct rtnl_link_stats64.rx_nohandler.

	* rtnl_link.c (decode_rtnl_link_stats): Do not accept structure length
	greater than min_size but less than sizeof(struct rtnl_link_stats).
	(decode_rtnl_link_stats64): Likewise, so not accept structure length
	greater than min_size but less than sizeof(struct rtnl_link_stats64).

2017-09-01  Dmitry V. Levin  <ldv@altlinux.org>

	rtnl_neightbl: enhance decoding of struct ndt_stats.
	Add support of kernels that operate with older definition of
	struct ndt_stats than the definition used to build strace.

	* rtnl_neightbl.c (decode_ndt_stats): Add runtime detection
	of struct ndt_stats.ndts_table_fulls field, print the field
	when it is available.

2017-09-01  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of IFLA_PROTINFO netlink attribute of ifinfomsg.
	* tests/nlattr_ifla_brport.c: New file.
	* tests/gen_tests.in (nlattr_ifla_brport): New entry.
	* tests/pure_executables.list: Add nlattr_ifla_brport.
	* tests/.gitignore: Likewise.
	* tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT): New macro.

	rtnl_link: decode IFLA_PROTINFO netlink attribute of ifinfomsg.
	* configure.ac (AC_CHECK_TYPES): Check for ifla_bridge_id
	and rtnl_link_stats64 structures in <linux/if_link.h>.
	* rtnl_link.c: Include "xlat/rtnl_ifla_brport_attrs.h".
	(decode_ifla_bridge_id, decode_ifla_protinfo): New functions.
	(ifla_brport_nla_decoders): New array.
	(ifinfomsg_nla_decoders) <IFLA_PROTINFO>: Use decode_ifla_protinfo.
	* xlat/rtnl_ifla_brport_attrs.in: New file.

	tests: check decoding of ndtmsg netlink attributes.
	* tests/nlattr_ndtmsg.c (NDTA_PARMS, NDTPA_IFINDEX): New macros.
	(main): Check decoding of NDTA_CONFIG, NDTA_PARMS and NDTA_STATS.

	rtnl_neightbl: decode ndtmsg netlink attributes.
	* configure.ac (AC_CHECK_TYPES): Check for ndt_config
	and ndt_stats structures in <linux/neighbour.h>.
	(AC_CHECK_MEMBERS): Check for ndts_table_fulls field in struct ndt_stats.
	* rtnl_neightbl.c: Include "xlat/rtnl_neightbl_parms_attrs.h".
	(decode_ndt_config, decode_ndta_parms, decode_ndta_parms): New functions.
	(ndt_parms_nla_decoders, ndtmsg_nla_decoders): New arrays.
	(decode_ndtmsg): Use ndtmsg_nla_decoders.
	* xlat/rtnl_neightbl_parms_attrs.in: New file.

	tests: check decoding of ifaddrlblmsg netlink attributes.
	* tests/nlattr_ifaddrlblmsg.c (main): Check decoding of IFAL_ADDRESS.

	rtnl_addrlabel: decode ifaddrlblmsg netlink attributes.
	* rtnl_addrlabel.c (decode_ifal_address): New function.
	(ifaddrlblmsg_nla_decoders): New array.
	(decode_ifaddrlblmsg): Use it.

2017-09-01  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: wire up new syscalls.
	* linux/alpha/syscallent.h [514..522]: New entries.

2017-08-31  JingPiao Chen  <chenjingpiao@gmail.com>

	tests/.gitignore: add missing files that should be ignored.
	* tests/.gitignore: Add is_linux_mips_n64.

2017-08-31  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.awk: declare local variables consistently.
	* mpers.awk (compare_indices): Make c1 and c2 variables local.
	(enter): Make item variable local.
	(what_is): Make loc_diff, returned_size, and to_return local.

2017-08-30  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.awk: separate local variables from real parameters by newline.
	* mpers.awk (array_get, update_upper_bound): Separate local variables
	from real parameters by newline.

2017-08-29  Dmitry V. Levin  <ldv@altlinux.org>

	rtnl_rule: enhance FRA_TABLE decoding.
	The attribute of FRA_TABLE is not just a 32-bit integer, some constants
	have well-known symbolic names like RT_TABLE_DEFAULT.

	* rtnl_rule.c (fib_rule_hdr_nla_decoders) <FRA_TABLE>:
	Use decode_nla_rt_class.
	* tests/nlattr_fib_rule_hdr.c (FRA_TABLE): New macro.
	(main): Check FRA_TABLE decoding.

2017-08-29  Dmitry V. Levin  <ldv@altlinux.org>

	rtnl_route: enhance RTA_TABLE decoding.
	The attribute of RTA_TABLE is not just a 32-bit integer, some constants
	have well-known symbolic names like RT_TABLE_DEFAULT.

	* nlattr.h (decode_nla_rt_class): New prototype.
	* rtnl_route.c (decode_nla_rt_class): New function.
	(rtmsg_nla_decoders) <RTA_TABLE>: Use it.
	* tests/nlattr_rtmsg.c (main): Check RTA_TABLE decoding.

2017-08-29  JingPiao Chen  <chenjingpiao@gmail.com>

	rtnl_nsid: decode rtgenmsg netlink attributes.
	* rtnl_nsid.c (rtgenmsg_nla_decoders): New array.
	(decode_rtgenmsg): Use it.

	rtnl_netconf: decode netconfmsg netlink attributes.
	* rtnl_netconf.c (netconfmsg_nla_decoders): New array.
	(decode_netconfmsg): Use it.

	tests: check decoding of ndmsg netlink attributes.
	* tests/nlattr_ndmsg.c: Include <netinet/in.h> and <arpa/inet.h>.
	(NDA_PORT): New macro.
	(main): Check decoding of NDA_DST, NDA_CACHEINFO and NDA_PORT.

	rtnl_neigh: decode ndmsg netlink attributes.
	* nlattr.c: Include <netinet/in.h> and <arpa/inet.h>.
	(decode_nla_be16): New function.
	* nlattr.h (decode_nla_be16): New prototype.
	* rtnl_neigh.c (decode_neigh_addr,
	decode_nda_cacheinfo): New functions.
	(ndmsg_nla_decoders): New array.
	(decode_ndmsg): Use it.

	tests: check decoding of fib_rule_hdr netlink attributes.
	* tests/nlattr_fib_rule_hdr.c: Include <inttypes.h>.
	(FRA_TUN_ID, FRA_UID_RANGE): New macros.
	(main): Check decoding of FRA_DST, FRA_UID_RANGE and FRA_TUN_ID.

	rtnl_rule: decode fib_rule_hdr netlink attributes.
	* configure.ac (AC_CHECK_FUNCS): Add be64toh.
	(AC_CHECK_TYPES): Check for struct fib_rule_uid_range
	in <linux/fib_rules.h>.
	* nlattr.c: Include <endian.h>.
	(decode_nla_be64): New function.
	* nlattr.h (decode_nla_be64): New prototype.
	* rtnl_rule.c (decode_rule_addr,
	decode_fib_rule_uid_range): New functions.
	(fib_rule_hdr_nla_decoders): New array.
	(decode_fib_rule_hdr): Use it.

	rtnl_neigh: fix ndm_type field decode in struct ndmsg.
	* defs.h (routing_types): New xlat prototype.
	* rtnl_neigh.c (decode_ndmsg): Fix ndm_type decode.
	* xlat/nda_types.in: Remove it.
	* tests/netlink_route.c (test_rtnl_neigh): Update the test.
	* tests/nlattr_ndmsg.c (init_ndmsg, print_ndmsg): Likewise.

2017-08-28  Dmitry V. Levin  <ldv@altlinux.org>

	Disallow more than one signal= specification in an injection expression.
	Specifying several signal= specifications in an injection expressions
	makes no sense.

	* filter_qualify.c (parse_inject_token): Disallow second
	signal= specification.
	* strace.1.in: Document it.
	* tests/qual_inject-syntax.test: Check it.

2017-08-28  Dmitry V. Levin  <ldv@altlinux.org>

	Add "flags" field to struct inject_data.
	Introduce "flags" field to struct inject_data and use it instead
	of magic rval and signo constants.
	Due to layout of struct inject_data, this new field does not change
	sizeof(struct inject_data).

	* defs.h (INJECT_F_RETVAL, INJECT_F_SIGNAL): New macros.
	(INJECT_OPTS_RVAL_DEFAULT): Remove macro.
	(struct inject_data): Add "flags" field.
	* filter_qualify.c (parse_inject_token, qualify_inject_common): Check
	struct inject_data.flags instead of inject_data.rval
	and inject_data.signo, do not initialize inject_opts.data.
	* syscall.c (tamper_with_syscall_entering): Check struct
	inject_data.flags instead of inject_data.rval and inject_data.signo.

2017-08-28  Dmitry V. Levin  <ldv@altlinux.org>
	    Victor Krapivensky  <krapivenskiy.va@phystech.edu>

	Move inject data of struct inject_opts to inject_data substructure.
	* defs.h (inject_data): New structure.
	(struct inject_opts): Replace "signo" and "rval" fields with "data"
	field of type "struct inject_data".
	* filter_qualify.c (parse_inject_token, qualify_inject_common): Update
	for the new layout of struct inject_opts.
	* syscall.c (tamper_with_syscall_entering, tamper_with_syscall_exiting):
	Likewise.

2017-08-28  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v4.13-rc7.
	* linux/32/ioctls_inc_align16.h: Update from linux v4.13-rc7 using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/arm/ioctls_arch0.h: Likewise.
	* linux/i386/ioctls_arch0.h: Likewise.
	* linux/powerpc/ioctls_arch0.h: Likewise.
	* linux/s390x/ioctls_arch0.h: Likewise.
	* linux/x86_64/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

2017-08-28  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of ifinfomsg netlink attributes.
	* tests/nlattr_ifinfomsg.c: Include <stddef.h> and <linux/if_link.h>.
	(IFLA_LINK_NETNSID): New macro.
	(main): Check decoding of IFLA_LINK_NETNSID,
	IFLA_STATS, IFLA_MAP and IFLA_STATS64.

	rtnl_link: decode ifinfomsg netlink attributes.
	* configure.ac (AC_CHECK_HEADERS): Add linux/if_link.h.
	(AC_CHECK_TYPES): Check for struct rtnl_link_stats64
	in <linux/if_link.h>.
	(AC_CHECK_MEMBERS): Check for rx_nohandler field
	in struct rtnl_link_stats/rtnl_link_stats64.
	* rtnl_link.c: Include <linux/if_link.h>.
	(decode_rtnl_link_stats, decode_rtnl_link_ifmap,
	decode_rtnl_link_stats64): New functions.
	(ifinfomsg_nla_decoders): New array.
	(decode_ifinfomsg): Use it.

2017-08-28  Dmitry V. Levin  <ldv@altlinux.org>
	    Eugene Syromyatnikov  <evgsyr@gmail.com>

	Imply RVAL_DECODED when RVAL_IOCTL_PARSED is returned on entering.
	Also, rename RVAL_IOCTL_PARSED to RVAL_IOCTL_DECODED as the latter
	is a more suitable name.

	* defs.h (RVAL_IOCTL_PARSED): Rename to RVAL_IOCTL_DECODED.
	* ioctl.c (ioctl_decode): Update comment.
	(SYS_FUNC(ioctl)): Replace RVAL_IOCTL_PARSED with RVAL_IOCTL_DECODED,
	add convertation of RVAL_IOCTL_DECODED to RVAL_DECODED.
	* block.c (block_ioctl): Replace RVAL_DECODED | RVAL_IOCTL_PARSED
	with RVAL_IOCTL_DECODED on entering.  Replace RVAL_IOCTL_PARSED
	with RVAL_IOCTL_DECODED on exiting.
	* btrfs.c (btrfs_ioctl): Likewise.
	* evdev.c: Likewise.
	* file_ioctl.c: Likewise.
	* fs_x_ioctl.c: Likewise.
	* hdio.c: Likewise.
	* loop.c: Likewise.
	* mtd.c: Likewise.
	* nsfs.c: Likewise.
	* print_sg_req_info.c: Likewise.
	* ptp.c: Likewise.
	* rtc.c: Likewise.
	* scsi.c: Likewise.
	* sg_io_v3.c: Likewise.
	* sg_io_v4.c: Likewise.
	* sock.c: Likewise.
	* term.c: Likewise.
	* ubi.c: Likewise.
	* userfaultfd.c: Likewise.
	* dm.c (dm_known_ioctl): Return RVAL_IOCTL_DECODED on exiting and 0
	on entering.  Replace RVAL_IOCTL_PARSED with RVAL_IOCTL_DECODED
	on exiting.
	* v4l2.c: Likewise.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Replace return 1 ioctl sub-decoder hack with proper flag.
	* defs.h (RVAL_IOCTL_PARSED): Introduce new flag for ioctl sub-decoders
	* to signalise that they have successfully printed argument.
	* ioctl.c (SYS_FUNC(ioctl)): Check for RVAL_IOCTL_PARSED flag, remove
	un-set it before returning the value.
	* block.c: Use RVAL_IOCTL_PARSED instead of 1.
	* btrfs.c: Likewise.
	* dm.c: Likewise.
	* evdev.c: Likewise.
	* file_ioctl.c: Likewise.
	* fs_x_ioctl.c: Likewise.
	* hdio.c: Likewise.
	* loop.c: Likewise.
	* mtd.c: Likewise.
	* nsfs.c: Likewise.
	* print_sg_req_info.c: Likewise.
	* ptp.c: Likewise.
	* rtc.c: Likewise.
	* scsi.c: Likewise.
	* sg_io_v3.c: Likewise.
	* sg_io_v4.c: Likewise.
	* sock.c: Likewise.
	* term.c: Likewise.
	* ubi.c: Likewise.
	* userfaultfd.c: Likewise.
	* v4l2.c: Likewise.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: streamline logic.
	Move exiting path out of if (entering(tcp)) { ... return 0; } else,
	provide common exit point in v4l2_ioctl handler, use break instead of
	return in specific command handlers.

	* v4l2.c (print_v4l2_format, print_v4l2_buffer, print_v4l2_standard,
	print_v4l2_input, print_v4l2_frmivalenum): Move exiting path out of else
	par of the entering(tcp) condition.
	(v4l2_ioctl): Add return RVAL_DECODED | 1 at the end of function.
	(v4l2_ioctl) <case VIDIOC_S_STD, case VIDIOC_S_INPUT>: Replace return
	with break.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: reorder field printing in order to avoid auxstr usage.
	Also rework flow a little in order to reduce amount of indentation.

	* v4l2.c (print_v4l2_requestbuffers): Print count as the last field on
	entering, append it with updated value on exiting.
	* tests/ioctl_v4l2.c: Update expected output.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	userfaultfd: streamline logic.
	Make userfaultfd ioctl handling more in line with other ioctl decoders.

	* userfaultfd.c (uffdio_ioctl): Return RVAL_DECODED | 1, break instead
	of returning in specific command handlers, return 0 on entering paths,
	move exiting paths out of else branch of entering(tcp) condition.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Do not return RVAL_DECODED on exiting path of ioctl decoders.
	* print_sg_req_info.c (decode_sg_req_info): Return 1 instead of
	RVAL_DECODED | 1 on exiting path.
	* scsi.c (decode_sg_scsi_id): Likewise.
	* sg_io_v3.c (decode_response): Likewise.
	* sg_io_v4.c (decode_response): Likewise.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	dm: return RVAL_DECODED instead of 0 if we can't decode command.
	Return RVAL_DECODED if we can't decode command in order to avoid being
	called on exiting.

	* dm.c (dm_ioctl): Return RVAL_DECODED instead of 0 if command can't be
	decoded.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Return 0 instead of 1 on entering path of ioctl decoders.
	As returning 1 (without RVAL_DECODED) on entering makes no sense.

	* block.c (block_ioctl) <case BLKTRACESETUP>: Replace return 1 with
	return 0 on entering path.
	* ptp.c (ptp_ioctl) <case PTP_SYS_OFFSET>: Likewise.
	* sg_io_v3.c (decode_request): Likewise.
	* sg_io_v4.c (decode_request): Likewise.
	* sock.c (decode)ifconf, sock_ioctl) <case SIOCGIFMAP>: Likewise.
	* ubi.c (ubi_ioctl) <case UBI_IOCMKVOL, case UBI_IOCATT>: Likewise.
	* v4l2.c (print_v4l2_ext_controls): Likewise.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ioctl: simplify ioctl_decode handling, document its return value semantics
	* ioctl.s (SYS_FUNC(ioctl.c)): Unconditionally unset 1, simply print arg
	when (ret & RVAL_DECODED) && !(ret & 1).

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	syscall.c: define personality names for all multi-personality architectures
	I see no reason for not having these definitions for SPARC64 and RISC-V.
	Also, borrow the check template from supported_personalities.h.

	* syscall.c (update_personality) [defined RISCV, defined SPARC64]
	<PERSONALITY_NAMES>: Define it for these architectures.

2017-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	copyright-year-gen: workaround for old git versions.
	Apply the same treatment to this script as the one in
	v4.18-278-g295cf32.

	* copyright-year-gen <year>: Change format to format:%cD, remove --date,
	supply output as a -d option argument to date +%Y.

2017-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ubi: trim overly long lines.

	term: use print_quoted_string.
	* term.c (decode_termios): Use print_quoted_string for printing c_cc field
	instead of writing the printing code by hand.

2017-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	update_copyright_years.sh: workaround for old git versions.
	Old git versions (like the one shipped in Debian 8) do not support setting
	date format with --date, working this around by processing git log output
	with date +%Y.

	* main/update_copyright_years.sh (process_file) <first_commit_year,
	last_commit_year>: Change format to format:%aD, remove --date, supply
	output as a -d option argument to date +%Y.

2017-08-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	syscall: use spaces in tile personality names, de-duplicate definition.
	As Chris Metcalf, the author of v4.7-40-g0b99a8a, told in private, there
	is no strong reason for having tile's personality name different from
	personality names on other architectures, so let's use spaces instead of
	dashes here. And, while we are here, remove duplication of personality
	name definitions for various architectures.

	* syscall.c (update_personality) [defined TILE]: Change dashes to spaces
	in personality names.

2017-08-26  JingPiao Chen  <chenjingpiao@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of rtmsg netlink attributes.
	* tests/nlattr_rtmsg.c: Include <netinet/in.h> and <arpa/inet.h>.
	(LWTUNNEL_ENCAP_NONE, RTA_ENCAP_TYPE): New macros.
	(main): Check decoding of RTA_DST, RTA_OIF, RTA_METRICS, RTA_MULTIPATH,
	RTA_CACHEINFO, RTA_MFC_STATS, RTA_VIA, and RTA_ENCAP_TYPE.

	rtnl_route: decode rtmsg netlink attributes.
	* configure.ac (AC_CHECK_TYPES): Check for
	rta_mfc_stats and rtvia structures in <linux/rtnetlink.h>.
	* nlattr.c (decode_nla_ifindex): New function.
	* nlattr.h (decode_nla_ifindex): New prototype.
	* rtnl_route.c (decode_route_addr, decode_rta_metrics,
	decode_rta_multipath, decode_rta_cacheinfo,
	decode_rta_mfc_stats, decode_rtvia,
	decode_rta_encap_type): New functions.
	(rta_metrics_nla_decoders, rtmsg_nla_decoders): New arrays.
	(decode_rtmsg): Use rtmsg_nla_decoders.
	* xlat/lwtunnel_encap_types.in: New file.
	* xlat/route_nexthop_flags.in: Likewise.
	* xlat/rtnl_rta_metrics_attrs.in: Likewise.

2017-08-25  Dmitry V. Levin  <ldv@altlinux.org>

	s390: wire up s390_guarded_storage syscall.
	* linux/s390/syscallent.h [378]: Add s390_guarded_storage entry.
	* linux/s390x/syscallent.h: Likewise.

	microblaze: wire up statx syscall.
	* linux/microblaze/syscallent.h [398]: Add statx entry.

2017-08-24  Dmitry V. Levin  <ldv@altlinux.org>

	alloc_number_set_array: add ATTRIBUTE_MALLOC.
	* number_set.h: Include "gcc_compat.h".
	(alloc_number_set_array): Add ATTRIBUTE_MALLOC.

2017-08-24  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

	Add macros for testing QUAL_* flags.
	* defs.h (traced, raw, inject): Add macros for testing QUAL_TRACE,
	QUAL_RAW, and QUAL_INJECT flags.
	* syscall.c (syscall_entering_trace, syscall_exiting_trace): Use them.

2017-08-24  Dmitry V. Levin  <ldv@altlinux.org>

	Remove QUAL_SIGNAL, QUAL_READ and QUAL_WRITE.
	Remove these flags that are unused since commit v4.15~26.
	They might be introduced later with a different meaning.

	* defs.h (QUAL_SIGNAL, QUAL_READ, QUAL_WRITE): Remove.

2017-08-24  Eugene Syromiatnikov  <evgsyr@gmail.com>

	xstrdup, xtrndup: allow NULL argument.
	Accept NULL argument in xstrdup and xtrndup functions to allow use
	of "xstrdup(str)" instead of "str ? xstrdup(str) : NULL".

	* xmalloc.c (xstrdup, xstrndup): Handle NULL argument.
	* xmalloc.h: Add comment regarding this deviation from the behaviour
	of the POSIX counterparts of these functions.

2017-08-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: really skip mips o32 scno tampering tests on mips n64.
	* tests/is_linux_mips_n64.c: New file.
	* tests/Makefile.am (check_PROGRAMS): Add it.
	* tests/scno_tampering.sh <$STRACE_ARCH == mips>:
	In case of mips o32 abi, skip the test if is_linux_mips_n64 says
	that the kernel is mips n64, even if "uname -m" claims it's mips.

2017-08-22  Dmitry V. Levin  <ldv@altlinux.org>

	Hide struct number_set implementation details from users.
	* number_set.h (number_slot_t, struct number_set): Move to number_set.c.
	(struct number_set): Add forward declaration.
	(read_set, write_set, signal_set): Change prototypes from objects
	to pointers.
	* filter_qualify.c (read_set, write_set, signal_set): Change definitions
	from objects to pointers.
	(abbrev_set, inject_set, raw_set, trace_set, verbose_set): Change
	definitions from arrays to pointers.
	(qualify_read): Initialize read_set before first use.
	(qualify_write): Initialize write_set before first use.
	(qualify_signals): Initialize signal_set before first use.
	(qualify_trace): Initialize trace_set before first use.
	(qualify_abbrev): Initialize abbrev_set before first use.
	(qualify_verbose): Initialize verbose_set before first use.
	(qualify_raw): Initialize raw_set before first use.
	(qualify_inject_common): Initialize inject_set before first use.
	* strace.c (print_signalled, print_stopped): Update signal_set usage.
	* syscall.c (dumpio): Update usage of read_set and write_set.

	Extend number_set interface.
	* number_set.h (number_set_array_is_empty, is_number_in_set_array,
	add_number_to_set_array, clear_number_set_array,
	invert_number_set_array, alloc_number_set_array, free_number_set_array):
	New function prototypes.
	* number_set.c (number_set_array_is_empty, is_number_in_set_array,
	add_number_to_set_array, clear_number_set_array,
	invert_number_set_array, alloc_number_set_array, free_number_set_array):
	New functions.
	* basic_filters.c (qualify_syscall_number, qualify_syscall_regex,
	qualify_syscall_class, qualify_syscall_name): Use
	add_number_to_set_array.
	(qualify_syscall_tokens, qualify_tokens): Use
	clear_number_set_array and invert_number_set_array.
	* filter_qualify.c (qualify_inject_common): Use alloc_number_set_array,
	number_set_array_is_empty, is_number_in_set_array,
	add_number_to_set_array, and free_number_set_array.
	(qual_flags): Use is_number_in_set_array.

	Move number_set interface to separate files.
	* number_set.c: New file.
	* number_set.h: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* basic_filters.c: Include "number_set.h".
	(number_slot_t, struct number_set): Move to number_set.h.
	(BITS_PER_SLOT, number_setbit, number_isset, reallocate_number_set,
	add_number_to_set, is_number_in_set): Move to number_set.c.
	* defs.h (struct number_set): Remove forward declaration.
	(read_set, write_set, signal_set, is_number_in_set): Move to number_set.h.
	* filter.h (add_number_to_set): Move to number_set.h.
	* filter_qualify.c: Include "number_set.h".
	(number_slot_t, struct number_set): Remove.
	* strace.c: Include "number_set.h".
	* syscall.c: Likewise.

2017-08-22  Edgar Kaziakhmedov  <edgar.kaziakhmedov@virtuozzo.com>

	Move SUPPORTED_PERSONALITIES to a separate file.
	Since the defs.h contains unrelated declarations which are
	redundant (and sometimes conflicting) for other binaries included
	in the strace package, move SUPPORTED_PERSONALITIES defintions
	to a separate file.

	* defs.h: Include "supported_personalities.h".
	(SUPPORTED_PERSONALITIES): Move ...
	* supported_personalities.h: ... to the new file.
	* Makefile.am (strace_SOURCES): Add it.

2017-08-22  Edgar Kaziakhmedov  <edgar.kaziakhmedov@virtuozzo.com>

	Move string_to_uint* functions to a separate file.
	Make string_to_uint* functions available to other binaries
	included in the strace package.

	* string_to_uint.h: New file.
	* defs.h: Include it.
	(string_to_uint_ex, string_to_uint_upto, string_to_uint): Move
	to string_to_uint.h.
	* util.c (string_to_uint_ex, string_to_uint): Move ...
	* string_to_uint.c: ... to the new file.
	* Makefile.am (strace_SOURCES): Add string_to_uint.h and string_to_uint.c.

2017-08-22  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of ifaddrmsg netlink attributes.
	* tests/nlattr_ifaddrmsg.c: Include <arpa/inet.h>.
	(IFA_FLAGS, SET_IFA_FAMILY): New macros.
	(init_ifaddrmsg): Set ifaddrmsg.ifa_family field from ifa_family.
	(print_ifaddrmsg): Print ifaddrmsg.ifa_family field using ifa_family_str.
	(main): Check decoding of IFA_ADDRESS, IFA_CACHEINFO, and IFA_FLAGS.

	rtnl_addr: decode ifaddrmsg netlink attributes.
	* rtnl_addr.c (decode_ifa_address,
	decode_ifa_cacheinfo, decode_ifa_flags): New functions.
	(ifaddrmsg_nla_decoders): New array.
	(decode_ifaddrmsg): Use it.

2017-08-22  Dmitry V. Levin  <ldv@altlinux.org>

	Export decode_inet_addr.
	* defs.h (decode_inet_addr): New prototype.
	* netlink_inet_diag.c (decode_inet_addr): Remove static keyword, move ...
	* sockaddr.c: ... here.

	netlink_inet_diag: prepare decode_inet_addr for export.
	* netlink_inet_diag.c (decode_inet_addr): Change return type to bool,
	parametrize field name using new var_name argument.
	(decode_inet_diag_hostcond): Specify "addr" field name
	to decode_inet_addr.

2017-08-20  Dmitry V. Levin  <ldv@altlinux.org>

	print_inet_addr: add support of invocations without field name.
	Prepare print_inet_addr for use in structureless contexts where
	no structure field name is available.

	* sockaddr.c (print_inet_addr): Handle var_name == NULL.

2017-08-19  Dmitry V. Levin  <ldv@altlinux.org>

	print_inet_addr: print address of unsupported family in hex.
	* sockaddr.c (print_inet_addr): Specify QUOTE_FORCE_HEX
	to print_quoted_string.

2017-08-18  Dmitry V. Levin  <ldv@altlinux.org>

	mips o32: do not bail out in get_syscall_args if umoven fails.
	If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3,
	both PTRACE_PEEKDATA and process_vm_readv become unavailable when the
	process dumpable flag is cleared.  As the first 4 syscall arguments are
	still available via registers, do not treat this as get_syscall_args
	error.

	This condition is triggered and therefore tested by prctl-dumpable test.

	* linux/mips/get_syscall_args.c (get_syscall_args) [LINUX_MIPSO32]:
	Do not bail out if umoven fails.

2017-08-17  Dmitry V. Levin  <ldv@altlinux.org>

	configure: cleanup struct statfs/statfs64 member checks.
	* configure.ac <AC_CHECK_TYPES([struct statfs])>: Merge several
	AC_CHECK_MEMBERS checks of struct statfs members into a single check.
	<AC_CHECK_TYPES([struct statfs64])>: Likewise, for checks
	of struct statfs64 members.

2017-08-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix a few harmless -Woverflow compilation warnings.
	Fix the following compilation warnings on platforms where
	sizeof(struct timeval.tv_usec) < sizeof(long):

	xettimeofday.c: In function ‘main’:
	xettimeofday.c:76:16: warning: overflow in implicit constant conversion [-Woverflow]
	  tv->tv_usec = (long) 0xbadc0dedfacefeedLL;
	xetitimer.c: In function ‘main’:
	xetitimer.c:170:28: warning: overflow in implicit constant conversion [-Woverflow]
	  p_new->it_value.tv_usec = (long) 0xbadc0dedfacefeedLL;
	In file included from utimes.c:38:0:
	xutimes.c: In function ‘main’:
	xutimes.c:110:18: warning: overflow in implicit constant conversion [-Woverflow]
	  tv[1].tv_usec = (long) 0xbadc0dedfacefeedLL;
	futimesat.c: In function ‘main’:
	futimesat.c:121:18: warning: overflow in implicit constant conversion [-Woverflow]
	  tv[1].tv_usec = (long) 0xbadc0dedfacefeedLL;
	In file included from _newselect.c:35:0:
	xselect.c: In function ‘main’:
	xselect.c:94:16: warning: overflow in implicit constant conversion [-Woverflow]
	  tv->tv_usec = (long) 0xbadc0dedfacefeedLL;
	                ^
	* tests/futimesat.c (main): In initialization of struct timeval.tv_usec,
	change explicit cast from (long) to (suseconds_t).
	* tests/xetitimer.c: Likewise.
	* tests/xettimeofday.c: Likewise.
	* tests/xselect.c: Likewise.
	* tests/xutimes.c: Likewise.

	Reported-by: Anatoly Pugachev <matorola@gmail.com>

2017-08-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix sigaction.test on sparc.
	On sparc, the first argument of old sigaction syscall has negated
	semantics, compared to other architectures.  While sigaction.test
	was aware about this arch-specific detail from the beginning, in one
	of many sigaction syscall invocations a non-negative signal number
	was erroneously passed on sparc.

	* tests/sigaction.c (ADDR_INT, SIGNO_INT): New arch-specific macros.
	(signo, addr): Use them.

2017-08-16  Dmitry V. Levin  <ldv@altlinux.org>

	nlattr: fix printing of unrecognized attribute data.
	Do not print more than "nlattr.nla_len - NLA_HDRLEN" bytes
	of unrecognized attribute data.

	* nlattr.c (decode_nlattr_with_data): Specify "nla_len - NLA_HDRLEN"
	instead of "len - NLA_HDRLEN" as the size of unrecognized attribute
	data.
	* tests/nlattr.c (test_nlattr): Check it.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_ROUTE rtgenmsg attributes.
	* tests/nlattr_rtgenmsg.c: New file.
	* tests/gen_tests.in (nlattr_rtgenmsg): New entry.
	* tests/pure_executables.list: Add nlattr_rtgenmsg.
	* tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add basic decoding of NETLINK_ROUTE rtgenmsg attributes.
	* rtnl_nsid.c: Include "nlattr.h" and "xlat/rtnl_nsid_attrs.h".
	(decode_rtgenmsg): Call decode_nlattr.
	* xlat/rtnl_nsid_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_ROUTE br_port_msg attributes.
	* tests/nlattr_br_port_msg.c: New file.
	* tests/gen_tests.in (nlattr_br_port_msg): New entry.
	* tests/pure_executables.list: Add nlattr_br_port_msg.
	* tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add basic decoding of NETLINK_ROUTE br_port_msg attributes.
	* rtnl_mdb.c: Include "netlink.h", "nlattr.h".
	and "xlat/rtnl_mdb_attrs.h".
	(decode_br_port_msg): Call decode_nlattr.
	* xlat/rtnl_mdb_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_ROUTE netconfmsg attributes.
	* tests/nlattr_netconfmsg.c: New file.
	* tests/gen_tests.in (nlattr_netconfmsg): New entry.
	* tests/pure_executables.list: Add nlattr_netconfmsg.
	* tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add basic decoding of NETLINK_ROUTE netconfmsg attributes.
	* rtnl_netconf.c: Include "netlink.h", "nlattr.h",
	and "xlat/rtnl_netconf_attrs.h".
	(decode_netconfmsg): Call decode_nlattr.
	* xlat/rtnl_netconf_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_ROUTE dcbmsg attributes.
	* tests/nlattr_dcbmsg.c: New file.
	* tests/gen_tests.in (nlattr_dcbmsg): New entry.
	* tests/pure_executables.list: Add nlattr_dcbmsg.
	* tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add basic decoding of NETLINK_ROUTE dcbmsg attributes.
	* rtnl_dcb.c: Include "netlink.h", "nlattr.h",
	and "xlat/rtnl_dcb_attrs.h".
	(decode_dcbmsg): Call decode_nlattr.
	* xlat/rtnl_dcb_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_ROUTE ifaddrlblmsg attributes.
	* tests/nlattr_ifaddrlblmsg.c: New file.
	* tests/gen_tests.in (nlattr_ifaddrlblmsg): New entry.
	* tests/pure_executables.list: Add nlattr_ifaddrlblmsg.
	* tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add basic decoding of NETLINK_ROUTE ifaddrlblmsg attributes.
	* rtnl_addrlabel.c: Include "netlink.h", "nlattr.h",
	and "xlat/rtnl_addrlabel_attrs.h".
	(decode_ifaddrlblmsg): Call decode_nlattr.
	* xlat/rtnl_addrlabel_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_ROUTE tcamsg attributes.
	* tests/nlattr_tcamsg.c: New file.
	* tests/gen_tests.in (nlattr_tcamsg): New entry.
	* tests/pure_executables.list: Add nlattr_tcamsg.
	* tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add basic decoding of NETLINK_ROUTE tcamsg attributes.
	* rtnl_tc_action.c: Include "nlattr.h" and "xlat/rtnl_tc_action_attrs.h".
	(decode_tcamsg): Call decode_nlattr.
	* xlat/rtnl_tc_action_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_ROUTE tcmsg attributes.
	* tests/nlattr_tcmsg.c: New file.
	* tests/gen_tests.in (nlattr_tcmsg): New entry.
	* tests/pure_executables.list: Add nlattr_tcmsg.
	* tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add basic decoding of NETLINK_ROUTE tcmsg attributes.
	* rtnl_tc.c: Include "nlattr.h" and "xlat/rtnl_tc_attrs.h".
	(decode_tcmsg): Call decode_nlattr.
	* xlat/rtnl_tc_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_ROUTE ndtmsg attributes.
	* tests/nlattr_ndtmsg.c: New file.
	* tests/gen_tests.in (nlattr_ndtmsg): New entry.
	* tests/pure_executables.list: Add nlattr_ndtmsg.
	* tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add basic decoding of NETLINK_ROUTE ndtmsg attributes.
	* rtnl_neightbl.c: Include "nlattr.h" and "xlat/rtnl_neightbl_attrs.h".
	(decode_ndtmsg): Call decode_nlattr.
	* xlat/rtnl_neightbl_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_ROUTE ndmsg attributes.
	* tests/nlattr_ndmsg.c: New file.
	* tests/gen_tests.in (nlattr_ndmsg): New entry.
	* tests/pure_executables.list: Add nlattr_ndmsg.
	* tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add basic decoding of NETLINK_ROUTE ndmsg attributes.
	* rtnl_neigh.c: Include "nlattr.h" and "xlat/rtnl_neigh_attrs.h".
	(decode_ndmsg): Call decode_nlattr.
	* xlat/rtnl_neigh_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_ROUTE fib_rule_hdr attributes.
	* tests/nlattr_fib_rule_hdr.c: New file.
	* tests/gen_tests.in (nlattr_fib_rule_hdr): New entry.
	* tests/pure_executables.list: Add nlattr_fib_rule_hdr.
	* tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add basic decoding of NETLINK_ROUTE fib_rule_hdr attributes.
	* rtnl_rule.c: Include "nlattr.h" and "xlat/rtnl_rule_attrs.h".
	(decode_fib_rule_hdr): Call decode_nlattr.
	* xlat/rtnl_rule_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_ROUTE rtmsg attributes.
	* tests/nlattr_rtmsg.c: New file.
	* tests/gen_tests.in (nlattr_rtmsg): New entry.
	* tests/pure_executables.list: Add nlattr_rtmsg.
	* tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add basic decoding of NETLINK_ROUTE rtmsg attributes.
	* rtnl_route.c: Include "nlattr.h" and "xlat/rtnl_route_attrs.h".
	(decode_rtmsg): Call decode_nlattr.
	* xlat/rtnl_route_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_ROUTE ifaddrmsg attributes.
	* tests/nlattr_ifaddrmsg.c: New file.
	* tests/gen_tests.in (nlattr_ifaddrmsg): New entry.
	* tests/pure_executables.list: Add nlattr_ifaddrmsg.
	* tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add basic decoding of NETLINK_ROUTE ifaddrmsg attributes.
	* rtnl_addr.c: Include "nlattr.h" and "xlat/rtnl_addr_attrs.h".
	(decode_ifaddrmsg): Call decode_nlattr.
	* xlat/rtnl_addr_attrs.in: New file.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_ROUTE ifinfomsg attributes.
	* tests/nlattr_ifinfomsg.c: New file.
	* tests/gen_tests.in (nlattr_ifinfomsg): New entry.
	* tests/pure_executables.list: Add nlattr_ifinfomsg.
	* tests/.gitignore: Likewise.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add basic decoding of NETLINK_ROUTE ifinfomsg attributes.
	* rtnl_link.c: Include "nlattr.h" and "xlat/rtnl_link_attrs.h".
	(decode_ifinfomsg): Call decode_nlattr.
	* xlat/rtnl_link_attrs.in: New file.

2017-08-15  Dmitry V. Levin  <ldv@altlinux.org>

	tests/test_nlattr.h: include <stdint.h>
	* tests/test_nlattr.h: Include <stdint.h> for definition of uint16_t
	used by init_nlattr.

	tests: use ifindex_lo and IFINDEX_LO_STR.
	* tests/netlink_route.c: Do not check for HAVE_IF_INDEXTONAME.
	(if_nametoindex, IFINDEX_LO): Remove.
	(test_rtnl_link, test_rtnl_addr, test_rtnl_neigh, test_rtnl_tc,
	test_rtnl_addrlabel, test_rtnl_mdb): Use ifindex_lo instead
	of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string.
	* tests/netlink_sock_diag.c: Do not check for HAVE_IF_INDEXTONAME.
	(if_nametoindex, IFINDEX_LO): Remove.
	(test_inet_diag_sockid, test_inet_diag_req, test_inet_diag_req_v2,
	test_inet_diag_msg, test_smc_diag_req): Use ifindex_lo instead
	of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string.
	* tests/nlattr_inet_diag_msg.c: Do not check for HAVE_IF_INDEXTONAME.
	(if_nametoindex, IFINDEX_LO): Remove.
	(init_inet_diag_msg): Use ifindex_lo instead of if_nametoindex.
	(print_inet_diag_msg): Use IFINDEX_LO_STR instead of hardcoded string.
	* tests/nlattr_inet_diag_req_compat.c: Do not check
	for HAVE_IF_INDEXTONAME.
	(if_nametoindex, IFINDEX_LO): Remove.
	(init_inet_diag_req): Use ifindex_lo instead of if_nametoindex.
	(print_inet_diag_req): Use IFINDEX_LO_STR instead of hardcoded string.
	* tests/nlattr_inet_diag_req_v2.c: Do not check for HAVE_IF_INDEXTONAME.
	(if_nametoindex, IFINDEX_LO): Remove.
	(init_inet_diag_req_v2, print_inet_diag_req_v2,
	test_inet_diag_bc_dev_cond): Use ifindex_lo instead of if_nametoindex,
	use IFINDEX_LO_STR instead of hardcoded string.
	* tests/nlattr_packet_diag_msg.c: Do not check for HAVE_IF_INDEXTONAME.
	(if_nametoindex, IFINDEX_LO): Remove.
	(main): Use ifindex_lo instead of if_nametoindex.
	(print_packet_diag_mclist): Use IFINDEX_LO_STR instead of hardcoded
	string.

	tests/net-sockaddr: use ifindex_lo and IFINDEX_LO_STR.
	* tests/net-sockaddr.c (if_nametoindex): Remove declaration.
	(check_in6_linklocal, check_ll): Remove HAVE_IF_INDEXTONAME checks,
	Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR instead
	of hardcoded string.

	tests/msg_control: use ifindex_lo and IFINDEX_LO_STR.
	* tests/msg_control.c (test_ip_pktinfo): Use ifindex_lo instead
	of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string.

	tests/inet-cmsg: use IFINDEX_LO_STR.
	* tests/inet-cmsg.c (print_pktinfo): Use IFINDEX_LO_STR instead
	of hardcoded string.

	tests/ip_mreq: use ifindex_lo and IFINDEX_LO_STR.
	* tests/ip_mreq.c: Do not check for HAVE_IF_INDEXTONAME.
	(main): Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR
	instead of hardcoded string.

	tests/group_req: use ifindex_lo and IFINDEX_LO_STR.
	* tests/group_req.c: Do not check for HAVE_IF_INDEXTONAME.
	(main): Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR
	instead of hardcoded string.

	tests: add ifindex_lo function and IFINDEX_LO_STR macro to libtests.
	* tests/ifindex.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.
	* tests/tests.h (ifindex_lo): New prototype.
	(IFINDEX_LO_STR): New macro.

2017-08-15  JingPiao Chen  <chenjingpiao@gmail.com>

	configure.ac: remove redundant linux/dcbnl.h header check.
	* configure.ac (AC_CHECK_HEADERS): Remove linux/dcbnl.h.
	* rtnl_dcb.c: Replace HAVE_LINUX_DCBNL_H with HAVE_STRUCT_DCBMSG.
	* tests/netlink_route.c: Likewise.

2017-08-14  Eugene Syromyatnikov  <evgsyr@gmail.com>

	pathtrace: fix typo in comment.

	pathtrace: limit amount of checked poll fds similarly to select limit.
	* pathtrace.c (pathtrace_match_set): Limit the maximum descriptor number
	checked for fd match in poll family syscalls to 1024 * 1024.

	pathtrace: fail poll path match on first failed umove.
	* pathtrace.c (pathtrace_match_set): When checking descriptors of poll
	family syscalls for fd match, break the loop on first failed umove call.

2017-08-14  JingPiao Chen  <chenjingpiao@gmail.com>

	Update NEWS.

2017-08-14  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	tests: check decoding of rtnetlink nsid messages.
	* tests/netlink_route.c (test_rtnl_nsid): New function.
	(main): Use it.

	netlink: add a basic rtnetlink parser of nsid messages.
	* rtnl_nsid.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* netlink_route.h (decode_rtgenmsg): New prototype.
	* netlink_route.c (route_decoders): Add RTM_DELNSID, RTM_GETNSID,
	and RTM_NEWNSID.

	tests: check decoding of rtnetlink mdb messages.
	* tests/netlink_route.c: Include <netinet/in.h>
	and <linux/if_bridge.h>.
	(test_rtnl_mdb): New function.
	(main): Use it.

	netlink: add a basic rtnetlink parser of mdb messages.
	* rtnl_mdb.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* netlink_route.h (decode_br_port_msg): New prototype.
	* configure.ac (AC_CHECK_TYPES): Check for struct br_port_msg
	in <linux/if_bridge.h>.
	* netlink_route.c (route_decoders): Add RTM_DELMDB, RTM_GETMDB,
	and RTM_NEWMDB.

	tests: check decoding of rtnetlink netconf messages.
	* tests/netlink_route.c: Include <linux/netconf.h>.
	(test_rtnl_netconf): New function.
	(main): Use it.

	netlink: add a basic rtnetlink parser of netconf messages.
	* rtnl_netconf.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* netlink_route.h (decode_netconfmsg): New prototype.
	* configure.ac (AC_CHECK_TYPES): Check for struct netconfmsg
	in <linux/netconf.h>.
	* netlink_route.c (route_decoders): Add RTM_GETNETCONF
	and RTM_NEWNETCONF.

	tests: check decoding of rtnetlink dcb messages.
	* tests/netlink_route.c: Include <linux/dcbnl.h>.
	(test_rtnl_dcb): New function.
	(main): Use it.

	netlink: add a basic rtnetlink parser of dcb messages.
	* rtnl_dcb.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* netlink_route.h (decode_dcbmsg): New prototype.
	* configure.ac (AC_CHECK_HEADERS): Add linux/dcbnl.h.
	(AC_CHECK_TYPES): Check for struct dcbmsg in <linux/dcbnl.h>.
	* netlink_route.c (route_decoders): Add RTM_GETDCB and RTM_SETDCB.
	* xlat/dcb_commands.in: New file.

	tests: check decoding of rtnetlink addrlabel messages.
	* tests/netlink_route.c: Include <linux/if_addrlabel.h>.
	(test_rtnl_addrlabel): New function.
	(main): Use it.

	netlink: add a basic rtnetlink parser of addrlabel messages.
	* rtnl_addrlabel.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* netlink_route.h (decode_ifaddrlblmsg): New prototype.
	* configure.ac (AC_CHECK_TYPES): Check for struct ifaddrlblmsg
	in <linux/if_addrlabel.h>.
	* netlink_route.c (route_decoders): Add RTM_DELADDRLABEL,
	RTM_GETADDRLABEL, and RTM_NEWADDRLABEL.

	tests: check decoding of rtnetlink tc action messages.
	* tests/netlink_route.c (test_rtnl_tca): New function.
	(main): Use it.

	netlink: add a basic rtnetlink parser of tc action messages.
	* rtnl_tc_action.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* netlink_route.h (decode_tcamsg): New prototype.
	* netlink_route.c (route_decoders): Add RTM_DELACTION, RTM_GETACTION,
	and RTM_NEWACTION.

	tests: check decoding of rtnetlink tc messages.
	* tests/netlink_route.c (test_rtnl_tc): New function.
	(main): Use it.

	netlink: add a basic rtnetlink parser of tc messages.
	* rtnl_tc.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* netlink_route.h (decode_tcmsg): New prototype.
	* netlink_route.c (route_decoders): Add RTM_DELQDISC,
	RTM_GETQDISC, RTM_NEWQDISC, RTM_DELTCLASS, RTM_GETTCLASS,
	RTM_NEWTCLASS, RTM_DELTFILTER, RTM_GETTFILTER, and RTM_NEWTFILTER.

	tests: check decoding of rtnetlink neightbl messages.
	* tests/netlink_route.c (test_rtnl_neightbl): New function.
	(main): Use it.

	netlink: add a basic rtnetlink parser of neightbl messages.
	* rtnl_neightbl.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* netlink_route.h (decode_ndtmsg): New prototype.
	* netlink_route.c (route_decoders): Add RTM_GETNEIGHTBL,
	RTM_NEWNEIGHTBL, and RTM_SETNEIGHTBL.

	tests: check decoding of rtnetlink neigh messages.
	* tests/netlink_route.c: Include <linux/neighbour.h>.
	(test_rtnl_neigh): New function.
	(main): Use it.

	netlink: add a basic rtnetlink parser of neigh messages.
	* rtnl_neigh.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* netlink_route.h (decode_ndmsg, decode_rtm_getneigh): New prototypes.
	* configure.ac (AC_CHECK_HEADERS): Add linux/neighbour.h.
	* netlink_route.c (route_decoders): Add RTM_DELNEIGH, RTM_DELNEIGH,
	and RTM_NEWNEIGH.
	* xlat/nda_types.in: New file.
	* xlat/neighbor_cache_entry_flags.in: Likewise.
	* xlat/neighbor_cache_entry_states.in: Likewise.

	tests: check decoding of rtnetlink rule messages.
	* tests/netlink_route.c: Include <linux/fib_rules.h>.
	(test_rtnl_rule): New function.
	(main): Use it.

	netlink: add a basic rtnetlink parser of rule messages.
	* defs.h (routing_table_ids): New xlat prototype.
	* rtnl_rule.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (ip_type_of_services, routing_table_ids): New xlat prototypes.
	* netlink_route.h (decode_fib_rule_hdr): New prototype.
	* configure.ac (AC_CHECK_HEADERS): Add linux/fib_rules.h.
	* netlink_route.c (route_decoders): Add RTM_DELRULE, RTM_GETRULE,
	and RTM_NEWRULE.
	* xlat/fib_rule_actions.in: New file.
	* xlat/fib_rule_flags.in: Likewise.

	tests: check decoding of rtnetlink route messages.
	* tests/netlink_route.c: Include <linux/ip.h>.
	(test_rtnl_route): New function.
	(main): Use it.

	netlink: add a basic rtnetlink parser of route messages.
	* defs.h (routing_scopes): New xlat prototype.
	* rtnl_route.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* netlink_route.h (decode_rtmsg): New prototype.
	* netlink_route.c (route_decoders): Add RTM_DELROUTE, RTM_GETROUTE,
	and RTM_NEWROUTE.
	* xlat/ip_type_of_services.in: New file.
	* xlat/routing_flags.in: Likewise.
	* xlat/routing_protocols.in: Likewise.
	* xlat/routing_table_ids.in: Likewise.
	* xlat/routing_types.in: Likewise.

	tests: check decoding of rtnetlink addr messages.
	* tests/netlink_route.c: Include <linux/if_addr.h>.
	(test_rtnl_addr): New function.
	(main): Use it.

2017-08-13  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add a basic rtnetlink parser of addr messages.
	* rtnl_addr.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* configure.ac (AC_CHECK_HEADERS): Add linux/if_addr.h.
	* netlink_route.h (decode_ifaddrmsg): New prototype.
	* netlink_route.c (route_decoders): Add RTM_DELADDR,
	RTM_GETADDR, RTM_GETANYCAST, RTM_GETMULTICAST, and RTM_NEWADDR.
	* xlat/ifaddrflags.in: New file.
	* xlat/routing_scopes.in: Likewise.

2017-08-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Make description of discrepancies between libc and kernel APIs more relevant
	Looks like this part was untouched since the days strace supported OSes
	other than Linux. Well, it's time to make it more contemporary.

	* strace.1.in (.SH NOTES): Use faccessat(2) and setrlimit(2)/prlimit(2)
	instead of time(2) and stat(2)/xstat(2) as examples of libc/kernel API
	discrepancies.

2017-08-11  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NLMSG_DONE messages of NETLINK_ROUTE.
	* tests/netlink_route.c (test_nlmsg_done): New function.
	(main): Use it.

2017-08-11  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

	Add TF flag to inotify_add_watch syscall entries.
	The second argument of the inotify_add_watch syscall is a file name,
	but inotify_add_watch has no TF flag set.

	* linux/32/syscallent.h (inotify_add_watch): Add TF flag.
	* linux/64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

2017-08-11  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

	pathtrace: fix matching of execveat syscall.
	* pathtrace.c (pathtrace_match_set): Add testing of SEN_execveat.

2017-08-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1: add indentation to examples.
	* strace.1 (.de CW): Add .in +4n.
	(.de CE): Add .in.

	Generate date for the man page.
	* Makefile.am (dist-hook): Add .strace.1.in.date generation.
	* strace.spec.in (%setup): Likewise.
	* configure.ac (manpage_date): New m4 define.
	(MANPAGE_DATE): New define/subst.
	* strace.1 (.TH): Add manpage date and strace's version.

	Add script for generating date of the last commit for specific file.
	* file-date-gen: New auxiliary script.

	Make strace.1 generated.
	* .gitignore (/strace.1): New entry.
	* configure.ac (AC_CONFIG_FILES): Add strace.1.
	* strace.1.in: Rename from strace.1.

2017-08-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1: format synopsis using .SY/.OP macros.
	Also, add .OM and .OR macros and use { ... | ... } syntax for indicating
	possible options regarding mandatory arguments.

	* strace.1 (.OM, .OR): New macro definitions, based on .OP
	(.SH SYNOPSYS): Format using .SY/.OP/.OM/.OR. Put -p/command inside
	{ ... | ... } block.

2017-08-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1: remove date from .TH, as it is no longer relevant.
	* strace.1 (.TH): Remove date.

2017-08-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1: remove .IX definition.
	It is present in groff macros nowadays.

	* strace.1 (.de IX): Remove.

2017-08-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1: replace .TP with .TQ between command-line option variants.
	In order to eliminate unneeded space between them.

	* strace.1 (Filtering): Replace .TP with .TQ between different variants
	of the same option.

2017-08-09  Dmitry V. Levin  <ldv@altlinux.org>

	rtnl_link: include "netlink.h" before <linux/rtnetlink.h>
	<sys/socket.h> has to be included before <linux/netlink.h> because
	the latter used to be incomplete in older kernel headers.

	As a local wrapper file called netlink.h was introduced earlier
	to workaround this and related portability issues, include it before
	<linux/rtnetlink.h> that in turn includes <linux/netlink.h>.

	This fixes build on systems with older kernel headers.

	* rtnl_link.c: Include "netlink.h" before <linux/rtnetlink.h>.

2017-08-09  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	tests: check decoding of rtnetlink link messages.
	* tests/netlink_route.c: Include <linux/if_arp.h>.
	(TEST_NL_ROUTE): New macro.
	(test_rtnl_link): New function.
	(main): Use it.

	netlink: add a basic rtnetlink parser of link messages.
	* netlink_route.h: New file.
	* rtnl_link.c: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* defs.h (arp_hardware_types, iffflags): New xlat prototypes.
	* netlink_route.c: Include "netlink_route.h"
	and <linux/rtnetlink.h>.
	(netlink_route_decoder_t): New typedef.
	(route_decoders): New array.
	(decode_netlink_route): Use it.

2017-08-09  JingPiao Chen  <chenjingpiao@gmail.com>

	Move nl_route_types definition from netlink.c to netlink_route.c.
	The side effect of #include "xlat/nl_route_types.h" is
	RTM_* constants properly defined in that header file.
	While netlink.c does not use these constants itself,
	netlink_route.c is going to need them soon.

	* defs.h (nl_route_types): New xlat prototype.
	* netlink.c: Move inclusion of "xlat/nl_route_types.h" ...
	* netlink_route.c: ... here.

2017-08-09  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	tests: check netlink family specific decoder of NETLINK_ROUTE.
	* tests/netlink_route.c: Include <stdint.h>,
	include "test_netlink.h" instead of "netlink.h".
	(test_rtnl_unspec): New function.
	(main): Use it.

	netlink: introduce family specific decoder of NETLINK_ROUTE.
	* netlink_route.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (decode_netlink_route): New prototype.
	* netlink.c (netlink_decoders): Add NETLINK_ROUTE.

2017-08-08  JingPiao Chen  <chenjingpiao@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of NETLINK_KOBJECT_UEVENT messages.
	* tests/netlink_kobject_uevent.c: New file.
	* tests/gen_tests.in (netlink_kobject_uevent): New entry.
	* tests/pure_executables.list: Add netlink_kobject_uevent.
	* tests/.gitignore: Likewise.

2017-08-08  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: add decoding of NETLINK_KOBJECT_UEVENT messages.
	* netlink.c (decode_netlink): Print NETLINK_KOBJECT_UEVENT messages
	as a string using printstrn.

2017-08-08  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: call get_fd_nl_family before nlmsghdr decoding.
	Prepare for decoding of NETLINK_KOBJECT_UEVENT.  Messages of the latter,
	unlike traditional netlink families, don't contain a header at all.

	* netlink.c (NL_FAMILY_*): Remove enum.
	(get_fd_nl_family): Replace NL_FAMILY_ERROR with -1.
	(decode_nlmsg_type): Update the comment.
	Skip family specific type decoders for type < NLMSG_MIN_TYPE.
	(decode_nlmsghdr_with_payload): Skip family specific decoders
	for type < NLMSG_MIN_TYPE && type != NLMSG_DONE.
	(print_nlmsghdr): Move get_fd_nl_family invocation ...
	(decode_nlmsghdr_with_payload): ... here.

2017-08-07  Dmitry V. Levin  <ldv@altlinux.org>

	Make sysent_shorthand_defs.h suitable for tests.
	* sysent_shorthand_defs.h [STRACE_TESTS_H]: Add shorthand notations from
	tests/ksysent.c and tests/nsyscalls.c.
	* tests/ksysent.c: Remove shorthand notations.
	* tests/nsyscalls.c: Likewise.

2017-08-07  Edgar Kaziakhmedov  <edgar.kaziakhmedov@virtuozzo.com>

	Move sysent shorthand notations to separate files.
	Avoid proliferation of exactly the same definitions of shorthand
	notations for macros defined in sysent.h by moving definitions
	and undefs of these shorthand notations to separate files.

	* sysent_shorthand_defs.h: New file.
	* sysent_shorthand_undefs.h: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* syscall.c: Use them.

2017-08-07  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink.c: fix indentation.
	* netlink.c (print_cookie): Fix indentation.

2017-08-07  Edgar Kaziakhmedov  <edgar.kaziakhmedov@virtuozzo.com>

	Move err/mem subroutines to separate files.
	In order to allow usage of utility functions by other binaries
	included in the strace package (like the upcoming asinfo utility),
	these functions should be moved to separate files.

	* error_prints.h: New file.
	* xmalloc.h: Likewise.
	* defs.h: Include "xmalloc.h" and "error_prints.h".
	(error_msg, error_msg_and_die, error_msg_and_help, perror_msg,
	perror_msg_and_die): Move to error_prints.h.
	(xcalloc, xmalloc, xreallocarray, xstrdup, xstrndup): Move to xmalloc.h.
	* strace.c (die): Remove static quialifier to make visible
	by error_prints.c.
	(error_msg, error_msg_and_die, error_msg_and_help, perror_msg,
	perror_msg_and_die, verror_msg): Move ...
	* error_prints.c: ... to the new file.
	* xmalloc.c: Include "config.h", <stdlib.h>, <string.h>,
	"error_prints.h", and "xmalloc.h" instead of "defs.h".
	Use int instead of bool.  Fix codestyle.
	* Makefile.am (strace_SOURCES): Add error_prints.c, error_prints.h,
	and xmalloc.h.

2017-08-07  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

	tests: move check_* functions from options-syntax.test to separate file.
	* tests/options-syntax.test: Move check_* functions to ...
	* tests/syntax.sh: ... new file.
	* tests/Makefile.am (EXTRA_DIST): Add syntax.sh.

2017-08-07  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

	Split qualify.c into basic_filters.c and filter_qualify.c.
	This change also exports add_number_to_set, qualify_tokens,
	and qualify_syscall_tokens.

	* basic_filters.c: New file, part of qualify.c.
	* filter_qualify.c: Likewise.
	* filter.h: New file.
	* qualify.c: Remove.
	* Makefile.am (strace_SOURCES): Add new files, remove qualify.c.

2017-08-06  Dmitry V. Levin  <ldv@altlinux.org>

	Simplify handling of unexpected tracees.
	* strace.c (maybe_allocate_tcb) <WIFSTOPPED(status) && !followfork>:
	Remove the dance around possible re-injection of WSTOPSIG(status)
	as the only observable stop here is the initial ptrace-stop.

	Fix handling of unexpected tracees when PTRACE_SEIZE is not in use.
	* strace.c (maybe_allocate_tcb) <WIFSTOPPED(status) && !followfork>:
	The expected ptrace stop signal in case of !use seize is not
	syscall_trap_sig but SIGSTOP.  An idea of using PTRACE_GETSIGINFO to
	distinguish signal stops that should be re-injected from other kinds
	of stops didn't work out due to kernel implementation peculiarities
	of initial ptrace-stop.

	pathtrace: fix matching of symlinkat syscall.
	* pathtrace.c (pathtrace_match_set) <SEN_symlinkat>: The first argument
	of symlinkat syscall is not a path but an arbitrary string, ignore it.

2017-08-06  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

	pathtrace: fix missing syscalls.
	* pathtrace.c (pathtrace_match_set): Fix symlink decoding,
	disable pathtracing for inotify_init.

2017-08-06  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance fflush error diagnostics.
	* strace.c (flush_tcp_output): New function.
	(line_ended, droptcb, print_event_exit): Use it to flush tcp->outf.
	* tests/fflush.c: New file.
	* tests/fflush.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.
	* tests/.gitignore: Add fflush.
	* tests/pure_executables.list: Likewise.

	tests: check handling of CLONE_PARENT'ed and CLONE_PTRACE'ed processes.
	* tests/clone_parent.c: New file.
	* tests/clone_ptrace.c: Likewise.
	* tests/clone_parent.test: New test.
	* tests/clone_ptrace.test: Likewise.
	* tests/.gitignore: Add clone_parent and clone_ptrace.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add clone_parent.test and clone_ptrace.test.

	tests: export a path to the trace executable to check_PROGRAMS.
	* tests/init.sh (STRACE_EXE): Initialize from $STRACE and export.

2017-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Makefile.am: build top directory first.
	This solves potential issues when tests run first and strace is rebuilt
	only after they have finished.  As noted in [1], providing the current
	directory explicitly should help.

	[1] https://www.gnu.org/software/automake/manual/html_node/Subdirectories.html

	* Makefile.am (SUBDIRS): Prepend the current directory.

2017-08-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Improve handling of unexpected tracees.
	When receiving a ptrace stop of an unexpected child, handle it
	in the most transparent way possible:
	- detach it instead of PTRACE_CONT'ing;
	- send it the signal with which it has been stopped.
	This should hopefully help to deal with processes that have been created
	with misused CLONE_PTRACE flag set.

	* strace.c (maybe_allocate_tcb) <WIFSTOPPED(status) && !followfork>:
	Calculate the signal similarly to the way next_event does,
	forward it to the unexpected tracee, and detach the tracee.

2017-08-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix unaligned access in nlattr.test.
	* tests/nlattr.c (test_nlattr): Use SET_STRUCT
	to initialize potentially unaligned struct nlattr.

	tests: fix unaligned access in nlattr_packet_diag_msg.test.
	* tests/nlattr_packet_diag_msg.c (init_packet_diag_msg): Use SET_STRUCT
	to initialize potentially unaligned struct packet_diag_msg.

2017-08-04  Dmitry V. Levin  <ldv@altlinux.org>

	sparc64: do not bail out in get_scno if PTRACE_PEEKTEXT fails.
	If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3,
	PTRACE_PEEKTEXT becames unavailable when the process dumpable flag is
	cleared.  As this is not a fatal condition for get_scno, do not bail out
	if PTRACE_PEEKTEXT fails.

	This condition is triggered and therefore tested by prctl-dumpable test.

	* linux/sparc64/get_scno.c (arch_get_scno): Do not bail out
	if PTRACE_PEEKTEXT fails.

2017-08-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance test coverage of printstrn and umoven.
	* tests/printstrn-umoven.c: New file.
	* tests/printstrn-umoven-peekdata.c: Likewise.
	* tests/printstrn-umoven-undumpable.c: Likewise.
	* tests/printstrn-umoven-legacy.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add printstrn-umoven-legacy.test.
	* tests/gen_tests.in (printstrn-umoven, printstrn-umoven-peekdata,
	printstrn-umoven-undumpable): New entries.
	* tests/pure_executables.list: Add printstrn-umoven,
	printstrn-umoven-peekdata, and printstrn-umoven-undumpable.
	* tests/.gitignore: Likewise.

	tests: add test_printstrn function to libtests.
	* tests/test_ucopy.h (test_printstrn): New prototype.
	* tests/test_printstrn.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.

2017-08-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance test coverage of printpath and umovestr.
	* tests/init.sh (TIMEOUT_DURATION): Raise from 300 to 600.
	* tests/printpath-umovestr.c: New file.
	* tests/printpath-umovestr-peekdata.c: Likewise.
	* tests/printpath-umovestr-undumpable.c: Likewise.
	* tests/printpath-umovestr-legacy.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add printpath-umovestr-legacy.test.
	* tests/gen_tests.in (printpath-umovestr, printpath-umovestr-peekdata,
	printpath-umovestr-undumpable): New entries.
	* tests/pure_executables.list: Add printpath-umovestr,
	printpath-umovestr-peekdata, and printpath-umovestr-undumpable.
	* tests/.gitignore: Likewise.

	tests: add test_printpath function to libtests.
	* tests/test_ucopy.h (test_printpath): New prototype.
	* tests/test_printpath.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.

	tests: add test_process_vm_readv and test_ptrace_peekdata to libtests.
	* tests/test_ucopy.c: New file.
	* tests/test_ucopy.h: Likewise.
	* tests/Makefile.am (libtests_a_SOURCES): Add them.

2017-08-01  Dmitry V. Levin  <ldv@altlinux.org>

	printpath: do not fetch more than PATH_MAX bytes from tracee's memory.
	The kernel does not copy more than PATH_MAX bytes from userspace
	pathnames, treating non-NUL-terminated pathnames as ENAMETOOLONG.

	* util.c (printpathn): Decrease buffer size to PATH_MAX.
	(printpath): Specify PATH_MAX - 1 as the maximum pathname length
	to match the kernel behaviour.  The underlying umovestr call will fetch
	up to PATH_MAX bytes from tracee's memory, but no more than first
	PATH_MAX - 1 bytes will be printed.

2017-07-31  Dmitry V. Levin  <ldv@altlinux.org>

	ucopy: cleanup umoven_peekdata and umovestr_peekdata.
	* ucopy.c (umoven_peekdata, umovestr_peekdata): Merge aligned
	and unaligned tracee address cases.

2017-07-31  Dmitry V. Levin  <ldv@altlinux.org>

	ucopy: move legacy fallbacks of umoven and umovestr to separate functions
	Move legacy PTRACE_PEEKDATA-based support to separate functions.

	* ucopy.c (umoven_peekdata, umovestr_peekdata): New functions.
	(umoven, umovestr): Use them.

2017-07-31  Dmitry V. Levin  <ldv@altlinux.org>

	ucopy: move process_vm_readv ENOSYS check to vm_read_mem.
	* ucopy.c (vm_read_mem): Set process_vm_readv_not_supported in case
	of ENOSYS.
	* ucopy.c (umoven, umovestr): Do not set process_vm_readv_not_supported.

2017-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Print enabled optional features in strace version output.
	In order to provide information to user what optionally built features
	are available.

	* strace.c (print_version): New variable "features".  Print features string
	after non-liability disclaimer (or "(none)" in case it is empty).
	(print_version) [USE_LIBUNWIND]: Concatenate "stack-unwind" into features
	string.
	* tests/strace-V.tests (getoption): New function.
	Update check in accordance with updated output.

2017-07-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/strace-V.test: rename getval to getstr.
	As this name is more suitable.

	* tests/strace-V (getval): Rename to getstr, update all call sites.

2017-07-30  Dmitry V. Levin  <ldv@altlinux.org>

	ucopy: refactor the check for invalid tracee addresses.
	* ucopy.c (tracee_addr_is_invalid): New function.
	* ucopy.c (umoven, umovestr): Use it.

	ucopy: enhance vm_read_mem error diagnostics.
	* ucopy.c (umoven, umovestr): Enhance vm_read_mem error diagnostics
	to match PTRACE_PEEKDATA case.

2017-07-29  Dmitry V. Levin  <ldv@altlinux.org>

	ucopy: skip redundant tracee address truncation check.
	* ucopy.c (vm_read_mem): Skip raddr != truncated_raddr check
	if these variables have the same data size.

2017-07-28  Dmitry V. Levin  <ldv@altlinux.org>

	util: move umoven and umovestr to a separate file.
	These functions are more kernel-specific compared to all other functions
	defined in util.c.

	* ucopy.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* util.c (umoven, umovestr): Move to ucopy.c.

2017-07-27  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: enhance decoding of BPF_MAP_LOOKUP_ELEM and BPF_MAP_GET_NEXT_KEY.
	Print union bpf_attr.value field of BPF_MAP_LOOKUP_ELEM command
	and union bpf_attr.next_key field of BPF_MAP_GET_NEXT_KEY command
	on entering syscall.  These fields are addresses specified to the
	kernel from userspace.  The amount of data written by the kernel
	to these addresses is specified at the map creation time
	by BPF_MAP_CREATE command and is not available at this point.

	* bpf.c (decode_BPF_MAP_LOOKUP_ELEM): Print union bpf_attr.value
	on entering syscall.
	(decode_BPF_MAP_GET_NEXT_KEY): Print union bpf_attr.next_key
	on entering syscall.
	(bpf_map_io): Remove.
	* tests/bpf.c (print_BPF_MAP_DELETE_ELEM_first,
	print_BPF_MAP_DELETE_ELEM_attr, print_BPF_MAP_GET_NEXT_KEY_first,
	print_BPF_MAP_GET_NEXT_KEY_attr): Replace macro redirects with
	new functions.
	(print_BPF_MAP_LOOKUP_ELEM_first, print_BPF_MAP_LOOKUP_ELEM_attr,

2017-07-27  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: update BPF_MAP_CREATE decoding.
	Implement decoding of map_flags and inner_map_fd fields of union bpf_attr
	for BPF_MAP_CREATE command introduced by linux kernel commits
	v4.6-rc1~91^2~108^2~6 and v4.12-rc1~64^3~373^2~2, respectively.

	* configure.ac: Check for inner_map_fd member of union bpf_attr
	instead of max_entries.
	* xlat/bpf_map_flags.in: New file.
	* bpf.c: Include "xlat/bpf_map_flags.h".
	(decode_BPF_MAP_CREATE): Add map_flags and inner_map_fd fields
	to the structure, print them.
	* tests/bpf.c: Update macro guards of BPF_MAP_CREATE decoder test.
	(init_BPF_MAP_CREATE_first, print_BPF_MAP_CREATE_attr): Update expected
	output.
	(init_BPF_MAP_CREATE_attr): Initialize map_flags and inner_map_fd
	fields, update offset.

2017-07-27  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: update BPF_PROG_LOAD decoding.
	Implement decoding of union bpf_attr.prog_flags field for BPF_PROG_LOAD
	command introduced by linux kernel commit v4.12-rc2~34^2~29^2~2.

	* configure.ac: Check for prog_flags member of union bpf_attr
	instead of kern_version.
	* xlat/bpf_prog_flags.in: New file.
	* bpf.c: Include "xlat/bpf_prog_flags.h".
	(decode_BPF_PROG_LOAD): Add prog_flags field to the structure, print it.
	* tests/bpf.c: Update macro guards of BPF_PROG_LOAD decoder test.
	(init_BPF_PROG_LOAD_first, print_BPF_PROG_LOAD_attr): Update expected
	output.
	(init_BPF_PROG_LOAD_attr): Initialize prog_flags field, update offset.

2017-07-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance test coverage of bpf syscall parser.
	* configure.ac: Update union bpf_attr member checks.
	* tests/bpf.c: Rewrite.
	* tests/bpf-v.c: New file.
	* tests/gen_tests.in (bpf-v): New entry.
	* tests/pure_executables.list: Add bpf-v.
	* tests/.gitignore: Likewise.

	m4: macroize union bpf_attr field checks.
	* m4/st_bpf.m4: New file.
	* configure.ac: Use st_CHECK_UNION_BPF_ATTR.

	Move offsetofend from defs.h to macros.h.
	* defs.h (offsetofend): Move ...
	* macros.h: ... here.

2017-07-26  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: print unused fields of union bpf_attr if one of them is non-zero.
	When the size argument specifies more data than necessary for the given
	command, kernel checks that all unused fields of union bpf_attr are
	zero.  Print this extra data when it contains non-zero bytes to enhance
	debugging experience.

	* bpf.c (decode_attr_extra_data): New function.
	(decode_BPF_MAP_CREATE, decode_BPF_MAP_UPDATE_ELEM,
	decode_BPF_MAP_DELETE_ELEM, bpf_map_io, decode_BPF_PROG_LOAD,
	decode_BPF_OBJ_PIN, decode_BPF_OBJ_GET, decode_BPF_PROG_ATTACH,
	decode_BPF_PROG_DETACH): Use it to print extra data passed
	via bpf_attr pointer.
	(bpf_obj_manage, bpf_prog_attach_detach): Remove.
	* tests/bpf.c (map_delete_elem): New function.
	(main): Use it.

2017-07-26  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: change handling of big and unaccessible data to match the kernel.
	When the size argument exceeds PAGE_SIZE, the kernel fails with E2BIG
	without parsing union bpf_attr.
	When the whole chunk of memory specified by addr and size arguments is
	not readable, the kernel fails with EFAULT.

	* bpf.c (DECL_BPF_CMD_DECODER) <bpf_cmd_decoder>: Add const qualifier
	to size argument, add data argument.
	(decode_BPF_MAP_CREATE, decode_BPF_MAP_UPDATE_ELEM,
	decode_BPF_MAP_DELETE_ELEM, bpf_map_io, decode_BPF_PROG_LOAD,
	bpf_obj_manage, bpf_prog_attach_detach): Move size argument check and
	memory fetching ...
	(SYS_FUNC(bpf)) ... here, add PAGE_SIZE check, pass fetched memory
	to command-specific parsers.

2017-07-25  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: replace big switch statement with a dispatch table.
	* bpf.c (DECL_BPF_CMD_DECODER, DEF_BPF_CMD_DECODER, BPF_CMD_ENTRY):
	New macros.
	(bpf_cmd_decoder_t): New typedef.
	Rename static parser functions using DEF_BPF_CMD_DECODER.
	(decode_BPF_MAP_LOOKUP_ELEM, decode_BPF_MAP_GET_NEXT_KEY): New proxy
	functions.
	(SYS_FUNC(bpf)): Replace big switch statement with a dispatch table.

	bpf: use PRINT_FIELD_* macros.
	* print_fields.h (PRINT_FIELD_STR, PRINT_FIELD_PATH): New macros.
	* bpf.c: Include "print_fields.h".
	(bpf_map_create): Use PRINT_FIELD_U and PRINT_FIELD_XVAL.
	(bpf_map_update_elem): Use PRINT_FIELD_FD, PRINT_FIELD_X, and
	PRINT_FIELD_XVAL.
	(bpf_map_delete_elem, bpf_map_io): Use PRINT_FIELD_FD and PRINT_FIELD_X.
	(bpf_prog_load): Use PRINT_FIELD_STR, PRINT_FIELD_U, PRINT_FIELD_X,
	and PRINT_FIELD_XVAL.
	(bpf_obj_manage): Use PRINT_FIELD_FD and PRINT_FIELD_PATH.
	(bpf_prog_attach_detach): Use PRINT_FIELD_FD, PRINT_FIELD_FLAGS,
	and PRINT_FIELD_XVAL.

2017-07-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add terminating comment after each DECL_* macro definition.
	In an attempt to improve readability.

	* defs.h (DECL_IOCTL, DECL_NETLINK, DECL_PRINTNUM, DECL_PRINTNUM_ADDR,
	ATTRIBUTE_FORMAT): Add comment that marks end of macro definition.
	* netlink_sock_diag (DECL_NETLINK_DIAG_DECODER): Likewise.
	* nlattr.h (DECL_NLA): Likewise.

2017-07-24  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce print_quoted_cstring.
	In many places where kernel expects a NUL-terminated string of length
	up to a known fixed limit, e.g. when a NUL-terminated string is
	a fixed-size field of a structure, strace does not print the last byte
	assuming it is NUL, which is not always the case.

	Change output format for such strings to distinguish NUL-terminated
	strings from non-NUL-terminated ones: append ellipsis to the output
	when the string is not NUL-terminated.

	* defs.h (print_quoted_cstring): New prototype.
	* util.c (print_quoted_cstring): New function.
	(printpathn): Use it instead of print_quoted_string with
	QUOTE_0_TERMINATED argument.
	* print_fields.h (PRINT_FIELD_CSTRING): Likewise.
	* btrfs.c (btrfs_ioctl): Likewise.
	* dirent.c (SYS_FUNC(getdents)): Likewise.
	* dirent64.c (SYS_FUNC(getdents64)): Likewise.
	* print_ifindex.c (print_ifindex): Likewise.
	* sysmips.c (SYS_FUNC(sysmips)): Likewise.
	* ubi.c (ubi_ioctl): Likewise.
	* tests/tests.h (print_quoted_cstring): New prototype.
	* tests/print_quoted_string.c (print_quoted_cstring): New function.
	* tests/ioctl_block.c (main): Update expected output.
	* tests/ioctl_dm.c (main): Likewise.
	* tests/ioctl_loop.c (print_loop_info, print_loop_info64): Likewise.
	* tests/netlink_crypto.c (test_crypto_msg_newalg): Likewise.

2017-07-24  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_CRYPTO crypto_user_alg attributes.
	* tests/nlattr_crypto_user_alg.c: New file.
	* tests/gen_tests.in (nlattr_crypto_user_alg): New entry.
	* tests/pure_executables.list: Add nlattr_crypto_user_alg.
	* tests/.gitignore: Likewise.

	tests: extend TEST_NLATTR_OBJECT macro.
	* tests/test_nlattr.h (TEST_NLATTR_OBJECT_EX_,
	TEST_NLATTR_OBJECT_EX): New macros.
	(TEST_NLATTR_OBJECT): Use TEST_NLATTR_OBJECT_EX_.

	netlink: decode NETLINK_CRYPTO crypto_user_alg netlink attributes.
	* configure.ac (AC_CHECK_TYPES): Check for crypto_report_aead,
	crypto_report_blkcipher, crypto_report_cipher, crypto_report_hash,
	and crypto_report_rng structures in <linux/cryptouser.h>.
	* netlink_crypto.c (decode_crypto_report_generic,
	decode_crypto_report_hash, decode_crypto_report_blkcipher,
	decode_crypto_report_aead, decode_crypto_report_rng,
	decode_crypto_report_cipher): New functions.
	(crypto_user_alg_nla_decoders): New array.
	(decode_crypto_user_alg): Use it.
	* xlat/crypto_nl_attrs.in: New file.
	* NEWS: Mention this.

	tests: check decoding of NETLINK_CRYPTO messages.
	* tests/netlink_crypto.c: Include "test_netlink.h"
	instead of "netlink.h".
	(test_crypto_msg_newalg, test_crypto_msg_unspec): New functions.
	(main): Use them.

2017-07-24  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: extend TEST_NETLINK_OBJECT macro.
	As the first field of NETLINK_CRYPTO messages is a string, print
	unrecognized data as a string.  Extend TEST_NETLINK_OBJECT macro
	to test this case.

	* tests/test_netlink.h (TEST_NETLINK_OBJECT_EX_,
	TEST_NETLINK_OBJECT_EX): New macros.
	(TEST_NETLINK_OBJECT): Use TEST_NETLINK_OBJECT_EX_.

2017-07-24  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: add a basic parser of NETLINK_CRYPTO messages.
	* netlink_crypto.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (decode_netlink_crypto): New prototype.
	* netlink.c (netlink_decoders): Add NETLINK_CRYPTO.
	* NEWS: Mention this.

2017-07-23  Dmitry V. Levin  <ldv@altlinux.org>

	Unify PRINT_FIELD_XVAL and PRINT_FIELD_XVAL64.
	* print_fields.h (PRINT_FIELD_XVAL64): Unify with PRINT_FIELD_XVAL.

	Unify PRINT_FIELD_FLAGS and PRINT_FIELD_FLAGS64.
	* print_fields.h (PRINT_FIELD_FLAGS64): Unify with PRINT_FIELD_FLAGS.
	* userfaultfd.c (uffdio_ioctl): Replace PRINT_FIELD_FLAGS64 with
	PRINT_FIELD_FLAGS.

2017-07-23  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

	pathtrace: fix fanotify_mark path tracing on 32-bit architectures.
	The fanotify_mark syscall takes a 64-bit mask, and on 32-bit
	architectures it is split up into two syscall arguments.

	* pathtrace.c (pathtrace_match_set): Use getllval to properly decode
	arguments after mask.

2017-07-22  Dmitry V. Levin  <ldv@altlinux.org>

	travis: add valgrind check support.
	* travis-build.sh [CHECK == valgrind]: Pass --enable-valgrind
	to configure and appropriate check-valgrind-* to make.
	* travis-install.sh [CHECK == valgrind]: Install valgrind.

2017-07-22  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink_sock_diag: replace NLA_ALIGN with NLMSG_ALIGN.
	In several netlink_sock_diag parsers NLA_ALIGN was used instead of
	NLMSG_ALIGN to align the length of netlink messages.  Fortunately,
	both macros round the given length to the closest multiple of 4,
	so technically there is no difference, but the use of wrong macro
	is misleading.

	* netlink_inet_diag.c (decode_inet_diag_req_compat,
	decode_inet_diag_req_v2, decode_inet_diag_msg): Replace
	NLA_ALIGN with NLMSG_ALIGN.
	* netlink_netlink_diag.c (decode_netlink_diag_msg): Likewise.
	* netlink_packet_diag.c (decode_packet_diag_msg): Likewise.
	* netlink_smc_diag.c (decode_smc_diag_msg): Likewise.

2017-07-22  Dmitry V. Levin  <ldv@altlinux.org>

	travis: configure build with dependency tracking disabled.
	Dependency tracking is completely useless for one-time builds,
	so configure build with dependency tracking disabled.

	* travis-build.sh (DISTCHECK_CONFIGURE_FLAGS): Add
	--disable-dependency-tracking.

2017-07-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	m4: remove equal sign from define directive in ax_valgrind_check.m4.
	Support for providing equal sign in define directives has been added
	only in GNU Make 3.82 [1] and it provides the same semantics (variables
	should be recursively expanded) as when it is omitted at all, so let's
	remove it in order to preserve compatibility with older GNU Make
	versions (like the one used on Travis).

	[1] https://git.savannah.gnu.org/cgit/make.git/tree/ChangeLog?h=3.82#n766

	* m4/ax_valgrind_check.m4 <define valgrind_tool_rule>: Remove equal
	sign.

2017-07-21  Dmitry V. Levin  <ldv@altlinux.org>

	keyctl: add support for KEYCTL_RESTRICT_KEYRING operation.
	* keyctl.c (keyctl_restrict_keyring): New function.
	(SYS_FUNC(keyctl)): Use it to implement KEYCTL_RESTRICT_KEYRING support.
	* NEWS: Mention this.
	* tests/keyctl.c (main): Check KEYCTL_RESTRICT_KEYRING decoding.

2017-07-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify strace-t.test.
	If strace -t is running too long, it might happen that time stamps
	before and after its invocation differ for more than a second.
	Adjust expected output to handle this rare but possible case.

	* tests/strace-t.test: Allow any time stamp between start and finish
	of strace invocation.

2017-07-21  Dmitry V. Levin  <ldv@altlinux.org>

	x86: wire up arch_prctl syscall.
	* linux/i386/syscallent.h [384]: Add arch_prctl entry.
	* xlat/archvals.in: Add fallback definitions for constants.
	* prctl.c: Stop including <asm/prctl.h>.
	(SYS_FUNC(arch_prctl)): Enable for [I386].
	* NEWS: Mention this.

2017-07-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tweak strace-ff.test for slow startup case.
	strace starts up much slower when invoked under valgrind control.
	Increase the tracee's sleep delay to let strace more time to attach.

	* tests/strace-ff.test: Increase sleep delay.

2017-07-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: update valgrind suppressions.
	* tests/strace.supp: Add a suppression for the memleak before
	error_msg_and_die in qualify_tokens.

2017-07-21  Dmitry V. Levin  <ldv@altlinux.org>

	Do not copy optarg unnecessarily.
	There is no need to copy the optarg string since it is a pointer
	into the original argv array, not into a static area
	that might be overwritten.

	* strace.c (username, outfname): Add const qualifier.
	(init): Do not xstrdup optarg to initialize outfname and username.

2017-07-20  Dmitry V. Levin  <ldv@altlinux.org>

	travis: add build environment information to the travis log.
	* travis-build.sh: Print build environment information.

2017-07-20  Dmitry V. Levin  <ldv@altlinux.org>

	build: add check-valgrind-* to recursive targets.
	As make -j$N check-valgrind cannot parallelize properly, add
	recursive targets for each of valgrind checks.  This way one can run
		for t in $valgrind_enabled_tools; do
			make -k check-valgrind-$n || rc=$?
		done
	in $top_builddir.

	* configure.ac (AM_EXTRA_RECURSIVE_TARGETS): Remove.
	* m4/ax_valgrind_check.m4 (AX_VALGRIND_CHECK): Add check-valgrind
	and check-valgrind-* to AM_EXTRA_RECURSIVE_TARGETS.

2017-07-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add check-valgrind-local make rule.
	This guarantees that $(check_LIBRARIES) and $(check_PROGRAMS)
	are made on 'make check-valgrind' before its recipe is processed.

	* tests/Makefile.am (check-valgrind-local): New rule.
	(.PHONY): Add it.

2017-07-20  Dmitry V. Levin  <ldv@altlinux.org>

	Add ksysent.h and scno.h to BUILT_SOURCES.
	This guarantees that ksysent.h and scno.h, along with other targets
	listed in BUILT_SOURCES, are made on 'make all', 'make check',
	and 'make check-valgrind' before other targets are processed.

	* scno.am (BUILT_SOURCES): Add scno.h.
	* tests/Makefile.am (BUILT_SOURCES): Add ksysent.h.

2017-07-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix valgrind suppression file path.
	* tests/Makefile.am (VALGRIND_SUPPRESSIONS_FILES): Replace srcdir
	with abs_srcdir.

	Fixes: v4.16-74-g16036030 ("tests: run every test except ksysent.test in its own subdirectory")

2017-07-19  Dmitry V. Levin  <ldv@altlinux.org>

	Update AX_VALGRIND_CHECK.
	* m4/ax_valgrind_check.m4: Update to serial 15.  In particular,
	this version does not eat check-valgrind errors.

	Update AX_CODE_COVERAGE.
	* m4/ax_code_coverage.m4: Update to serial 24.  In particular,
	this version has no lcov version check.
	* Makefile.am (strace_LDADD): Rename CODE_COVERAGE_LDFLAGS
	to CODE_COVERAGE_LIBS.

	Update input event KEY_* constants.
	* xlat/evdev_keycode.in: Add KEY_ASSISTANT introduced by linux kernel
	commit v4.13-rc1~13^2~1^2~1.
	* NEWS: Mention this.

	Update fs *_MAGIC constants.
	* xlat/fsmagic.in: Add AAFS_MAGIC introduced by linux kernel commit
	v4.13-rc1~161^2~87.
	* NEWS: Mention this.

2017-07-19  Dmitry V. Levin  <ldv@altlinux.org>

	Move family-specific NETLINK_SOCK_DIAG parsers to separate files.
	Split netlink_sock_diag.c that grew too big.

	* defs.h (tcp_states, tcp_state_flags): New xlat prototypes.
	* netlink_sock_diag.h: New file.
	* netlink_inet_diag.c: Likewise.
	* netlink_netlink_diag.c: Likewise.
	* netlink_packet_diag.c: Likewise.
	* netlink_smc_diag.c: Likewise.
	* netlink_unix_diag.c: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* netlink_sock_diag.c: Move family-specific parsers and associated
	header includes to separate files.
	* nlattr.h (DECL_NLA(meminfo)): New prototype.
	* nlattr.c: Include <linux/sock_diag.h>.
	(print_meminfo, decode_nla_meminfo): New functions from
	netlink_sock_diag.c.

2017-07-19  Dmitry V. Levin  <ldv@altlinux.org>

	Adjust prototypes of netlink parsing functions.
	Change the type of "len" argument that is based
	on struct nlmsghdr.nlmsg_len from kernel_ulong_t to unsigned int.

	* defs.h (netlink_decoder_t, DECL_NETLINK): Change "len" argument type
	from kernel_ulong_t to unsigned int.
	* netlink.c (decode_nlmsgerr_attr_cookie, decode_nlmsgerr,
	decode_payload): Likewise.
	* netlink_selinux.c (decode_netlink_selinux): Likewise.
	* netlink_sock_diag.c (decode_family, decode_unix_diag_req,
	decode_meminfo, decode_unix_diag_vfs, decode_unix_diag_inode,
	decode_unix_diag_rqlen, decode_unix_diag_msg, decode_netlink_diag_req,
	print_group, decode_netlink_diag_ring, decode_netlink_diag_flags,
	decode_netlink_diag_msg, decode_packet_diag_req,
	decode_packet_diag_info, decode_packet_diag_mclist,
	decode_packet_diag_ring, decode_packet_diag_filter,
	decode_packet_diag_msg, decode_inet_addr, decode_inet_diag_hostcond,
	decode_inet_diag_markcond, decode_bytecode_data, decode_inet_diag_bc_op,
	decode_inet_diag_req_compat, decode_inet_diag_req_v2,
	decode_inet_diag_req, decode_inet_diag_meminfo, decode_tcpvegas_info,
	decode_tcp_dctcp_info, decode_tcp_bbr_info, decode_inet_diag_msg,
	decode_smc_diag_req, decode_smc_diag_conninfo, decode_smc_diag_lgrinfo,
	decode_smc_diag_msg, netlink_diag_decoder_t, decode_netlink_sock_diag):
	Likewise.
	* nlattr.c (fetch_nlattr, decode_nlattr_with_data, decode_nlattr,
	decode_nla_str, decode_nla_strn, DECODE_NLA_INTEGER): Likewise.
	* nlattr.h (nla_decoder_t, DECL_NLA, decode_nlattr): Likewise.

2017-07-19  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of nlmsgerr attributes.
	* tests/nlattr_nlmsgerr.c: New file.
	* tests/gen_tests.in (nlattr_nlmsgerr): New entry.
	* tests/pure_executables.list: Add nlattr_nlmsgerr.
	* tests/.gitignore: Likewise.

	netlink: decode nlmsgerr attributes.
	* netlink.c: Include "nlattr.h" and "xlat/nlmsgerr_attrs.h".
	(print_cookie, decode_nlmsgerr_attr_cookie): New functions.
	(nlmsgerr_nla_decoders): New array.
	(decode_nlmsgerr): Use it.
	* xlat/nlmsgerr_attrs.in: New file.
	* NEWS: Mention this.

2017-07-19  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: adjust decode_nlmsgerr for extended ACK reporting.
	Extended ACK reporting introduced by linux kernel commit
	v4.11-rc5-1382-g2d4bc93.

	* netlink.h (NLM_F_CAPPED): New macro.
	* netlink.c (decode_payload): Pass
	nlmsghdr->nlmsg_flags & NLM_F_CAPPED to decode_nlmsgerr.
	(decode_nlmsgerr): Adjust the length pass to
	decode_nlmsghdr_with_payload.

2017-07-19  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: decode netlink message ack flags.
	* netlink.c: Include "xlat/netlink_ack_flags.h".
	(decode_nlmsg_flags): Decode ack flags when type == NLMSG_ERROR.
	* xlat/netlink_ack_flags.in: New file.
	* NEWS: Mention this.
	* tests/netlink_protocol.c (test_ack_flags): New function, check this.
	(main): Use it.

2017-07-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance error diagnostics.
	* tests/init.sh (dump_log_and_fail_with): Dump $LOG to stderr instead
	of stdout as the latter is more likely to be redirected to a temporary
	file in the context where this function is called.

	tests: enhance timeout diagnostics.
	* tests/init.sh: Trap SIGXCPU.
	* tests/run.sh: Send SIGXCPU instead of SIGKILL in case of timeout, send
	SIGKILL if the command is still running 5 seconds after SIGXCPU.

	userfaultfd: decode struct uffdio_api.features as flags.
	* xlat/uffd_api_features.in: New file.
	* userfaultfd.c: Include "xlat/uffd_api_features.h".
	(uffdio_ioctl): Print struct uffdio_api.features using
	PRINT_FIELD_FLAGS64 and uffd_api_features.
	* NEWS: Mention this.
	* tests/ioctl_uffdio.c: Include "xlat.h" and "xlat/uffd_api_features.h".
	(main): Update expected output.

2017-07-19  Dmitry V. Levin  <ldv@altlinux.org>

	userfaultfd: enhance decoding of struct uffdio_api.features.
	As struct uffdio_api.features has read-write semantics,
	print the value returned by the kernel only when it differs
	from the value passed to the kernel.

	* userfaultfd.c (uffdio_ioctl) <UFFDIO_API>: On entering syscall,
	save the value of struct uffdio_api.features.  On exiting syscall, do
	not print struct uffdio_api.features when it's the same as on entering.
	* tests/ioctl_uffdio.c (main): Update expected output.

2017-07-18  Dmitry V. Levin  <ldv@altlinux.org>

	userfaultfd: use PRINT_FIELD_* macros.
	This also fixes output correctness for struct uffdio_api.features.

	* userfaultfd.c: Include "print_fields.h".
	(tprintf_uffdio_range): Use PRINT_FIELD_X.
	(PRINT_FIELD_UFFDIO_RANGE): New macro.
	(uffdio_ioctl): Use it, PRINT_FIELD_FLAGS64, and PRINT_FIELD_X.
	* tests/ioctl_uffdio.c (main): Update expected output.

2017-07-18  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce PRINT_FIELD_FLAGS64 and PRINT_FIELD_XVAL64.
	* print_fields.h (PRINT_FIELD_FLAGS64, PRINT_FIELD_XVAL64): New macros.

2017-07-17  Dmitry V. Levin  <ldv@altlinux.org>

	Update NEWS.

	aio: change struct iocb.aio_lio_opcode output format.
	* aio.c (tprint_lio_opcode): Change opcode output format to match
	the kernel.
	* tests/aio.c (main): Update expected output.

2017-07-17  Dmitry V. Levin  <ldv@altlinux.org>

	aio: use PRINT_FIELD_* macros.
	This also fixes output correctness for struct iocb.

	* aio.c: Include "print_fields.h".
	(print_common_flags, print_iocb_header, print_iocb, print_io_event):
	Use PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X, PRINT_FIELD_FD,
	and PRINT_FIELD_STRN.
	* tests/aio.c (main): Update expected output.

2017-07-17  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce PRINT_FIELD_FD and PRINT_FIELD_STRN.
	* print_fields.h (PRINT_FIELD_FD, PRINT_FIELD_STRN): New macros.

2017-07-16  Dmitry V. Levin  <ldv@altlinux.org>

	Update BPF_* constants.
	* xlat/bpf_commands.in: Add BPF_PROG_TEST_RUN, BPF_PROG_GET_NEXT_ID,
	BPF_MAP_GET_NEXT_ID, BPF_PROG_GET_FD_BY_ID, BPF_MAP_GET_FD_BY_ID,
	and BPF_OBJ_GET_INFO_BY_FD introduced by linux kernel commits
	v4.12-rc1~64^3~287^2~5, v4.13-rc1~157^2~271^2~5,
	v4.13-rc1~157^2~271^2~4, v4.13-rc1~157^2~271^2~3, and
	v4.13-rc1~157^2~271^2~1, respectively.
	* xlat/bpf_attach_type.in: Add BPF_CGROUP_SOCK_OPS introduced
	by linux kernel commit v4.13-rc1~157^2~37^2~15.
	* xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_SOCK_OPS introduced
	by the same commit.

	Update SO_* constants.
	* xlat/sockoptions.in: Add SO_PEERGROUPS introduced by linux kernel
	commit v4.13-rc1~157^2~124.

	Update SCM_* constants.
	* xlat/scmvals.in: Add SCM_TIMESTAMPING_PKTINFO introduced
	by linux kernel commit v4.13-rc1~157^2~405^2~3.

2017-07-16  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_SELINUX protocol.
	* test_netlink.h (TEST_NETLINK_OBJECT): New macro.
	* tests/netlink_selinux.c: Include "test_netlink.h"
	instead of "netlink.h".
	(test_selnl_msg_unspec, test_selnl_msg_setenforce,
	test_selnl_msg_policyload): New functions.
	(main): Use them.

	netlink: decode NETLINK_SELINUX protocol.
	* netlink_selinux.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (decode_netlink_selinux): New prototype.
	* netlink.c (netlink_decoders): Add NETLINK_SELINUX.

2017-07-15  Dmitry V. Levin  <ldv@altlinux.org>

	sg_io_v3: use PRINT_FIELD_* macros.
	* sg_io_v3.c: Include "print_fields.h".
	(PRINT_FIELD_SG_IO_BUFFER): New macro.
	(decode_request, decode_response): Use it, PRINT_FIELD_D, PRINT_FIELD_U,
	PRINT_FIELD_X, PRINT_FIELD_PTR, PRINT_FIELD_FLAGS, and PRINT_FIELD_XVAL.

	Introduce PRINT_FIELD_PTR.
	* print_fields.h (PRINT_FIELD_PTR): New macro.

2017-07-15  Dmitry V. Levin  <ldv@altlinux.org>

	Provide mpers_ptr_t definition for non-mpers case.
	In mpers case, mpers_ptr_t is already defined by DEF_MPERS_TYPE(...).
	This allows use of mpers_ptr_t regardless of IN_MPERS state.

	* mpers_type.h [!IN_MPERS] (mpers_ptr_t): New typedef.

2017-07-14  Lazar Trsic  <Lazar.Trsic@imgtec.com>

	Move is_negated_errno() to new header negated_errno.h.
	Move is_negated_errno() to a separate new header file negated_errno.h
	and include it just for architectures which require it.

	is_negated_errno() is not used on those architectures
	that have a dedicated register to signal a syscall error.

	The issue was raised when compiling with clang, which is more
	strict regarding semantics of unused static inline functions
	defined in C files and will issue a -Wunused-function warrning
	if they are not used anywhere.

	* syscall.c (is_negated_errno): Move to ...
	* negated_errno.h: ... new file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/aarch64/get_error.c: Include it.
	* linux/arc/get_error.c: Likewise.
	* linux/arm/get_error.c: Likewise.
	* linux/avr32/get_error.c: Likewise.
	* linux/bfin/get_error.c: Likewise.
	* linux/crisv10/get_error.c: Likewise.
	* linux/hppa/get_error.c: Likewise.
	* linux/i386/get_error.c: Likewise.
	* linux/ia64/get_error.c: Likewise.
	* linux/m68k/get_error.c: Likewise.
	* linux/metag/get_error.c: Likewise.
	* linux/microblaze/get_error.c: Likewise.
	* linux/or1k/get_error.c: Likewise.
	* linux/riscv/get_error.c: Likewise.
	* linux/s390/get_error.c: Likewise.
	* linux/sh/get_error.c: Likewise.
	* linux/sh64/get_error.c: Likewise.
	* linux/tile/get_error.c: Likewise.
	* linux/x86_64/get_error.c: Likewise.
	* linux/xtensa/get_error.c: Likewise.

2017-07-14  Dmitry V. Levin  <ldv@altlinux.org>

	sg_io_v4: use PRINT_FIELD_* macros.
	* sg_io_v4.c: Include "print_fields.h".
	(PRINT_FIELD_SG_IO_BUFFER): New macro.
	(decode_request, decode_response): Use it, PRINT_FIELD_D, PRINT_FIELD_U,
	PRINT_FIELD_X, PRINT_FIELD_FLAGS, and PRINT_FIELD_XVAL.

	dm: use PRINT_FIELD_* macros.
	* dm.c (dm_decode_values, dm_decode_dm_target_spec,
	dm_decode_dm_target_deps, dm_decode_dm_target_msg, dm_known_ioctl): Use
	PRINT_FIELD_D, PRINT_FIELD_U, and PRINT_FIELD_FLAGS.

2017-07-13  Dmitry V. Levin  <ldv@altlinux.org>

	Move macros related to kernel types to kernel_types.h.
	Some macros related to kernel types are defined both in defs.h and
	tests/tests.h.  Avoid this redundancy by moving these definitions
	to kernel_types.h.

	* defs.h (PRI_kl, PRI_kld, PRI_klu, PRI_klx, PRI__64, PRI__d64,
	PRI__u64, PRI__x64): Move ...
	* kernel_types.h: ... here.
	* tests/tests.h (PRI__64, PRI__d64, PRI__u64, PRI__x64): Remove.

2017-07-13  Lazar Trsic  <Lazar.Trsic@imgtec.com>

	mips64: fix PRI__64 macro definition when compiled for Android.
	By default for MIPS64 in Android __u64 type is exported
	as unsigned long long.  This caused compilation -Wformat warnings
	and would break the build if -Werror is used.

	* defs.h [SIZEOF_LONG != 4 && MIPS && __ANDROID__] (PRI__64): Change
	from "l" to "ll".

2017-07-13  Dmitry V. Levin  <ldv@altlinux.org>

	block: use PRINT_FIELD_* macros.
	This also fixes output correctness for struct blkpg_ioctl_arg.

	* block.c (print_blkpg_req): Use PRINT_FIELD_D and PRINT_FIELD_XVAL.
	(block_ioctl): Use PRINT_FIELD_U.
	* tests/ioctl_block.c (main): Update expected output.

2017-07-12  Dmitry V. Levin  <ldv@altlinux.org>

	netlink_sock_diag: enhance decoding of long meminfo arrays.
	Print trailing dots instead of silent truncation if the array
	is too long.

	* netlink_sock_diag.c (decode_meminfo): Do not apply SK_MEMINFO_VARS
	limit to nmemb, specify element count to print_array instead.
	(print_meminfo): Check element count and terminate printing
	if the element count exceeds SK_MEMINFO_VARS.
	* tests/nlattr_inet_diag_msg.c (main): Check it.

2017-07-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend coverage of netlink_diag_req decoder.
	Add one more NETLINK_SOCK_DIAG check to ressurrect full coverage
	of netlink_diag_req decoder that was lost after commit
	v4.18-58-g37ef2d0d.

	* tests/netlink_sock_diag.c (test_netlink_diag_req): Add a check for
	sdiag_protocol != NDIAG_PROTO_ALL.

2017-07-12  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_CRYPTO nlmsg_flags.
	* tests/netlink_crypto.c (test_nlmsg_flags): New function.
	(main): Use it.

	netlink: add decoding of NETLINK_CRYPTO nlmsg_flags.
	* netlink.c (decode_nlmsg_flags): Add NETLINK_CRYPTO.

	tests: check decoding of NETLINK_CRYPTO message types.
	* configure.ac (AC_CHECK_HEADERS): Add linux/cryptouser.h.
	* tests/netlink_crypto.c: New file.
	* tests/gen_tests.in (netlink_crypto): New entry.
	* tests/pure_executables.list: Add netlink_crypto.
	* tests/.gitignore: Likewise.

	netlink: add decoding of NETLINK_CRYPTO message types.
	* xlat/nl_crypto_types.in: New file.
	* netlink.c: Include "xlat/nl_crypto_types.h".
	(nlmsg_types): Add NETLINK_CRYPTO.

	tests: introduce TEST_NETLINK and TEST_NETLINK_ macros.
	* tests/test_netlink.h: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.
	* tests/netlink_sock_diag.c: Include "test_netlink.h"
	instead of "netlink.h".
	(TEST_SOCK_DIAG): New macro.
	(test_unix_diag_req, test_unix_diag_msg,
	test_netlink_diag_req, test_netlink_diag_msg,
	test_packet_diag_req, test_packet_diag_msg,
	test_inet_diag_req, test_inet_diag_req_v2,
	test_inet_diag_msg, test_smc_diag_req,
	test_smc_diag_msg): Use it.
	(test_odd_family_req, test_odd_family_msg,
	test_inet_diag_sockid): Use TEST_NETLINK macro.

2017-07-11  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of nlattr_inet_diag_req_v2 attributes.
	* tests/nlattr_inet_diag_req_v2.c: New file.
	* tests/gen_tests.in (nlattr_inet_diag_req_v2): New entry.
	* tests/pure_executables.list: Add nlattr_inet_diag_req_v2.
	* tests/.gitignore: Likewise.

	tests: check decoding of nlattr_inet_diag_req_compat attributes.
	* tests/nlattr_inet_diag_req_compat.c: New file.
	* tests/gen_tests.in (nlattr_inet_diag_req_compat): New entry.
	* tests/pure_executables.list: Add nlattr_inet_diag_req_compat.
	* tests/.gitignore: Likewise.

	netlink: decode AF_INET inet_diag_req_* attributes.
	* linux/inet_diag.h (inet_diag_bc_op, inet_diag_hostcond,
	inet_diag_markcond): New structures.
	(INET_DIAG_BC_*): New enum.
	* netlink_sock_diag.c: Include "xlat/inet_diag_bytecodes.h".
	(decode_inet_addr, decode_inet_diag_hostcond,
	print_inet_diag_bc_op, decode_inet_diag_markcond,
	decode_bytecode_data, decode_inet_diag_bc_op): New functions.
	(inet_diag_req_nla_decoders): New array.
	(decode_inet_diag_req_compat, decode_inet_diag_req_v2): Use it.
	* xlat/inet_diag_bytecodes.in: New file.

2017-07-11  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce PRINT_FIELD_CSTRING.
	* print_fields.h (PRINT_FIELD_CSTRING): New macro.
	* block.c (print_blkpg_req, block_ioctl): Use PRINT_FIELD_CSTRING
	instead of print_quoted_string.
	* btrfs.c (btrfs_ioctl): Likewise.
	* dm.c (dm_decode_device, dm_decode_dm_target_spec): Likewise.
	* loop.c (decode_loop_info, decode_loop_info64): Likewise.
	* v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc,
	print_v4l2_standard, print_v4l2_input, print_v4l2_tuner,
	print_v4l2_queryctrl): Likewise.
	* netlink_sock_diag.c (decode_smc_diag_lgrinfo): Use PRINT_FIELD_CSTRING
	instead of PRINT_FIELD_STRING.
	* uname.c (PRINT_UTS_MEMBER): Remove.
	(SYS_FUNC(uname)): Use PRINT_FIELD_CSTRING instead of PRINT_UTS_MEMBER.

2017-07-11  Dmitry V. Levin  <ldv@altlinux.org>

	Rename PRINT_FIELD_QUOTED_STRING to PRINT_FIELD_STRING.
	As string fields are always qouted when printed, choose a shorter name
	for the helper macro.

	* print_fields.h (PRINT_FIELD_QUOTED_STRING): Rename
	to PRINT_FIELD_STRING.  All callers updated.

2017-07-10  Dmitry V. Levin  <ldv@altlinux.org>

	Update RWF_* constants.
	* xlat/rwf_flags.in: Add RWF_NOWAIT introduced by linux kernel
	commit v4.12-rc5-150-gb745fafa.

	Intorduce PRINT_FIELD_0X.
	* print_fields.h (PRINT_FIELD_0X): New macro.
	* sockaddr.c (print_sockaddr_data_ipx, print_sockaddr_data_nl): Use it
	instead of manual tprintf statements.
	* netlink_sock_diag.c (PRINT_FIELD_SMC_DIAG_CONNINFO_FLAGS): Remove.
	(decode_smc_diag_conninfo): Replace it with PRINT_FIELD_0X.

	print_inet_addr: use inet_addr-based output format for IPv4.
	* sockaddr.c (print_inet_addr): Remove af_name variable.
	<AF_INET>: Use inet_addr-based output format.
	* tests/netlink_sock_diag.c (test_inet_diag_sockid, test_inet_diag_req,
	test_inet_diag_req_v2, test_inet_diag_msg, test_smc_diag_req,
	test_smc_diag_msg): Update expected output.
	* tests/nlattr_inet_diag_msg.c (print_inet_diag_msg): Likewise.
	* tests/nlattr_smc_diag_msg.c (print_smc_diag_msg): Likewise.

2017-07-10  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of netlink smc_diag_msg attributes.
	* tests/nlattr_smc_diag_msg.c: New file.
	* tests/gen_tests.in (nlattr_smc_diag_msg): New entry.
	* tests/pure_executables.list: Add nlattr_smc_diag_msg.
	* tests/.gitignore: Likewise.

	netlink: decode AF_SMC smc_diag_msg attributes.
	* linux/smc_diag.h (smc_diag_cursor, smc_diag_conninfo
	smc_diag_linkinfo, smc_diag_lgrinfo): New structures.
	* netlink_sock_diag.c: Include "xlat/smc_link_group_roles.h".
	(decode_smc_diag_conninfo, decode_smc_diag_lgrinfo): New functions.
	(smc_diag_msg_nla_decoders): New array.
	(decode_smc_diag_msg): Use it.
	* xlat/smc_link_group_roles.in: New file.

2017-07-10  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

	pathtrace.c: introduce user-provided sets of paths.
	* defs.h (struct path_set): New structure.
	(global_path_set): New variable prototype.
	(tracing_paths): Change macro body to use global_path_set variable.
	(pathtrace_select_set): Add "struct path_set *" argument.
	(pathtrace_match_set): Likewise.  Change return type to bool.
	(pathtrace_select, pathtrace_match): Change into thin macro wrappers
	around pathtrace_select_set and pathtrace_match_set, repsectively.
	* pathtrace.c (global_path_set): New variable.
	(storepath, pathtrace_select_set): Add "struct path_set *" argument.
	(pathmatch, upathmatch, fdmatch, pathtrace_match_set): Likewise.
	Change return type to bool.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP.
	* tests/group_req.c: New file.
	* tests/gen_tests.in (group_req): New entry.
	* tests/pure_executables.list: Add group_req.
	* tests/.gitignore: Likewise.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	Mpersify struct group_req.
	The size of struct group_req depends on alignment of long and therefore
	has to be mpersified.

	* print_group_req.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* net.c (print_group_req): Move to print_group_req.c, wrap into
	MPERS_PRINTER_DECL.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	net: enhance decoding of MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP.
	* net.c (print_group_req): Allow option length greater than
	sizeof(struct group_req) to match the kernel behaviour.
	When the option length is invalid, print the address.
	* NEWS: Mention this.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	net: hook up MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP decoding for SOL_IPV6.
	As multicast socket options are shared between IPv4 and IPv6,
	they should be decoded both for SOL_IP and SOL_IPV6.

	* net.c (print_setsockopt) <SOL_IPV6> [MCAST_JOIN_GROUP]: Handle
	MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: add MCAST_* to sockipv6options.
	Multicast socket options are shared between IPv4 and IPv6.

	* xlat/sockipv6options.in: Add MCAST_JOIN_GROUP, MCAST_BLOCK_SOURCE,
	MCAST_UNBLOCK_SOURCE, MCAST_LEAVE_GROUP, MCAST_JOIN_SOURCE_GROUP,
	MCAST_LEAVE_SOURCE_GROUP, and MCAST_MSFILTER.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	net: enhance decoding of IP_ADD_MEMBERSHIP et al socket options.
	* net.c (print_mreq, print_mreq6): Treat negative option length
	as invalid to match the kernel behaviour.  When the option length
	is invalid, print the address.
	* NEWS: Mention it.
	* tests/ip_mreq.c (main): Check it.  Update expected output.

	net: enhance decoding of setsockopt's SO_LINGER negative option length.
	* net.c (print_set_linger): Treat negative option length as invalid
	to match the kernel behaviour.
	* tests/so_linger.c (main): Check it.

	msghdr: use PRINT_FIELD_* macros.
	* msghdr.c (print_scm_creds): Use PRINT_FIELD_U and PRINT_FIELD_UID.
	(print_cmsg_ip_recverr): Use PRINT_FIELD_U.
	(print_struct_msghdr): Use PRINT_FIELD_U and PRINT_FIELD_FLAGS.

	Intorduce PRINT_FIELD_SOCKADDR.
	* print_fields.h (PRINT_FIELD_SOCKADDR): New macro.
	* msghdr.c (print_cmsg_ip_recverr): Use it instead of print_sockaddr.
	* net.c (print_group_req): Likewise.
	* sock.c (PRINT_IFREQ_ADDR): Remove.
	(print_ifreq, print_ifconf_ifreq): Use PRINT_FIELD_SOCKADDR
	instead of PRINT_IFREQ_ADDR.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	print_sockaddr: remove "struct tcb *" argument.
	print_sockaddr does not use its first argument, remove it.

	* defs.h (print_sockaddr): Remove argument.
	* sockaddr.c (print_sockaddr): Remove argument.  All callers updated.
	* sock.c (PRINT_IFREQ_ADDR): Likewise.

2017-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	net: use PRINT_FIELD_* macros.
	* net.c (print_tpacket_stats, print_tpacket_req): Use PRINT_FIELD_U.
	(print_group_req): Use PRINT_FIELD_IFINDEX.
	(print_packet_mreq): Use PRINT_FIELD_IFINDEX, PRINT_FIELD_U,
	and PRINT_FIELD_XVAL.

	netlink_sock_diag: introduce PRINT_FIELD_INET_DIAG_SOCKID.
	* netlink_sock_diag.c (PRINT_FIELD_INET_DIAG_SOCKID): New macro.
	(decode_inet_diag_req_compat, decode_inet_diag_req_v2,
	decode_inet_diag_msg, decode_smc_diag_req, decode_smc_diag_msg): Use it
	instead of print_inet_diag_sockid.

	Intorduce PRINT_FIELD_DEV.
	* print_fields.h (PRINT_FIELD_DEV): New macro.
	* dm.c (dm_decode_device, dm_decode_dm_name_list): Use it
	instead of print_dev_t.
	* loop.c (decode_loop_info, decode_loop_info64): Likewise.
	* netlink_sock_diag.c (decode_unix_diag_vfs): Likewise.

	Intorduce PRINT_FIELD_INET4_ADDR.
	* print_fields.h (PRINT_FIELD_INET4_ADDR): New macro.
	* msghdr.c (print_cmsg_ip_pktinfo): Use it instead of manual
	tprintf statements.
	* net.c (print_mreq): Likewise.
	* sockaddr.c (print_sockaddr_data_in): Likewise.

	Intorduce PRINT_FIELD_NET_PORT.
	* print_fields.h (PRINT_FIELD_NET_PORT): New macro.
	* netlink_sock_diag.c (print_inet_diag_sockid): Use it
	instead of a manual tprintf statement.
	* sockaddr.c (print_sockaddr_data_in, print_sockaddr_data_in6,
	print_sockaddr_data_ipx): Likewise.

	Intorduce PRINT_FIELD_IFINDEX.
	* print_fields.h (PRINT_FIELD_IFINDEX): New macro.
	* msghdr.c (print_cmsg_ip_pktinfo): Use it instead of print_ifindex.
	* net.c (print_mreq6): Likewise.
	* netlink_sock_diag.c (print_packet_diag_mclist,
	print_inet_diag_sockid): Likewise.
	* sockaddr.c (print_sockaddr_data_in6, print_sockaddr_data_ll):
	Likewise.

	Intorduce PRINT_FIELD_INET_ADDR.
	* print_fields.h (PRINT_FIELD_INET_ADDR): New macro.
	* net.c (print_mreq6): Use it instead of print_inet_addr.
	* netlink_sock_diag.c (print_inet_diag_sockid): Likewise.
	* sockaddr.c (print_sockaddr_data_in6): Likewise.

	net: move print_ifindex to a separate file.
	* print_ifindex.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* net.c (print_ifindex): Move to print_ifindex.c.

	net: move parsers of bind, listen, and shutdown to separate files.
	* bind.c: New file.
	* listen.c: Likewise.
	* shutdown.c: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* net.c (SYS_FUNC(bind)): Move to bind.c.
	(SYS_FUNC(listen)): Move to listen.c.
	(SYS_FUNC(shutdown)): Move to shutdown.c.

2017-07-09  JingPiao Chen  <chenjingpiao@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of packet_diag_msg attributes.
	* tests/netlink_sock_diag-v.sh: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/nlattr_packet_diag_msg.c: New file.
	* tests/gen_tests.in (nlattr_packet_diag_msg): New entry.
	* tests/pure_executables.list: Add nlattr_packet_diag_msg.
	* tests/.gitignore: Likewise.

	netlink: decode AF_PACKET packet_diag_msg attributes.
	* linux/packet_diag.h (packet_diag_info, packet_diag_mclist,
	packet_diag_ring): New structures.
	(PDI_*): New macros.
	* netlink_sock_diag.c: Include <linux/filter.h>
	and "xlat/packet_diag_info_flags.h".
	(decode_packet_diag_info, decode_packet_diag_mclist,
	decode_packet_diag_ring, decode_packet_diag_filter): New functions.
	(packet_diag_msg_nla_decoders): New array.
	(decode_packet_diag_msg): Use it.
	* print_fields.h (PRINT_FIELD_QUOTED_STRING): New macro.
	* xlat/packet_diag_info_flags.in: New file.

2017-07-09  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: fix TEST_NLATTR_OBJECT and TEST_NLATTR_ARRAY for large objects.
	commit v4.17-161-gdbd0605 that adjusted TEST_NLATTR_OBJECT and
	TEST_NLATTR_ARRAY for large objects, only changed the pattern
	print length, large length still can be specified as nla_data_len,
	resulting to output mismatch.

	* tests/test_nlattr.h (TEST_NLATTR_OBJECT): Pass "plen"
	both as nla_data_len and slen arguments of TEST_NLATTR_
	in len < sizeof(object) case.
	(TEST_NLATTR_ARRAY): Likewise, Pass "plen" both as nla_data_len
	and slen arguments of TEST_NLATTR_ in len < sizeof(object[0]) case.

2017-07-09  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: introduce TEST_NLATTR_nla macro in test_nlattr.h.
	Explicitly make struct nlattr * pointer which is internal
	to TEST_NLATTR_ macro available to its varadic arguments.

	* tests/test_nlattr.h (TEST_NLATTR_): Rename nla to TEST_NLATTR_nla.

2017-07-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of SO_PEERCRED socket option.
	* tests/so_peercred.c: New file.
	* tests/gen_tests.in (so_peercred): New entry.
	* tests/pure_executables.list: Add so_peercred.
	* tests/.gitignore: Likewise.

	net: accept arbitrary option length for getsockopt's SO_PEERCRED.
	* print_fields.h (PRINT_FIELD_UID): New macro.
	* net.c (print_ucred): Rewrite to match the kernel behaviour.
	* NEWS: Mention this.

	tests: check decoding of socket filters.
	* tests/sock_filter-v.c: New file.
	* tests/gen_tests.in (sock_filter-v): New entry.
	* tests/pure_executables.list: Add sock_filter-v.
	* tests/.gitignore: Likewise.

	Implement decoding of linux socket filter programs.
	* bpf_sock_filter.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* xlat/skf_ad.in: New file.
	* defs.h (decode_sock_fprog, print_sock_fprog): New prototypes.
	* fetch_bpf_fprog.c (get_bpf_fprog_size): New mpers printer.
	* net.c (print_getsockopt): Use decode_sock_fprog to print
	socket filter programs for SO_GET_FILTER socket option.
	(print_setsockopt): Use decode_sock_fprog and get_bpf_fprog_size
	to print socket filter programs for SO_ATTACH_FILTER
	and SO_ATTACH_REUSEPORT_CBPF socket options.
	* NEWS: Mention this.

	tests: check decoding of SO_LINGER socket option.
	* tests/so_linger.c: New file.
	* tests/gen_tests.in (so_linger): New entry.
	* tests/pure_executables.list: Add so_linger.
	* tests/.gitignore: Likewise.

	tests: fix print_quoted_hex output of bytes with high bit set.
	* tests/tests.h (print_quoted_memory, print_quoted_hex): Change the type
	of first argument from "const char *" to "const void *".
	* tests/print_quoted_string.c: Likewise.
	(print_quoted_hex): Print bytes as unsigned char objects to avoid
	unwanted sign extension.
	* tests/netlink_protocol.c (send_query): Remove the cast of print_quoted_hex
	first argument which is now redundant.

	net: accept arbitrary option length for getsockopt's SO_LINGER.
	* net.c (print_linger): Rename to print_set_linger.
	(print_setsockopt): Replace print_linger with print_set_linger.
	(print_get_linger): New function that accepts arbitrary option length
	to match the kernel behaviour.
	(print_getsockopt): Replace print_linger with print_get_linger.
	* NEWS: Mention this.

	net: accept large option length for SO_LINGER.
	* net.c (print_linger): Allow len > sizeof(struct linger) to match
	the kernel behaviour.

	net: fix printing of struct linger's field names.
	* net.c: Include "print_fields.h".
	(print_linger): Print fields of struct linger using PRINT_FIELD_D.

2017-07-08  Dmitry V. Levin  <ldv@altlinux.org>

	net: enhance decoding of getsockopt's optlen argument.
	As the last argument of getsockopt syscall has read-write semantics,
	print both user and kernel values when they differ.

	* net.c (SYS_FUNC(getsockopt)): On entering syscall, fetch and save
	the length specified to the kernel.  On error, print the length saved
	on entering.  When the saved length and the length returned by the
	kernel differ, print both values.
	* NEWS: Mention this.
	* tests/net-icmp_filter.c (main): Update expected output.

2017-07-08  Dmitry V. Levin  <ldv@altlinux.org>

	net: move printing of [gs]etsockopt's socklen argument to toplevel parsers
	* net.c (print_getsockopt, print_setsockopt): Remove "done" label,
	replace "goto done" statement with "return".
	Move printing of "len" argument ...
	(SYS_FUNC(getsockopt), SYS_FUNC(setsockopt)): ... here.

2017-07-08  Dmitry V. Levin  <ldv@altlinux.org>

	Generalize seccomp filter parser.
	Linux socket filter uses almost the same classic BPF as seccomp filter,
	The only difference noticeable from strace PoV is the meaning of generic
	multiuse field.

	Transform the parser of seccomp filters to a more generic parser
	of classic BPF, parametrized with a method of parsing the generic
	multiuse field in BPF_STMT.

	* bpf_filter.c: New file.
	* bpf_filter.h: Likewise.
	* bpf_fprog.h: Likewise.
	* bpf_seccomp_filter.c: Likewise.
	* fetch_bpf_fprog.c: Likewise.
	* fetch_seccomp_fprog.c: Remove.
	* seccomp_fprog.h: Likewise.
	* Makefile.am (strace_SOURCES): Add bpf_filter.c, bpf_filter.h,
	bpf_fprog.h, bpf_seccomp_filter.c, and fetch_bpf_fprog.c.
	Remove fetch_seccomp_fprog.c and seccomp_fprog.h.
	* seccomp.c: Do not include linux/filter.h and xlat header files.
	Do not define SECCOMP_RET_ACTION.
	(bpf_filter, decode_bpf_code, decode_bpf_stmt, decode_bpf_jump,
	print_bpf_filter, print_seccomp_fprog, print_seccomp_filter): Remove.
	* defs.h (print_seccomp_filter): Rename to decode_seccomp_fprog.
	(SYS_FUNC(seccomp)): Replace print_seccomp_filter
	with decode_seccomp_fprog.
	* prctl.c (SYS_FUNC(prctl)): Likewise.

2017-07-08  Dmitry V. Levin  <ldv@altlinux.org>

	Assume that <linux/filter.h> is always available.
	<linux/filter.h> was introduced in linux 2.1.75, way before
	the minimal kernel version supported by strace.

	* configure.ac (AC_CHECK_HEADERS): Remove linux/filter.h.
	* seccomp.c: Assume HAVE_LINUX_FILTER_H.
	* tests/prctl-seccomp-filter-v.c: Likewise.
	* tests/seccomp-filter-v.c: Likewise.
	* tests/seccomp-filter.c: Likewise.

2017-07-07  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: add BPF_END to BPF_ALU opcode list.
	BPF_END is one of three eBPF-only opcodes for BPF_ALU class.
	Other two (BPF_MOV and BPF_ARSH) has been added earlier.

	* xlat/bpf_op_alu.in: Add BPF_END.

2017-07-07  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink_sock_diag: print unrecognized data in hex.
	* netlink_sock_diag.c (decode_family): Replace printstrn with
	printstr_ex and set QUOTE_FORCE_HEX flag.
	* tests/netlink_sock_diag.c (test_odd_family_req,
	test_odd_family_msg): Update expected output.

	netlink: print unrecognized nlattr in hex.
	* nlattr.c (fetch_nlattr): Replace printstrn
	with printstr_ex and set QUOTE_FORCE_HEX flag.
	* tests/nlattr.c (test_nlattr): Update expected output.

	netlink: print unrecognized netlink messages in hex.
	* netlink.c (fetch_nlmsghdr): Replace printstrn
	with printstr_ex and set QUOTE_FORCE_HEX flag.
	* tests/netlink_protocol.c (send_query): Update expected output.

	netlink: print unrecognized netlink payload in hex.
	* netlink.c (decode_payload): Replace printstrn
	with printstr_ex and set QUOTE_FORCE_HEX flag.
	* tests/netlink_protocol.c (send_query, test_nlmsgerr,
	test_nlmsg_done): Update expected output.
	* tests/netlink_generic.c (test_nlmsg_type): Likewise.

	netlink: print unrecognized nlmsgerr in hex.
	* netlink.c (decode_nlmsgerr): Replace printstrn
	with printstr_ex and set QUOTE_FORCE_HEX flag.
	* tests/netlink_protocol.c (test_nlmsgerr): Update expected output.

	netlink: print unrecognized attribute data in hex.
	* nlattr.c (decode_nlattr_with_data): Replace printstrn
	with printstr_ex and set QUOTE_FORCE_HEX flag.
	* tests/tests.h (print_quoted_hex): New prototype.
	* tests/print_quoted_string.c (print_quoted_hex): New function.
	* tests/test_nlattr.h (TEST_NLATTR_OBJECT, TEST_NLATTR_ARRAY): Use it
	for updated expected output.  Change the type of "plen" variable
	to unsigned int.
	* tests/nlattr.c (test_nlattr): Update expected output.

	tests: print quotation marks in print_quoted_memory.
	* tests/print_quoted_string.c (print_quoted_memory): Print opening
	and closing quotation marks.
	* tests/getcwd.c (main): Do not print quotation marks around
	print_quoted_string.
	* tests/uname.c (main): Likewise.
	* tests/keyctl.c (print_quoted_string_limit): Do not print quotation
	marks around print_quoted_memory.
	* tests/netlink_protocol.c (send_query): Likewise.
	* tests/xattr.c (main): Likewise.

2017-07-06  Dmitry V. Levin  <ldv@altlinux.org>

	strace.1: remove misleading remark that -i option is weakly supported.
	Given that -i functionality is covered by pc.test, the remark that
	it is weakly supported is wrong.

	* strace.1 (BUGS): Remove the remark about weakly supported -i option.

2017-07-06  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.18-1.
	* strace.spec.in: Likewise.

2017-07-05  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.18 release.
	* NEWS: Update for 4.18 release.

2017-07-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify create_nl_socket based tests against the race condition
	There is a race condition between the moment a netlink socket is created
	and the moment it is reported via SOCK_DIAG_BY_FAMILY interface.
	Add one more operation on the socket created by create_nl_socket
	to increase chances of winning the race.

	* tests/create_nl_socket.c (create_nl_socket_ext): Add a getsockopt call
	with the created socket.

2017-07-04  Dmitry V. Levin  <ldv@altlinux.org>

	Update NEWS.

2017-07-04  Romain Naour  <romain.naour@smile.fr>

	nios2: fix wrong access to "SP" register in user_pt_regs.
	Starting with linux commit v4.0-rc4~21^2, "SP" register
	is available via regs[PTR_SP] member of struct user_pt_regs.

	* linux/nios2/arch_regs.h (nios2_sp_ptr): Change type
	to "unsigned int *".
	* linux/nios2/arch_regs.c (nios2_sp_ptr): Likewise.
	Replace .sp with .regs[PTR_SP].

	Fixes: http://autobuild.buildroot.net/results/b9f/b9fc25b82f3280872fe1593ac252a8529ba83576
	Fixes: v4.16-34-g6117728a ("nios2: export nios2_sp_ptr")

2017-07-03  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	tests: add multi-process check to qual_fault.test.
	Check that syscall counters used for tampering are per-tcb.

	* tests/qual_fault.c: Include <fcntl.h> for open(),
	<sys/param.h> for PATH_MAX, and <sys/wait.h> for wait().
	(expfd): Rename to exp_fd, remove const qualifier and initialization.
	(gotfd): Rename to got_fd, remove const qualifier and initialization.
	(out_fd): New variable, for the expected strace output.
	(open_file): New helper function.
	(main): Remove st, add num_procs, proc, exp_prefix, got_prefix,
	out_prefix, pid_prefix.  Remove stat asserts, update argc assert.
	Add num_procs, exp_prefix, got_prefix, out_prefix, pid_prefix
	initialization.  Add per-process loop, open expfd, gotfd, out_fd, pidfd
	in each one, print process's pid to pidfd, print exit message to out_fd.
	Add wait() call for each forked process.
	* tests/qual_fault.test (N): increase to 100 in order to check
	concurrent process execution.
	(check_fault_injection): Take additional argument for the process
	count, pass it to qual_fault, add filename variables for expected strace
	output and pid file, pass them to qual_fault.
	Specify -ff parameter to strace invocation.
	Compare write and strace output for the each process.
	Update all check_fault_injection invocation with process count argument,
	add an invocation with 4 concurrent processes.
	* tests/init.sh (TIMEOUT_DURATION): Raise from 120 to 300.

2017-07-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: adjust TEST_NLATTR_OBJECT and TEST_NLATTR_ARRAY for large objects
	* tests/test_nlattr.h (TEST_NLATTR_OBJECT, TEST_NLATTR_ARRAY): Add
	support for objects larger than DEFAULT_STRLEN.
	* tests/nlattr_inet_diag_msg.c (main): Change pattern size
	from DEFAULT_STRLEN to 4096.
	* tests/nlattr_netlink_diag_msg.c: Likewise.
	* tests/nlattr_unix_diag_msg.c: Likewise.

	Reported-by: JingPiao Chen <chenjingpiao@gmail.com>

2017-07-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: move DEFAULT_STRLEN macro to tests.h.
	* tests/tests.h [!DEFAULT_STRLEN] (DEFAULT_STRLEN): New macro.
	* tests/mincore.c (DEFAULT_STRLEN): Remove.
	* tests/mmsg_name.c: Likewise.
	* tests/msg_control.c: Likewise.
	* tests/netlink_protocol.c: Likewise.
	* tests/nlattr.c: Likewise.
	* tests/nlattr_inet_diag_msg.c: Likewise.
	* tests/nlattr_netlink_diag_msg.c: Likewise.
	* tests/nlattr_unix_diag_msg.c: Likewise.
	* tests/printstr.c: Likewise.
	* tests/xattr.c: Likewise.
	* tests/execve.c: Likewise.
	(main): Initialize str_a and str_b arrays at run time.
	* tests/execveat.c: Likewise.

	Suggested-by: JingPiao Chen <chenjingpiao@gmail.com>

2017-07-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: use unified diff in order to improve test log readability.
	* tests/init.sh (match_diff): Add -u option to the diff invocation.

2017-07-02  Dmitry V. Levin  <ldv@altlinux.org>

	Fix error diagnostics in case of zero argc.
	* strace.c (init): Adjust argc along with argv,
	check that adjusted argc is sane.
	* tests/zeroargc.c: New file.
	* tests/.gitignore: Add zeroargc.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	* tests/options-syntax.test: Check strace error diagnostics
	in case of zero argc.

2017-07-02  Dmitry V. Levin  <ldv@altlinux.org>

	Use program_invocation_name instead of a local progname variable.
	Emulate program_invocation_name only if it is not provided by libc.

	* configure.ac: Check for program_invocation_name variable.
	* strace.c (progname): Remove.
	[!HAVE_PROGRAM_INVOCATION_NAME] (program_invocation_name): New variable.
	(verror_msg, error_msg_and_help): Use it instead of progname.
	(init): Initialize program_invocation_name instead of progname.

2017-07-02  Dmitry V. Levin  <ldv@altlinux.org>
	    Victor Krapivensky  <krapivenskiy.va@phystech.edu>

	Introduce generic STRINGIFY and STRINGIFY_VAL macros.
	* macros.h (STRINGIFY, STRINGIFY_VAL): New macros.
	* mpers_type.h: Include "macros.h".
	[IN_MPERS] (STRINGIFY): Remove.
	* tests/sockname.c (TEST_SYSCALL_STR__, TEST_SYSCALL_STR_): Remove.
	(TEST_SYSCALL_STR): Use STRINGIFY_VAL.

2017-07-02  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce macros.h.
	Introduce a separate header file for generic macros shared between
	strace and its tests.  Start this unification with ARRAY_SIZE macro.

	* defs.h: Include "macros.h".
	(ARRAY_SIZE): Move ...
	* macros.h: ... to new file.
	* Makefile.am (strace_SOURCES): Add it.
	* tests/tests.h: Include "macros.h".
	(ARRAY_SIZE): Remove.  All callers updated.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

	quota: use PRINT_FIELD_FLAGS.
	* quota.c (struct xfs_dqblk): Change d_flags field's type from int8_t
	to uint8_t.
	(decode_cmd_data): Use PRINT_FIELD_FLAGS.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

	Unify different generic PRINT_FIELD_* implementations.
	Create a new header print_fields.h and move generic PRINT_FIELD_*
	macros there.

	* print_fields.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* netlink_sock_diag.c: Include "print_fields.h".
	(PRINT_FIELD_U, PRINT_FIELD_X, PRINT_FIELD_COOKIE, PRINT_FIELD_FLAGS,
	PRINT_FIELD_XVAL): Move to print_fields.h file.
	* quota.c: Include "print_fields.h".
	(PRINT_FIELD_D): Move to print_fields.h file.
	(PRINT_FIELD_U, PRINT_FIELD_X): Remove.
	* statx.c: Include "print_fields.h".
	(PRINT_FIELD_U): Remove.
	(SYS_FUNC(statx)): Update PRINT_FIELD_U callers.
	* tests/quotactl.h: Include "print_fields.h".
	* tests/quotactl-xfs.c: Update callers of PRINT_FIELD_* macros.
	* tests/quotactl.c: Likewise.
	(PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X): Remove.
	* tests/test_nlattr.h: Include "print_fields.h".
	(PRINT_FIELD_U, PRINT_FIELD_X): Remove.
	* tests/xstatx.c: Include "print_fields.h".
	(PRINT_FIELD_U): Remove.
	(print_stat): Update PRINT_FIELD_U callers.
	* tests/tests.h [!STRACE_PRINTF] (STRACE_PRINTF): Define to printf.

2017-07-01  Eugeniy Paltsev  <Eugeniy.Paltsev@synopsys.com>

	arc: fix wrong access to "sp" member in user_regs_struct.
	"sp" register is a member of "scratch" structure (which is nested
	in user_regs_struct)

	* linux/arc/arch_regs.c: Replace .sp with .scratch.sp .

	Fixes: v4.16-31-g134042a5 ("arc: export arc_sp_ptr")

2017-07-01  Khem Raj  <raj.khem@gmail.com>

	aarch64, tile: replace struct ucontext with ucontext_t.
	glibc >= 2.26 has dropped the tag struct ucontext from ucontext_t type.

	* linux/arm/arch_sigreturn.c (arch_sigreturn) [AARCH64]: Replace
	struct ucontext with ucontext_t.
	* linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance nlattr_unix_diag_msg test.
	* tests/nlattr_unix_diag_msg.c: Include "test_nlattr.h".
	(test_unix_diag_vfs, test_unix_diag_icons, test_unix_diag_rqlen):
	Remove.
	(init_unix_diag_msg): Add const qualifier to arguments and variables.
	(print_unix_diag_msg, print_uint): New functions.
	(main): Use them and macros from test_nlattr.h file.

2017-07-01  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of netlink unix_diag_msg attributes.
	* tests/nlattr_unix_diag_msg.c: New file.
	* tests/gen_tests.in (nlattr_unix_diag_msg): New entry.
	* tests/pure_executables.list: Add nlattr_unix_diag_msg.
	* tests/.gitignore: Likewise.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

	netlink_sock_diag: ensure that structure field names are printed properly
	* netlink_sock_diag.c (decode_unix_diag_vfs, decode_unix_diag_rqlen):
	Use PRINT_FIELD_U to print structure fields.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

	netlink_sock_diag: add const qualifiers.
	Add const qualifiers to auto variables and function arguments.
	This change does not affect the code generated by the compiler,
	the purpose of these "const" qualifiers is to highlight the intent.

	* netlink_sock_diag.c (decode_unix_diag_vfs, decode_unix_diag_inode,
	decode_unix_diag_rqlen): Add const qualifier to tcp, addr, and len
	arguments.

2017-07-01  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: decode AF_UNIX unix_diag_msg attributes.
	* netlink_sock_diag.c (unix_diag_msg_nla_decoders): New array.
	(decode_unix_diag_msg): Use it.
	* linux/unix_diag.h (unix_diag_vfs, unix_diag_rqlen): New structures.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance nlattr_netlink_diag_msg test.
	* tests/nlattr_netlink_diag_msg.c: Include "test_nlattr.h".
	(test_netlink_diag_groups, test_netlink_diag_rx_ring,
	test_netlink_diag_flags): Remove.
	(init_netlink_diag_msg): Add const qualifier to arguments and variables.
	(print_netlink_diag_msg, print_xlong): New functions.
	(main): Use them and macros from test_nlattr.h file.

2017-07-01  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of netlink_diag_msg attributes.
	* tests/nlattr_netlink_diag_msg.c: New file.
	* tests/gen_tests.in (nlattr_netlink_diag_msg): New entry.
	* tests/pure_executables.list: Add nlattr_netlink_diag_msg.
	* tests/.gitignore: Likewise.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

	netlink_sock_diag: ensure that structure field names are printed properly
	* netlink_sock_diag.c (decode_netlink_diag_ring): Use PRINT_FIELD_U
	to print structure fields.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

	netlink_sock_diag: add const qualifiers.
	Add const qualifiers to auto variables and function arguments.
	This change does not affect the code generated by the compiler,
	the purpose of these "const" qualifiers is to highlight the intent.

	* netlink_sock_diag.c (print_group, decode_netlink_diag_groups,
	decode_netlink_diag_ring, decode_netlink_diag_flags): Add const
	qualifier to tcp, addr, and len arguments.

2017-07-01  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: decode AF_NETLINK netlink_diag_msg attributes.
	* linux/netlink_diag.h (netlink_diag_ring): New structure.
	(NDIAG_FLAG_*): New macros.
	* netlink_sock_diag.c: Include "xlat/netlink_socket_flags.h".
	(print_group, decode_netlink_diag_groups, decode_netlink_diag_ring,
	decode_netlink_diag_flags): New functions.
	(netlink_diag_msg_nla_decoders): New array.
	(decode_netlink_diag_msg): Use it.
	* xlat/netlink_socket_flags.in: New file.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>

	netlink_sock_diag: print inet_diag_sockid.idiag_if as an interface index
	* netlink_sock_diag.c (print_inet_diag_sockid): Print idiag_if field
	using print_ifindex.
	* tests/nlattr_inet_diag_msg.c: Include <net/if.h>.
	(IFINDEX_LO): New macro.
	(init_inet_diag_msg): Set inet_diag_sockid.idiag_if field.
	(print_inet_diag_msg): Update expected output.

2017-07-01  Dmitry V. Levin  <ldv@altlinux.org>
	    JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of several standard netlink attributes.
	* tests/nlattr_inet_diag_msg.c (main): Check decoding of uint32_t,
	uint8_t, and zero-terminated string attributes.

2017-06-30  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance nlattr_inet_diag_msg test.
	* tests/test_nlattr.h: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.
	* tests/nlattr_inet_diag_msg.c: Include "test_nlattr.h".
	(test_inet_diag_meminfo, test_inet_diag_vegasinfo,
	test_inet_diag_dctcpinfo, test_inet_diag_bbrinfo): Remove.
	(address): New variable.
	(init_inet_diag_msg): Remove "address" argument, add const qualifier
	to all remaining arguments.
	(print_inet_diag_msg, print_uint): New functions.
	(main): Use macros from test_nlattr.h file.

2017-06-30  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of netlink inet_diag_msg attributes.
	* tests/nlattr_inet_diag_msg.c: New file.
	* tests/gen_tests.in (nlattr_inet_diag_msg): New entry.
	* tests/pure_executables.list: Add nlattr_inet_diag_msg.
	* tests/.gitignore: Likewise.

2017-06-30  Dmitry V. Levin  <ldv@altlinux.org>

	netlink_sock_diag: ensure that structure field names are printed properly
	* netlink_sock_diag.c (PRINT_FIELD_X): New macro.
	(decode_inet_diag_meminfo, decode_tcpvegas_info, decode_tcp_dctcp_info,
	decode_tcp_bbr_info): Use it and PRINT_FIELD_U to print structure
	fields.

2017-06-30  Dmitry V. Levin  <ldv@altlinux.org>

	netlink_sock_diag: add const qualifiers.
	Add const qualifiers to auto variables and function arguments.
	This change does not affect the code generated by the compiler,
	the purpose of these "const" qualifiers is to highlight the intent.

	* netlink_sock_diag.c (print_meminfo, decode_meminfo,
	decode_inet_diag_meminfo, decode_tcpvegas_info, decode_tcp_dctcp_info,
	decode_tcp_bbr_info): Add const qualifier to tcp, addr, and len
	arguments.

2017-06-30  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: decode AF_INET inet_diag_msg attributes.
	* linux/inet_diag.h (inet_diag_meminfo, tcpvegas_info,
	tcp_dctcp_info, tcp_bbr_info): New structures.
	* linux/sock_diag.h (SK_MEMINFO_VARS): New macro.
	* netlink_sock_diag.c: Include  <linux/sock_diag.h>.
	(print_meminfo, decode_meminfo, decode_inet_diag_meminfo,
	decode_tcpvegas_info, decode_tcp_dctcp_info, decode_tcp_bbr_info):
	New functions.
	(inet_diag_msg_nla_decoders): New array.
	(decode_inet_diag_msg): Use it.

2017-06-30  Dmitry V. Levin  <ldv@altlinux.org>

	nlattr: add const qualifiers to auto variables and function arguments.
	This change does not affect the code generated by the compiler,
	the purpose of these "const" qualifiers is to highlight the intent.

	* nlattr.c (decode_nlattr_with_data, decode_nla_str, decode_nla_strn,
	decode_nla_##name): Add const qualifier to tcp, addr, and len arguments.

2017-06-30  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: introduce nla_decoder_t to parse netlink attributes data.
	* nlattr.h (nla_decoder_t): New typedef.
	(DECL_NLA): New macro.
	(decode_nlattr): Add decoders, size and opaque_data argument.
	* nlattr.c: (decode_nlattr_with_data): Likewise.
	(decode_nla_*): New functions.
	* netlink_sock_diag.c (decode_inet_diag_req_compat)
	(decode_inet_diag_req_v2, decode_inet_diag_msg)
	(decode_netlink_diag_msg, (decode_packet_diag_msg)
	(decode_smc_diag_msg, decode_unix_diag_msg): Add decoders,
	size and opaque_data arguments. All callers updated.

2017-06-30  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: add a basic netlink attribute parser of AF_SMC diag.
	* netlink_sock_diag.c: Include "xlat/smc_diag_attrs.h".
	(decode_smc_diag_msg): Use decode_nlattr.
	* xlat/smc_diag_attrs.in: New file.

2017-06-30  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add a basic netlink attribute parser of AF_INET diag.
	* linux/inet_diag.h (INET_DIAG_REQ_*): New enum.
	* netlink_sock_diag.c: Include "xlat/inet_diag_attrs.h"
	and "xlat/inet_diag_req_attrs.h".
	(decode_inet_diag_req_compat, decode_inet_diag_req_v2,
	 decode_inet_diag_msg): Use decode_nlattr.
	* xlat/inet_diag_attrs.in: New file.
	* xlat/inet_diag_req_attrs.in: Likewise.

	netlink: add a basic netlink attribute parser of AF_PACKET diag.
	* linux/packet_diag.h (PACKET_DIAG_*): New enum.
	* netlink_sock_diag.c: Include "xlat/packet_diag_attrs.h".
	(decode_packet_diag_msg): Use decode_nlattr.
	* xlat/packet_diag_attrs.in: New file.

	netlink: add a basic netlink attribute parser of AF_NETLINK diag.
	* linux/netlink_diag.h (NETLINK_DIAG_*): New enum.
	* netlink_sock_diag.c: Include "xlat/netlink_diag_attrs.h".
	(decode_netlink_diag_msg): Use decode_nlattr.
	* xlat/netlink_diag_attrs.in: New file.

2017-06-29  Dmitry V. Levin  <ldv@altlinux.org>

	netlink_sock_diag: ensure that structure field names are printed properly
	* netlink_sock_diag.c (PRINT_FIELD_U, PRINT_FIELD_COOKIE,
	PRINT_FIELD_FLAGS, PRINT_FIELD_XVAL): New macros.
	(decode_unix_diag_req, decode_unix_diag_msg, decode_netlink_diag_req,
	decode_netlink_diag_msg, decode_packet_diag_req, decode_packet_diag_msg,
	print_inet_diag_sockid, decode_inet_diag_req_compat,
	decode_inet_diag_req_v2, decode_inet_diag_msg, decode_smc_diag_req,
	decode_smc_diag_msg): Use them to print structure fields.

2017-06-29  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v4.12-rc7.
	* linux/32/ioctls_inc_align16.h: Update from linux v4.12-rc7
	(with f7a320ff commit applied on top) using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* NEWS: Mention this.

2017-06-29  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	maint: fix ioctls_sym.sh premature termination.
	When the list of headers do not fit into the command line, xargs splits
	it into several lists and then passes them to grep.  If no headers from
	a list match the grep pattern, grep exits with a non-zero status that
	causes xargs to exit with a non-zero status, too.

	* maint/ioctls_sym.sh: Use "find -exec +" instead of xargs,
	ignore its exit status.

2017-06-27  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: introduce NLMSG_ATTR macro.
	* tests/tests.h (NLMSG_ATTR): New macro.
	* tests/nlattr.c (test_nlattr, test_nla_type): Use it.

2017-06-27  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: pass NLMSG_DONE messages to family specific payload decoders.
	While many NLMSG_DONE messages indeed have payload containing
	just one integer, there are exceptions. Handle this by passing
	payloads of NLMSG_DONE messages to family specific netlink
	payload decoders.

	* netlink.c (print_nlmsghdr): Do not skip family detection
	for nlmsg_type == NLMSG_DONE.
	(decode_nlmsg_type): Skip family specific type decoders
	for type == NLMSG_DONE.
	(decode_nlmsg_flags): Skip family specific decoding of flags
	for type == NLMSG_DONE.
	(decode_netlink_sock_diag): Skip for nlmsg_type == NLMSG_DONE.

2017-06-26  Dmitry V. Levin  <ldv@altlinux.org>

	Unexport die_out_of_memory.
	Print more specific error diagnostics than a generic "Out of memory"
	when an error happens outside xmalloc.c.

	* defs.h (die_out_of_memory): Remove prototype.
	* strace.c (strace_popen, init): Call perror_msg_and_die instead
	of die_out_of_memory.
	* unwind.c (unwind_tcb_init): Likewise.
	* xmalloc.c (die_out_of_memory): Add static qualifier.

2017-06-26  Dmitry V. Levin  <ldv@altlinux.org>

	Check -s argument early.
	* util.c (printstr_ex): Move the check that -s argument
	does not exceed -1U / 4 ...
	* strace.c (init): ... here.
	* tests/options-syntax.test: Check it.

2017-06-25  Dmitry V. Levin  <ldv@altlinux.org>

	Include "netlink.h" instead of <linux/netlink.h>
	* net.c: Include "netlink.h" instead of <linux/netlink.h>.
	* sockaddr.c: Likewise.
	* tests/create_nl_socket.c: Likewise.
	* tests/net-sockaddr.c: Likewise.
	* tests/netlink_audit.c: Likewise.
	* tests/netlink_generic.c: Likewise.
	* tests/netlink_inet_diag.c: Likewise.
	* tests/netlink_netfilter.c: Likewise.
	* tests/netlink_route.c: Likewise.
	* tests/netlink_selinux.c: Likewise.
	* tests/netlink_xfrm.c: Likewise.
	* tests/net-yy-netlink.c: Include "netlink.h" instead
	of <linux/netlink.h>, remove fallback definition of NETLINK_SOCK_DIAG.
	* tests/netlink_netlink_diag.c: Likewise.
	* tests/netlink_protocol.c: Likewise.
	* tests/netlink_sock_diag.c: Likewise.
	* tests/netlink_unix_diag.c: Likewise.
	* tests/nlattr.c: Likewise.

2017-06-24  Dmitry V. Levin  <ldv@altlinux.org>

	netlink: provide a fallback definition of NETLINK_SOCK_DIAG.
	Add a fallback definition of NETLINK_SOCK_DIAG to netlink.h
	instead of adding these fallback definitions to every file.

	* netlink.h: Provide a fallback definition of NETLINK_SOCK_DIAG.
	* socketutils.c: Include "netlink.h" instead of <linux/netlink.h>,
	remove fallback definition of NETLINK_SOCK_DIAG.

2017-06-23  Dmitry V. Levin  <ldv@altlinux.org>

	Update prctl ARCH_* constants.
	* xlat/archvals.in: Add ARCH_GET_CPUID and ARCH_SET_CPUID
	introduced by linux kernel commit v4.12-rc1~153^2~2.

2017-06-22  Dmitry V. Levin  <ldv@altlinux.org>

	Update V4L2_* constants.
	* xlat/v4l2_buf_types.in: Add V4L2_BUF_TYPE_META_CAPTURE introduced
	by linux kernel commit v4.12-rc1~85^2~71.
	* xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_META_CAPTURE
	introduced by the same commit.
	* xlat/v4l2_control_flags.in: Add V4L2_CTRL_FLAG_HAS_PAYLOAD,
	V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, and V4L2_CTRL_FLAG_MODIFY_LAYOUT
	introduced by linux kernel commits v3.17-rc1~112^2~363,
	v4.1-rc1~59^2~1^2~63, and v4.12-rc1~85^2~62, respectively.
	* xlat/v4l2_control_types.in: Add V4L2_CTRL_TYPE_U8, V4L2_CTRL_TYPE_U16,
	and V4L2_CTRL_TYPE_U32 introduced by linux kernel commits
	v3.17-rc1~112^2~343 and v3.17-rc1~112^2~112.

	Update SCTP_* constants.
	* xlat/socksctpoptions.in: Add SCTP_ENABLE_STREAM_RESET,
	SCTP_RESET_STREAMS, SCTP_RESET_ASSOC, SCTP_ADD_STREAMS,
	SCTP_RECONFIG_SUPPORTED, and SCTP_PR_STREAM_STATUS introduced
	by linux kernel commits v4.11-rc1~124^2~387^2~1, v4.11-rc1~124^2~387^2,
	v4.11-rc1~124^2~166^2~2, v4.11-rc1~124^2~166^2, v4.12-rc1~64^3~469^2,
	and v4.12-rc1~64^3~276, respectively.

	Update RTM_* constants.
	* xlat/nl_route_types.in: Add RTM_DELNETCONF introduced
	by linux kernel commit v4.12-rc1~64^3~312^2~6.

	Update NDIAG_SHOW_* constants.
	* linux/netlink_diag.h (NDIAG_SHOW_FLAGS): New constant introduced
	by linux kernel commit v4.12-rc1~64^3~260.
	* xlat/netlink_diag_show.in: Add it.

	Update KEYCTL_* constants.
	* xlat/keyctl_commands.in: Add KEYCTL_RESTRICT_KEYRING introduced
	by linux kernel commit v4.12-rc1~123^2~7^2~2^2~3.

	Update ARPHRD_* constants.
	* xlat/arp_hardware_types.in: Add ARPHRD_VSOCKMON introduced
	by linux kernel commit v4.12-rc1~129^2~118^2~2.

	Update SO_* constants.
	* xlat/sockoptions.in: Add SO_MEMINFO, SO_INCOMING_NAPI_ID,
	and SO_COOKIE introduced by linux kernel commits v4.12-rc1~64^3~389,
	v4.12-rc1~64^3~341^2, and v4.12-rc1~64^3~221^2~1, respectively.

2017-06-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check more corner cases of nlattr decoding.
	* tests/nlattr.c (test_nlattr): Check decoding in case of invalid
	struct nlattr.nla_len.

2017-06-21  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of netlink attribute.
	* tests/nlattr.c: New file.
	* tests/gen_tests.in (nlattr): New entry.
	* tests/pure_executables.list: Add nlattr.
	* tests/.gitignore: Likewise.

2017-06-21  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: introduce a basic netlink attributes parser.
	* linux/unix_diag.h (UNIX_DIAG_*): New enum.
	* nlattr.c: New file.
	* nlattr.h: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* netlink_sock_diag.c: Include "nlattr.h" and "xlat/unix_diag_attrs.h".
	(decode_unix_diag_msg): Use decode_nlattr.
	* xlat/unix_diag_attrs.in: New file.

2017-06-21  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: introduce netlink.h.
	* netlink.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* netlink_sock_diag.c: Include "netlink.h",
	remove <sys/socket.h> and <linux/netlink.h>.
	* netlink.c: Likewise.
	(NLMSG_HDRLEN): Move to netlink.h.
	* tests/netlink_protocol.c: Replace <linux/netlink.h> with "netlink.h".
	* tests/netlink_sock_diag.c: Likewise.

2017-06-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add SET_STRUCT macro to tests.h.
	* tests/netlink_sock_diag.c (INIT_STRUCT): Rename to SET_STRUCT,
	all callers updated.  Move ...
	* tests/tests.h: ... here.

2017-06-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix potential unaligned access in netlink_sock_diag.test.
	Despite our efforts made to avoid unaligned access, gcc appears to be
	generating instructions that might cause unaligned access when copying
	structures to unaligned addresses.

	Fix this issue by replacing copying of structures to unaligned addresses
	with memcpy calls.

	* tests/netlink_sock_diag.c (INIT_STRUCT): New macro.
	(test_odd_family_req, test_odd_family_msg, test_unix_diag_req,
	test_unix_diag_msg, test_netlink_diag_req, test_netlink_diag_msg,
	test_packet_diag_req, test_packet_diag_msg, test_inet_diag_sockid,
	test_inet_diag_req, test_inet_diag_req_v2, test_inet_diag_msg,
	test_smc_diag_req, test_smc_diag_msg): Use it to initialize potentially
	unaligned struct nlmsghdr.  Do not access nlh->nlmsg_len.

2017-06-19  Masatake YAMATO  <yamato@redhat.com>

	tests: check decoding of NETLINK_GENERIC message types.
	* tests/netlink_generic.c: New file.
	* tests/gen_tests.in (netlink_generic): New entry.
	* tests/pure_executables.list: Add netlink_generic.
	* tests/.gitignore: Likewise.

2017-06-19  Masatake YAMATO  <yamato@redhat.com>

	netlink: add decoding of NETLINK_GENERIC protocol families.
	NETLINK_GENERIC is a protocol stacked on netlink protocol.

	When a NETLINK_GENERIC subsystem registers its "family" name in the
	kernel at run time, an integer value associated with this name is
	assigned by the kernel.  This integer value is specified in struct
	nlmsghdr.nlmsg_type of subsequent communications with the
	NETLINK_GENERIC subsystem.

	This change implements decoding of NETLINK_GENERIC message types in
	symbolic form, for example:

	  $ ./strace -yy -e 'sendto' ip tcp_metrics > /dev/null
	  sendto(4<NETLINK:[GENERIC:12345]>, {{len=20, type=tcp_metrics, ...
	  +++ exited with 0 +++

	Note that type= specifying the NETLINK_GENERIC protocol family
	is decoded properly.

	* netlink.c (decode_nlmsg_type_generic): New function.
	(nlmsg_types): Add NETLINK_GENERIC entry.

2017-06-19  Masatake YAMATO  <yamato@redhat.com>

	socketutils: build a dynamic xlat table for NETLINK_GENERIC decoding.
	* configure.ac (AC_CHECK_HEADERS): Add linux/genetlink.h.
	* defs.h (genl_families_xlat): New prototype.
	* socketutils.c [HAVE_LINUX_GENETLINK_H]: Include <linux/genetlink.h>.
	[HAVE_LINUX_GENETLINK_H] (genl_send_dump_families,
	genl_parse_families_response): New helper functions.
	(genl_families_xlat): New function for building the xlat table
	for NETLINK_GENERIC decoding.

2017-06-19  Masatake YAMATO  <yamato@redhat.com>

	dyxlat: new interface for building xlat tables dynamically.
	xlat tables are usually generated at build time.

	printxval is suitable for printing struct nlmsghdr.nlmsg_type for
	NETLINK_GENERIC protocol.  However, the corresponding xlat table
	cannot be defined at build time because the values are registered
	by the kernel at run time.

	This change introduces dyxlat functions for building xlat tables
	dynamically.  The primary use case is decoding nlmsg_type but this
	interface can be used for other purposes.

	* defs.h (struct dyxlat): New opaque data type.
	(dyxlat_alloc, dyxlat_free, dyxlat_add_pair): New function declarations.
	* dyxlat.c: New file.
	* Makefile.am (strace_SOURCES): Add it.

2017-06-19  Masatake YAMATO  <yamato@redhat.com>

	Introduce xstrndup function.
	* configure.ac (AC_CHECK_FUNCS): Add strndup.
	* defs.h (xstrndup): New prototype.
	* xmalloc.c (xstrndup): New function.

2017-06-18  Dmitry V. Levin  <ldv@altlinux.org>

	netlink: do not print extra braces around payloadless nlmsghdr.
	* netlink.c (decode_nlmsghdr_with_payload): Print braces before
	print_nlmsghdr and after decode_payload iff decode_payload is invoked.
	* tests/netlink_audit.c (test_nlmsg_type): Update expected output.
	* tests/netlink_netfilter.c: Likewise.
	* tests/netlink_selinux.c: Likewise.
	* tests/netlink_protocol.c (send_query): Likewise.
	* tests/netlink_route.c (test_nlmsg_type, test_nlmsg_flags): Likewise.
	* tests/netlink_sock_diag.c: Likewise.
	* tests/netlink_xfrm.c: Likewise.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	Strip argument name of type "struct tcb *" from function prototypes.
	"struct tcb *" was used in most prototypes along with "struct tcb *tcp",
	this change converts the latter form to the former for consistency.

	Fix a few spacing style issues.
	Reported by kernel's checkpatch.pl script.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	Strip redundant trailing semicolons.
	Strip trailing semicolons from macro definitions.
	Strip extra semicolons from statements terminations.

	Reported by kernel's checkpatch.pl script.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	Fix macros encosure in a do/while loop.
	Enclose macros with multiple statements and macros starting
	with "if" statement in a do/while loop.
	Do not enclose single statement macros in a do/while loop.

	Reported by kernel's checkpatch.pl script.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	Use __func__ instead of gcc specific __FUNCTION__
	Reported by kernel's checkpatch.pl script.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	Fix a few initialization style issues.
	Do not initialise statics and globals to 0, NULL, or false.

	Reported by kernel's checkpatch.pl script.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	Fix function prototypes with unspecified arguments.
	Change functions declared as taking unspecified number of arguments
	of unspecified type to functions that take no arguments.

	Reported by kernel's checkpatch.pl script.

2017-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	Fix a few sizeof style issues.
	Reported by kernel's checkpatch.pl script.

	Fix a few misspellings in comments.
	Reported by kernel's checkpatch.pl script.

2017-06-16  Dmitry V. Levin  <ldv@altlinux.org>

	print_mreq: remove superfluous print_quoted_string calls.
	The string returned by inet_ntoa(3) has IPv4 dotted-decimal notation,
	no need to quote it.

	* net.c (print_mreq): Remove print_quoted_string calls.

2017-06-15  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of incomplete SCM_TIMESTAMP* control messages.
	* tests/msg_control.c (test_scm_timestamp, test_scm_timestampns,
	test_scm_timestamping): Check decoding of incomplete control messages.

2017-06-15  Miroslav Lichvar  <mlichvar@redhat.com>

	msghdr: print SCM_TIMESTAMP* control messages.
	Add support for printing control messages containing software and/or
	hardware timestamps, which are typically enabled by NTP and PTP
	implementations.

	* print_timeval.c (print_struct_timeval_data_size): New mpers printer.
	* print_timespec.c (print_struct_timespec_data_size,
	print_struct_timespec_array_data_size): Likewise.
	* msghdr.c (print_scm_timestamp, print_scm_timestampns,
	print_scm_timestamping): New functions.
	(cmsg_socket_printers): Add them.
	* NEWS: Mention this change.
	* tests/msg_control.c: Include "xlat.h" and "xlat/scmvals.h".
	(test_scm_timestamp, test_scm_timestampns, test_scm_timestamping):
	New functions.
	(test_sol_socket): Use them.

2017-06-15  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_SOCK_DIAG AF_SMC messages.
	* tests/netlink_sock_diag.c: Include <linux/smc_diag.h>.
	(SMC_ACTIVE): New macro.
	(test_smc_diag_req, test_smc_diag_msg): New functions.
	(main): Use them.

	netlink: add a basic socket diag parser of AF_SMC messages.
	* linux/smc_diag.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* netlink_sock_diag.c: Include <linux/smc_diag.h>,
	"xlat/smc_diag_extended_flags.h" and "xlat/smc_states.h".
	(decode_smc_diag_req, decode_smc_diag_msg): New functions.
	(diag_decoders): Add AF_SMC.
	* xlat/smc_diag_extended_flags.in: New file.
	* xlat/smc_states.in: Likewise.

2017-06-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	tests: check decoding of NETLINK_SOCK_DIAG AF_INET messages.
	* tests/netlink_sock_diag.c: Include <arpa/inet.h>
	and <linux/inet_diag.h>.
	(test_inet_diag_sockid, test_inet_diag_req, test_inet_diag_req_v2,
	test_inet_diag_msg): New functions.
	(mian): Use them.

	netlink: add a basic socket diag parser of AF_INET and AF_INET6 messages
	* defs.h (inet_protocols): New xlat prototype.
	* linux/inet_diag.h (inet_diag_req): New structure.
	(INET_DIAG_*): New enum.
	* netlink_sock_diag.c: Include <arpa/inet.h>, <linux/inet_diag.h>
	and "xlat/inet_diag_extended_flags.h".
	(print_inet_diag_sockid, decode_inet_diag_req_compat)
	(decode_inet_diag_req_v2, decode_inet_diag_req)
	(decode_inet_diag_msg): New functions.
	(diag_decoders): Add AF_INET and AF_INET6;
	* xlat/inet_diag_extended_flags.in: New file.

2017-06-15  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce print_inet_addr.
	* defs.h (print_inet_addr): New prototype.
	* sockaddr.c (print_inet_addr): New function.
	(print_sockaddr_data_in6): Use it.
	* net.c (print_mreq6): Likewise.
	* tests/ip_mreq.c (main): Update expected output.

2017-06-15  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>

	tests: check decoding of NETLINK_SOCK_DIAG AF_PACKET messages.
	* tests/netlink_sock_diag.c: Include <linux/if_ether.h>
	and <linux/packet_diag.h>.
	(test_packet_diag_req, test_packet_diag_msg): New functions.
	(main): Use them.

	netlink: add a basic socket diag parser of AF_PACKET messages.
	* linux/packet_diag.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* defs.h (ethernet_protocols): New xlat prototype.
	* netlink_sock_diag.c: Include <linux/packet_diag.h>
	and "xlat/packet_diag_show.h".
	(decode_packet_diag_req, decode_packet_diag_msg): New functions.
	(diag_decoders): Add AF_PACKET.
	* xlat/packet_diag_show.in: New file.

	tests: check decoding of NETLINK_SOCK_DIAG AF_NETLINK messages.
	* tests/netlink_sock_diag.c: Include <linux/netlink_diag.h>.
	(test_netlink_diag_req, test_netlink_diag_msg): New functions.
	(main): Use them.

	netlink: add a basic socket diag parser of AF_NETLINK messages.
	* linux/netlink_diag.h (NDIAG_SHOW_GROUPS, NDIAG_SHOW_RING_CFG):
	New macros.
	* netlink_sock_diag.c: Include <linux/netlink_diag.h>,
	"xlat/netlink_diag_show.h" and "xlat/netlink_states.h".
	(decode_netlink_diag_req, decode_netlink_diag_msg): New functions.
	(diag_decoders): Add AF_NETLINK.
	* xlat/netlink_diag_show.in: New file.
	* xlat/netlink_states.in: Likewise.

2017-06-15  Dmitry V. Levin  <ldv@altlinux.org>
	    Fabien Siron  <fabien.siron@epita.fr>
	    JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_SOCK_DIAG AF_UNIX messages.
	* tests/netlink_sock_diag.c: Include <netinet/tcp.h>
	and <linux/unix_diag.h>.
	(test_odd_family_req, test_odd_family_msg, test_unix_diag_req,
	test_unix_diag_msg): New functions.
	(main): Use them.

	netlink: add a basic socket diag parser of AF_UNIX messages.
	* defs.h (socktypes): New xlat prototype.
	* linux/unix_diag.h (UDIAG_SHOW_VFS, UDIAG_SHOW_ICONS, UDIAG_SHOW_RQLEN,
	UDIAG_SHOW_MEMINFO): New macros.
	* netlink_sock_diag.c: Include <sys/socket.h>, <linux/netlink.h>,
	<linux/unix_diag.h>, "xlat/tcp_states.h", "xlat/tcp_state_flags.h",
	and "xlat/unix_diag_show.h".
	(decode_unix_diag_req, decode_unix_diag_msg): New functions.
	(netlink_diag_decoder_t): New typedef.
	(diag_decoders): New array.
	(decode_netlink_sock_diag): Use it.
	* xlat/tcp_state_flags.in: New file.
	* xlat/tcp_states.in: Likewise.
	* xlat/unix_diag_show.in: Likewise.

	netlink: introduce family specific payload decoders.
	* defs.h (netlink_decoder_t): New typedef.
	(DECL_NETLINK): New macro.
	(decode_netlink_sock_diag): New prototype.
	* netlink.c (netlink_decoders): New array.
	(decode_payload): Use it to invoke netlink family specific decoders.
	* netlink_sock_diag.c: New file.
	* Makefile.am (strace_SOURCES): Add it.

2017-06-15  Dmitry V. Levin  <ldv@altlinux.org>

	Update SCM_* constants.
	* xlat/scmvals.in: Add SCM_TIMESTAMP, SCM_TIMESTAMPNS, SCM_TIMESTAMPING,
	SCM_WIFI_STATUS, and SCM_TIMESTAMPING_OPT_STATS.

2017-06-14  Dmitry V. Levin  <ldv@altlinux.org>

	netlink: refactor decode_nlmsg_type.
	* netlink.c (decode_nlmsg_type_default, decode_nlmsg_type_netfilter):
	New functions.
	(nlmsg_types_decoder_t): New typedef.
	(nlmsg_types): Add decoder field.
	(decode_nlmsg_type): Use it.

2017-06-14  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: extend printstr test.
	* tests/printstr.c (main): Add a case for short read.

2017-06-13  Dmitry V. Levin  <ldv@altlinux.org>

	v4l2: fix preprocessor checks.
	Fix checks for struct v4l2_window.global_alpha and struct
	v4l2_sdr_format.buffersize.

	* v4l2.c (print_v4l2_format_fmt): Do not assume that
	HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA and
	HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE are defined.
	* tests/ioctl_v4l2.c (init_v4l2_format, dprint_ioctl_v4l2): Likewise.

2017-06-12  Dmitry V. Levin  <ldv@altlinux.org>

	Move xlat related functions to a separate file.
	* util.c (xlookup, xlat_bsearch_compare, xlat_search, printxvals,
	printxval_searchn, addflags, sprintflags, printflags_ex): Move ...
	* xlat.c: ... to this new file.
	* Makefile.am (strace_SOURCES): Add it.

2017-06-12  Masatake YAMATO  <yamato@redhat.com>

	socketeutils: extend receive_responses further.
	This is the second patch in series of implementing NETLINK_GENERIC
	protocol decoder.

	This change allows passing of opaque user data to the callback function.

	* socketutils.c (receive_responses): Change the type of proto_name
	argument from "const char *" to "void *" to allow passing
	of arbitrary data to the callback function.
	Rename proto_name to opaque_data, make it the last argument.
	Pass it to the callback function as the last argument.
	(inet_parse_response, unix_parse_response, netlink_parse_response):
	Change the type of proto_name argument from "const char *" to "void *",
	rename it to opaque_data, make it the last argument.
	Introduce a local variable proto_name to convert the type
	of opaque_data argument from "void *" to "const char *".
	(unix_get, inet_get, netlink_get): Cast the protocol name from
	"const char *" to "void *" for passing to the callback function.

2017-06-12  Masatake YAMATO  <yamato@redhat.com>

	socketeutils: extend receive_responses to handle other netlink types.
	This is the first patch in series of implementing NETLINK_GENERIC
	protocol decoder.

	receive_responses was written for decoding kernel responses of type
	SOCK_DIAG_BY_FAMILY, other types were ignored.

	This change makes the type of netlink response a parameter
	so the function can be used for other types of communication.

	* socketutils.c (receive_responses): add a new parameter
	expected_msg_type to handle types other than SOCK_DIAG_BY_FAMILY.

2017-06-12  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: fix typo.
	* tests/dup3.c (SKIP_MAIN_UNDEFINED): Remove duplicated &&.

2017-06-08  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce printflags_ex function.
	Add printflags_ex extension over printflags64 that, similar
	to printxvals, takes a NULL-terminated sequence of xlat pointers.

	* defs.h (printflags_ex): New prototype.
	(printflags64): Turn into a thin wrapper around printflags_ex.
	* netlink.c (decode_nlmsg_flags): Use printflags_ex.
	* util.c (printflags_ex): New function.
	(printflags64): Remove.
	* xlat/netlink_get_flags.in: Remove entries listed
	in xlat/netlink_flags.in file.
	* xlat/netlink_new_flags.in: Likewise.

2017-06-08  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: add check for decoding netlink get and new flags.
	* tests/netlink_route.c (test_nlmsg_flags): New function, checks
	decoding of NETLINK_ROUTE get and new flags.
	(main): Use it.
	* tests/netlink_sock_diag.c (test_nlmsg_flags): New function, checks
	decoding of NETLINK_SOCK_DIAG get flags.
	(main): Use it.
	* tests/netlink_xfrm.c: (test_nlmsg_flags): New function, checks
	decoding of NETLINK_XFRM get and new flags.
	(main): Use it.

2017-06-08  JingPiao Chen  <chenjingpiao@gmail.com>
	    Fabien Siron  <fabien.siron@epita.fr>
	    Dmitry V. Levin  <ldv@altlinux.org>

	netlink: implement generic nlmsg_flags decoding.
	* netlink.c: Include "xlat/netlink_get_flags.h"
	and "xlat/netlink_new_flags.h".
	(decode_nlmsg_flags): New function.
	(print_nlmsghdr): Use it.
	* xlat/netlink_get_flags.in: New file.
	* xlat/netlink_new_flags.in: Likewise.

2017-06-08  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: provide fallback definitions for XFRM_MSG_* constants.
	Some of XFRM_MSG_* constants were introduced later than the header file
	where they are defined.

	* xlat/nl_xfrm_types.in: Add default values for constants.

2017-06-05  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

	syscall.c: split trace_syscall() into 6 functions.
	This change removes the trace_syscall function.  Now, the code that uses
	syscall.c trace functions is expected to check whether it is a syscall
	entry or exit (with entering(tcp)/exiting(tcp)) itself, and then make
	an appropriate sequence of function calls.

	* defs.h: Update comment on TCB_INSYSCALL.
	(trace_syscall): Remove prototype.
	(syscall_entering_decode, syscall_entering_trace,
	syscall_entering_finish, syscall_exiting_decode, syscall_exiting_trace,
	syscall_exiting_finish): New prototypes.
	* strace.c (trace_syscall): New static replacement for old trace_syscall.
	* syscall.c (trace_syscall): Remove.
	(trace_syscall_entering): Split into ...
	(syscall_entering_decode, syscall_entering_trace,
	syscall_entering_finish): ... new functions.
	(trace_syscall_exiting): Split into ...
	(syscall_exiting_decode, syscall_exiting_trace,
	syscall_exiting_finish): ... new functions.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: guard against missing linux/netfilter/nfnetlink.h.
	nfnetlink was introduced in linux by commit v2.6.14-rc1~1035^2~217,
	add a guard for the case when system headers are not fresh enough.

	* configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/nfnetlink.h.
	* tests/netlink_netfilter.c: Check for HAVE_LINUX_NETFILTER_NFNETLINK_H.

2017-06-05  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: check decoding of NETLINK_XFRM message types.
	* tests/netlink_xfrm.c: New file.
	* tests/gen_tests.in (netlink_xfrm): New entry.
	* tests/pure_executables.list: Add netlink_xfrm.
	* tests/.gitignore: Likewise.

	tests: check decoding of NETLINK_SELINUX message types.
	* tests/netlink_selinux.c: New file.
	* tests/gen_tests.in (netlink_selinux): New entry.
	* tests/pure_executables.list: Add netlink_selinux.
	* tests/.gitignore: Likewise.

	tests: check decoding of NETLINK_NETFILTER message types.
	* tests/netlink_netfilter.c: New file.
	* tests/gen_tests.in (netlink_netfilter): New entry.
	* tests/pure_executables.list: Add netlink_netfilter.
	* tests/.gitignore: Likewise.

	tests: check decoding of NETLINK_AUDIT message types.
	* tests/netlink_audit.c: New file.
	* tests/gen_tests.in (netlink_audit): New entry.
	* tests/pure_executables.list: Add netlink_audit.
	* tests/.gitignore: Likewise.

	tests: check decoding of NETLINK_ROUTE message types.
	* tests/netlink_route.c: New file.
	* tests/gen_tests.in (netlink_route): New entry.
	* tests/pure_executables.list: Add netlink_route.
	* tests/.gitignore: Likewise.

	tests: check decoding of NETLINK_SOCK_DIAG message types.
	* tests/netlink_sock_diag.c: New file.
	* tests/netlink_sock_diag.test: New test.
	* tests/pure_executables.list: Add netlink_sock_diag.
	* tests/.gitignore: Likewise.
	* tests/Makefile.am (DECODER_TESTS): Add netlink_sock_diag.test.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use create_nl_socket in netlink_protocol.test.
	* tests/netlink_protocol.c (main): Use create_nl_socket.

	tests: change netlink_protocol.test to trace sendto syscalls only.
	* tests/gen_tests.in (netlink_protocol): Replace %network with sendto.
	* tests/netlink_protocol.c (main): Update expected output.

	tests: enhance create_nl_socket diagnostics messages.
	* tests/tests.h (create_nl_socket): Rename to create_nl_socket_ext,
	add a string argument.
	(create_nl_socket): New macro wrapper around create_nl_socket_ext.
	* tests/create_nl_socket.c (create_nl_socket): Rename
	to create_nl_socket_ext, add a string argument, include it
	in diagnostic messages.

	tests: use const and designated initializers in create_nl_socket.c.
	* tests/create_nl_socket.c: Stop including <string.h>.
	(create_nl_socket): Use const and designated initializers.

2017-06-05  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: add create_nl_socket function to libtests.
	* tests/create_nl_socket.c: New file.
	* tests/tests.h (create_nl_socket): New prototype.
	* tests/Makefile.am (libtests_a_SOURCES): Add create_nl_socket.c.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: add decoding of NETLINK_NETFILTER message types.
	* xlat/nl_netfilter_msg_types.in: New file.
	* xlat/nl_netfilter_subsys_ids.in: Likewise.
	* netlink.c: Include "xlat/nl_netfilter_msg_types.h"
	and "xlat/nl_netfilter_subsys_ids.h".
	(nlmsg_types): Add NETLINK_NETFILTER.
	(decode_nlmsg_type): Handle NETLINK_NETFILTER.

	netlink: add decoding of NETLINK_XFRM message types.
	* xlat/nl_xfrm_types.in: New file.
	* netlink.c: Include "xlat/nl_xfrm_types.h".
	(nlmsg_types): Add NETLINK_XFRM.

	netlink: add decoding of NETLINK_SELINUX message types.
	* xlat/nl_selinux_types.in: New file.
	* netlink.c: Include "xlat/nl_selinux_types.h".
	(nlmsg_types): Add NETLINK_SELINUX.

	netlink: add decoding of NETLINK_ROUTE message types.
	* xlat/nl_route_types.in: New file.
	* netlink.c: Include <linux/rtnetlink.h> and "xlat/nl_route_types.h".
	(nlmsg_types): Add NETLINK_ROUTE.

	netlink: add decoding of NETLINK_AUDIT message types.
	* xlat/nl_audit_types.in: New file.
	* netlink.c: Include <linux/audit.h> and "xlat/nl_audit_types.h".
	(nlmsg_types): Add NETLINK_AUDIT.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>
	    Fabien Siron  <fabien.siron@epita.fr>

	netlink: implement generic nlmsg_type decoding.
	Implement a pluggable mechanism of nlmsg_type decoding.
	Add decoding of NETLINK_SOCK_DIAG types.

	* linux/sock_diag.h (SOCK_DESTROY): New macro.
	* xlat/nl_sock_diag_types.in: New file.
	* netlink.c: Include xlat/nl_sock_diag_types.h.
	(get_fd_nl_family, decode_nlmsg_type): New functions.
	(print_nlmsghdr): Use them for nlmsg_type decoding.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>

	netlink: add netlink family argument to printers and decoders.
	* netlink.c (NL_FAMILY_ERROR, NL_FAMILY_DEFAULT): New constants.
	(print_nlmsghdr): Add netlink family argument, change return type
	to int, return family.
	(decode_nlmsghdr_with_payload, decode_nlmsgerr, decode_payload): Add
	netlink family argument.  All callers updated.

2017-06-05  Fabien Siron  <fabien.siron@epita.fr>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Add file descriptor argument to decode_netlink.
	* defs.h (decode_netlink): Add file descriptor argument.
	* io.c (print_iovec): Specify file descriptor to decode_netlink.
	* net.c (decode_sockbuf): Likewise.
	* netlink.c (print_nlmsghdr, decode_nlmsghdr_with_payload,
	decode_nlmsgerr, decode_payload, decode_nlmsghdr_with_payload,
	decode_netlink): Likewise.
	All callers updated.

	Introduce getfdinode to obtain inode from fd.
	* defs.h (getfdinode): New prototype.
	* utils.c (getfdinode): New function.

2017-06-05  Fabien Siron  <fabien.siron@epita.fr>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Introduce get_sockaddr_by_inode.
	Add a way to get socket information without printing it.

	* defs.h (get_sockaddr_by_inode): New prototype.
	* socketutils.c (get_sockaddr_by_inode): New function.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>

	socketutils.c: introduce get_sockaddr_by_inode_uncached.
	* socketutils.c (get_sockaddr_by_inode_uncached): New function.
	(print_sockaddr_by_inode_uncached): Use it.

2017-06-05  Fabien Siron  <fabien.siron@epita.fr>
	    Dmitry V. Levin  <ldv@altlinux.org>

	socketutils.c: use get_sockaddr_by_inode_cached.
	* socketutils.c (unix_print, inet_print, tcp_v4_print, tcp_v6_print,
	udp_v4_print, udp_v6_print, netlink_print): Remove.
	(unix_get, inet_get, tcp_v4_get, tcp_v6_get, udp_v4_get,
	udp_v6_get, netlink_get): New functions.
	(protocols): Update.

2017-06-05  Dmitry V. Levin  <ldv@altlinux.org>

	socketutils.c: move inet_print closer to its first use.
	* socketutils.c (inet_print): Move right before tcp_v4_print.

2017-06-05  Fabien Siron  <fabien.siron@epita.fr>
	    Dmitry V. Levin  <ldv@altlinux.org>

	socketutils.c: introduce cache_inode_details.
	cache_inode_details gives a way to obtain cache information without
	printing it.

	* socketutils.c (cache_and_print_inode_details): Rename
	to cache_inode_details.  Do not print cached information.
	(inet_parse_response, unix_parse_response, netlink_parse_response):
	Use cache_inode_details instead of cache_and_print_inode_details.
	(inet_print, unix_print, netlink_print): Call
	print_sockaddr_by_inode_cached.

2017-06-05  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

	strace.c: move termination code to a separate function.
	This will be needed for the pull-style API.

	* strace.c (terminate): New function.
	(main): Use it.

2017-06-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: avoid hitting SO_SNDBUF limit in sendfile/sendfile64 tests.
	Do not assume that an executable is small enough and SO_SNDBUF is large
	enough so that the executable could be sendfile'ed into a socket pair.

	* tests/sendfile.c (main): Create a regular file of the right size
	to avoid hitting SO_SNDBUF limit.
	* tests/sendfile64.c: Likewise.

	Reported-by: Andreas Schwab <schwab@linux-m68k.org>

2017-06-04  Dmitry V. Levin  <ldv@altlinux.org>

	Move netlink_protocols definition from net.c to netlink.c.
	The side effect of #include "xlat/netlink_protocols.h" is
	NETLINK_* constants properly defined in that header file.
	While net.c does not use these constants itself, netlink.c
	is going to need them soon.

	* net.c: Move inclusion of "xlat/netlink_protocols.h" ...
	* netlink.c: ... here.

2017-06-04  Dmitry V. Levin  <ldv@altlinux.org>

	travis: switch from gcc-6 to gcc-7.
	* .travis.yml (matrix): Change gcc-6 to gcc-7.

	tests: extend checking of NLMSG_DONE decoding.
	* tests/netlink_protocol.c (test_nlmsg_done):  Use designated
	initializers.  Check decoding of messages with non-integer payload.

2017-06-04  JingPiao Chen  <chenjingpiao@gmail.com>

	netlink: decode NLMSG_DONE messages.
	* netlink.c (decode_payload): Decode NLMSG_DONE messages.
	* tests/netlink_protocol.c (test_nlmsg_done): New function
	for checking decoding of NLMSG_DONE messages.
	(main): Use it.

2017-06-04  Dmitry V. Levin  <ldv@altlinux.org>

	socketutils.c: introduce get_sockaddr_by_inode_cached.
	* socketutils.c (get_sockaddr_by_inode_cached): New function.
	(print_sockaddr_by_inode_cached): Use it.

2017-06-03  Dmitry V. Levin  <ldv@altlinux.org>

	Unexport print_sockaddr_by_inode_cached.
	Change print_sockaddr_by_inode to be the only function exposed,
	hide print_sockaddr_by_inode_cached as a part of implementation.

	* defs.h (print_sockaddr_by_inode_cached): Remove prototype.
	(print_sockaddr_by_inode): Add struct tcb * and descriptor arguments.
	* socketutils.c (print_sockaddr_by_inode_cached): Make static.
	(print_sockaddr_by_inode): Rename to print_sockaddr_by_inode_uncached,
	make static.
	(print_sockaddr_by_inode): New function.
	* util.c (printfd): Update to use new print_sockaddr_by_inode.

2017-06-03  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce str_strip_prefix_len function and STR_STRIP_PREFIX macro.
	Address proliferation of string prefix check implementations.

	* defs.h (str_strip_prefix_len): New inline function.
	(STR_STRIP_PREFIX): New macro.
	* qualify.c (strip_prefix): Remove.
	(parse_inject_token): Use STR_STRIP_PREFIX instead of strip_prefix.
	(qualify): Use str_strip_prefix_len.
	* socketutils.c (netlink_parse_response): Likewise.
	* util.c (printfd): Likewise.

2017-06-02  Dmitry V. Levin  <ldv@altlinux.org>

	netlink: move NLMSG_ERROR payload length check to nlmsgerr decoder.
	Move decoder specific check to the decoder.

	* netlink.c (decode_payload): Move NLMSG_ERROR payload length check ...
	(decode_nlmsgerr): ... here.

2017-06-02  Dmitry V. Levin  <ldv@altlinux.org>

	strace.c: handle PTRACE_EVENT_EXEC like other events.
	There is nothing unusual about PTRACE_EVENT_EXEC that would require
	a special treatment.

	* strace.c (next_event): Move PTRACE_EVENT_EXEC handling to the main
	switch statement.

2017-06-02  Dmitry V. Levin  <ldv@altlinux.org>

	strace.c: remove dead code.
	As strace does not use WCONTINUED flag, there is no need to handle
	WIFCONTINUED status.

	* strace.c (print_debug_info) [WIFCONTINUED]: Remove.
	(next_event): Remove redundant !WIFSTOPPED check.

2017-06-02  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

	strace.c: refactor trace into two functions.
	This change decouples waiting for next event from reacting to it.  This
	makes the control flow easier to understand, and serves as a preparation
	for implementing a pull-style API for LuaJIT.

	* strace.c (enum trace_event): New enum.
	(trace): Split into ...
	(next_event, dispatch_event): ... new functions.
	(main): Use them.

2017-05-30  Dmitry V. Levin  <ldv@altlinux.org>

	scno.am: include config.h before syscallent.h.
	This fixes generation of syscallent.i and subsequent scno.h files
	on mips where syscallent.h checks macros defined in config.h.

	* scno.am (syscallent.i): Add $(top_builddir)/config.h
	to prerequisites, include it.
	* NEWS: Mention this fix.

	Reported-by: David Robins <dbrobins@i4031.net>

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of sigaction syscall.
	* tests/sigaction.c: New file.
	* tests/gen_tests.in (sigaction): New entry.
	* tests/pure_executables.list: Add sigaction.
	* tests/.gitignore: Likewise.

	tests: rename sigaction.test to rt_sigaction.test.
	* tests/sigaction.awk: Rename to rt_sigaction.awk.
	* tests/sigaction.c: Rename to tests/rt_sigaction.c.
	* tests/sigaction.test: Rename to tests/rt_sigaction.test.
	* tests/.gitignore: Replace sigaction with rt_sigaction.
	* tests/pure_executables.list: Likewise.
	* tests/Makefile.am (DECODER_TESTS): Replace sigaction.test
	with rt_sigaction.test.
	(EXTRA_DIST): Replace sigaction.awk with rt_sigaction.awk.

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	sparc: enhance decoding of signal number argument of sigaction syscall.
	On sparc, unlike all other architectures, old sigaction syscall takes
	a negated signal number.

	* signal.c (SYS_FUNC(sigaction)) [SPARC || SPARC64]: Enhance printing
	of negative signal number argument.

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	signal: enhance printing of old_sigaction.mask.
	* signal.c (decode_old_sigaction): Print old_sigaction.mask
	using tprint_old_sigmask_val.

	signal: limit scope of struct old_sigaction32 definition.
	* signal.c (struct old_sigaction32): Define only if [!current_wordsize].

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	signal: fix decoding of struct old_sigaction on some architectures.
	On alpha, struct old_sigaction.sa_flags has a 32-bit type.

	On mips, only first word of old_sigaction.sa_mask is read.

	On all architectures except alpha and mips that have old sigaction
	syscall, struct old_sigaction has sa_restorer field that has to be
	decoded.

	* signal.c (struct old_sigaction) [ALPHA]: Change sa_flags type
	to unsigned int, add ATTRIBUTE_PACKED.
	[MIPS]: Dhrink sa_mask array to 1 element.
	[!ALPHA && !MIPS]: Define sa_restorer field unconditionally.
	(struct old_sigaction32): Likewise.
	(decode_old_sigaction) [!current_wordsize]: Initialize sa_restorer field
	from old_sigaction32.sa_restorer unconditionally.
	[!ALPHA && !MIPS]: Print old_sigaction.sa_restorer if SA_RESTORER flag
	is set.
	* NEWS: Mention this change.

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: rename SA_STACK to SA_ONSTACK.
	SA_ONSTACK is the standard name while its alias SA_STACK is not even
	defined on many platforms.

	* xlat/sigact_flags.in (SA_STACK): Rename to SA_ONSTACK.

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of sigpending syscall.
	* tests/sigpending.c: New file.
	* tests/gen_tests.in (sigpending): New entry.
	* tests/pure_executables.list: Add sigpending.
	* tests/.gitignore: Likewise.

	tests: check decoding of sigprocmask syscall.
	* tests/sigprocmask.c: New file.
	* tests/gen_tests.in (sigprocmask): New entry.
	* tests/pure_executables.list: Add sigprocmask.
	* tests/.gitignore: Likewise.

2017-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: rename sys_sigprocmask to sys_osf_sigprocmask.
	Parsers of sigprocmask and osf_sigprocmask syscalls are different
	anyway, so rename the function to match the syscall name.

	* signal.c [ALPHA] (SYS_FUNC(sigprocmask)): Rename
	to SYS_FUNC(osf_sigprocmask).
	* linux/alpha/syscallent.h: Update sys_func.

2017-05-27  Dmitry V. Levin  <ldv@altlinux.org>

	Enable coverage when strace is self terminated by signal.
	The data collected by -fprofile-arcs during program run is saved
	on program exit.  When program is terminated by signal, the data
	is not saved.  However, libgcov provides an interface to dump
	the data at runtime.

	* m4/ax_code_coverage.m4 (AX_CODE_COVERAGE): Add -DENABLE_COVERAGE_GCOV
	to CODE_COVERAGE_CPPFLAGS.
	* strace.c [ENABLE_COVERAGE_GCOV] (__gcov_flush): New prototype.
	(main) [ENABLE_COVERAGE_GCOV]: Call __gcov_flush() before raise()
	and sigprocmask() calls that might cause program termination.

2017-05-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check termination signal forwarding.
	* tests/run_expect_termsig.c: New file.
	* tests/unblock_reset_raise.c: Likewise.
	* tests/termsig.test: New test.
	* tests/.gitignore: Add run_expect_termsig and unblock_reset_raise.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add termsig.test.

2017-05-27  Dmitry V. Levin  <ldv@altlinux.org>

	Fix termination signal forwarding.
	When traced command is terminated by a blocked signal, unblock
	that signal to ensure strace termination with the same signal.

	* strace.c (main): Unblock the signal raised for strace termination.
	* NEWS: Mention this change.

2017-05-27  Dmitry V. Levin  <ldv@altlinux.org>

	Do not reset SIGCHLD handler in tracees to SIG_DFL.
	While strace resets SIGCHLD handler to the default action so that
	waitpid definitely works without losing track of children, tracees
	should not inherit this change.

	* strace.c (struct exec_params): Add child_sa field.
	(init): When setting SIGCHLD handler to SIG_DFL, save the old handler.
	(exec_or_die): Restore SIGCHLD handler if it was different from SIG_DFL
	at startup.
	* NEWS: Mention this change.

2017-05-27  Dmitry V. Levin  <ldv@altlinux.org>

	Refactor setting of signal handlers to reduce redundancy.
	* strace.c (set_sigaction): New function.
	(init): Use it instead of sigaction with sigaddset.

	tests: check how signals are unblocked in interactive mode.
	* tests/block_reset_raise_run.c: New file.
	* tests/interactive_block.test: New test.
	* tests/.gitignore: Add block_reset_raise_run.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add interactive_block.test.

2017-05-27  Dmitry V. Levin  <ldv@altlinux.org>

	Fix unblocking of signals in interactive mode.
	In interactive mode (-I2), those signals that were blocked at startup
	will remain blocked for the whole period of strace execution.

	* strace.c (empty_set): Rename to start_set.  All users changed.
	(init): Initialize start_set and blocked_set to the set of currently
	blocked signals.
	(startup_attach, trace): Use SIG_SETMASK instead of SIG_BLOCK.
	* NEWS: Mention this change.

2017-05-26  Dmitry V. Levin  <ldv@altlinux.org>

	Cleanup interactive check.
	* strace.c (init): Check for INTR_WHILE_WAIT mode the same way
	as in other places.

	tests: check decoding of signal syscall.
	* tests/signal.c: New file.
	* tests/gen_tests.in (signal): New entry.
	* tests/pure_executables.list: Add signal.
	* tests/.gitignore: Likewise.

2017-05-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Unify capitalisation of (c) in copyright notices.

2017-05-25  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.17-1.
	* strace.spec.in: Likewise.

2017-05-24  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.17 release.
	* NEWS: Update for 4.17 release.

	powerpc64, sparc, sparc64: wire up statx syscall.
	* linux/powerpc64/syscallent.h [383]: Add statx entry.
	* linux/sparc/syscallent.h [360]: Likewise.
	* linux/sparc64/syscallent.h [360]: Likewise.

2017-05-23  Dmitry V. Levin  <ldv@altlinux.org>

	Fix compat personality support for sgetmask syscall.
	* signal.c (SYS_FUNC(sgetmask)): Replace sprintsigmask_val
	with sprint_old_sigmask_val.
	* tests/sxetmask.c (main): Check decoding of signal mask containing
	RT signals.

2017-05-22  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of sgetmask and ssetmask syscalls.
	Old ssetmask syscall takes an argument and returns a value of type int.
	Old sgetmask syscall may return an error.

	* signal.c (SYS_FUNC(ssetmask)): Explicitly convert the argument
	and return value to unsigned int, print it using sprint_old_sigmask_val.
	(SYS_FUNC(sgetmask)): Do not print the mask in case of syserror.
	* tests/sxetmask.c: New file.
	* tests/gen_tests.in (sxetmask): New entry.
	* tests/pure_executables.list: Add sxetmask.
	* tests/.gitignore: Likewise.
	* NEWS: Mention this fix.

2017-05-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add copyright headers.

2017-05-22  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Elvira Khabirova  <lineprinter0@gmail.com>

	Add scripts for automating copyright notices update.
	* maint/update_copyright_years.awk: New file.
	* maint/update_copyright_years.sh: Likewise.

2017-05-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Fix typos in copyright notices.

	unwind.c: remove non-ASCII character from comment.

2017-05-21  Dmitry V. Levin  <ldv@altlinux.org>

	Rename sys_sig[gs]etmask to sys_s[gs]etmask to match syscall names.
	* signal.c (SYS_FUNC(sigsetmask)): Rename to SYS_FUNC(ssetmask).
	(SYS_FUNC(siggetmask)): Rename to SYS_FUNC(sgetmask).
	* linux/arm/syscallent.h (sgetmask, ssetmask): Update sys_func.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.

	tests: enhance sigsuspend.test.
	* tests/sigsuspend.c (sigtxt): New variable.
	(main): Change signal masks to contain all signals except USR1 and USR2.

2017-05-20  Dmitry V. Levin  <ldv@altlinux.org>

	Fix compat personality support for old sigsuspend syscall.
	* signal.c (sprint_old_sigmask_val): New function.
	(tprint_old_sigmask_val): New macro.
	(SYS_FUNC(sigsuspend)): Use it.

2017-05-16  Dmitry V. Levin  <ldv@altlinux.org>

	Move errnoent.sh, signalent.sh, and syscallent.sh to maint subdirectory.
	Also do not include them into release tarballs.  These files are
	intended for developers who are expected to use a git repository.

	* errnoent.sh: Move to maint subdirectory.
	* signalent.sh: Likewise.
	* syscallent.sh: Likewise.
	* HACKING-scripts: Update.
	* Makefile.am (EXTRA_DIST): Remove errnoent.sh, signalent.sh,
	and syscallent.sh.

2017-05-16  Dmitry V. Levin  <ldv@altlinux.org>

	Do not include maint subdirectory into release tarballs.
	These files are intended for developers who are expected to use
	a git repository.

	* Makefile.am (EXTRA_DIST): Remove maint/ioctls_gen.sh,
	maint/ioctls_hex.sh, maint/ioctls_sym.sh, and maint/print_ioctlent.c.

2017-05-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	linux/ia64/syscallent.h: remove tabulation, add spaces in file comment.

	linux/mtd-abi.h: remove non-ASCII character from file comment.

2017-05-01  Dmitry V. Levin  <ldv@altlinux.org>

	alpha, cris, mips, ppc, sh, sparc: fix decoding of sigsuspend syscall.
	On some architectures old sigsuspend syscall takes the signal mask from
	the 3rd argument, on some from the 1st.  And, if it wasn't peculiar
	enough, the signal mask is passed by value on all architectures except
	mips where it's passed by reference.

	* signal.c (SYS_FUNC(sigsuspend)): Take the signal mask from the last
	argument.
	* linux/alpha/syscallent.h (sigsuspend): Set nargs to 1.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* tests/sigsuspend.c: New file.
	* tests/gen_tests.in (sigsuspend): New entry.
	* tests/pure_executables.list: Add sigsuspend.
	* tests/.gitignore: Likewise.
	* NEWS: Mention this fix.

2017-05-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: raise default timeout for individual tests.
	Recently added tests based on pure_executables.list are quite slow
	by their nature, the one minute default timeout is no longer enough
	for some of not so fast architectures.

	* tests/init.sh (TIMEOUT_DURATION): Raise from 60 to 120.

2017-05-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.

2017-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	Update TCP_* constants.
	* xlat/socktcpoptions.in: Add TCP_FASTOPEN_CONNECT introduced
	by linux kernel commit v4.11-rc1~124^2~321^2.

2017-04-28  Dmitry V. Levin  <ldv@altlinux.org>

	Update AF_* constants.
	* xlat/addrfams.in: Add AF_SMC introduced by linux kernel
	commit v4.11-rc1~94^2~43^2~13.

2017-04-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance madvise decoder check.
	* tests/mmap.c (main): Remove madvise check.
	* tests/madvise.c: New file.
	* tests/gen_tests.in (madvise): New entry.
	* tests/.gitignore: Add madvise.
	* tests/pure_executables.list: Likewise.

2017-04-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add -etrace=?... test.
	Check for some architecture-specific syscalls which are not present
	on most architectures.

	* gen_tests.in: Add trace_question test.
	* tests/trace_question.in: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.

2017-04-25  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add more information to generated header comments.
	* tests/gen_tests.sh: Update header comment with the source string
	used for test generation.

	tests: move generated common header comment into a variable.
	* tests/gen_tests.sh: Move generated file header comment
	into a variable, use it in all cases.

2017-04-25  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use TAIL_ALLOC_OBJECT_CONST_PTR in v4l2 test.
	* tests/ioctl_v4l2.c (main): Use TAIL_ALLOC_OBJECT_CONST_PTR.

2017-04-25  Edgar Kaziahmedov  <edos@linux.com>

	tests: Check decoding of VIDIOC_G/S_TUNER's arg.
	* tests/ioctl_v4l2.c (main): Add checks for VIDIOC_G/S_TUNER's arg.

	v4l2: Add decoding for VIDIOC_G/S_TUNER's arg.
	* v4l2.c: Include "xlat/v4l2_tuner_types.h", "xlat/v4l2_tuner_capabilities.h",
	"xlat/v4l2_tuner_rxsubchanses.h", and "xlat/v4l2_tuner_audmodes.h".
	(print_v4l2_tuner): New function. Add decoding for VIDIOC_G/S_TUNER's arg.
	(v4l2_ioctl): Add new cases for decoding VIDIOC_G/S_TUNER's arg.
	* xlat/v4l2_tuner_types.in: Add V4L2_TUNER_RADIO and
	V4L2_TUNER_ANALOG_TV introduced by linux kernel commit
	2.5.46~39^2~23^2~4.
	Add V4L2_TUNER_DIGITAL_TV introduced by linux kernel
	commit v2.6.11-rc4~55^2~20.
	Add V4L2_TUNER_ADC and V4L2_TUNER_RF introduced by linux kernel commit
	v3.15-rc1~85^2~215.
	Add V4L2_TUNER_SDR introduced by linux kernel commit v4.4-rc1~118^2~17
	(as the replacement of V4L2_TUNER_ADC).
	* xlat/v4l2_tuner_capabilities.in: Add V4L2_TUNER_CAP_LOW,
	V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_STEREO, V4L2_TUNER_CAP_LANG2,
	V4L2_TUNER_CAP_SAP, and V4L2_TUNER_CAP_LANG1 introduced by linux kernel
	commit 2.5.46~39^2~23^2~4.
	Add V4L2_TUNER_CAP_HWSEEK_BOUNDED and V4L2_TUNER_CAP_HWSEEK_WRAP
	introduced by linux kernel commit v3.6-rc1~28^2~306.
	Add V4L2_TUNER_CAP_RDS introduced by linux commit v2.6.32-rc1~679^2~189.
	Add V4L2_TUNER_CAP_RDS_BLOCK_IO and V4L2_TUNER_CAP_RDS_CONTROLS
	introduced by linux kernel commit v2.6.37-rc1~64^2~110.
	Add V4L2_TUNER_CAP_FREQ_BANDS introduced by linux kernel commit
	v3.6-rc1~28^2~46.
	Add V4L2_TUNER_CAP_HWSEEK_PROG_LIM introduced by linux kernel commit
	v3.6-rc1~28^2~40.
	Add V4L2_TUNER_CAP_1HZ introduced by linux kernel commit
	v3.15-rc1~85^2~214.
	* xlat/v4l2_tuner_audmodes.in: Add V4L2_TUNER_MODE_MONO,
	V4L2_TUNER_MODE_STEREO, V4L2_TUNER_MODE_LANG2, V4L2_TUNER_MODE_SAP, and
	V4L2_TUNER_MODE_LANG1 introduced by linux kernel commit
	2.5.46~39^2~23^2~4.
	Add V4L2_TUNER_MODE_LANG1_LANG2 introduced by linux kernel commit
	v2.6.17-rc1~739^2~9.
	* xlat/v4l2_tuner_rxsubchanses.in: Add V4L2_TUNER_SUB_MONO,
	V4L2_TUNER_SUB_STEREO, V4L2_TUNER_SUB_LANG2, V4L2_TUNER_SUB_SAP, and
	V4L2_TUNER_SUB_LANG1 introduced by linux kernel commit
	2.5.46~39^2~23^2~4.
	Add V4L2_TUNER_SUB_RDS introduced by linux kernel commit
	v2.6.32-rc1~679^2~189.

2017-04-24  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of invalid tv_sec and tv_usec values.
	* tests/futimesat.c (main): Check decoding of invalid tv_sec and tv_usec
	values.
	* tests/xetitimer.c (main): Likewise.
	* tests/xettimeofday.c (main): Likewise.
	* tests/xselect.c (main): Likewise.
	* tests/xutimes.c (main): Likewise.

	tests: check decoding of invalid tv_sec and tv_nsec values.
	* tests/aio.c (main): Check decoding of invalid tv_sec and tv_nsec
	values.
	* tests/clock_nanosleep.c (main): Likewise.
	* tests/clock_xettime.c (main): Likewise.
	* tests/futex.c (main): Likewise.
	* tests/nanosleep.c (main): Likewise.
	* tests/ppoll.c (main): Likewise.
	* tests/pselect6.c (main): Likewise.
	* tests/recvmmsg-timeout.c (main): Likewise.
	* tests/rt_sigtimedwait.c (main): Likewise.
	* tests/semop.c (main): Likewise.
	* tests/timer_xettime.c (main): Likewise.
	* tests/timerfd_xettime.c (main): Likewise.
	* tests/utimensat.c (main): Likewise.

2017-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Print time in ISO 8601 format in time syscall decoder.
	* print_time.c (SYS_FUNC(time)): Print timestamp stringification
	(via sprinttime) for the value stored in the argument and return value
	(return RVAL_STR in the latter case).
	* tests/time.c (main): Update expected output.

2017-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Print string representation of timestamps in parsers of *utime* syscalls
	* print_timespec.c (print_timespec_t_utime): Use sprinttime_nsec
	to format a string representation of time, use tprints_comment
	to print it as a comment.
	* print_timeval.c (print_timeval_t_utime): New function.
	(print_timeval_utimes): Use it instead of print_timeval_t.
	[ALPHA] (print_timeval32_t_utime): New function.
	[ALPHA] (print_timeval32_utimes): Use it instead of print_timeval32_t.
	* tests/futimesat.c (print_tv): Update expected output.
	* tests/utimensat.c (print_ts): Likewise.
	* tests/xutimes.c (print_tv): Likewise.

2017-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add support for printing timestamp with microsecond precision.
	It will be needed later.

	* tests/tests.h (print_time_t_usec): New prototype.
	* tests/print_time.c (print_time_t_usec): New function, a thin wrapper
	around print_time_t_ex.

2017-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Print microseconds/nanoseconds as non-negative.
	Negative micro/nanoseconds values are treated as invalid by kernel
	anyway, and in one case (timespec_valid in include/linux/time.h)
	it is even checked by conversion to unsigned long.

	* print_timespec.c (timespec_fmt): Change tv_sec format to %lld and
	tv_nsec format to %llu.
	(print_timespec_t): Cast tv_sec to long long and process tv_nsec with
	zero_extend_signed_to_ull.
	(sprint_timespec): Likewise.
	* print_timeval.c (timeval_fmt): Change tv_sec format to %lld and
	tv_usec format to %llu.
	(print_timeval_t): Cast tv_sec to long long and process tv_nsec with
	zero_extend_signed_to_ull.
	(sprint_timeval, print_timeval32_t, sprint_timeval32): Likewise.
	* defs.h (TIMESPEC_TEXT_BUFSIZE): Update.
	* tests/adjtimex.c (main): Change tv_sec printing format to %lld, cast
	it to long long; change tv_usec printing format to %llu, process it with
	zero_extend_signed_to_ull.
	* tests/clock_nanosleep.c (main): Change tv_sec printing format to %lld,
	cast it to long long; change tv_nsec printing format to %llu, process it
	with zero_extend_signed_to_ull.
	* tests/clock_xettime.c (main): Likewise.
	* tests/futex.c (main): Likewise.
	* tests/futimesat.c (print_tv): Likewise.
	* tests/getrusage.c (invoke_print): Likewise.
	* tests/mq_sendrecv.c (do_send, do_recv, main): Likewise.
	* tests/nanosleep.c (main): Likewise.
	* tests/pselect6.c (main): Likewise.
	* tests/restart_syscall.c (main): Likewise.
	* tests/rt_sigtimedwait.c (iterate, main): Likewise.
	* tests/sched_rr_get_interval.c (main): Likewise.
	* tests/semop.c (main): Likewise.
	* tests/timer_xettime.c (main): Likewise.
	* tests/timerfd_xettime.c (main): Likewise.
	* tests/waitid.c (main): Likewise.
	* tests/xetitimer.c (main): Likewise.
	* tests/xettimeofday.c (main): Likewise.
	* tests/xselect.c (main): Likewise.
	* tests/xutimes.c (print_tv): Likewise.
	* tests/wait4.c (sprint_rusage): Likewise.
	* tests/waitid.c (sprint_rusage): Likewise.
	* tests/utimensat.c (print_ts): Likewise.
	(main): Add check for higher bits of tv_sec/tv_nsec.

2017-04-24  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Always print raw values of time data fields.
	Refactor sprinttime: implement sprinttime_nsec and sprinttime_usec
	that handle nanoseconds and microseconds, respectively.
	Always print raw values of time data fields, format string
	representations of time as comments.

	* defs.h (sprinttime): Change argument type from time_t to long long.
	(sprinttime_nsec, sprinttime_usec): New prototypes.
	* util.c (sprinttime_ex, sprinttime_nsec, sprinttime_usec): New
	functions.
	(sprinttime): Turn into a thin wrapper around sprinttime_ex.
	* stat.h (struct strace_stat): Add has_nsec field.
	* fetch_struct_stat.c (HAVE_NSEC): New macro.
	(fetch_struct_stat): Initialize has_nsec field with HAVE_NSEC.
	* fetch_struct_stat64.c (HAVE_NSEC): New macro.
	(fetch_struct_stat64): Initialize has_nsec field with HAVE_NSEC.
	* print_struct_stat.c (print_struct_stat) <PRINT_ST_TIME>:
	Print raw values of time fields, use sprinttime_nsec to format a string
	representation of time, use tprints_comment to print it as a comment.
	* statx.c (SYS_FUNC(statx)) <PRINT_FIELD_TIME>: Likewise.
	* utime.c (SYS_FUNC(utime)): Print raw values of struct utimbuf.actime
	and struct utimbuf.modtime fields, use sprinttime to format a string
	representation of time, use tprints_comment to print it as a comment.
	* tests/tests.h (print_time_t_nsec): Add int argument.
	* tests/print_time.c (print_time_t_ex): New function.
	(print_time_t_nsec): Add int argument, turn into a thin wrapper around
	print_time_t_ex.
	* tests/utime.c (main): Update expected output.
	* tests/xstatx.c [!IS_STATX] (HAVE_NSEC): New macro.
	[!IS_STATX] (PRINT_ST_TIME), [IS_STATX] (PRINT_FIELD_TIME): Update
	expected output.
	* NEWS: Mention this timestamps representation improvement.

2017-04-24  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce tprintf_comment and tprints_comment functions.
	* defs.h (tprintf_comment, tprints_comment): New prototypes.
	* strace.c (tvprintf): New function.
	(tprintf): Use it.
	(tprintf_comment, tprints_comment): New functions.
	* aio.c (tprint_lio_opcode): Use tprints_comment.
	* dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps,
	dm_decode_dm_name_list, dm_decode_dm_target_versions,
	dm_decode_dm_target_msg, dm_decode_string, dm_known_ioctl): Likewise.
	* futex.c (SYS_FUNC(futex)): Likewise.
	* perf.c (print_perf_event_attr): Likewise.
	* seccomp.c (decode_bpf_code): Likewise.
	* util.c (printxvals, printxval_searchn, printflags64): Likewise.
	* btrfs.c (print_u64, btrfs_print_key_type, btrfs_print_objectid,
	print_key_value_internal): Likewise.
	(btrfs_ioctl): Use tprints_comment and tprintf_comment.
	* dirent.c (SYS_FUNC(getdents)): Likewise.
	* dirent64.c (SYS_FUNC(getdents64)): Likewise.
	* execve.c (printargc): Use tprintf_comment.
	* tests/btrfs.c (btrfs_test_get_dev_stats_ioctl,
	btrfs_test_features_ioctls): Update expected output.

	Make output of execve/execveat syscall parsers more structured.
	* execve.c (printargc): Always print the address, format the number
	of variables as a comment.
	* tests/execve.c: Update expected output.
	* tests/execveat.c: Likewise.
	* tests/qual_syscall.test: Likewise.
	* tests/strace-r.expected: Likewise.
	* tests/strace-t.test: Likewise.
	* tests/strace-tt.test: Likewise.
	* tests/strace-ttt.test: Likewise.
	* tests/threads-execve.c: Likewise.
	* tests/threads-execve.test: Likewise.

	dm: fix diagnostics about misplaced parts of struct dm_ioctl.
	* dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps,
	dm_decode_dm_name_list, dm_decode_dm_target_versions,
	dm_decode_dm_target_msg, dm_decode_string, dm_known_ioctl): Fix
	diagnostics about various misplaced parts of struct dm_ioctl.
	* tests/ioctl_dm.c: Update expected output.

	print_mq_attr: fix typo.
	* print_mq_attr.c (printmqattr): Fix the last argument of printflags64.

2017-04-23  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add faulty pointer check to time test.
	* tests/time.c (main): Add check for an inaccessible pointer.

2017-04-22  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix print_time_t_nsec usage in xstatx.c.
	* tests/xstatx.c (print_stat): Pass tv_nsec field through
	zero_extend_signed_to_ull before feeding it to print_time_t_nsec.

2017-04-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix netlink_protocol on sparc.
	* tests/netlink_protocol.c (test_nlmsgerr): Do not access fields of an
	unaligned structure, this makes architectures like sparc very unhappy.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: return pointer to string literal directly in sprinttime.
	There is no sense to copy it to static buffer first.

	* util.c (sprinttime): Just return "0", do not copy it to internal
	buffer first.

2017-04-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: remove stat.sample creation from gen_tests.in.
	stat.sample is created by appropriate executables and never removed.

	* tests/gen_tests.in (trace_fstat, trace_lstat, trace_stat,
	trace_stat_like): Remove stat.sample creation.

2017-04-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tabulate fstat.test.
	* tests/gen_tests.in (fstat): New entry.
	(fstat64, oldfstat): Update.
	* tests/fstat.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove fstat.test.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement -e trace=%stat option.
	linux/*/syscallent*.h part is updated automatically by:

	    sed -i '/statx/! s/TF|TSTA,/TF|TST|TSTA,/' linux/*/syscallent*.h

	* sysent.h (TRACE_STAT): New macro.
	* syscall.c: Alias LST to TRACE_STAT around syscallent.h inclusion.
	* qualify.c (lookup_class): Add TRACE_STAT for "%stat".
	* strace.1 (.SS Filtering): Add information about %stat syscall class.
	* NEWS: Mention this change.
	* linux/aarch64/syscallent.h (stat): Add TST flag.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/arm/syscallent.h (oldstat, stat, stat64): Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/avr32/syscallent.h (stat, stat64): Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h (oldstat, stat): Likewise.
	* linux/alpha/syscallent.h (osf_old_stat, osf_stat, stat, stat64): Likewise.
	* linux/mips/syscallent-compat.h (bsd43_oldstat, bsd43_stat, posix_stat,
	svr4_stat, svr4_xstat, sysv_stat, sysv_xstat): Likewise.
	* tests/gen_tests.in (trace_stat): New entry.
	* tests/trace_stat.in: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/ksysent.c (TST): New macro, defined to 0.
	* tests/nsyscalls.c: Likewise.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement -e trace=%lstat option.
	linux/*/syscallent*.h part is updated automatically by:

	    sed -i '/TSTA,.*lx\?stat/ s/TSTA,/TLST|&/' linux/*/syscallent*.h

	* sysent.h (TRACE_LSTAT): New macro.
	* syscall.c: Alias TLST to TRACE_LSTAT around syscallent.h inclusion.
	* qualify.c (lookup_class): Add TRACE_LSTAT for "%lstat".
	* strace.1 (.SS Filtering): Add information about %lstat syscall class.
	* NEWS: Mention this change.
	* linux/aarch64/syscallent.h (lstat): Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/arm/syscallent.h (lstat, lstat64, oldlstat): Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/avr32/syscallent.h (lstat, lstat64): Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* linux/alpha/syscallent.h (lstat, lstat64, osf_lstat, osf_old_lstat): Likewise.
	* linux/mips/syscallent-compat.h (bsd43_lstat, posix_lstat, svr4_lstat,
	sysv_lstat): Likewise.
	* tests/gen_tests.in (trace_lstat): New entry.
	* tests/trace_lstat.in: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/ksysent.c (TLST): New macro, defined to 0.
	* tests/nsyscalls.c: Likewise.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement -e trace=%fstat option.
	linux/*/syscallent*.h part is updated automatically by:

	    sed -i -e '/TSTA.*fx\?stat/ s/TSTA,/TFST|&/' \
	           -e 's/\(TD|TF|TFST|TSTA,\)[[:space:]]/\1/' linux/*/syscallent*.h

	* sysent.h (TRACE_FSTAT): New macro.
	* syscall.c: Alias TFST to TRACE_FSTAT around syscallent.h inclusion.
	* qualify.c (lookup_class): Add TRACE_FSTAT for "%fstat".
	* strace.1 (.SS Filtering): Add information about %fstat syscall class.
	* NEWS: Mention this change.
	* linux/32/syscallent.h (fstat64, fstatat64): Add TFST flag.
	* linux/64/syscallent.h (fstat, newfstatat): Likewise.
	* linux/aarch64/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/arm/syscallent.h (fstat, fstat64, fstatat64, oldfstat): Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/avr32/syscallent.h (fstat, fstat64, fstatat64): Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* linux/alpha/syscallent.h (fstat, fstat64, fstatat64, osf_fstat,
	osf_old_fstat): Likewise.
	* linux/powerpc64/syscallent.h (fstat, newfstatat, oldfstat): Likewise.
	* linux/mips/syscallent-compat.h (bsd43_fstat, bsd43_oldfstat, posix_fstat,
	svr4_fstat, sysv_fstat): Likewise.
	* tests/gen_tests.in (trace_fstat): New entry.
	* tests/trace_fstat.in: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/ksysent.c (TFST): New macro, defined to 0.
	* tests/nsyscalls.c: Likewise.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement -e trace=%%stat option.
	linux/*/syscallent*.h part is updated automatically by:

	    sed -i '/TSFA\|stat[iu]s/! s/,[[:space:]]\?\([[:space:]]*SEN(.*stat\)/|TSTA,\1/' \
	        linux/*/syscallent*.h

	* sysent.h (TRACE_STAT_LIKE): New macro.
	* syscall.c: Alias TSTA to TRACE_STAT_LIKE around syscallent.h inclusion.
	* qualify.c (lookup_class): Add TRACE_STAT_LIKE for "%%stat".
	* strace.1 (.SS Filtering): Add information about %%stat syscall class.
	* NEWS: Mention this change.
	* linux/32/syscallent.h (fstat64, fstatat64, statx): Add TSTA flag.
	* linux/64/syscallent.h (fstat, newfstatat, statx): Likewise.
	* linux/aarch64/syscallent.h (fstat, lstat, newfstatat, stat): Likewise.
	* linux/alpha/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
	osf_fstat, osf_lstat, osf_old_fstat, osf_old_lstat, osf_old_stat, osf_stat,
	stat, stat64): Likewise.
	* linux/arm/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat,
	oldlstat, oldstat, stat, stat64, statx): Likewise.
	* linux/avr32/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat,
	stat64): Likewise.
	* linux/bfin/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
	oldfstat, oldlstat, oldstat, stat, stat64): Likewise.
	* linux/crisv10/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
	oldfstat, oldlstat, oldstat, stat, stat64): Likewise.
	* linux/hppa/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat,
	stat64): Likewise.
	* linux/i386/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat,
	oldlstat, oldstat, stat, stat64, statx): Likewise.
	* linux/ia64/syscallent.h (fstat, lstat, newfstatat, stat): Likewise.
	* linux/m68k/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat,
	oldlstat, oldstat, stat, stat64, statx): Likewise.
	* linux/microblaze/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
	oldfstat, oldlstat, oldstat, stat, stat64): Likewise.
	* linux/mips/syscallent-compat.h (bsd43_fstat, bsd43_lstat, bsd43_oldfstat,
	bsd43_oldstat, bsd43_stat, posix_fstat, posix_lstat, posix_stat, svr4_fstat,
	svr4_fxstat, svr4_lstat, svr4_lxstat, svr4_stat, svr4_xstat, sysv_fstat,
	sysv_fxstat, sysv_lstat, sysv_lxstat, sysv_stat, sysv_xstat): Likewise.
	* linux/mips/syscallent-n32.h (fstat, lstat, newfstatat, stat, statx): Likewise.
	* linux/mips/syscallent-n64.h (fstat, lstat, newfstatat, stat, statx): Likewise.
	* linux/mips/syscallent-o32.h (fstat, fstat64, fstatat64, lstat, lstat64,
	oldfstat, oldlstat, oldstat, stat, stat64, statx): Likewise.
	* linux/powerpc64/syscallent.h (fstat, lstat, newfstatat, oldfstat, oldlstat,
	oldstat, stat): Likewise.
	* linux/powerpc/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
	oldfstat, oldlstat, oldstat, stat, stat64, statx): Likewise.
	* linux/s390/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat,
	stat64, statx): Likewise.
	* linux/s390x/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise.
	* linux/sh64/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat,
	oldlstat, oldstat, stat, stat64): Likewise.
	* linux/sh/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat,
	oldlstat, oldstat, stat, stat64): Likewise.
	* linux/sparc64/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
	oldlstat, stat, stat64): Likewise.
	* linux/sparc/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64,
	oldlstat, stat, stat64): Likewise.
	* linux/x32/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise.
	* linux/x86_64/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise.
	* linux/xtensa/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat,
	stat64, statx): Likewise.
	* tests/gen_tests.in (trace_stat_like): New entry.
	* tests/trace_stat_like.in: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/ksysent.c (TSTA): New macro, defined to 0.
	* tests/nsyscalls.c: Likewise.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	qualify: add syntax for optional non-matching syscall qualification.
	It may be useful in case syscall is not present on the target
	architecture.

	* qualify.c (qualify_syscall): Add ignore_fail flag, set it to true
	in case syscall qualification is led by a question mark(s).
	* strace.1 (.SS Filtering): Document ability to use question marks
	in syscall qualification.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	linux/alpha/syscallent.h: add TSFA flag to osf_getfsstat.
	In accordance with [1].

	[1] https://www.freebsd.org/cgi/man.cgi?query=getfsstat&sektion=2

	* linux/alpha/syscallent.h (osf_getfsstat): Add TSFA flag.
	* strace.1 (.SS Filtering) <%%statfs>: Update equivalent regexp.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	linux/mips/syscallent-compat.h: add some TD/TF flags for *stat* variants
	*xstat syscalls are, according to [1], like their *stat counterparts,
	but with additional argument with fixed value.

	[1] http://math-atlas.sourceforge.net/devel/assembly/mipsabi32.pdf

	* linux/mips/syscallent-compat.h (*_xstat, *_lxstat, bsd43_oldstat):
	Add TF flag.
	(*_fxstat, bsd43_oldfstat): Add TD flag.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement -e trace=%%statfs option.
	linux/*/syscallent*.h part is updated automatically by:

	    sed -i 's/\(TSF\),[[:space:]]\?/\1|TSFA,/' linux/*/syscallent*.h
	    sed -i 's/\(TFSF\),/\1|TSFA,/' linux/*/syscallent*.h
	    sed -i 's/0\(,.*ustat\)/TSFA\1/' linux/*/syscallent*.h

	* sysent.h (TRACE_STATFS_LIKE): New macro.
	* syscall.c: Alias TSFA to TRACE_STATFS_LIKE around syscallent.h inclusion.
	* qualify.c (lookup_class): Add SCHED_STATFS_LIKE for "%%statfs".
	* strace.1 (.SS Filtering): Add information about %%statfs syscall class.
	* NEWS: Mention this change.
	* linux/32/syscallent.h (statfs64, fstatfs64): Add TSFA flag.
	* linux/64/syscallent.h (statfs, fstatfs): Likewise.
	* linux/aarch64/syscallent.h (statfs, fstatfs, ustat): Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/arm/syscallent.h (statfs, statfs64, fstatfs, fstatfs64, ustat):
	Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* linux/alpha/syscallent.h (osf_statfs, osf_statfs64, statfs,
	ofs_fstatfs, osf_fstatfs64, ustat): Likewise.
	* linux/mips/syscallent-compat.h (*_statfs, *_statvfs, *_fstatfs): Likewise.
	* tests/gen_tests.in (trace_statfs_like): New entry.
	* tests/trace_statfs_like.in: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/ksysent.c (TSFA): New macro, defined to 0.
	* tests/nsyscalls.c: Likewise.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement -e trace=%fstatfs option.
	linux/*/syscallent*.h part is updated automatically by:

	    sed -i 's/TD,[[:space:]]\([[:space:]]*SEN.*[_"]fstatv\?fs\)/TD|TFSF,\1/' \
	           linux/*/syscallent*.h

	* sysent.h (TRACE_FSTATFS): New macro.
	* syscall.c: Alias TFSF to TRACE_FSTATFS around syscallent.h inclusion.
	* qualify.c (lookup_class): Add SCHED_FSTATFS for "%fstatfs".
	* strace.1 (.SS Filtering): Add information about %fstatfs syscall class.
	* NEWS: Mention this change.
	* linux/32/syscallent.h (fstatfs64): Add TFSF flag.
	* linux/64/syscallent.h (fstatfs): Likewise.
	* linux/aarch64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/arm/syscallent.h (fstatfs, fstatfs64):
	Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* linux/alpha/syscallent.h (ofs_fstatfs, osf_fstatfs64): Likewise.
	* linux/mips/syscallent-compat.h (*_fstatfs, *_fstatvfs): Likewise.
	* tests/gen_tests.in (trace_fstatfs): New entry.
	* tests/trace_fstatfs.in: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/ksysent.c (TFSF): New macro, defined to 0.
	* tests/nsyscalls.c: Likewise.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sysent.h: format syscall flag macros.
	Add some tabulation and leading zeroes to the values.

2017-04-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tabulate sched.test.
	Rewrite sched.test using test_trace_expr().

	* tests/gen_tests.in (sched): New entry.
	* tests/sched.in: New file, derived from a set of tests in sched.test.
	* tests/sched.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove sched.test.
	(EXTRA_DIST): Add sched.in.

2017-04-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tabulate regex.test.
	Rewrite regex.test using test_trace_expr().

	* tests/gen_tests.in (regex): New entry.
	* tests/regex.in: New file, derived from a set of tests in regex.test.
	* tests/regex.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove regex.test.
	(EXTRA_DIST): Add regex.in.

2017-04-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tabulate clock.test.
	Rewrite clock.test using test_trace_expr().

	* tests/gen_tests.in (clock): New entry.
	* tests/clock.in: New file, derived from a set of tests in clock.test.
	* tests/clock.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove clock.test.
	(EXTRA_DIST): Add clock.in.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: tabulate trace_statfs.test.
	Rewrite trace_statfs.test using test_trace_expr().

	* tests/gen_tests.in (trace_statfs): New entry.
	* tests/trace_statfs.in: New file, derived from a set of tests
	in trace_statfs.test.
	* tests/trace_statfs.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove trace_statfs.test.
	(EXTRA_DIST): Add trace_statfs.in.

2017-04-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/init.sh: add helpers for running set of programs.
	This introduces three new helpers:
	prog_set_subtract subtracts one program set from another,
	test_pure_prog_set runs strace check on a set of programs,
	test_trace_expr tests trace expressions.

	* tests/init.sh (prog_set_subtract, test_pure_prog_set,
	test_trace_expr): New functions.

2017-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend gen_tests.sh further.
	* tests/gen_tests.sh: Extend support of arbitrary rules.

2017-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/xstat.c: do not remove sample file after test.
	As tests are executed in separate directories now, there is no need to
	remove sample file.

	* tests/xstat.c (main): Remove unlink calls.

2017-04-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: use fixed name for stat tests sample file.
	As tests are now run in separate directories.

	* tests/xstatx.c: Use fixed "stat.sample" name for sample file.
	* tests/fstat.test: Use it as an argument for -P option.
	* tests/gen_tests.in (fstat64, lstat, lstat64, newfstatat, oldlstat,
	oldstat, stat, stat64, statx): Likewise.

2017-04-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Derive copyright year from the git commit date.
	This solves problems like the need to update test suite on every
	New Year's Eve.

	* Makefile.am (dist-hook): Generate .year.
	* copyright-year-gen: New file.
	* configure.ac (copyright_year): New m4 variable, defined as the output
	of copyright-year-gen script.
	(AC_COPYRIGHT): Use it.
	(COPYRIGHT_YEAR): New output variable and preprocessor macro.
	* strace.c (print_version): Use COPYRIGHT_YEAR.
	* strace.spec.in (%prep): Save the value of COPYRIGHT_YEAR autoconf
	variable to .year file.
	* tests/strace-V.test (config_year): New variable, derived from config.h.
	Add sanity checks for $config_year and use it in expected output.

	Reported-by: Andreas Schwab <schwab@suse.de>

2017-04-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: move /proc/ checks from scripts to executables.
	Move most of /proc/self/task/ and /proc/self/fd/ checks from scripts
	to xecutables.

	* tests/attach-f-p.test: Move /proc/self/task/ check ...
	* tests/attach-f-p-cmd.c (main): ... here.
	* tests/fstat.test: Move /proc/self/fd/ check ...
	* tests/xstatx.c (main): ... here.
	* tests/net-y-unix.test: Move /proc/self/fd/ check ...
	* tests/net-y-unix.c (main): ... here.
	* tests/net-yy-inet.test: Move /proc/self/fd/ check ...
	* tests/net-yy-inet.c (main): ... here.
	* tests/net-yy-netlink.test: Move /proc/self/fd/ check ...
	* tests/net-yy-netlink.c (main): ... here.
	* tests/net-yy-unix.test: Move /proc/self/fd/ check ...
	* tests/net-yy-unix.c (main): ... here.

2017-04-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tabulate pread64-pwrite64.test.
	* tests/gen_tests.in (pread64-pwrite64): New entry.
	* tests/pread64-pwrite64.c: (main): Skip the test if /proc/self/fd/
	is not available.
	* tests/pread64-pwrite64.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove pread64-pwrite64.test.

	tests: tabulate read-write.test.
	* tests/gen_tests.in (read-write): New entry.
	* tests/read-write.c: (main): Skip the test if /proc/self/fd/
	is not available.
	* tests/read-write.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove read-write.test.

	tests: add skip_if_unavailable function to libtests.
	* tests/skip_unavailable.c: New file.
	* tests/tests.h (skip_if_unavailable): New prototype.
	* tests/Makefile.am (libtests_a_SOURCES): Add skip_unavailable.c.

	tests: tabulate netlink_protocol.test.
	* tests/gen_tests.in (netlink_protocol): New entry.
	* tests/netlink_protocol.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove netlink_protocol.test.

	tests: tabulate statfs.test.
	* tests/gen_tests.in (statfs): New entry.
	(fstatfs, fstatfs64, statfs64): Update.
	* tests/statfs.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove statfs.test.

2017-04-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip statfs related tests if their sample files are not available
	* tests/xstatfsx.c (print_statfs): Skip the test if open failed.

	tests: extend gen_tests.sh to support arbitrary test_* rules.
	* tests/gen_tests.sh: Add support of arbitrary test_* rules.

	tests: change gen_tests.sh to read its input as raw input.
	* tests/gen_tests.sh: Specify -r option to read.
	* tests/gen_tests.in (shmxt): Update.

2017-04-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1: s/regex expression/regular expression/

2017-04-17  Dmitry V. Levin  <ldv@altlinux.org>

	strace.1: enhance %statfs description.
	* strace.1 (.SS Filtering) <%statfs>: Fix the list of syscalls,
	add an equivalent regex expression.

	netlink: decode NLMSG_ERROR messages.
	* netlink.c (decode_nlmsgerr, decode_payload): New functions.
	(decode_nlmsghdr_with_payload): Use decode_payload.
	* tests/netlink_protocol.c (send_query): Check decoding
	of NLMSG_ERROR messages.
	* NEWS: Mention this change.

	netlink: avoid using unaligned sizeof(struct nlmsghdr) unnecessarily.
	* netlink.c (NLMSG_HDRLEN): Redefine.
	(decode_nlmsghdr_with_payload, decode_netlink): Use it instead
	of sizeof(struct nlmsghdr).

	Fix the length argument passed from print_iovec to decode_netlink.
	* io.c (print_iovec): Pass the actual length to decode_netlink
	instead of the original length.
	* NEWS: Mention this fix.

	numa: fix printing of error values in move_pages status array.
	* numa.c (print_status): Do not lose a minus sign when printing
	a symbolic error code.
	* tests/move_pages.c (print_status_array): Update expected output.

	tests: generate pure_executables part of check_PROGRAMS automatically.
	* tests/gen_pure_executables.sh: New file.
	* bootstrap: Invoke it.
	* tests/Makefile.am: Include pure_executables.am.
	(check_PROGRAMS): Add $(PURE_EXECUTABLES).  Remove everything listed
	in pure_executables.list.
	(EXTRA_DIST): Add gen_pure_executables.sh.
	* tests/.gitignore: Add pure_executables.am.

	tests: make EXTRA_DIST sorted.
	* tests/Makefile.am (EXTRA_DIST): Sort.

	tests: check decoding of alpha specific osf_utimes syscall.
	* tests/osf_utimes.c: New file.
	* tests/gen_tests.in (osf_utimes): New entry.
	* tests/Makefile.am (check_PROGRAMS): Add osf_utimes.
	* tests/pure_executables.list: Likewise.
	* tests/.gitignore: Likewise.

	tests: parametrize utimes.c.
	* tests/xutimes.c: New file, based on utimes.c.
	* tests/utimes.c [__NR_utimes] (TEST_SYSCALL_NR, TEST_SYSCALL_STR,
	TEST_STRUCT): New macros.
	[__NR_utimes]: Replace all the rest with include "xutimes.c".
	* tests/Makefile.am (EXTRA_DIST): Add xutimes.c.

2017-04-16  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: fix tracing flags of osf_select and osf_utimes syscalls.
	* linux/alpha/syscallent.h (osf_select): Add TD flag.
	(osf_utimes): Add TF flag.
	* NEWS: Mention alpha specific fixes.

2017-04-16  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: rename print_timeval32_pair to print_timeval32_utimes.
	This follows the rename of print_timeval_item to print_timeval_utimes.

	* defs.h [ALPHA] (print_timeval32_pair): Rename
	to print_timeval32_utimes.
	* print_timeval.c [ALPHA] (print_timeval32_pair): Likewise.
	* utimes.c [ALPHA] (SYS_FUNC(osf_utimes)): Replace print_timeval32_pair
	with print_timeval32_utimes.

2017-04-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: do more rigorous testing of utimes syscall parser.
	* tests/utimes.c (errstr): New variable.
	(print_ts, k_utimes): New functions.
	(main): Use them to do more rigorous testing of utimes syscall parser.
	* tests/gen_tests.in (utimes): Update -a option.

	tests: do more rigorous testing of futimesat syscall parser.
	* tests/futimesat.c (errstr): New variable.
	(print_ts, k_futimesat): New functions.
	(main): Use them to do more rigorous testing of futimesat syscall parser.

2017-04-16  Dmitry V. Levin  <ldv@altlinux.org>

	Fix printing of inaccessible times argument of utimes and futimesat syscalls
	When the whole pair of struct timeval structures cannot be fetched from
	tracee's memory, print the address.  This behavior follows the kernel's
	that uses copy_from_user for the whole pair, too.

	* print_timeval.c (print_timeval_item): Remove.
	(print_timeval_pair): Rename to print_timeval_utimes, all callers
	updated.  Fetch the whole timeval_t array with a single
	umove_or_printaddr call.
	* tests/futimesat.c (main): Update expected output.
	* tests/utimes.c (main): Likewise.

2017-04-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite utimensat.test without relying on libc utimensat wrapper.
	The new test also does more rigorous testing.

	* tests/utimensat.c: Stop including <assert.h> and <errno.h>, include
	<unistd.h> and <asm/unistd.h>, check __NR_utimensat instead
	of HAVE_UTIMENSAT.
	(errstr): New variable.
	(k_utimensat): New function, a thin wrapper around
	syscall(__NR_utimensat).
	(main): Use them instead of utimensat.
	* tests/gen_tests.in (utimensat): New entry.
	* tests/utimensat.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove it.

2017-04-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use fixed timestamps in utime related tests.
	* tests/clock.test: Remove futimesat, utime, utimensat, and utimes tests
	from the list of exceptions.
	* tests/utime.c (main): Do not use time(), use fixed timestamp instead.
	* tests/futimesat.c (main): Do not use gettimeofday(), use fixed
	timestamps instead.
	* tests/utimensat.c (main): Likewise.
	* tests/utimes.c (main): Likewise.

2017-04-15  Dmitry V. Levin  <ldv@altlinux.org>

	xtensa: wire up new syscalls.
	* linux/xtensa/syscallent.h [348..350]: New pkey_* entries.

	Reported-by: Victor Krapivensky <krapivenskiy.va@phystech.edu>

2017-04-15  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

	Update statx parser and syscall entries lists to the upstream.
	* linux/32/syscallent.h [291]: Add statx entry.
	* linux/64/syscallent.h [291]: Likewise.
	* linux/arm/syscallent.h [397]: Likewise.
	* linux/m68k/syscallent.h [379]: Likewise.
	* linux/mips/syscallent-n32.h [6330]: Likewise.
	* linux/mips/syscallent-n64.h [5326]: Likewise.
	* linux/mips/syscallent-o32.h [4366]: Likewise.
	* linux/powerpc/syscallent.h [383]: Likewise.
	* linux/s390/syscallent.h [379]: Likewise.
	* linux/s390x/syscallent.h [379]: Likewise.
	* linux/xtensa/syscallent.h [351]: Likewise.
	* statx.h (struct_statx): Update.
	* statx.c (SYS_FUNC(statx)): Print struct_statx.stx_attributes_mask.
	* tests/xstatx.c (print_stat, main): Update to test decoding
	of struct_statx.stx_attributes_mask.

2017-04-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add more regex match checks.
	* tests/qual_syscall.test: Add regex match checks.

	tests: make mq_sendrecv* test executables reenterable.
	* tests/mq_sendrecv.c (MQ_NAME): Remove.
	(mq_name): New static variable.
	(cleanup): Use it instead of MQ_NAME.
	(main): Initialize it dynamically using the pid of process.  Use it
	instead of MQ_NAME.

	tests: make mq test executable reenterable.
	* tests/mq.c (NAME): Remove.
	(main): Replace the fixed message queue name with a dynamically
	made name containing the pid of process.
	* tests/gen_tests.in (mq): Update -a option.

	tests: make net-yy-netlink test executable reenterable.
	* tests/net-yy-netlink.c (main): Use getpid() instead of a fixed
	magic number.

	tests: tabulate shmxt.test.
	* tests/gen_tests.in (shmxt): New entry.
	* tests/shmxt.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove shmxt.test.

2017-04-14  Dmitry V. Levin  <ldv@altlinux.org>

	Revert "Implement -e trace=%sched option"
	-e trace=%sched became redundant as -e trace=/sched does the same.

	This reverts commit 811638e9c1805438a63c14f9704b8b00ac922623.

	* syscall.c (TSC): Remove.
	* sysent.h (TRACE_SCHED): Remove.
	* qualify.c (lookup_class): Remove %sched.
	* strace.1 (.SS Filtering): Likewise.
	* NEWS: Likewise.
	* linux/32/syscallent.h: Remove TSC flag from sched* syscalls.
	* linux/64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* tests/sched.test: Replace trace=%sched with trace=/sched.
	* tests/ksysent.c (TSC): Remove.
	* tests/nsyscalls.c: Likewise.

2017-04-14  Dmitry V. Levin  <ldv@altlinux.org>

	Revert "Implement -e trace=%clock option"
	-e trace=%clock became redundant as -e trace=/clock does the same.

	This reverts commit 0a13d2391c413e3847b71ec0c1d38f56e353b1b5.

	* syscall.c (TCL): Remove.
	* sysent.h (TRACE_CLOCK): Remove.
	* qualify.c (lookup_class): Remove %clock.
	* strace.1 (.SS Filtering): Likewise.
	* NEWS: Likewise.
	* linux/32/syscallent.h: Remove TCL flag from clock_* syscalls.
	* linux/64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* tests/clock.test: Replace trace=%clock with trace=/clock.
	* tests/ksysent.c (TCL): Remove.
	* tests/nsyscalls.c: Likewise.

2017-04-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify regex.test.
	* tests/regex.test: Use trace_statfs.test as a template instead
	of clock.test and sched.test, not because of more interesting
	regular expressions but to fix build on platforms where
	clock.test and sched.test are not reenterable.

2017-04-14  JingPiao Chen  <chenjingpiao@gmail.com>

	Implement -e trace=/regex option.
	* qualify.c: Include <regex.h>.
	(qualify_syscall_regex): New function.
	(qualify_syscall): Use it.
	* strace.1: Document -e trace=/regex option.
	* NEWS: Mention -e trace=/regex option.
	* tests/regex.test: New test.
	* tests/Makefile.am (DECODER_TESTS): Add it.
	* tests/options-syntax.test: Add checks for invaild regexp
	and for regexp that doesn't match a syscall.

2017-04-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix ioctl_nsfs.test on hppa.
	* tests/ioctl_nsfs.c (test_user_namespace): Specify an address
	in the middle of a mapped page as child_stack address argument
	of the clone call.
	[IA64] (clone): Update.

2017-04-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix ioctl_nsfs.test on ia64.
	glibc on ia64 provides no clone() function, but there is a __clone2
	function instead.  It is documented but no prototype is provided by
	glibc.

	* tests/ioctl_nsfs.c [IA64] (__clone2): New prototype.
	[IA64] (clone): New macro wrapper around __clone2.

2017-04-13  Edgar Kaziahmedov  <edos@linux.com>

	tests: check decoding of the remaining V4L2_BUF_TYPE_* types.
	* tests/ioctl_v4l2.c (init_v4l2_format, print_ioctl_v4l2): New functions
	to avoid code duplication in VIDIOC_S_FMT and VIDIOC_TRY_FMT tests.
	(main) <VIDIOC_G_FMT, VIDIOC_S_FMT, VIDIOC_TRY_FMT>: Use them.  Add
	checks for remaining V4L2_BUF_TYPE_* types.

	v4l2: Implement decoding of the remaining V4L2_BUF_TYPE_* types.
	* v4l2.c: Include "xlat/v4l2_vbi_flags.h" and "xlat/v4l2_sliced_flags.h".
	(struct_v4l2_clip): New typedef.  Mpersify it.
	(print_v4l2_clip): New function.
	(print_v4l2_format_fmt): Use it.  Add struct tcb argument.  Implement
	decoding of the remaining V4L2_BUF_TYPE_* types.
	* xlat/v4l2_vbi_flags.in: Add V4L2_VBI_UNSYNC and V4L2_VBI_INTERLACED
	introduced by linux kernel commit v2.5.46~39^2~23^2~4.
	Add V4L2_VBI_ITU_525_F1_START, V4L2_VBI_ITU_525_F2_START,
	V4L2_VBI_ITU_625_F1_START, and V4L2_VBI_ITU_625_F2_START introduced by
	linux kernel commit v3.17-rc1~112^2~217.
	* xlat/v4l2_sliced_flags.in: Add V4L2_SLICED_TELETEXT_B, V4L2_SLICED_VPS,
	V4L2_SLICED_CAPTION_525, V4L2_SLICED_WSS_625, V4L2_SLICED_VBI_525, and
	V4L2_SLICED_VBI_625 introduced by linux kernel commit v2.6.14-rc2~64.
	* configure.ac (AC_CHECK_DECLS): Add V4L2_BUF_TYPE_SDR_CAPTURE and
	V4L2_BUF_TYPE_SDR_OUTPUT.
	(AC_CHECK_MEMBERS): Add struct v4l2_window.global_alpha and
	struct v4l2_sdr_format.buffersize.
	* NEWS: Mention this change.

2017-04-13  Dmitry V. Levin  <ldv@altlinux.org>

	travis: use mainline kernel uapi headers for coverage.
	* .travis.yml (matrix) <CHECK=coverage>: Add KHEADERS=torvalds/linux.
	* travis-build.sh: Handle $KHEADERS.
	* travis-install.sh: Likewise.

	travis: switch from clang-3.6 to clang-3.8.
	* .travis.yml (matrix): Change clang-3.6 to clang-3.8.

2017-04-13  Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>

	Implement decoding of NS_* ioctl commands.
	* configure.ac (AC_CHECK_HEADERS): Add linux/nsfs.h.
	* defs.h (DECL_IOCTL(nsfs)): New prototype.
	(setns_types): Make global.
	* ioctl.c (ioctl_decode): Call nsfs_ioctl for 0xb7 code.
	* nsfs.c: New file.
	* nsfs.h: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* tests/ioctl_nsfs.c: New file.
	* tests/ioctl_nsfs.test: Likewise.
	* tests/.gitignore: Add ioctl_nsfs.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioctl_nsfs.test.
	* NEWS: Mention this change.

2017-04-13  Dmitry V. Levin  <ldv@altlinux.org>

	travis: copy coverage test suite log to the travis log.
	* travis-build.sh (coverage): Print tests*/test-suite.log
	and tests*/ksysent.log.

2017-04-12  Dmitry V. Levin  <ldv@altlinux.org>

	travis: add gcc-6.
	* .travis.yml (matrix): Add gcc-6 entries.
	* travis-build.sh: Handle gcc*.
	* travis-install.sh: Handle gcc-*.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify gen_tests.sh against in-tree builds.
	* tests/gen_tests.sh: Use abs_srcdir instead of srcdir to construct
	a path to gen_tests.sh in implicit make rules.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	trace_syscall_exiting: do not call get_regs for filtered syscalls.
	This saves up to 25% of ptrace syscalls in case of trace filtering.

	* syscall.c (trace_syscall_exiting): Do not call gettimeofday
	and get_regs for filtered syscalls.
	* NEWS: Mention this change.
	* tests/get_regs.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	Delay get_regs invocation.
	strace used to call get_regs on every stop of a tracee, including cases
	when the result is going to be discarded.  Prepare to change this lavish
	practice by delaying get_regs invocation until its result is actually
	needed.

	* defs.h (get_regs): Remove.
	* strace.c (trace): Do not call get_regs.
	* syscall.c (get_regs): Add static qualifier.
	(trace_syscall_exiting, print_pc, get_scno): Call get_regs.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	startup_tcb: move get_scno invocation to a more convenient place.
	* strace.c (trace): Move get_scno invocation ...
	(startup_tcb): ... here.  This is a no-op change that slightly improves
	readability.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	get_regs: guard against subsequent invocations.
	At this moment there is only one call to get_regs,
	but there is going to be more of them, so a guard is needed.

	This change also adds a clear_regs call before get_regs,
	which essentially reverts commit v4.9-288-ge9bfff6.

	* strace.c (trace): Call clear_regs before get_regs.
	* syscall.c (get_regs): Skip if get_regs_error != -1.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	syscall: move definitions of automatic variables closer to their use.
	* syscall.c (trace_syscall_entering, trace_syscall_exiting): Move
	definitions of automatic variables closer to their first use.  This
	change slightly improves readability.

	tests: check decoding of gettid syscall.
	* tests/gettid.c: New file.
	* tests/.gitignore: Add gettid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	* tests/gen_tests.in (gettid): New entry.

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix build on alpha.
	* tests/getpid.c: Skip if __NR_getpid is not defined.
	* tests/getppid.c: Skip if __NR_getppid is not defined.

	Fixes: fd1041f6 ("tests: add tests for getpid and getppid syscalls")

2017-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build with old linux/netlink.h.
	* socketutils.c: Provide a fallback definition of NETLINK_SOCK_DIAG.

	Fixes: 5c256356 ("Do not include xlat/netlink_protocols.h twice")

2017-04-10  Dmitry V. Levin  <ldv@altlinux.org>

	Do not include xlat/netlink_protocols.h twice.
	Make netlink_protocols a global xlat array defined in net.c file.

	* defs.h (netlink_protocols): New prototype.
	* socketutils.c: Stop including "xlat/netlink_protocols.h".

2017-04-10  Dmitry V. Levin  <ldv@altlinux.org>

	Do not include xlat/clocknames.h twice.
	Make clocknames a global xlat array defined in time.c file.

	* defs.h (clocknames): New prototype.
	* perf.c: Stop including "xlat/clocknames.h".

2017-04-10  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unused xlat/openmodessol.in.
	* xlat/openmodessol.in: Remove file unused since commit
	v4.10-45-gdf4dd8b.

	Remove unused xlat/aclipc.in.
	* xlat/aclipc.in: Remove file unused since commit v4.9-46-g681452b.

2017-04-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: remove statfs.expected.
	statfs.expected is unused since commit v4.11-515-g67c2f67.

	* tests/statfs.expected: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove it.

2017-04-07  Sandhya Bankar  <bankarsandhya512@gmail.com>

	tests: add tests for getpid and getppid syscalls.

	[ldv: rewritten everything]

	* tests/getpid.c: New file.
	* tests/getppid.c: Likewise.
	* tests/.gitignore: Add getpid and getppid.
	* tests/pure_executables.list: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	* tests/gen_tests.in (getpid, getppid): New entries.

2017-04-07  Edgar Kaziahmedov  <edos@linux.com>

	Update V4L2_* constants.
	* xlat/v4l2_buf_flags.in: Add V4L2_BUF_FLAG_PREPARED,
	V4L2_BUF_FLAG_NO_CACHE_INVALIDATE, and V4L2_BUF_FLAG_NO_CACHE_CLEAN
	introduced by linux kernel commit v3.2-rc1~63^2~55.
	Add V4L2_BUF_FLAG_TIMESTAMP_MASK, V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN,
	and V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC introduced by linux kernel commit
	v3.9-rc1~93^2~536.
	Add V4L2_BUF_FLAG_TIMESTAMP_COPY introduced by linux kernel commit
	v3.10-rc1~136^2~560.
	Add V4L2_BUF_FLAG_TSTAMP_SRC_MASK, V4L2_BUF_FLAG_TSTAMP_SRC_EOF,
	and V4L2_BUF_FLAG_TSTAMP_SRC_SOE introduced by linux kernel commit
	v3.15-rc1~85^2~186.
	Add V4L2_BUF_FLAG_LAST introduced by linux kernel commit
	v4.2-rc1~107^2~389.
	* xlat/v4l2_buf_types.in: Add V4L2_BUF_TYPE_SDR_CAPTURE
	and V4L2_BUF_TYPE_SDR_OUTPUT introduced by linux kernel commits
	v3.15-rc1~85^2~213 and v4.4-rc1~118^2~14, respectively.
	* xlat/xlat/v4l2_colorspaces.in: Add V4L2_COLORSPACE_ADOBERGB
	and V4L2_COLORSPACE_BT2020 introduced by linux kernel commit
	v3.19-rc1~29^2~72.
	Add V4L2_COLORSPACE_RAW and V4L2_COLORSPACE_DCI_P3 introduced by linux
	kernel commits v4.2-rc1~107^2~182 and v4.4-rc1~118^2~120, respectively.
	* xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_SDR_CAPTURE,
	V4L2_CAP_EXT_PIX_FORMAT, and V4L2_CAP_SDR_OUTPUT introduced by linux
	kernel commits v3.15-rc1~85^2~210, v3.17-rc1~112^2~327,
	and v4.4-rc1~118^2~14, respectively.
	* xlat/v4l2_memories.in: Add V4L2_MEMORY_OVERLAY introduced
	in linux 2.5.46.  Add V4L2_MEMORY_DMABUF introduced by linux kernel
	commit v3.8-rc1~115^2^2~52.

2017-04-07  Abhishek Tiwari  <erabhishektiwarics@gmail.com>

	Implement -e trace=%statfs option.
	linux/*/syscallent*.h part is modified automatically by:

		sed -i 's/TF\(,[[:space:]]*SEN.*[_"]statv\?fs\)/TF|TSF\1/' \
			linux/*/syscallent*.h

	[ldv: rewritten trace_statfs.test using sched.test as a template]

	* sysent.h (TRACE_STATFS): New macro.
	* syscall.c: Alias TSF to TRACE_STATFS around syscallent.h inclusion.
	* qualify.c (lookup_class): Add SCHED_STATFS for "%statfs".
	* strace.1 (.SS Filtering): Add information about %statfs syscall class.
	* NEWS: Mention this change.
	* linux/64/syscallent.h (statfs): Add TSF flag.
	* linux/aarch64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/32/syscallent.h (statfs64): Likewise.
	* linux/arm/syscallent.h (statfs, statfs64): Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* linux/alpha/syscallent.h (osf_statfs, osf_statfs64, statfs): Likewise.
	* linux/mips/syscallent-compat.h (*_statfs, *_statvfs): Likewise.
	* tests/trace_statfs.test: New test.
	* tests/Makefile.am (DECODER_TESTS): Add it.
	* tests/ksysent.c (TSF): New macro, defined to 0.
	* tests/nsyscalls.c: Likewise.

2017-04-06  Rishi Bhatt  <bhatt.rishi062@gmail.com>

	Implement -e trace=%clock option.
	linux/*/syscallent.h part is modified automatically by
	sed -i 's/0\(,[[:space:]]*SEN(clock_\)/TCL\1/' linux/*/syscallent*.h

	[ldv: rewritten clock.test using sched.test as a template]

	* sysent.h (TRACE_CLOCK): New macro.
	* syscall.c: Alias TCL to TRACE_CLOCK around syscallent.h inclusion.
	* qualify.c (lookup_class): Add TRACE_CLOCK for "%clock".
	* strace.1 (.SS Filtering): Add information about %clock syscall class.
	* NEWS: Mention this change.
	* linux/32/syscallent.h: Add TCL flag for clock_* syscalls.
	* linux/64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* tests/clock.test: New test.
	* tests/Makefile.am (DECODER_TESTS): Add it.
	* tests/ksysent.c (TCL): New macro, defined to 0.
	* tests/nsyscalls.c: Likewise.

2017-04-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tabulate xattr.test.
	* tests/gen_tests.in (xattr): New entry.
	* tests/xattr.test: Remove.
	* tests/Makefile.am (DECODER_TESTS): Remove xattr.test.

2017-04-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: generalize scripts that check non-abbreviated decoding of ioctls.
	* tests/ioctl-v.sh: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	(DECODER_TESTS): Remove ioctl_evdev-v.test, ioctl_loop-v.test,
	and ioctl_rtc-v.test.
	* tests/gen_tests.in (ioctl_evdev-v, ioctl_loop-v, ioctl_rtc-v):
	New entries.
	* tests/ioctl_evdev-v.test: Remove.
	* tests/ioctl_loop-v.test: Ditto.
	* tests/ioctl_rtc-v.test: Ditto.

2017-04-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tabulate stereotypical test scripts.
	Convert test scripts that follow simple testing patterns to a table.
	Generate all these scripts from gen_tests.in file using gen_tests.sh
	script at bootstrap time.

	The largest set of test scripts has been converted using
	the following command:

	grep -l ^run_strace_match_diff *.test |while read f; do
		n="${f%.test}"
		grep '^[^#]' "$f" |
		grep -Evq '^(\. "\${srcdir=\.}/init\.sh"|run_strace_match_diff)' ||
		sed -n 's/^run_strace_match_diff\(.*\)/'$n'\1/p' "$f"
	done

	The second largest set of test scripts has been converted using
	the following command:

	grep -l srcdir= *.test |while read f; do
		n="${f%.test}"
		grep '^[^#]' "$f" |
		grep -Fvq srcdir= ||
		sed -n 's/^. "\${srcdir=.}\/\([^"]\+\)".*/'$n'\t+\1/p' "$f"
	done

	* tests/gen_tests.in: New file.
	* tests/gen_tests.sh: New file.
	* bootstrap: Invoke it.
	* tests/.gitignore: Add *.gen.test and gen_tests.am.
	* tests/_newselect.test: Remove.
	* tests/accept.test: Ditto.
	* tests/accept4.test: Ditto.
	* tests/access.test: Ditto.
	* tests/acct.test: Ditto.
	* tests/add_key.test: Ditto.
	* tests/adjtimex.test: Ditto.
	* tests/aio.test: Ditto.
	* tests/alarm.test: Ditto.
	* tests/bpf.test: Ditto.
	* tests/btrfs.test: Ditto.
	* tests/chmod.test: Ditto.
	* tests/chown.test: Ditto.
	* tests/chown32.test: Ditto.
	* tests/chroot.test: Ditto.
	* tests/clock_adjtime.test: Ditto.
	* tests/clock_nanosleep.test: Ditto.
	* tests/clock_xettime.test: Ditto.
	* tests/copy_file_range.test: Ditto.
	* tests/creat.test: Ditto.
	* tests/delete_module.test: Ditto.
	* tests/dup.test: Ditto.
	* tests/dup2.test: Ditto.
	* tests/dup3.test: Ditto.
	* tests/epoll_create.test: Ditto.
	* tests/epoll_create1.test: Ditto.
	* tests/epoll_ctl.test: Ditto.
	* tests/epoll_pwait.test: Ditto.
	* tests/epoll_wait.test: Ditto.
	* tests/erestartsys.test: Ditto.
	* tests/execveat-v.test: Ditto.
	* tests/execveat.test: Ditto.
	* tests/faccessat.test: Ditto.
	* tests/fadvise64_64.test: Ditto.
	* tests/fallocate.test: Ditto.
	* tests/fanotify_init.test: Ditto.
	* tests/fanotify_mark.test: Ditto.
	* tests/fchdir.test: Ditto.
	* tests/fchmod.test: Ditto.
	* tests/fchmodat.test: Ditto.
	* tests/fchown.test: Ditto.
	* tests/fchown32.test: Ditto.
	* tests/fchownat.test: Ditto.
	* tests/fcntl.test: Ditto.
	* tests/fcntl64.test: Ditto.
	* tests/fdatasync.test: Ditto.
	* tests/file_handle.test: Ditto.
	* tests/file_ioctl.test: Ditto.
	* tests/finit_module.test: Ditto.
	* tests/flock.test: Ditto.
	* tests/fork-f.test: Ditto.
	* tests/fstat64.test: Ditto.
	* tests/fstatat64.test: Ditto.
	* tests/fstatfs.test: Ditto.
	* tests/fstatfs64.test: Ditto.
	* tests/fsync.test: Ditto.
	* tests/ftruncate.test: Ditto.
	* tests/ftruncate64.test: Ditto.
	* tests/futimesat.test: Ditto.
	* tests/get_mempolicy.test: Ditto.
	* tests/getcpu.test: Ditto.
	* tests/getcwd.test: Ditto.
	* tests/getdents.test: Ditto.
	* tests/getdents64.test: Ditto.
	* tests/getegid.test: Ditto.
	* tests/getegid32.test: Ditto.
	* tests/geteuid.test: Ditto.
	* tests/geteuid32.test: Ditto.
	* tests/getgid.test: Ditto.
	* tests/getgid32.test: Ditto.
	* tests/getgroups.test: Ditto.
	* tests/getgroups32.test: Ditto.
	* tests/getpeername.test: Ditto.
	* tests/getpgrp.test: Ditto.
	* tests/getrandom.test: Ditto.
	* tests/getresgid.test: Ditto.
	* tests/getresgid32.test: Ditto.
	* tests/getresuid.test: Ditto.
	* tests/getresuid32.test: Ditto.
	* tests/getrlimit.test: Ditto.
	* tests/getrusage.test: Ditto.
	* tests/getsid.test: Ditto.
	* tests/getsockname.test: Ditto.
	* tests/getuid32.test: Ditto.
	* tests/getxxid.test: Ditto.
	* tests/inet-cmsg.test: Ditto.
	* tests/init_module.test: Ditto.
	* tests/inotify.test: Ditto.
	* tests/inotify_init1.test: Ditto.
	* tests/int_0x80.test: Ditto.
	* tests/ioctl_block.test: Ditto.
	* tests/ioctl_evdev.test: Ditto.
	* tests/ioctl_loop.test: Ditto.
	* tests/ioctl_mtd.test: Ditto.
	* tests/ioctl_rtc.test: Ditto.
	* tests/ioctl_scsi.test: Ditto.
	* tests/ioctl_sg_io_v3.test: Ditto.
	* tests/ioctl_sg_io_v4.test: Ditto.
	* tests/ioctl_uffdio.test: Ditto.
	* tests/ioctl_v4l2.test: Ditto.
	* tests/ioperm.test: Ditto.
	* tests/iopl.test: Ditto.
	* tests/ioprio.test: Ditto.
	* tests/ip_mreq.test: Ditto.
	* tests/ipc.test: Ditto.
	* tests/ipc_msg.test: Ditto.
	* tests/ipc_sem.test: Ditto.
	* tests/ipc_shm.test: Ditto.
	* tests/kcmp.test: Ditto.
	* tests/kexec_file_load.test: Ditto.
	* tests/kexec_load.test: Ditto.
	* tests/keyctl.test: Ditto.
	* tests/kill.test: Ditto.
	* tests/lchown.test: Ditto.
	* tests/lchown32.test: Ditto.
	* tests/link.test: Ditto.
	* tests/linkat.test: Ditto.
	* tests/lookup_dcookie.test: Ditto.
	* tests/lstat.test: Ditto.
	* tests/lstat64.test: Ditto.
	* tests/mbind.test: Ditto.
	* tests/membarrier.test: Ditto.
	* tests/memfd_create.test: Ditto.
	* tests/migrate_pages.test: Ditto.
	* tests/mincore.test: Ditto.
	* tests/mkdir.test: Ditto.
	* tests/mkdirat.test: Ditto.
	* tests/mknod.test: Ditto.
	* tests/mknodat.test: Ditto.
	* tests/mlock.test: Ditto.
	* tests/mlock2.test: Ditto.
	* tests/mlockall.test: Ditto.
	* tests/mmap64.test: Ditto.
	* tests/mmsg-silent.test: Ditto.
	* tests/mmsg.test: Ditto.
	* tests/mmsg_name-v.test: Ditto.
	* tests/mmsg_name.test: Ditto.
	* tests/mount.test: Ditto.
	* tests/move_pages.test: Ditto.
	* tests/mq.test: Ditto.
	* tests/mq_sendrecv-read.test: Ditto.
	* tests/mq_sendrecv-write.test: Ditto.
	* tests/mq_sendrecv.test: Ditto.
	* tests/msg_control-v.test: Ditto.
	* tests/msg_control.test: Ditto.
	* tests/msg_name.test: Ditto.
	* tests/munlockall.test: Ditto.
	* tests/nanosleep.test: Ditto.
	* tests/net-icmp_filter.test: Ditto.
	* tests/net-sockaddr.test: Ditto.
	* tests/newfstatat.test: Ditto.
	* tests/old_mmap.test: Ditto.
	* tests/oldfstat.test: Ditto.
	* tests/oldlstat.test: Ditto.
	* tests/oldstat.test: Ditto.
	* tests/open.test: Ditto.
	* tests/openat.test: Ditto.
	* tests/pause.test: Ditto.
	* tests/perf_event_open.test: Ditto.
	* tests/perf_event_open_nonverbose.test: Ditto.
	* tests/perf_event_open_unabbrev.test: Ditto.
	* tests/pipe2.test: Ditto.
	* tests/pkey_alloc.test: Ditto.
	* tests/pkey_free.test: Ditto.
	* tests/pkey_mprotect.test: Ditto.
	* tests/ppoll-v.test: Ditto.
	* tests/ppoll.test: Ditto.
	* tests/preadv-pwritev.test: Ditto.
	* tests/preadv.test: Ditto.
	* tests/preadv2-pwritev2.test: Ditto.
	* tests/printstr.test: Ditto.
	* tests/prlimit64.test: Ditto.
	* tests/process_vm_readv.test: Ditto.
	* tests/process_vm_writev.test: Ditto.
	* tests/pselect6.test: Ditto.
	* tests/ptrace.test: Ditto.
	* tests/pwritev.test: Ditto.
	* tests/quotactl-v.test: Ditto.
	* tests/quotactl-xfs-v.test: Ditto.
	* tests/quotactl-xfs.test: Ditto.
	* tests/quotactl.test: Ditto.
	* tests/readahead.test: Ditto.
	* tests/readdir.test: Ditto.
	* tests/readlink.test: Ditto.
	* tests/readlinkat.test: Ditto.
	* tests/reboot.test: Ditto.
	* tests/recvfrom.test: Ditto.
	* tests/recvmmsg-timeout.test: Ditto.
	* tests/recvmsg.test: Ditto.
	* tests/remap_file_pages.test: Ditto.
	* tests/rename.test: Ditto.
	* tests/renameat.test: Ditto.
	* tests/renameat2.test: Ditto.
	* tests/request_key.test: Ditto.
	* tests/rmdir.test: Ditto.
	* tests/rt_sigpending.test: Ditto.
	* tests/rt_sigprocmask.test: Ditto.
	* tests/rt_sigqueueinfo.test: Ditto.
	* tests/rt_sigreturn.test: Ditto.
	* tests/rt_sigsuspend.test: Ditto.
	* tests/rt_sigtimedwait.test: Ditto.
	* tests/rt_tgsigqueueinfo.test: Ditto.
	* tests/sched_get_priority_mxx.test: Ditto.
	* tests/sched_rr_get_interval.test: Ditto.
	* tests/sched_xetaffinity.test: Ditto.
	* tests/sched_xetattr.test: Ditto.
	* tests/sched_xetparam.test: Ditto.
	* tests/sched_xetscheduler.test: Ditto.
	* tests/sched_yield.test: Ditto.
	* tests/seccomp-filter-v.test: Ditto.
	* tests/seccomp-filter.test: Ditto.
	* tests/select.test: Ditto.
	* tests/semop.test: Ditto.
	* tests/sendfile.test: Ditto.
	* tests/sendfile64.test: Ditto.
	* tests/set_mempolicy.test: Ditto.
	* tests/setdomainname.test: Ditto.
	* tests/setfsgid.test: Ditto.
	* tests/setfsgid32.test: Ditto.
	* tests/setfsuid.test: Ditto.
	* tests/setfsuid32.test: Ditto.
	* tests/setgid.test: Ditto.
	* tests/setgid32.test: Ditto.
	* tests/setgroups.test: Ditto.
	* tests/setgroups32.test: Ditto.
	* tests/sethostname.test: Ditto.
	* tests/setns.test: Ditto.
	* tests/setregid.test: Ditto.
	* tests/setregid32.test: Ditto.
	* tests/setresgid.test: Ditto.
	* tests/setresgid32.test: Ditto.
	* tests/setresuid.test: Ditto.
	* tests/setresuid32.test: Ditto.
	* tests/setreuid.test: Ditto.
	* tests/setreuid32.test: Ditto.
	* tests/setrlimit.test: Ditto.
	* tests/setuid.test: Ditto.
	* tests/setuid32.test: Ditto.
	* tests/shutdown.test: Ditto.
	* tests/siginfo.test: Ditto.
	* tests/signal_receive.test: Ditto.
	* tests/signalfd4.test: Ditto.
	* tests/sigreturn.test: Ditto.
	* tests/socketcall.test: Ditto.
	* tests/splice.test: Ditto.
	* tests/stat.test: Ditto.
	* tests/stat64.test: Ditto.
	* tests/statfs64.test: Ditto.
	* tests/statx.sh: Ditto.
	* tests/statx.test: Ditto.
	* tests/swap.test: Ditto.
	* tests/symlink.test: Ditto.
	* tests/symlinkat.test: Ditto.
	* tests/sync.test: Ditto.
	* tests/sync_file_range.test: Ditto.
	* tests/sync_file_range2.test: Ditto.
	* tests/sysinfo.test: Ditto.
	* tests/syslog.test: Ditto.
	* tests/tee.test: Ditto.
	* tests/time.test: Ditto.
	* tests/timer_create.test: Ditto.
	* tests/timer_xettime.test: Ditto.
	* tests/timerfd_xettime.test: Ditto.
	* tests/times-fail.test: Ditto.
	* tests/times.test: Ditto.
	* tests/truncate.test: Ditto.
	* tests/truncate64.test: Ditto.
	* tests/ugetrlimit.test: Ditto.
	* tests/umask.test: Ditto.
	* tests/umoven-illptr.test: Ditto.
	* tests/umovestr-illptr.test: Ditto.
	* tests/umovestr3.test: Ditto.
	* tests/unlink.test: Ditto.
	* tests/unlinkat.test: Ditto.
	* tests/unshare.test: Ditto.
	* tests/userfaultfd.test: Ditto.
	* tests/ustat.test: Ditto.
	* tests/utime.test: Ditto.
	* tests/utimes.test: Ditto.
	* tests/vfork-f.test: Ditto.
	* tests/vhangup.test: Ditto.
	* tests/vmsplice.test: Ditto.
	* tests/wait4-v.test: Ditto.
	* tests/wait4.test: Ditto.
	* tests/waitid-v.test: Ditto.
	* tests/waitid.test: Ditto.
	* tests/waitpid.test: Ditto.
	* tests/xattr-strings.test: Ditto.
	* tests/xet_robust_list.test: Ditto.
	* tests/xetitimer.test: Ditto.
	* tests/xetpgid.test: Ditto.
	* tests/xetpriority.test: Ditto.
	* tests/xettimeofday.test: Ditto.
	* tests/Makefile.am (DECODER_TESTS, MISC_TESTS): Remove them.
	Include gen_tests.am.
	(TESTS): Add $(GEN_TESTS).
	(XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Rename int_0x80.test
	to int_0x80.gen.test.
	(EXTRA_DIST): Add gen_tests.in and gen_tests.sh, remove statx.sh.
	(clean-local-check): Remove $(GEN_TESTS:.gen.test=.dir).

2017-04-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: handle test scripts with .gen.test suffix.
	* tests/init.sh: If script name ends with .gen.test,
	set NAME variable with .gen.test suffix stripped.

2017-04-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mpers.awk: add support for multidimensional arrays.
	* mpers.awk (update_upper_bound): New function, which maintains new "count"
	property for storing total element count and updates "upper_bound"
	property which now contains string with array dimensions.
	(/^DW_AT_upper_bound/, /^DW_AT_count/): Use it.
	(what_is) <case "array_type">: Use "count" property in order to calculate
	returned_size, do not embody returned string in square brackets.
	* mpers_test.sh: Add checks for multidimensional arrays.

2017-04-04  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.awk: prepare for adding support of multidimensional arrays.
	* mpers.awk (what_is) <case "structure_type", case "union_type">:
	Move formatting of array upper_bound ...
	<case "array_type">: ... here.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: cleanup temporary files removals.
	As every test now runs in its own subdirectory, there is no need
	to remove leftover files manually by each test.

	* tests/init.sh (run_strace_match_diff): Do not remove $EXP.
	* tests/brk.test: Likewise.
	* tests/options-syntax.test: Likewise.
	* tests/qual_inject-retval.test (check_injection): Likewise.
	* tests/qual_signal.test (test_one_sig): Likewise.
	* tests/sched.test: Likewise.
	* tests/seccomp-strict.test: Likewise.
	* tests/strace-V.test: Likewise.
	* tests/strace-tt.test: Likewise.
	* tests/strace-ttt.test: Likewise.
	* tests/threads-execve.test: Likewise.
	* tests/attach-f-p.test: Use $EXP instead of $OUT, do not remove it.
	* tests/personality.test: Likewise.
	* tests/poll.test: Likewise.
	* tests/fstat.test: Likewise.
	* tests/ipc.sh: Likewise.
	* tests/restart_syscall.test: Likewise.
	* tests/utimensat.test: Likewise.
	* tests/attach-p-cmd.test: Likewise.  Do not remove
	attach-p-cmd.test-lock.
	* tests/detach-running.test: Do not remove $LOG.
	* tests/detach-sleeping.test: Likewise.
	* tests/detach-stopped.test: Likewise.
	* tests/redirect.test: Do not remove $OUT.
	* tests/strace-S.test: Likewise.
	* tests/getdents.test: Do not remove $LOG.dir.
	* tests/getdents64.test: Likewise.
	* tests/readdir.test: Likewise.
	* tests/btrfs-v.test: Do not remove $EXP and $OUT.
	* tests/btrfs-vw.test: Likewise.
	* tests/btrfs-w.test: Likewise.
	* tests/execve-v.test: Likewise.
	* tests/execve.test: Likewise.
	* tests/fadvise64.test: Likewise.
	* tests/getuid.test: Likewise.
	* tests/ioctl.test: Likewise.
	* tests/ioctl_dm-v.test: Likewise.
	* tests/ioctl_dm.test: Likewise.
	* tests/ioctl_evdev-v.test: Likewise.
	* tests/ioctl_loop-nv.test: Likewise.
	* tests/ioctl_loop-v.test: Likewise.
	* tests/ioctl_loop.test: Likewise.
	* tests/ioctl_rtc-v.test: Likewise.
	* tests/ioctl_sock_gifconf.test: Likewise.
	* tests/llseek.test: Likewise.
	* tests/lseek.test: Likewise.
	* tests/mmap.test: Likewise.
	* tests/net-y-unix.test: Likewise.
	* tests/net-yy-inet.test: Likewise.
	* tests/net-yy-netlink.test: Likewise.
	* tests/net-yy-unix.test: Likewise.
	* tests/opipe.test: Likewise.
	* tests/prctl-arg2-intptr.test: Likewise.
	* tests/prctl-dumpable.test: Likewise.
	* tests/prctl-name.test: Likewise.
	* tests/prctl-no-args.test: Likewise.
	* tests/prctl-pdeathsig.test: Likewise.
	* tests/prctl-seccomp-filter-v.test: Likewise.
	* tests/prctl-seccomp-strict.test: Likewise.
	* tests/prctl-securebits.test: Likewise.
	* tests/prctl-tid_address.test: Likewise.
	* tests/prctl-tsc.test: Likewise.
	* tests/umovestr2.test: Likewise.
	* tests/uname.test: Likewise.
	* tests/pread64-pwrite64.test: Do nore remove pread64-pwrite64-tmpfile.
	* tests/read-write.test: Do nore remove read-write-tmpfile.
	* tests/qual_fault.test (check_fault_injection): Do not remove $EXP,
	$outexp, and $outgot.
	* tests/redirect-fds.test (check_fd): Reorder removal of work files.
	* tests/pc.test: Use $EXP instead of $EXPECTED, do not remove it.
	* tests/strace-t.test: Likewise.
	* tests/scm_rights-fd.test: Likewise.  Use dir instead of $LOG.dir,
	do not remove it.
	* tests/strace-ff.test: Do not remove $OUT and $LOG.* files.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance sched.test negative check.
	* tests/sched.test: Test that trace=%sched doesn't match
	anything besides sched_* syscalls by checking it against all test
	executables without side effects listed in pure_executables.list
	except sched_* and times.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a list of executables without side effects.
	These are executables that could be used by several different tests
	simultaneously.

	* tests/pure_executables.list: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use fixed socket address in net-yy-unix.test.
	This allows net-yy-unix invocation without arguments.

	* tests/net-yy-unix.c (TEST_SOCKET): New macro.
	(void): Use it instead of av[1].
	* tests/net-yy-unix.test: Do not specify arguments for the test
	executable.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use fixed socket address in net-y-unix.test.
	This allows net-y-unix invocation without arguments.

	* tests/net-y-unix.c (TEST_SOCKET): New macro.
	(void): Use it instead of av[1].
	* tests/net-y-unix.test: Do not specify arguments for the test
	executable.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: run every test except ksysent.test in its own subdirectory.
	Many test executables create temporary files in the current work
	directory for the duration of their execution.
	This level of test isolation allows more test executables to be invoked
	several times simultaneously.

	* tests/.gitignore: Add *.dir, remove *.log.*, *.tmp, *.tmp-*,
	and *.tmp.* patterns.
	* tests/Makefile.am (clean-local, clean-local-check): New rules.
	(.PHONY): Add clean-local-check.
	(CLEANFILES): Remove all but ksysent.h.
	* tests/init.sh: Strip test-specific prefix from LOG, OUT, and EXP
	variables.  When invoked from a test, create a new test-specific
	directory, chdir into it, and add more ../ prefix to STRACE variable.
	(run_prog): Replace "./" with "../".
	* tests/attach-f-p.test: Replace "./" with "../".
	* tests/attach-p-cmd.test: Likewise.
	* tests/bexecve.test: Likewise.
	* tests/btrfs-v.test: Likewise.
	* tests/btrfs-vw.test: Likewise.
	* tests/btrfs-w.test: Likewise.
	* tests/count.test: Likewise.
	* tests/detach-running.test: Likewise.
	* tests/detach-sleeping.test: Likewise.
	* tests/detach-stopped.test: Likewise.
	* tests/mmap.test: Likewise.
	* tests/net-y-unix.test: Likewise.
	* tests/net-yy-inet.test: Likewise.
	* tests/net-yy-netlink.test: Likewise.
	* tests/net-yy-unix.test: Likewise.
	* tests/net.test: Likewise.
	* tests/opipe.test: Likewise.
	* tests/poll.test: Likewise.
	* tests/prctl-seccomp-strict.test: Likewise.
	* tests/qual_fault-exit_group.test: Likewise.
	* tests/qual_fault.test: Likewise.
	* tests/qual_inject-error-signal.test: Likewise.
	* tests/qual_inject-retval.test: Likewise.
	* tests/qual_inject-signal.test: Likewise.
	* tests/qual_signal.test: Likewise.
	* tests/qual_syscall.test: Likewise.
	* tests/readv.test: Likewise.
	* tests/redirect-fds.test: Likewise.
	* tests/sched.test: Likewise.
	* tests/scm_rights-fd.test: Likewise.
	* tests/seccomp-strict.test: Likewise.
	* tests/strace-C.test: Likewise.
	* tests/strace-E.expected: Likewise.
	* tests/strace-E.test: Likewise.
	* tests/strace-S.test: Likewise.
	* tests/strace-T.test: Likewise.
	* tests/strace-V.test: Likewise.
	* tests/strace-ff.test: Likewise.
	* tests/strace-k.test: Likewise.
	* tests/strace-r.expected: Likewise.
	* tests/strace-r.test: Likewise.
	* tests/strace-t.test: Likewise.
	* tests/strace-tt.test: Likewise.
	* tests/strace-ttt.test: Likewise.
	* tests/sun_path.test: Likewise.
	* tests/uname.test: Likewise.
	* tests/unix-pair-send-recv.test: Likewise.
	* tests/unix-pair-sendto-recvfrom.test: Likewise.

2017-04-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: make test executables invocable outside current work directory.
	Most of test executables were ready for the upcoming change,
	this change prepares all the rest.

	* tests/getdents.c (main): Use fixed name for the sample directory.
	* tests/getdents64.c (main): Likewise.
	* tests/readdir.c (main): Likewise.
	* tests/mknod.c (sample): Change to a pointer.
	(main): Use av[0] as a sample.
	* tests/symlink.c (main): Use av[0] as a linkpath.
	* tests/umode_t.c (sample): Change to a pointer.
	(test_syscall): Fix expected output.
	(main): Use av[0] as a sample.

2017-03-31  Dmitry V. Levin  <ldv@altlinux.org>

	tests: cleanup access.test.
	* tests/access.test: Use run_strace_match_diff.
	* tests/access.c (main): Update expected output.

2017-03-30  Dmitry V. Levin  <ldv@altlinux.org>

	tests: cleanup oldfstat.test.
	* tests/oldfstat.test: Use fstat.test.

2017-03-29  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64: workaround gcc+kernel bug.
	Due to a subtle gcc bug that leads to miscompiled aarch64 kernels,
	the 3rd argument of sched_getattr syscall is not quite 32-bit
	on aarch64 as on other architectures.  For more details see
	https://sourceforge.net/p/strace/mailman/message/35721703/

	* defs.h (print_abnormal_hi): New prototype.
	* util.c (print_abnormal_hi): New function.
	* sched.c (SYS_FUNC(sched_getattr)) [AARCH64]: Use it.
	* tests/sched_xetattr.c (main) [__arm64__ || __aarch64__]: Test it.

2017-03-29  Abhishek Tiwari  <erabhishektiwarics@gmail.com>

	alpha, mips: fix missing flags in stat related compatibility syscalls.
	Following commands do the fix:

	Add TF flag, fixed by:
		git grep -Fl '_stat' linux/*/syscallent* | xargs sed -i \
	  		's/0\(,[[:space:]]*SEN(.*_l\?stat[^i]\)/TF\1/'

	Add TD flag, fixed by:
		git grep -Fl '_stat' linux/*/syscallent* | xargs sed -i \
		  's/0\(,[[:space:]]*SEN(.*_fstat\)/TD\1/'

	* linux/alpha/syscallent.h: Add TF and TD flags to stat related
	compat syscall entries.
	* linux/mips/syscallent-compat.h: Likewise.

2017-03-24  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: fix the number of arguments in alpha specific syscalls.
	* linux/alpha/syscallent.h (getxgid, osf_stat, osf_lstat, osf_fstat,
	osf_sysinfo, sethae): Set nargs according to arch/alpha/kernel/osf_sys.c
	from linux v4.10.

	alpha: update comments about not implemented syscalls.
	* linux/alpha/syscallent.h: Sync "not implemented" comments
	with arch/alpha/kernel/systbls.S from linux v4.10.

2017-03-23  Quentin Monnet  <quentin.monnet@6wind.com>

	Update BPF_MAP_TYPE_* constants.
	* xlat/bpf_map_types.in: Add BPF_MAP_TYPE_ARRAY_OF_MAPS
	and BPF_MAP_TYPE_HASH_OF_MAPS constants.

2017-03-23  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v4.11-rc3.
	* linux/32/ioctls_inc_align16.h: Update from linux v4.11-rc3 using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/arm/ioctls_arch0.h: Likewise.
	* linux/i386/ioctls_arch0.h: Likewise.
	* linux/powerpc/ioctls_arch0.h: Likewise.
	* linux/s390/ioctls_arch0.h: Likewise.
	* linux/s390x/ioctls_arch0.h: Likewise.
	* linux/x86_64/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

	maint: update for linux 4.11.
	* maint/ioctls_sym.sh (ppc_list): Add KVM_PPC_GET_RMMU_INFO
	and KVM_PPC_CONFIGURE_V3_MMU.

2017-03-19  Dmitry V. Levin  <ldv@altlinux.org>

	test: rename README to README.md.
	* test/README: Rename to README.md, turn ../tests reference into an URL.

	test: update README.
	* test/README: Tell the reader what this directory is actually for.

	test: rewrite skodic.c demo.
	* test/skodic.c: Rewrite this demo to simplify its use.

2017-03-18  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

	Implement decoding of statx syscall.
	* linux/i386/syscallent.h [383]: Add statx entry.
	* linux/x32/syscallent.h [332]: Likewise.
	* linux/x86_64/syscallent.h [332]: Likewise.
	* pathtrace.c (pathtrace_match): Handle SEN_statx.
	* statx.c: New file.
	* statx.h: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* tests/.gitignore: Add statx.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add statx.test.
	* tests/statx.c: New file.
	* tests/statx.test: Likewise.
	* tests/xstatx.c: Modify to support statx.
	* xlat/at_statx_sync_types.in: New file.
	* xlat/statx_attrs.in: Likewise.
	* xlat/statx_masks.in: Likewise.
	* NEWS: Mention this change.

2017-03-17  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check for out of bounds fetch in parsers of stat family syscalls.
	* tests/xstatx.c (main): Create STRUCT_STAT object using
	TAIL_ALLOC_OBJECT_CONST_PTR.

	tests: check unexpected syscall errors returned by stat family syscalls.
	* tests/xstatx.c (main) [!OLD_STAT]: Do not skip the test
	in case of EOVERFLOW.
	Treat errors other than ENOSYS and EOVERFLOW as fatal.

2017-03-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: move try_run_prog to init.sh.
	Looks like try_run_prog may be of general use by other syscall class
	tests.

	* tests/sched.test (try_run_prog): Move it...
	* tests/init: ... here.

2017-03-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/sched.test: rc should be a local variable in try_run_prog.
	* tests/sched.test (try_run_prog): Add local rc.

2017-03-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of int 0x80 on x86_64, x32, and x86.
	* tests/int_0x80.c: New file.
	* tests/int_0x80.test: New test.
	* tests/.gitignore: Add int_0x80.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS, XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Add int_0x80.test.
	(XFAIL_TESTS): Add $(XFAIL_TESTS_$(ARCH)).
	(CLEANFILES): Add $(TESTS:=.tmp.out) and $(TESTS:=.tmp.exp).

2017-03-16  Damien Profeta  <damien.profeta@amadeus.com>

	strace-graph: handle pid looping.
	* strace-graph: On long running process or heavily forking one (like
	compilation), it can happen that a parent get 2 different children with
	the same pid.  By tracking the currently runnig pid and adding the start
	timestamp to the pid, the graph can now handle that case.

	Closes: https://github.com/strace/strace/pull/7

2017-03-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use TAIL_ALLOC_OBJECT_CONST_PTR.
	Automatically convert tests to use TAIL_ALLOC_OBJECT_CONST_PTR macro
	with the following sed expression:

	sed -ri \
	's/^([[:space:]]*)(([^*]+[[:alnum:]_])( \*)?) *\*( *const )?([^ =]+) = tail_alloc\(sizeof\((\2|\*\6)\)\);/\1TAIL_ALLOC_OBJECT_CONST_PTR(\2, \6);/' \
	tests/*.c

2017-03-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use TAIL_ALLOC_OBJECT_VAR_PTR.
	Automatically convert tests to use TAIL_ALLOC_OBJECT_VAR_PTR macro
	with the following sed expression:

	sed -ri \
	's/^([[:space:]]*)(([^*]+[[:alnum:]_])( \*)?) *\*([^ =]+) = tail_alloc\(sizeof\((\2|\*\5)\)\);/\1TAIL_ALLOC_OBJECT_VAR_PTR(\2, \5);/' \
	tests/{move_pages,net-sockaddr,sendfile}.c

2017-03-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add TAIL_ALLOC_OBJECT_{CONST,VAR}_PTR to tests.h.
	Introduce a new macros for the most widespread use of tail_alloc.

	* tests/tests.h (TAIL_ALLOC_OBJECT_CONST_PTR,
	TAIL_ALLOC_OBJECT_VAR_PTR): New macros.

2017-03-16  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

	Decode RUSAGE_THREAD.
	* xlat/usagewho.in: Add values for existing entities, add
	RUSAGE_THREAD.
	* tests/getrusage.c: Test decoding of RUSAGE_THREAD.

2017-03-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/sched.test: use heredoc in order to avoid spawning of subprocess.
	Pipelined commands executed in subprocesses (some shells have special
	provision for last command in the pipeline, but it is not guaranteed
	and not POSIX), so exit codes of these subprocesses can be lost.
	In order to avoid creating subprocesses, input for read commands
	is better to supply via heredoc and not pipe.

	* tests/sched.test: Move test cases to heredoc.

2017-03-15  Dmitry V. Levin  <ldv@altlinux.org>

	tests: do not skip sched.test if one of its subtests skips.
	* tests/sched.test (try_run_prog): New function.
	Use it instead of run_prog.

2017-03-15  Dmitry V. Levin  <ldv@altlinux.org>

	tests: do not check decoding of setitimer syscall outside xetitimer.test
	xetitimer.test already implements a comprehensive test of setitimer
	syscall parser, no need to duplicate its parts in other tests.

	* tests/clock_nanosleep.c (main): Remove setitimer expected output.
	* tests/nanosleep.c (main): Likewise.
	* tests/clock_nanosleep.test: Remove setitimer from the trace set.
	* tests/nanosleep.test: Likewise.

2017-03-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of getitimer and setitimer corner cases.
	* tests/sched_xetattr.c: Include <unistd.h> and <asm/unistd.h>.
	(main): Check that pointer and integer arguments of getitimer
	and setitimer syscalls are decoded properly.
	* tests/xetitimer.test: Add -a option.

2017-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite sigreturn syscall decoding check from match_grep to match_diff
	Unlike the former test that was based on match_grep,
	the new one uses match_diff and does more rigorous testing.

	* tests/sigreturn.c: Rewrite.
	* tests/sigreturn.test: Likewise.

2017-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	ia64, mips, x86_64: remove no longer used parsers of sigreturn syscalls.
	As there is no sigreturn syscall on ia64, mips n32, mips n64, x32,
	and x86_64, no longer used parsers could be safely removed.

	* linux/ia64/arch_sigreturn.c: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* linux/mips/arch_sigreturn.c (arch_sigreturn): Remove [!LINUX_MIPSO32].
	* linux/x86_64/arch_sigreturn.c (arch_sigreturn): Remove.

2017-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	Move sigreturn parser to libstrace.
	All architectures have rt_sigreturn, but only old ones also have
	sigreturn.  Since not all architectures need a parser of sigreturn
	syscall, remove the warning and move the parser to libstrace.

	* Makefile.am (strace_SOURCES): Move sigreturn.c ...
	(libstrace_a_SOURCES): ... here.
	* linux/arch_sigreturn.c: Remove warning.

2017-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of rt_sigreturn syscall.
	* tests/rt_sigreturn.c: New file.
	* tests/rt_sigreturn.test: New test.
	* tests/.gitignore: Add rt_sigreturn.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add rt_sigreturn.test.

	Implement proper decoding of rt_sigreturn syscall.
	* rt_sigreturn.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/dummy.h (sys_rt_sigreturn): Remove.
	* linux/64/syscallent.h (rt_sigreturn): Change sys_func to rt_sigreturn.
	* linux/hppa/syscallent.h (rt_sigreturn): Likewise.
	* linux/ia64/syscallent.h (rt_sigreturn): Likewise.
	* linux/s390/syscallent.h (rt_sigreturn): Likewise.
	* linux/s390x/syscallent.h (rt_sigreturn): Likewise.
	* linux/x86_64/syscallent.h (rt_sigreturn): Likewise.
	* linux/x32/syscallent.h (rt_sigreturn, 64:rt_sigreturn): Likewise.
	* NEWS: Mention this change.

2017-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce get_rt_sigframe_addr function.
	Add get_rt_sigframe_addr function for all supported architectures.
	It is going to be used in a parser of rt_sigreturn syscall.

	* defs.h (get_rt_sigframe_addr): New function prototype.
	* rt_sigframe.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/aarch64/arch_rt_sigframe.c: New file.
	* linux/alpha/arch_rt_sigframe.c: Likewise.
	* linux/arc/arch_rt_sigframe.c: Likewise.
	* linux/arm/arch_rt_sigframe.c: Likewise.
	* linux/avr32/arch_rt_sigframe.c: Likewise.
	* linux/bfin/arch_rt_sigframe.c: Likewise.
	* linux/crisv10/arch_rt_sigframe.c: Likewise.
	* linux/crisv32/arch_rt_sigframe.c: Likewise.
	* linux/hppa/arch_rt_sigframe.c: Likewise.
	* linux/i386/arch_rt_sigframe.c: Likewise.
	* linux/ia64/arch_rt_sigframe.c: Likewise.
	* linux/m68k/arch_rt_sigframe.c: Likewise.
	* linux/metag/arch_rt_sigframe.c: Likewise.
	* linux/microblaze/arch_rt_sigframe.c: Likewise.
	* linux/mips/arch_rt_sigframe.c: Likewise.
	* linux/nios2/arch_rt_sigframe.c: Likewise.
	* linux/or1k/arch_rt_sigframe.c: Likewise.
	* linux/powerpc/arch_rt_sigframe.c: Likewise.
	* linux/powerpc64/arch_rt_sigframe.c: Likewise.
	* linux/riscv/arch_rt_sigframe.c: Likewise.
	* linux/s390/arch_rt_sigframe.c: Likewise.
	* linux/s390x/arch_rt_sigframe.c: Likewise.
	* linux/sh/arch_rt_sigframe.c: Likewise.
	* linux/sh64/arch_rt_sigframe.c: Likewise.
	* linux/sparc/arch_rt_sigframe.c: Likewise.
	* linux/sparc64/arch_rt_sigframe.c: Likewise.
	* linux/tile/arch_rt_sigframe.c: Likewise.
	* linux/x32/arch_rt_sigframe.c: Likewise.
	* linux/x86_64/arch_rt_sigframe.c: Likewise.
	* linux/xtensa/arch_rt_sigframe.c: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.

2017-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce struct_rt_sigframe type.
	Add rt_sigframe.h files with definitions of struct_rt_sigframe type
	for all supported architectures.
	These definitions are going to be used in a parser of rt_sigreturn
	syscall.

	* linux/rt_sigframe.h: New file.
	* linux/bfin/rt_sigframe.h: Likewise.
	* linux/crisv10/rt_sigframe.h: Likewise.
	* linux/crisv32/rt_sigframe.h: Likewise.
	* linux/hppa/rt_sigframe.h: Likewise.
	* linux/i386/rt_sigframe.h: Likewise.
	* linux/ia64/rt_sigframe.h: Likewise.
	* linux/m68k/rt_sigframe.h: Likewise.
	* linux/mips/rt_sigframe.h: Likewise.
	* linux/powerpc64/rt_sigframe.h: Likewise.
	* linux/s390/rt_sigframe.h: Likewise.
	* linux/s390x/rt_sigframe.h: Likewise.
	* linux/sh64/rt_sigframe.h: Likewise.
	* linux/sparc/rt_sigframe.h: Likewise.
	* linux/sparc64/rt_sigframe.h: Likewise.
	* linux/tile/rt_sigframe.h: Likewise.
	* linux/x32/rt_sigframe.h: Likewise.
	* linux/x86_64/rt_sigframe.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.

2017-03-13  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

	unwind.c: fix a possible buffer overflow.
	Linux does not prevent a user from creating a lot of nested directories
	with length of the absolute path of the deepest one exceeding PATH_MAX,
	then chdir'ing into it, creating a file there and mmap'ing it. Since the
	length of the prefix preceding the pathname in /proc/[pid]/maps is not
	necessary 80 (it's 73 on my machine), an overflow is possible.

	* unwind.c (build_mmap_cache): Fix a possible buffer overflow.

2017-03-13  Victor Krapivensky  <krapivenskiy.va@phystech.edu>

	util.c: remove a wrong comment.
	4924dbd6d750665cf383b20ab4fd67e48219ab91 modified the return type, but
	not the comment.

2017-03-10  Dmitry V. Levin  <ldv@altlinux.org>

	riscv: export riscv_sp_ptr.
	Export SP register for later use by get_rt_sigframe_addr.

	* linux/riscv/arch_regs.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* linux/riscv/arch_regs.c (riscv_sp_ptr): New variable.

2017-03-10  Dmitry V. Levin  <ldv@altlinux.org>

	or1k: export or1k_sp_ptr.
	Export SP register for later use by get_rt_sigframe_addr.

	* linux/or1k/arch_regs.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* linux/or1k/arch_regs.c (or1k_sp_ptr): New variable.

2017-03-10  Dmitry V. Levin  <ldv@altlinux.org>

	nios2: export nios2_sp_ptr.
	Export SP register for later use by get_rt_sigframe_addr.

	* linux/nios2/arch_regs.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* linux/nios2/arch_regs.c (nios2_sp_ptr): New variable.

2017-03-10  Dmitry V. Levin  <ldv@altlinux.org>

	metag: export metag_sp_ptr.
	Export SP register for later use by get_rt_sigframe_addr.

	* linux/metag/arch_regs.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* linux/metag/arch_regs.c (metag_sp_ptr): New variable.

2017-03-10  Dmitry V. Levin  <ldv@altlinux.org>

	avr32: export avr32_sp_ptr.
	Export SP register for later use by get_rt_sigframe_addr.

	* linux/avr32/arch_regs.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* linux/avr32/arch_regs.c (avr32_sp_ptr): New variable.

2017-03-10  Dmitry V. Levin  <ldv@altlinux.org>

	arc: export arc_sp_ptr.
	Export SP register for later use by get_rt_sigframe_addr.

	* linux/arc/arch_regs.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* linux/arc/arch_regs.c (arc_sp_ptr): New variable.

2017-03-09  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce print_sigset_addr function.
	As the definition of NSIG_BYTES is based on NSIG defined in <signal.h>,
	NSIG_BYTES cannot be used in files that use kernel sigset_t.

	Add another wrapper around print_sigset_addr_len_limit function that
	takes one argument less than print_sigset_addr_len wrapper.  This new
	wrapper is going to be used in cases when the length argument is equal
	to NSIG_BYTES.

	* defs.h (print_sigset_addr): New function prototype.
	* signal.c (print_sigset_addr): New function.
	* linux/alpha/arch_sigreturn.c (arch_sigreturn): Replace
	print_sigset_addr_len with print_sigset_addr.
	* linux/arm/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/crisv10/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/mips/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/x86_64/arch_sigreturn.c (arch_sigreturn): Likewise.

2017-03-08  Dmitry V. Levin  <ldv@altlinux.org>

	README.md: rework guidelines about sending bug reports.

2017-03-08  Abhishek Tiwari  <erabhishektiwarics@gmail.com>

	Update information on how to build strace from git repository.
	* INSTALL-git.md: Describe how to build strace from git repository.
	* README.md: Add reference to INSTALL-git.md.
	* README-hacking: Likewise.

2017-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	README.md: fix references to in-tree files.
	* README.md: Change references to COPYING and NEWS files from absolute
	to relative.

2017-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	INSTALL: regenerate from install.texi.
	Regenerate INSTALL from install.texi using the following command:
	makeinfo --plaintext install.texi > INSTALL

	* INSTALL: Regenerate from install.texi.

2017-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	install.texi: remove irrelevant sections.
	Remove "Multiple Architectures" and "Particular Systems" sections using
	the following filter script:

	awk '/^@node (Multiple Architectures|Particular Systems)/{skip=1;next}
	/^@node/{skip=0} {if(!skip)print}'

	* install.texi (Multiple Architectures, Particular Systems): Remove.

2017-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	install.texi: import from GNU Autoconf.
	install.texi from GNU Autoconf is the ultimate source of INSTALL file.
	This edition of install.texi has been downloaded from
	https://git.savannah.gnu.org/cgit/autoconf.git/plain/doc/install.texi?id=63f3c78cdb0ccc85751543e387ef2a7252d5f0a2

	* install.texi: Import from GNU Autoconf.

2017-03-05  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Md Haris Iqbal  <haris.phnx@gmail.com>

	Implement -e trace=%sched option for tracing sched_* syscalls.
	Based on the patch by Md Haris Iqbal
	(https://sourceforge.net/p/strace/mailman/message/35111320/)

	linux/*/syscallent.h part is modified automatically by:

	    git grep -Fl 'SEN(sched_' linux/ | xargs sed -i \
	        's/0\(,[[:space:]]*SEN(sched_\)/TSC\1/'

	* sysent.h (TRACE_SCHED): New definition.
	* syscall.c: Alias TSC to TRACE_SCHED around syscallent.h inclusion.
	* linux/32/syscallent.h: Add TSC flag for sched_* sycalls.
	* linux/64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* qualify.c (lookup_class): Add TRACE_SCHED for "%sched".
	* tests/ksysent.c: Define TSC to 0.
	* tests/nsyscalls.c: Likewise.
	* tests/sched.test: New test.
	* tests/Makefile.am (DECODER_TESTS): Add sched.test.
	* strace.1 (.SS Filtering): Add information about %sched syscall class.
	* NEWS: Mention this change.

2017-03-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add "%" prefix for syscall classes in qualify.
	(as suggested in
	https://www.mail-archive.com/strace-devel@lists.sourceforge.net/msg05147.html )

	In order to move them to a different namespace than syscall names. This is
	already a problem in case of ipc class which shadows ipc syscall.

	Old behaviour is retained in order to preserve backwards compatibility.

	* qualify.c (lookup_class) <syscall_class>: Add %-prefixed class definitions.
	* strace.1 (.SS Filtering): Add information regarding %-prefixed class
	syntax, declare legacy class syntax deprecated.
	* tests/net.test: Update to use %-prefixed syscall class name.
	* tests/netlink_protocol.test: Likewise.
	* tests/qual_fault-exit_group.test: Likewise.
	* tests/qual_syscall.test: Likewise.
	* tests/scm_rights-fd.test: Likewise.
	* tests/sigreturn.test: Likewise.
	* tests/uio.test: Likewise.
	* NEWS: Mention this change.

2017-02-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: simplify print_time_t.
	* tests/print_time.c (print_time_t): Treat localtime errors as fatal.

2017-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	Update homepage URL.
	* README: Change homepage URL to https://strace.io
	* debian/control: Likewise.
	* strace.spec.in: Likewise.

2017-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: transform print_time_t into print_time_t_nsec.
	* tests/print_time.c (print_time_t): Rename to print_time_t_nsec,
	take second argument and print it.
	* tests/tests.h (print_time_t): Rename to print_time_t_nsec,
	add second argument.
	* tests/utime.c (main): Use print_time_t_nsec instead of print_time_t.
	* tests/xstatx.c (print_stat): Likewise.  Pass nanoseconds
	to print_time_t_nsec instead of printing them.

	tests: use print_time_t in utime.test.
	* tests/utime.c (print_tm): Remove.
	(main): Use print_time_t instead of print_tm.

2017-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: move print_time function to libtests.
	Rename print_time function to print_time_t and move it to libtests.

	* tests/print_time.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.
	* tests/tests.h (print_time_t): New prototype.
	* tests/print_time.c (print_time): Remove.
	(print_stat): Replace print_time with print_time_t.

2017-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: macroize printing of atime, mtime, and ctime fields in xstatx.c.
	Introduce a macro for printing similar time related fields.

	* print_struct_stat.c (PRINT_ST_TIME): New macro.
	(print_stat): Use it.

2017-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	print_struct_stat.c: macroize printing of atime, mtime, and ctime fields
	Introduce a macro for printing similar time related fields.

	* print_struct_stat.c (PRINT_ST_TIME): New macro.
	(print_struct_stat): Use it.

2017-02-25  Dmitry V. Levin  <ldv@altlinux.org>

	x32: fix decoding of flags argument of preadv2 and pwritev2 syscalls.
	x32 is the only linux architecture where preadv2 and pwritev2 syscalls
	take 5 arguments instead of 6.

	* io.c (PREADV2_PWRITEV2_FLAGS_ARG_NO): New macro.
	(SYS_FUNC(preadv2), SYS_FUNC(pwritev2)): Use it.
	* linux/x32/syscallent.h (preadv2, pwritev2): Change nargs to 5.
	* NEWS: Mention this fix.
	* tests/preadv2-pwritev2.c (main): Fix invocation of preadv2
	and pwritev2 syscalls on x32.

2017-02-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite ppoll syscall decoding check from match_grep to match_diff
	Unlike the former test that was based on match_grep,
	the new one uses match_diff and does more rigorous testing.

	* tests/ppoll-v.c: New file.
	* tests/ppoll-v.test: New test.
	* tests/ppoll.c: Rewrite.
	* tests/ppoll.test: Likewise.
	* tests/ppoll.expected: Remove.
	* tests/ppoll-v.expected: Remove.
	* tests/.gitignore: Add ppoll-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ppoll-v.test.
	(EXTRA_DIST): Remove ppoll.expected and ppoll-v.expected.

2017-02-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: move get_sigset_size function to libtests.
	* tests/get_sigset_size.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.
	* tests/tests.h (get_sigset_size): New prototype.
	* tests/ptrace.c: Do not check for __NR_rt_sigprocmask.
	(main): Use get_sigset_size.
	* tests/signalfd4.c: Do not check for __NR_rt_sigprocmask.
	(get_sigset_size): Remove.

2017-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	sched: enhance decoding of sched_setattr syscall.
	Implement read/write semantics of struct sched_attr.size argument
	of sched_setattr syscall.  Do not print members of struct sched_attr
	besides sched_attr.size when the specified structure size is less than
	the minimal size allowed by the kernel.

	* sched.c (print_sched_attr): Fetch struct sched_attr.size and use it
	as the structure size.  Print struct sched_attr.size only when the
	structure size is less than SCHED_ATTR_MIN_SIZE.
	(SYS_FUNC(sched_setattr)): Call print_sched_attr with zero size
	argument.  Print struct sched_attr.size returned by the kernel
	on exiting syscall in case of E2BIG. Print the last syscall argument
	on exiting syscall.
	(SYS_FUNC(sched_getattr)): Do not call print_sched_attr with zero size
	argument.
	* NEWS: Mention it.
	* tests/sched_xetattr.c (main): Check it.

2017-02-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of sched_[gs]etattr corner cases.
	* tests/sched_xetattr.c (main): Check that integer arguments
	of sched_getattr and sched_setattr syscalls are decoded properly
	by adding a few cases with filled higher 32 bits.
	Check that pointer argument is decoded properly
	on F8ILL_KULONG_SUPPORTED architectures.

2017-02-18  Dmitry V. Levin  <ldv@altlinux.org>

	Move definition of struct sched_attr to a separate header file.
	Avoid multiple defintions of struct sched_attr by creating a separate
	header file with its definition and using it in other places.

	* sched_attr.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* sched.c: Include it.
	(print_sched_attr): Use it.
	* tests/sched_xetattr.c: Include it.
	(main): Use it.

2017-02-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite sched_xetattr.test from match_grep to match_diff.
	Unlike the previous edition of the test that was based on match_grep,
	the new one is match_diff based and does more rigorous testing.

	* tests/adjtimex.c: Include "xlat.h" and "xlat/schedulers.h",
	(sys_sched_getattr, sys_sched_setattr): New functions.
	(main): Use them.  Update expected output.
	* tests/adjtimex.test: Use run_strace_match_diff.

2017-02-17  Dmitry V. Levin  <ldv@altlinux.org>

	Use tprints instead of tprintf in a few more places.
	* bpf.c (bpf_obj_manage, bpf_prog_attach_detach): Replace tprintf
	with tprints for printing strings without format specifiers.
	* dm.c (dm_decode_dm_target_spec): Likewise.
	* mq.c (SYS_FUNC(mq_timedreceive)): Likewise.
	* perf.c (print_perf_event_attr): Likewise.
	* syscall.c (trace_syscall_exiting): Likewise.

2017-02-17  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: update BPF_PROG_ATTACH decoding.
	Implement decoding of BPF_F_ALLOW_OVERRIDE flag of BPF_PROG_ATTACH
	command introduced by linux kernel commit v4.10-rc7-174-g7f67763.

	* configure.ac: Check for union bpf_attr.attach_flags
	instead of union bpf_attr.attach_type.
	* xlat/bpf_attach_flags.in: New file.
	* bpf.c: Include "xlat/bpf_attach_flags.h".
	(bpf_prog_attach_detach): Rename print_attach_bpf_fd argument
	to print_attach.  Add attach_flags field to the structure,
	print it in case of BPF_PROG_ATTACH.
	* tests/bpf.c: Check for HAVE_UNION_BPF_ATTR_ATTACH_FLAGS
	instead of HAVE_UNION_BPF_ATTR_ATTACH_TYPE.
	(prog_cgroup): Initialize attach_flags field.
	(main): Update expected output.

2017-02-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite adjtimex.test from match_grep to match_diff.
	Unlike the previous edition of the test that was based on match_grep,
	the new one is match_diff based and does more rigorous testing.

	* tests/adjtimex.c: Include "xlat.h", "xlat/adjtimex_state.h",
	and "xlat/adjtimex_status.h".
	(main): Update expected output.
	* tests/adjtimex.test: Use run_strace_match_diff.

2017-02-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: replace casts of 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
	* tests/init_delete_module.h (bogus_zero): Remove.
	* tests/delete_module.c (main): Replace bogus_zero and
	(kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
	* tests/finit_module.c (main): Replace bogus_zero
	with F8ILL_KULONG_MASK.
	* tests/init_module.c (main): Likewise.
	* tests/pipe2.c (main): Likewise.
	* tests/epoll_ctl.c (invoke_syscall): Replace
	(unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
	* tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Likewise.
	* tests/fanotify_init.c (main): Likewise.
	* tests/xetpgid.c (main): Likewise.
	* tests/xetpriority.c (main): Likewise.
	(kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
	* tests/fanotify_mark.c (main): Likewise.
	* tests/file_handle.c (main): Likewise.
	* tests/kexec_load.c (main): Likewise.
	* tests/setfsugid.c (main): Likewise.
	* tests/getgroups.c (main): Replace (long) 0xffffffff00000000ULL
	with F8ILL_KULONG_MASK.
	* tests/setgroups.c (main): Replace (long) 0xffffffff00000000ULL
	and (unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.

2017-02-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fill higher bits of integer arguments of fcntl* syscalls.
	Check that integer arguments of fcntl and fcntl64 syscalls are decoded
	properly by casting them to kernel_ulong_t and filling higher bits.

	* tests/struct_flock.c (invoke_test_syscall): Cast "fd" and "cmd"
	syscall arguments to kernel_ulong_t, fill their higher 32 bits.

2017-02-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use sprintrc in tests of fcntl and fcntl64 syscalls.
	* tests/struct_flock.c (EINVAL_STR): Remove.
	(test_flock_einval, test_flock): Use sprintrc instead of EINVAL_STR.
	* tests/fcntl.c (test_flock64_einval): Likewise.
	* tests/fcntl64.c (test_flock64_einval, test_flock64): Likewise.

2017-02-15  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.16-1.
	* strace.spec.in: Likewise.

2017-02-14  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.16 release.
	* NEWS: Update for 4.16 release.

2017-02-13  Dmitry V. Levin  <ldv@altlinux.org>

	.mailmap: add addresses of JingPiao Chen.
	* .mailmap: Add both addresses of JingPiao Chen here to avoid
	duplications in CREDITS file.

	tests: skip scno tampering tests on compat mips abi.
	* tests/scno_tampering.sh: In case of mips abi, skip the test
	unless it is the native abi.

2017-02-12  Dmitry V. Levin  <ldv@altlinux.org>

	Fix -Werror=duplicate-decl-specifier compilation issues.
	capability.c:82:28: error: duplicate "const" declaration specifier
	capability.c:110:33: error: duplicate "const" declaration specifier
	rt_tgsigqueueinfo.c:42:61: error: duplicate "const" declaration specifier
	utime.c:66:23: error: duplicate "const" declaration specifier
	waitid.c:147:20: error: duplicate "const" declaration specifier

	* capability.c (cap_user_header_t, cap_user_data_t): Remove.
	(get_cap_header): Change return type
	to "const struct user_cap_header_struct *".
	(print_cap_header, print_cap_data): Change the type of last argument
	to "const struct user_cap_header_struct * const".
	(SYS_FUNC(capget)): Change type of "h" variable
	to "const struct user_cap_header_struct *".
	(SYS_FUNC(capset)): Change type of "h" variable
	to "const struct user_cap_header_struct * const".
	* tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Change the type of last
	argument to "const void *const".
	* tests/utime.c (main): Change the type of "tail_u" variable
	to "const struct utimbuf *const".
	* tests/waitid.c (do_waitid): Change the type of 3rd argument
	to "const siginfo_t *const".

2017-02-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite pipe syscall decoding check from match_grep to match_diff
	* configure.ac (AC_CHECK_FUNCS): Remove pipe2.
	* tests/pipe.c: Include <asm/unistd.h>, skip the test if [!__NR_pipe]
	instead of [!HAVE_PIPE2].
	(main): Do not call pipe2.
	* tests/pipe.test: Skip the test if libc pipe wrapper does not use
	pipe syscall, rewrite from match_grep to match_diff.
	* tests/pipe.expected: Update expected output.

2017-02-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite pipe2 syscall decoding check from match_grep to match_diff
	Unlike pipe.test that is based on match_grep, the new test
	is based on match_diff and does more rigorous testing.

	* tests/pipe2.c: New file.
	* tests/pipe2.test: New test.
	* tests/.gitignore: Add pipe2.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add pipe2.test.

2017-02-10  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite mq.test from match_grep to match_diff.
	Unlike the previous edition of the test that was based on match_grep,
	the new one is match_diff based and does more rigorous testing.

	* tests/mq.c: Include <stdio.h>.
	(NAME): New macro.
	(main): Use it.  Print expected output.
	* tests/mq.expected: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove mq.expected.
	* tests/mq.test: Use run_strace_match_diff.

2017-02-09  Dmitry V. Levin  <ldv@altlinux.org>

	Simplify struct inject_opts.rval semantics.
	Drop use of INJECT_OPTS_RVAL_DISABLE special inject_opts.rval value,
	INJECT_OPTS_RVAL_DEFAULT is enough.

	* defs.h (INJECT_OPTS_RVAL_DISABLE): Remove.
	* qualify.c (qualify_inject_common): Do not replace
	INJECT_OPTS_RVAL_DEFAULT with INJECT_OPTS_RVAL_DISABLE
	in inject_opts.rval.
	* syscall.c (tamper_with_syscall_entering): Check
	for INJECT_OPTS_RVAL_DEFAULT instead of INJECT_OPTS_RVAL_DISABLE.

2017-02-09  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check signal injection along with fault injection.
	* tests/qual_inject-error-signal.c: New file.
	* tests/qual_inject-error-signal.expected: Likewise.
	* tests/qual_inject-error-signal.test: New test.
	* tests/.gitignore: Add qual_inject-error-signal.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add qual_inject-error-signal.test.
	(EXTRA_DIST): Add qual_inject-error-signal.expected.

	tests: simplify qual_inject-signal.test.
	* tests/qual_inject-signal.test: Use $NAME instead of qual_inject-signal.

2017-02-09  Dmitry V. Levin  <ldv@altlinux.org>

	Make symbolic errno values match case-insensitive.
	Follow the example of case-insensitive symbolic signal values in signal
	and inject expressions and make symbolic errno values in inject
	expressions case-insensitive.

	* qualify.c (find_errno_by_name): Use strcasecmp instead of strcmp
	to match symbolic errno values.
	* tests/qual_fault.c (main): Likewise.
	* tests/qual_fault.test: Test case-insensitive symbolic errno match.

2017-02-09  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check case-insensitive symbolic signal match.
	* tests/qual_signal.test: Test case-insensitive symbolic signal match.

2017-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	Update NEWS.

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	strace.spec.in: fix dist version checks.
	* strace.spec.in: Fix libunwind availability check.

	Reported-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: update ipc_sem.test for new glibc.
	Starting with commit glibc-2.24-553-g40c0a78, glibc may pass NULL
	address to semctl like other libcs.

	* tests/ipc_sem.c (main) [__GLIBC__]: Remove.

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix typo in bpf.test.
	* tests/bpf.c (main): Add missing semicolon.

	Fixes: ad427721 ("tests: rewrite bpf.test from match_grep to match_diff")

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check signal injection.
	* tests/qual_inject-signal.c: New file.
	* tests/qual_inject-signal.expected: Likewise.
	* tests/qual_inject-signal.test: New test.
	* tests/.gitignore: Add qual_inject-signal.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add qual_inject-signal.test.
	(EXTRA_DIST): Add qual_inject-signal.expected.

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	Implement -e inject= option.
	Introduce -e inject= as a general injection option,
	limit -e fault= option to syscall fault injection.

	Change default return code of syscall fault injection to ENOSYS.

	* qualify.c (parse_inject_token): Add fault_tokens_only argument,
	do not accept retval= and signal= tokens when fault_tokens_only
	is set to true.
	(parse_inject_expression): Add fault_tokens_only argument,
	forward it to parse_inject_token.
	(qualify_inject_common): New function.
	(qualify_fault): Use it.
	(qualify_inject): New function.
	(qual_options): New entry.
	* strace.1: Describe -e inject= option.
	* NEWS: Mention -e inject= option.
	* tests/qual_fault-syntax.test: Test that -e fault= option does not
	support retval=, signal=, and multiple error= tokens.
	* tests/qual_fault.c (DEFAULT_ERRNO): Set to ENOSYS unconditionally.
	* tests/qual_inject-retval.test: Replace -e fault= option
	with -e inject= option.
	* tests/qual_inject-syntax.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: prepare for introduction of -e inject= option.
	Rename files related to fault injection to avoid further confusion.

	* tests/fault_injection-exit_group.expected: Rename
	to tests/qual_fault-exit_group.expected.
	* tests/fault_injection-exit_group.test: Rename
	to tests/qual_fault-exit_group.test.
	* tests/fault_syntax.test: Rename to tests/qual_fault-syntax.test.
	* tests/fault_injection.c: Rename to tests/qual_fault.c.
	* tests/fault_injection.test: Rename to tests/qual_fault.test.
	* tests/fault_injection-retval.c: Rename to tests/qual_inject-retval.c.
	* tests/fault_injection-retval.test: Rename
	to tests/qual_inject-retval.test.
	* tests/fault_injection.sh: Rename to tests/scno_tampering.sh.
	* tests/.gitignore: Update.
	* tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS,
	EXTRA_DIST): Update.

2017-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for introduction of -e inject= option.
	As -e fault= injection syntax has been extended to configure various
	kinds of injections besides fault injection, the original option name
	bacame too narrow.

	This change renames internal constants, types, and functions from
	"fault" to more generic inject/tamper ones.

	* defs.h (fault_opts): Rename to inject_opts.
	(FAULT_OPTS_RVAL_DEFAULT): Rename to INJECT_OPTS_RVAL_DEFAULT.
	(FAULT_OPTS_RVAL_DISABLE): Rename to INJECT_OPTS_RVAL_DISABLE.
	(struct tcb): Rename fault_vec field to inject_vec.
	(TCB_FAULT_INJ): Rename to TCB_TAMPERED.
	(QUAL_FAULT): Rename to QUAL_INJECT.
	(fault_vec): Rename to inject_vec.
	All users changed.
	* qualify.c (fault_set): Rename to inject_set.
	(parse_fault_token): Rename to parse_inject_token.
	(parse_fault_expression): Rename to parse_inject_expression.
	All callers changed.
	* syscall.c (fault_vec): Rename to inject_vec.
	(tcb_fault_opts): Rename to tcb_inject_opts.
	(inject_syscall_fault_entering): Rename to tamper_with_syscall_entering.
	(update_syscall_fault_exiting): Rename to tamper_with_syscall_exiting.
	(syscall_fault_injected): Rename to syscall_tampered.
	All callers changed.

2017-02-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: make Makefile.am lists sorted in C locale.
	* tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS,
	EXTRA_DIST): Make sorted in C locale.

2017-02-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use ARG_STR in msg_control.test.
	Drop local VAL_STR macro in favour of ARG_STR macro from tests/tests.h.

	* tests/msg_control.c (VAL_STR): Remove.
	(test_sol_socket, test_sol_ip): Replace VAL_STR with ARG_STR.

2017-02-07  Dmitry V. Levin  <ldv@altlinux.org>

	powerpc, powerpc64: wire up new syscalls.
	* linux/powerpc/syscallent.h [382]: Add kexec_file_load entry.
	* linux/powerpc64/syscallent.h [382]: Likewise.

	microblaze: wire up new syscalls.
	* linux/microblaze/syscallent.h [392..397]: New entries.

	avr32: wire up new syscalls.
	* linux/avr32/syscallent.h [328..330]: New entries.

2017-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	Update IPV6_* constants.
	* xlat/sockipv6options.in: Add IPV6_RECVFRAGSIZE introduced
	by linux kernel commit v4.10-rc1~202^2~340^2~1.

	Update IP_* constants.
	* xlat/sockipoptions.in: Add IP_RECVFRAGSIZE introduced
	by linux kernel commit v4.10-rc1~202^2~340^2~2.

2017-02-06  Jacob Goense  <dugo@xs4all.nl>

	or1k: fix build.
	This fixes a typo in the arch_set_success for the or1k architecture.

	* linux/or1k/set_error.c (arch_setsuccess): Rename to arch_set_success.

	Fixes: 41d647c ("Implement success injection")
	Closes: https://github.com/strace/strace/pull/6

2017-02-04  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux 4.10.
	* linux/32/ioctls_inc_align16.h: Update from linux v4.10 using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* NEWS: Mention this.

	maint: update for linux 4.10.
	* maint/ioctls_sym.sh: Update workaround for linux/if_pppox.h file.

	maint: add workaround for m68k.
	* maint/ioctls_sym.sh: Skip asm/amigayle.h.

2017-01-31  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of bpf corner cases.
	* tests/bpf.c (bogus_bpf): New function.
	(BOGUS_BPF): New macro.
	(main): Use them.
	* tests/bpf.test: Add -a option.

2017-01-29  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite bpf.test from match_grep to match_diff.
	* tests/bpf.c (errstr): New variable.
	(sys_bpf): New function.
	(map_create, map_any, prog_load, obj_manage, prog_cgroup): Use it.
	(main): Update expected output.
	* tests/bpf.test: Use run_strace_match_diff.

	bpf: move common code to a separate function.
	* bpf.c (bpf_prog_attach_detach): New function.
	(bpf_prog_attach, bpf_prog_detach): Use it.

2017-01-29  Quentin Monnet  <quentin.monnet@6wind.com>

	Update bpf syscall decoding.
	Implement decoding of BPF_OBJ_PIN, BPF_OBJ_GET, BPF_PROG_ATTACH,
	and BPF_PROG_DETACH commands.

	* bpf.c: Include "xlat/bpf_attach_type.h".
	(bpf_obj_manage, bpf_prog_attach, bpf_prog_detach): New functions.
	(SYS_FUNC(bpf)): Use them.
	* configure.ac: Check for union bpf_attr.bpf_fd and union
	bpf_attr.attach_type.
	* xlat/bpf_attach_type.in: New file.
	* xlat/bpf_commands.in: Update list of BPF_* command constants.
	* xlat/bpf_map_types.in: Update list of BPF_MAP_TYPE_* constants.
	* xlat/bpf_prog_types.in: Update list of BPF_PROG_TYPE_* constants.
	* tests/bpf.c [HAVE_UNION_BPF_ATTR_BPF_FD] (obj_manage): New function.
	[HAVE_UNION_BPF_ATTR_ATTACH_TYPE] (prog_cgroup): Likewise.
	(main): Use them.

2017-01-28  Elvira Khabirova  <lineprinter0@gmail.com>

	tests: check success injection.
	* tests/fault_injection-retval.c: New file.
	* tests/fault_injection-retval.test: New test.
	* tests/.gitignore: Add fault_injection-retval.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add fault_injection-retval.test.

2017-01-28  Elvira Khabirova  <lineprinter0@gmail.com>

	Implement success injection.
	This extends fault injection syntax with :retval= option.
	When :retval=VALUE is specified, the syscall number is replaced by -1
	and a bogus success VALUE is returned to the callee.

	* defs.h (fault_opts): Remove err field, add rval field.
	(MAX_ERRNO_VALUE, FAULT_OPTS_RVAL_DEFAULT, FAULT_OPTS_RVAL_DISABLE):
	New macros.
	* qualify.c (parse_fault_token): Handle retval= token.
	(qualify_fault): Update fault_opts initialization after the move
	from struct fault_opts.err to struct fault_opts.rval.
	* syscall.c (arch_set_success): New prototype.
	(inject_syscall_fault_entering): Check opts->rval instead of opts->err.
	(update_syscall_fault_exiting): Implement retval injection.
	* strace.1: Update the section on fault injection.
	* NEWS: Mention retval= option.
	* linux/aarch64/set_error.c (arch_set_success): New function.
	* linux/alpha/set_error.c: Likewise.
	* linux/arc/set_error.c: Likewise.
	* linux/arm/set_error.c: Likewise.
	* linux/avr32/set_error.c: Likewise.
	* linux/bfin/set_error.c: Likewise.
	* linux/crisv10/set_error.c: Likewise.
	* linux/hppa/set_error.c: Likewise.
	* linux/i386/set_error.c: Likewise.
	* linux/ia64/set_error.c: Likewise.
	* linux/m68k/set_error.c: Likewise.
	* linux/metag/set_error.c: Likewise.
	* linux/microblaze/set_error.c: Likewise.
	* linux/mips/set_error.c: Likewise.
	* linux/nios2/set_error.c: Likewise.
	* linux/or1k/set_error.c: Likewise.
	* linux/powerpc/set_error.c: Likewise.
	* linux/riscv/set_error.c: Likewise.
	* linux/s390/set_error.c: Likewise.
	* linux/sh/set_error.c: Likewise.
	* linux/sh64/set_error.c: Likewise.
	* linux/sparc/set_error.c: Likewise.
	* linux/sparc64/set_error.c: Likewise.
	* linux/tile/set_error.c: Likewise.
	* linux/x86_64/set_error.c: Likewise.
	* linux/xtensa/set_error.c: Likewise.

	Closes: https://github.com/strace/strace/issues/3

2017-01-26  Dmitry V. Levin  <ldv@altlinux.org>

	mips: rewrite configure check without sgidefs.h.
	Use builtin macros provided by gcc >= 3.4 instead of sgidefs.h macros.

	* configure.ac <mips>: Do not include <asm/sgidefs.h>, use _ABIO32
	instead of _MIPS_SIM_ABI32, _ABIN32 instead of _MIPS_SIM_NABI32,
	and _ABI64 instead of _MIPS_SIM_ABI64.

2017-01-20  Elvira Khabirova  <lineprinter0@gmail.com>

	.gitignore: add missing files that should be ignored.
	* .gitignore: Add /ioctl_iocdef.[ih].

	Fixes: 5679fad ("ioctlsort: get ioctl definitions from host, not build")

2017-01-20  Andre McCurdy  <armccurdy@gmail.com>

	mips: use <asm/sgidefs.h>
	Build fix for MIPS with musl libc.

	The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
	but not by musl. Regardless of the libc, the kernel headers provide
	<asm/sgidefs.h> which provides the same definitions, so use that
	instead.

	* configure.ac: Replace <sgidefs.h> with <asm/sgidefs.h>.

2017-01-20  JingPiao Chen  <chenjingpiao@gmail.com>

	Implement decoding of ustat syscall.
	* configure.ac (AC_CHECK_HEADERS): Add ustat.h.
	* ustat.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/dummy.h: Remove sys_ustat.
	* tests/ustat.c: New file.
	* tests/ustat.test: New test.
	* tests/.gitignore: Add ustat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ustat.test.

	Makefile.am: allow indented DEF_MPERS_TYPE includes.
	* Makefile.am (m%_type_defs.h): Change sed regular expression to allow
	arbitrary number of whitespace characters between "#" symbol
	and "include" directive.

	strace.1: fix formatting.
	* strace.1: Remove misplaced .TP macros.

2017-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: drop non-USE_ASM_STAT case support.
	With the switch of fstatat family tests to USE_ASM_STAT variant,
	there are no non-USE_ASM_STAT users left.  Remove support of unused
	non-USE_ASM_STAT case.

	* configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_mtim.tv_nsec.
	* tests/fstatat.c (USE_ASM_STAT): Remove.
	* tests/fstatx.c: Likewise.
	* tests/lstatx.c: Likewise.
	* tests/xstatx.c: Assume USE_ASM_STAT.
	[!USE_ASM_STAT]: Remove.

2017-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: call newfstatat and fstatat64 syscalls directly.
	Do not use glibc wrappers to call newfstatat and fstatat64.
	These wrappers have various problems, e.g. they segfault on sparc64
	and mips64 if BOGUS_STRUCT_STAT is not disabled, and they do wrong
	conversion of timestamps on mips64.

	* tests/fstatat.c (TEST_SYSCALL_INVOKE): Invoke the relevant syscall
	directly.
	(USE_ASM_STAT): Define.
	* tests/fstatat64.c (TEST_BOGUS_STRUCT_STAT): Remove.
	(STRUCT_STAT, STRUCT_STAT_STR, STRUCT_STAT_IS_STAT64): Define.

	Based on patch by James Cowgill <james410@cowgill.org.uk>.

2017-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: remove redundant SAMPLE_SIZE definitions.
	Remove all definitions of SAMPLE_SIZE that are identical to the fallback
	definition in tests/xstatx.c.

	* tests/fstat64.c (SAMPLE_SIZE): Remove.
	* tests/lstat64.c (SAMPLE_SIZE): Remove.
	* tests/stat64.c (SAMPLE_SIZE): Remove.

2017-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change SAMPLE_SIZE type to libc_off_t.
	As ftruncate libc function and our create_sample function that calls
	ftruncate both take size argument of type libc_off_t, change the type
	of SAMPLE_SIZE constant to libc_off_t.

	* tests/fstat.c (SAMPLE_SIZE): Cast to libc_off_t.
	* tests/lstat.c (SAMPLE_SIZE): Likewise.
	* tests/oldfstat.c (SAMPLE_SIZE): Likewise.
	* tests/oldlstat.c (SAMPLE_SIZE): Likewise.
	* tests/oldstat.c (SAMPLE_SIZE): Likewise.
	* tests/stat.c (SAMPLE_SIZE): Likewise.
	* tests/xstatx.c (SAMPLE_SIZE): Likewise.

2017-01-13  Alexey Neyman  <stilor@att.net>

	ioctlsort: get ioctl definitions from host, not build.
	When cross-compiling, ioctlsort must obtain _IOC_* values from the
	host, build's values may be incompatible.

	* ioctl_iocdef.c: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	(ioctl_iocdef.i, ioctl_iocdef.h): New rules.
	(ioctlsort%.o): Depend on ioctl_iocdef.h.
	(CLEANFILES): Add ioctl_iocdef.h and ioctl_iocdef.i.
	* ioctlsort.c: Include "ioctl_iocdef.h" instead of <linux/ioctl.h>.

2017-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: treat struct stat mismatch as an error.
	If the test detects struct stat mismatch, this is likely an error
	in definitions of a stat structure that might affect strace as well.
	Fail the test instead of skipping it to attract more attention.

	* tests/xstatx.c (main): Return 1 instead of 77
	in case of struct stat mismatch.

2017-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite diagnostics about struct stat mismatch.
	* tests/xstatx.c (LOG_STAT_OFFSETOF_SIZEOF): New macro.
	(main): Use it to print struct stat mismatch details.

	tests: fix typo in tests/xstatx.c.
	* tests/xstatx.c [!IS_FSTAT]: Define IS_FSTAT instead of IS_STAT.

2017-01-12  JingPiao Chen  <chenjingpiao@gmail.com>

	tests: fix typo in mlock.c.
	* tests/mlock.c [!(__NR_mlock && __NR_munlock)]: Fix spelling
	of SKIP_MAIN_UNDEFINED.

2017-01-12  JingPiao Chen  <chenjingpiao@gmail.com>

	strace: move description of -k option to the appropriate place.
	Follow the example of strace.1 and put the description of -k option
	into the  output format group.

	* strace.c (usage): Move description of -k option to the output
	format group.

2017-01-11  Dmitry V. Levin  <ldv@altlinux.org>

	Remove redundant commas at the end of structure initializers.
	Automatically remove redundant commas using the following
	sed expression:

	git grep -El ',[[:space:]]+}' |xargs sed -ri 's/,([[:space:]]+\})/\1/'

	* linux/32/syscallent.h: Remove redundant commas at the end of structure
	initializers.
	* linux/64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/crisv10/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/microblaze/userent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* tests/kexec_file_load.c: Likewise.

	Reported-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of scsi ioctl commands.
	* tests/ioctl_scsi.c: New file.
	* tests/ioctl_scsi.test: New test.
	* tests/.gitignore: Add ioctl_scsi.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioctl_scsi.test.

	scsi: implement decoding of all SG_* ioctl commands.
	* print_sg_req_info.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* xlat/sg_scsi_reset.in: New file.
	* scsi.c: Include "xlat/sg_scsi_reset.h".
	(scsi_ioctl): Implement decoding of all SG_* ioctl commands.

	scsi: prepare for decoding of other SG_* ioctl commands.
	* scsi.c (scsi_ioctl): Introduce a switch statement.

	tests: check decoding of ioctl SG_IO v3 commands.
	* tests/ioctl_sg_io_v3.c: New file.
	* tests/ioctl_sg_io_v3.test: New test.
	* tests/.gitignore: Add ioctl_sg_io_v3.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioctl_sg_io_v3.test.

	tests: check decoding of ioctl SG_IO v4 commands.
	* tests/ioctl_sg_io_v4.c: New file.
	* tests/ioctl_sg_io_v4.test: New test.
	* tests/.gitignore: Add ioctl_sg_io_v4.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioctl_sg_io_v4.test.

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

	scsi: add fallback definitions for SG_* ioctl command constants.
	Unfortunately, <scsi/sg.h> from libc does not provide all constants
	recognized by the kernel.

	* xlat/scsi_sg_commands.in: New file.
	* scsi.c: Include "xlat/scsi_sg_commands.h" instead of providing
	a fallback definition of SG_IO.

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: provide fallback definitions for BSG_FLAG_* constants.
	BSG_FLAG_* constants were introduced later than the header file where
	they are defined.

	* xlat/bsg_flags.in: Add default values for constants.

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: provide fallback definitions for SG_FLAG_* constants.
	Unfortunately, <scsi/sg.h> from libc does not provide all constants
	recognized by the kernel.

	* xlat/sg_io_flags.in: Add default values for constants.

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

	sg_io_v4: print din_resid and dout_resid fields as signed integers.
	* sg_io_v4.c (decode_response): Print din_resid and dout_resid fields
	using %d format.

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

	sg_io: cleanup printing of sg_io buffers.
	Turn print_sg_io_buffer into a universal sg_io buffer printer.

	* sg_io_v3.c (print_sg_io_buffer): Add iovec_count argument.
	Call tprint_iov_upto when iovec_count is non-zero.
	(decode_request, decode_response): Do not call tprint_iov_upto directly,
	use print_sg_io_buffer instead.
	* sg_io_v4.c: Likewise.

2017-01-10  Dmitry V. Levin  <ldv@altlinux.org>

	sg_io: decode structures on exiting syscall in case of syserror.
	The SCSI driver, starting with kernel commit v2.6.25-rc1~1230^2~78,
	translates its "struct request.errors" to ioctl errors after
	filling in all the output members of the SG_IO header structure.

	As there is no easy way to tell SCSI layer errors from other syscall
	errors, decode the structure on exiting syscall in case of syserror,
	too.

	* scsi.c (scsi_ioctl): Do not call set_tcb_priv_ulong, use
	get_tcb_priv_data instead of get_tcb_priv_ulong, call decode_sg_io
	unconditionally.
	* sg_io_v3.c (decode_request): Save a copy of struct_sg_io_hdr using
	set_tcb_priv_data.
	(decode_response): Restore it using get_tcb_priv_data.  Print its i/o
	fields when umove call fails.  Pass IOV_DECODE_STR to tprint_iov_upto
	unconditionally.
	* sg_io_v4.c (decode_request): Save a copy of struct sg_io_v4 using
	set_tcb_priv_data.
	(decode_response): Restore it using get_tcb_priv_data.  Print its i/o
	fields when umove call fails.  Pass IOV_DECODE_STR to tprint_iov_upto
	unconditionally.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	sg_io: reorder printing of fields to follow structure order.
	* sg_io_v4.c (decode_request): Print timeout, flags, and usr_ptr fields
	after dout_xferp field.

	sg_io_v3: print sg_io_hdr.duration field as unsigned integer.
	* sg_io_v3.c (decode_response): Print duration field using %u format.

	sg_io_v3: print msg_status field.
	* sg_io_v3.c (decode_response): Print msg_status field.

	sg_io: print names of array fields and corresponding length fields.
	* sg_io_v3.c (decode_request): Print names of cmd_len, cmdp,
	and dxferp fields.
	(decode_response): Print names of dxferp, sb_len_wr, and sbp fields.
	* sg_io_v4.c (decode_request): Print names of request_len, request,
	dout_xfer_len, and dout_xferp fields.
	(decode_response): Print names of response_len, response,
	and din_xferp fields.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	sg_io_v3: print status fields using %#x format specifier.
	The formerly used format string %02x led to misleading output as there
	was no clear indication sometimes whether the printed integer was
	decimal or hexadecimal.

	* sg_io_v3.c (decode_response): Print status and masked_status fields
	using %#x format specifier instead of %02x.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	sg_io_v4: print status fields in a hexadecimal form.
	The tradition is to print scsi status codes in a hexadecimal form.

	* sg_io_v4.c (decode_response): Print driver_status, transport_status,
	and device_status fields using %#x format specifier instead of %u.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	sg_io_v4: print request_tag and generated_tag fields in hex.
	The tradition is to print scsi tags in a hexadecimal form.

	* sg_io_v4.c (decode_request): Print request_tag field
	using ("%#" PRI__x64) format string.
	(decode_response): Print generated_tag field using ("%#" PRI__x64)
	format string.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	sg_io_v4: print usr_ptr field in a hexadecimal form.
	As the nature of this field is pointer-like, print it
	in a hexadecimal form.

	* sg_io_v4.c (decode_request): Print usr_ptr field
	using ("%#" PRI__x64) format string.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	sg_io_v4: do not print spare_in and spare_out fields.
	As the kernel does not touch these fields, there is no use
	to print them.

	* sg_io_v4.c (decode_request): Do not print spare_in field.
	(decode_response): Do not print spare_out field.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	sg_io: decode struct sg_io_hdr.info and struct sg_io_v4.info.
	Print struct sg_io_hdr.info and struct sg_io_v4.info using printflags.

	* xlat/sg_io_info.in: New file.
	* defs.h (sg_io_info): New xlat prototype.
	* sg_io_v3.c: Include "xlat/sg_io_info.h".
	(decode_response): Print struct_sg_io_hdr.info using printflags.
	* sg_io_v4.c: (decode_response): Print struct sg_io_v4.info
	using printflags.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	sg_io: decode struct sg_io_hdr.flags and struct sg_io_v4.flags.
	Print struct sg_io_hdr.flags and struct sg_io_v4.flags using printflags.

	* xlat/sg_io_flags.in: New file.
	* sg_io_v3.c: Include "xlat/sg_io_flags.h".
	(decode_request): Print struct_sg_io_hdr.flags using printflags.
	* xlat/bsg_flags.in: New file.
	* sg_io_v4.c: Include "xlat/bsg_flags.h".
	(decode_request): Print struct sg_io_v4.flags using printflags.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	Mpersify struct sg_io_hdr.
	struct sg_io_hdr contains pointers and therefore has to be mpersified.

	* defs.h (decode_sg_io_v3): Remove prototype.
	* sg_io_v3.c (struct_sg_io_hdr): Typedef to struct sg_io_hdr.
	Mpersify it.
	(decode_sg_io_v3): Wrap into MPERS_PRINTER_DECL.

2017-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	Split scsi.c.
	Move decoders of SG_IO v3 and v4 APIs into separate files,
	compile generic SG_IO decoder unconditionally.

	* sg_io_v3.c: New file.
	* sg_io_v4.c: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* defs.h (decode_sg_io_v3, decode_sg_io_v4): New prototypes.
	* ioctl.c (ioctl_decode): Remove [HAVE_SCSI_SG_H] condition.
	* scsi.c: (print_sg_io_res): Remove.
	(print_sg_io_req): Rename to decode_sg_io, replace print_sg_io_v3_req
	with decode_sg_io_v3, replace print_sg_io_v4_req with decode_sg_io_v4,
	compile uncoditionally.
	(scsi_ioctl): Replace print_sg_io_req and print_sg_io_res
	with decode_sg_io, compile uncoditionally.
	Move [HAVE_SCSI_SG_H] code to sg_io_v3.c.
	Move [HAVE_LINUX_BSG_H] code to sg_io_v4.c.

2017-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	scsi: detect and print changes of interface id.
	* scsi.c (print_sg_io_v3_res): Detect and print changes
	of struct sg_io_hdr.interface_id field between entering and exiting
	syscall.
	(print_sg_io_v4_res): Detect and print changes of struct sg_io_v4.guard
	field between entering and exiting syscall.

	scsi: print field names of all fields being printed.
	* scsi.c (print_sg_io_v3_req): Always print the name
	of struct sg_io_hdr.interface_id field.
	(print_sg_io_v4_req): Always print the name of struct sg_io_v4.guard
	field.
	(print_sg_io_req): Print unknown interface id as an integer.
	(scsi_ioctl): Save interface id on entering syscall and use it
	on exiting syscall.

	scsi: print struct sg_io_hdr.dxfer_direction field name.
	* scsi.c (print_sg_io_v3_req): Print struct sg_io_hdr.dxfer_direction
	field name.

	scsi: print "protocol" and "subprotocol" field names of struct sg_io_v4.
	* scsi.c (print_sg_io_v4_req): Print field names
	of struct sg_io_v4.protocol and struct sg_io_v4.subprotocol.

2017-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	Print hexadecimal integer in error diagnostics using %#x.
	The formerly used format string %x led to misleading output as there was
	no clear indication sometimes whether the printed integer was decimal or
	hexadecimal.

	* aio.c (startup_child, test_ptrace_seize): Print status
	using %#x format specifier instead of %x.

2017-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	aio: print hexadecimal integer using %#x.
	The formerly used format string %x led to misleading output as there was
	no clear indication sometimes whether the printed integer was decimal or
	hexadecimal.

	* aio.c (print_common_flags): Print struct iocb.aio_flags using %#x
	format specifier instead of %x.
	* tests/aio.c (main): Likewise.

2017-01-06  Dmitry V. Levin  <ldv@altlinux.org>

	scsi: rewrite print_sg_io_buffer using printstr_ex(QUOTE_FORCE_HEX)
	As printstr_ex has got QUOTE_FORCE_HEX flag support, there is no need
	to implement it manually any longer.

	* scsi.c (print_uchar): Remove.
	(print_sg_io_buffer): Rewrite using printstr_ex(QUOTE_FORCE_HEX).

2017-01-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	getrandom: print string as hex-escaped.
	Since there is no reason to interpret the value returned by getrandom as
	ASCII string, it makes sense to always print it as a hex-escaped string.

	* getrandom.c (SYS_FUNC(getrandom)): Use printstr_ex instead
	of printstrn, set QUOTE_FORCE_HEX in user_style parameter in order
	to force hex-escaped string formatting.
	* tests/getrandom.test: Remove no longer needed -xx flag as the string
	is always printed in hexadecimal format now.

	Suggested-by: JingPiao Chen <chenjingpiao@gmail.com>

2017-01-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: add support for forcing printing string as hex-escaped.
	This could be useful in cases when some binary data should not be
	interpreted as an ASCII string, but rather as an array of byte values.

	* defs.h (QUOTE_FORCE_HEX): New macro constant.
	* util.c (quote_string): Enable use_hex when QUOTE_FORCE_HEX is set
	in user_style parameter.

2017-01-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	term: do not abort decoding in case of non-verbose output.
	The case of unset verbose is handled by umoven_or_printaddr, moreover,
	exiting at this point is plain wrong and leads to last argument not
	being printed while it should be.

	* term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize,
	decode_modem_flags): Do not check verbose flags explicitly and do not
	exit early if it is not set.

2017-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip fault injection tests on hppa if the kernel is too old.
	* tests/fault_injection.sh: Add the minimal kernel version for hppa.

2017-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip readahead.test on MIPS n64 when built with glibc < 2.25.
	Due to a bug in glibc readahead syscall wrapper on MIPS n64,
	this wrapper cannot be used in readahead.test.

	* tests/readahead.c [HAVE_READAHEAD && LINUX_MIPSN64 && glibc < 2.25]:
	Undefine HAVE_READAHEAD.

	Reported-by: James Cowgill <james410@cowgill.org.uk>

2017-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: replace init_magic with fill_memory.
	Use the same fill_memory/fill_memory_ex interface in all affected tests.

	* tests/ioctl_block.c (init_magic): Remove.
	(main): Replace init_magic with fill_memory.
	* tests/ioctl_evdev.c: Likewise.
	* tests/ioctl_v4l2.c: Likewise.
	* tests/ioctl_mtd.c (magic, init_magic): Remove.
	(main): Replace init_magic with fill_memory.
	* tests/ioctl_rtc.c: Likewise.

2017-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite ioctl_v4l2 test without reliance on init_magic.
	* tests/ioctl_v4l2.c (cc0, cc1, cc2, cc3, fourcc): New macros.
	(main): Use them.  Rewrite expected output without assumptions
	on any particular magic data.

2017-01-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: remove redundant casts in fill_memory{,_ex} invocations.
	* tests/ioctl_loop.c (main): Remove redundant casts of fill_memory
	first argument.
	* tests/kexec_load.c (main): Likewise.
	* tests/perf_event_open.c (main): Likewise.
	* tests/quotactl.c (main): Likewise.
	* tests/mq_sendrecv.c (main): Remove redundant casts of fill_memory_ex
	first argument.
	* tests/quotactl-xfs.c (main): Likewise.

2017-01-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change the type of fill_memory{,_ex} first argument to void *
	As these functions behave like memset, it's more convenient to have
	the first argument of type void * like memset.

	* tests/fill_memory.c (fill_memory, fill_memory_ex): Change the type
	of first argument from "char *" to "void *".
	* tests/tests.h (fill_memory, fill_memory_ex): Likewise.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check non-verbose decoding of LOOP_* ioctls.
	* tests/ioctl_loop-nv.c: New file.
	* tests/ioctl_loop-nv.test: New test.
	* tests/ioctl_loop.c [!ABBREV] (ABBREV): Define to 0.
	(print_loop_info, print_loop_info64): Handle [ABBREV != 0] case.
	* tests/.gitignore: Add ioctl_loop-nv.
	* tests/Makefile.am (check_PROGRAMS): Likewise.

	tests: add more checks of LOOP_* ioctls decoding.
	* tests/ioctl_loop.c: Include <linux/ioctl.h>.
	(magic, lmagic): Move static constants ...
	(main): ... here.  Change types of magic constants to kernel_ulong_t.
	Add more checks.

2017-01-04  JingPiao Chen  <chenjingpiao@gmail.com>
	    Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of LOOP_* ioctls.
	* tests/ioctl_loop.c: New file.
	* tests/ioctl_loop-v.c: Likewise.
	* tests/ioctl_loop.test: New test.
	* tests/ioctl_loop-v.test: Likewise.
	* tests/.gitignore: Add ioctl_loop and ioctl_loop-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioctl_loop.test and ioctl_loop-v.test.

2017-01-04  Dmitry V. Levin  <ldv@altlinux.org>

	Drop vsprintf.c.
	Drop custom vfprintf implementation that was disabled by default.
	Apparently nobody tests strace with this vfprintf enabled, otherwise
	multiple uses of format specifiers not supported by this custom vfprintf
	would not left unnoticed.

	The GNU C library is not the only libc available, so those who want
	faster implementations of libc functions are encouraged to try building
	strace with other libc implementations.

	* vsprintf.c: Remove.
	* Makefile.am (strace_SOURCES): Remove vsprintf.c.
	* defs.h (USE_CUSTOM_PRINTF, strace_vfprintf): Remove.
	* strace.c (tprintf): Replace strace_vfprintf with vfprintf.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	loop: remove unnecessary verbose check.
	The verbose flag is responsible for dereferencing of addresses, and it
	is perfectly handled by umove_or_printaddr; moreover, this early exit
	leads to incorrect formatting of last argument.

	* loop.c (loop_ioctl): Do not check verbose flag explicitly and do not
	exit early if it is not set.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	loop: fix lo_encrypt_key field output.
	lo_encrypt_key is a sized string with its size specified by
	lo_encrypt_key_size field, so take lo_encrypt_key_size into account.

	* loop.c (decode_loop_info, decode_loop_info64): Use minimum of
	LO_KEY_SIZE and lo_encrypt_key_size field value as lo_encrypt_key size.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	loop: print lo_encrypt_key_size field of struct loop_info as unsigned.
	It is converted to an unsigned value in kernel (see loop_info64_from_old
	in drivers/block/loop.c), so let's print it that way despite its type.

	* loop.c (decode_loop_info): Print lo_encrypt_key_size as an uint32_t
	value.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add more checks of unknown ioctl command formatting.
	* tests/ioctl.c (main): Additional check for unknown ioctl command
	decoding.
	* tests/ioctl_evdev.c (main): Likewise.
	* tests/ioctl_dm.c: Include <linux/ioctl.h> for _IOC_SIZE and _IOC_NR.
	(main) <dummy_dm_ioctl1, dummy_dm_ioctl2, dummy_dm_arg>: New constants.
	Add more checks for unknown command formatting.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ioctl: do not print explicit 0x prefix and do not specify minimum width.
	Specifying output width for size argument is rather misleading - it can
	be up to 14 bits in size.  The use of explicit "0x" prefix is
	discouraged because 0x0 looks ugly.  Usage of width specification along
	with alternate form flag leads to inconsistent output for 0.
	Let's use just plain %#x qualifiers instead.

	* ioctl.c (ioctl_print_code): Change printf qualifiers for ioctl command
	type, number and size to "%#x".
	* tests/ioctl.c (main): Update expected test output.
	* tests/ioctl_dm.c (main): Likewise.
	* tests/ioctl_evdev.c (main): Likewise.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	loop: fix printing of the reserved field array items.
	They are of char type, so "hh" length modifier should be used (otherwise
	they are printed incorrectly as they are sign extended implicitly when
	passed as printf arguments in case char is a signed type which is true
	for most compilers).

	* loop.c (decode_loop_info): Change "%#x" printf qualifier to "%#hhx"
	in printing routine for array elements of the "reserved" field of
	loop_info structure.

2017-01-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check ioctl(SIOCGIFCONF) decoding.
	* tests/ioctl_sock_gifconf.c: New file.
	* tests/ioctl_sock_gifconf.test: New test.
	* tests/.gitignore: Add ioctl_sock_gifconf.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioctl_sock_gifconf.test.

	dm.c: add copyright notice.

2017-01-04  Dmitry V. Levin  <ldv@altlinux.org>

	Add scno.h and syscallent.i to .gitignore files.
	* .gitignore: Add /scno.h and /syscallent.i.
	* tests/.gitignore: Add scno.h and syscallent.i.

2017-01-04  JingPiao Chen  <chenjingpiao@gmail.com>

	tests/.gitignore: add generated files that should be ignored.
	* tests/.gitignore: Replace addkey with add_key, add attach-f-p-cmd.

2017-01-03  Dmitry V. Levin  <ldv@altlinux.org>

	Remove checks of __NR_* availability from strace source code.
	* strace.c: Remove __NR_tkill checks, assume it is always defined.
	* util.c: Remove __NR_process_vm_readv checks and fallback definitions,
	assume it is always defined.

	Include "scno.h" in files that check __NR_* constants.
	* strace.c: Include "scno.h".
	* util.c: Likewise.

	Generate scno.h for use during the build of strace itself.
	* Makefile.am: Include scno.am.
	($(strace_OBJECTS)): New rule.

2017-01-01  Dmitry V. Levin  <ldv@altlinux.org>

	Generate scno.h without invoking a generated executable helper.
	Generate scno.h using only those tools that are available for cross
	build.  This allows to use scno.h during the build of strace itself.

	* scno.am: New file.
	* scno.head: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* tests/generate_scno.c: Remove.
	* tests/.gitignore: Remove generate_scno.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(CLEANFILES): Remove scno.h.
	(scno.h, $(scno_dependants)): Remove rules.
	(scno_dependants): Remove.
	($(objects)): New rule.
	Include ../scno.am.

2017-01-01  Dmitry V. Levin  <ldv@altlinux.org>

	Update all publicly shown copyright year number ranges.
	* COPYING: Update copyright year number range.
	* configure.ac: Likewise.
	* strace.c: Likewise.
	* tests/strace-V.test: Use the current year for the check.

2016-12-31  Dmitry V. Levin  <ldv@altlinux.org>

	defs.h: stop including <asm/unistd.h>
	Limit the number of files where <asm/unistd.h> is included
	to only those few that need it.

	* defs.h: Do not include <asm/unistd.h>.
	* clone.c: Include <asm/unistd.h>.
	* strace.c: Likewise.
	* syscall.c: Likewise.
	* util.c: Likewise.

2016-12-30  Dmitry V. Levin  <ldv@altlinux.org>

	tests: do not use BUILT_SOURCES.
	* tests/Makefile.am (ksysent.$(OBJEXT)): New rule.
	(BUILT_SOURCES): Remove.

2016-12-30  Dmitry V. Levin  <ldv@altlinux.org>

	Fix cross build.
	This fixes cross build regression introduced by commit
	v4.15-39-g605a705a63d533dceb3c2d489468fcd3aed3963c.

	* tests/Makefile.am (BUILT_SOURCES): Remove scno.h
	(objects, scno_dependants): New variables.
	($(scno_dependants)): New rule.

	Reported-by: Joakim Bech <joakim.bech@linaro.org>

2016-12-30  Dmitry V. Levin  <ldv@altlinux.org>

	tests: do not use defs.h and syscall.h.
	* tests/generate_scno.c: Include "tests.h", "sysent.h", <stdio.h>,
	<string.h>, and <asm/unistd.h> instead of "defs.h" and "syscall.h".
	* tests/ksysent.c: Likewise.
	* tests/nsyscalls.c: Include "tests.h", "sysent.h", <errno.h>,
	<stdio.h>, and <unistd.h> instead of "defs.h" and "syscall.h".

	Move definition of struct sysent and trace flags to a separate file.
	* sysent.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h: Include it.
	(struct sysent, TRACE_FILE, TRACE_IPC, TRACE_NETWORK, TRACE_PROCESS,
	TRACE_SIGNAL, TRACE_DESC, TRACE_MEMORY, SYSCALL_NEVER_FAILS,
	STACKTRACE_INVALIDATE_CACHE, STACKTRACE_CAPTURE_ON_ENTER,
	TRACE_INDIRECT_SUBCALL, COMPAT_SYSCALL_TYPES): Remove.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Mpersify SIOC* ioctls.
	struct ifreq and struct ifconf are ABI-dependent and should have been
	mpersified.

	* defs.h (sock_ioctl): Remove prototype.
	* sock.c (struct_ifconf, struct_ifreq): New typedefs.
	(DEF_MPERS_TYPE(struct_ifconf), DEF_MPERS_TYPE(struct_ifreq),
	MPERS_DEFS): New includes.
	(print_ifreq, print_ifc_len, print_ifconf_ifreq): Replace struct ifreq
	with struct_ifreq.
	(decode_ifconf): Replace struct ifconf with struct_ifconf, struct ifreq
	with struct_fireq.
	(sock_ioctl): Wrap into MPERS_PRINTER_DECL.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	sock: rewrite decode_ifconf.
	* sock.c (decode_ifconf): Rewrite.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update LOOP_* ioctl flags constants.
	* configure.ac (AC_CHECK_DECLS): Add LO_FLAGS_USE_AOPS
	and LO_FLAGS_DIRECT_IO.
	* xlat/loop_flags_options.in: Likewise.  Add default values
	for constants.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	loop: add fallback definitions for LOOP_* ioctl command constants.
	Since these are architecture-independent and have been added over the
	kernel's lifetime, it makes sense to have these definitions in strace
	itself.

	* xlat/loop_cmds.in: New file.
	* loop.c: Include "xlat/loop_cmds.h".
	(loop_ioctl): Eliminate conditional compilation based on availability
	of LOOP_* constant definitions.

2016-12-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: extend syntax.
	* xlat/gen.sh: Implement #stop directive that stops preprocessor
	at the line it has been encountered during the first pass.  This could
	be used, for example, to provide fallback definitions for constants
	without defining xlat tables.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	loop: mpersify struct loop_info and loop_ioctl function.
	struct loop_info contains fields of type long, so it definitely should
	have been mpersified.

	* defs.h (loop_ioctl): Remove prototype.
	* loop.c (struct_loop_info): New typedef.
	Include DEF_MPERS_TYPE(struct_loop_info) and MPERS_DEFS.
	(decode_loop_info): Replace struct loop_info with struct_loop_info.
	Cast lo_inode, lo_init[0], and lo_init[1] to kernel_ulong_t and print
	them using appropriate format specifiers.
	(loop_ioctl): Wrap into MPERS_PRINTER_DECL.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	loop: print lo_device and lo_rdevice fields using print_dev_t.
	* loop.c (decode_loop_info, decode_loop_info64): Use print_dev_t
	for printing lo_device and lo_rdevice fields.

2016-12-29  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Move device number printing code into a separate routine.
	* print_dev_t.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (print_dev_t): New prototype.
	* dm.c: Do not include <sys/sysmacros.h>.
	(dm_decode_device, dm_print_dev, dm_decode_dm_name_list): Use
	print_dev_t function for printing device numbers.
	* mknod.c: Do not include <sys/sysmacros.h>.
	(decode_mknod): Use print_dev_t function for printing device number.
	* print_struct_stat.c: Do not include <sys/sysmacros.h>.
	(print_struct_stat): Use print_dev_t function for printing device
	numbers.

2016-12-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance invalid address decoding check in seccomp-strict.test.
	* tests/seccomp-strict.c (main): Change the type of addr variable
	containg the invalid address from unsigned long to kernel_ulong_t,
	print it using %#llx format.

2016-12-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of prctl PR_GET_TID_ADDRESS operation.
	* tests/prctl-tid_address.c: New file.
	* tests/prctl-tid_address.test: New test.
	* tests/.gitignore: Add prctl-tid_address.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add prctl-tid_address.test.

2016-12-28  Dmitry V. Levin  <ldv@altlinux.org>

	Update the publicly shown copyright information.
	Set the publicly shown copyright holder to "The strace developers.".

	* COPYING: Update copyright information.
	* configure.ac: Add AC_COPYRIGHT.
	* strace.c (print_version): New function.
	(init): Use it.
	* tests/strace-V.test: Update expected output.

2016-12-28  Dmitry V. Levin  <ldv@altlinux.org>

	configure: specify project URL.
	* configure.ac (AC_INIT): Add URL.

2016-12-28  Seraphime Kirkovski  <kirkseraph@gmail.com>

	Document signal injection.
	* strace.1: Describe :signal=SIG option of the fault injection syntax.
	* NEWS: Mention signal injection.

2016-12-28  Seraphime Kirkovski  <kirkseraph@gmail.com>

	Implement signal injection.
	This extends the fault injection capability with :signal=SIG option
	which injects a signal on entering each syscall from the specified set.

	:signal and :error options are complementary, if they are both specified
	the syscall will be fault injected as usual and the specified signal
	will be delivered to the tracee.

	* defs.h (struct fault_opts): Change the type of err field to int16_t,
	add signo field.
	(trace_syscall): Add a pointer argument.
	* qualify.c: Include "nsig.h".
	(parse_fault_token): Handle signal= option.
	(qualify_fault): Update default fault_opts.
	* strace.c (trace): Forward signal number from trace_syscall
	to ptrace_restart(PTRACE_SYSCALL).
	* syscall.c (inject_syscall_fault_entering): Add pointer argument,
	save there the signal number specified by fault options.  Do not inject
	a syscall fault unless instructed by fault options.
	(update_syscall_fault_exiting): Update the error code injection check.
	(trace_syscall_entering): Add pointer argument, forward it to
	inject_syscall_fault_entering.
	(trace_syscall): Add pointer argument, forward it to
	trace_syscall_entering.

2016-12-28  Dmitry V. Levin  <ldv@altlinux.org>

	Update README.md.
	* README.md: Update homepage URL, mention command-line interface
	and tampering capabilities in the description.

2016-12-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify prctl-arg2-intptr.test.
	Robustify prctl-arg2-intptr.test against unrelated prctl invocations.

	* tests/prctl-arg2-intptr.test: Filter out unrelated PR_GET_*
	and PR_SET_* prctl calls.

2016-12-27  Dmitry V. Levin  <ldv@altlinux.org>

	signal: remove redundant checks around NSIG.
	* signal.c (struct old_sigaction, struct new_sigaction,
	struct new_sigaction32): Remove safety checks for NSIG >= sizeof(long).

	Introduce NSIG_BYTES.
	* nsig.h (NSIG_BYTES): New macro.
	* desc.c: Use it in comments instead of NSIG.
	* epoll.c: Likewise.
	* poll.c: Likewise.
	* signalfd.c: Likewise.
	* signal.c: Likewise.
	(sprintsigmask_n, print_sigset_addr_len_limit): Use it instead of NSIG.
	* linux/alpha/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/arm/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/crisv10/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/m68k/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/mips/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/powerpc/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/s390/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/sparc/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/x86_64/arch_sigreturn.c (arch_sigreturn): Likewise.
	* tests/pselect6.c (main): Likewise.

	Move NSIG ifdefery to a separate header file.
	* nsig.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* signal.c: Include "nsig.h" instead of <signal.h>, remove
	NSIG workarounds.
	* sigreturn.c: Likewise.
	* syscall.c: Likewise.
	* tests/pselect6.c: Likewise.

	Introduce ANY_WORDSIZE_LESS_THAN_KERNEL_LONG macro.
	* defs.h (ANY_WORDSIZE_LESS_THAN_KERNEL_LONG): New macro.
	(truncate_klong_to_current_wordsize,
	truncate_kulong_to_current_wordsize): Use it.
	* mem.c (SYS_FUNC(old_mmap)): Likewise.
	* util.c (umoven, umovestr, dumpiov_upto): Likewise.
	* syscall.c (trace_syscall_exiting): Likewise.

	Simplify personality checks in msghdr.c and signal.c.
	* msghdr.c: Check for [!current_wordsize] instead
	of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4].
	* signal.c: Likewise.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Replace widen_to_long with truncate_klong_to_current_wordsize.
	* defs.h (widen_to_long): Remove.
	(truncate_klong_to_current_wordsize): New static inline function.
	* aio.c (SYS_FUNC(io_submit), SYS_FUNC(io_getevents): Use it
	instead of widen_to_long.
	* linux/sparc64/get_syscall_args.c (get_syscall_args): Update comment.
	* linux/x86_64/get_syscall_args.c (get_syscall_args): Likewise.

	Replace widen_to_ulong with truncate_kulong_to_current_wordsize.
	* defs.h (widen_to_ulong): Remove.
	(truncate_kulong_to_current_wordsize): New static inline function.
	* io.c (do_preadv, do_pwritev): Use it instead of widen_to_ulong.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Simplify print_lld_from_low_high_val ifdefery.
	The demise of HAVE_STRUCT_TCB_EXT_ARG opens the way for a simpler
	implementation.

	* io.c (print_lld_from_low_high_val): Merge [SIZEOF_LONG > 4
	&& SIZEOF_LONG == SIZEOF_LONG_LONG]
	and [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] cases
	into a single [SIZEOF_KERNEL_LONG_T > 4] case.
	[SIZEOF_KERNEL_LONG_T == 4]: Use direct casts to long long
	instead of zero_extend_signed_to_ull.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Simplify getllval ifdefery.
	The demise of HAVE_STRUCT_TCB_EXT_ARG opens the way for a simpler
	implementation.

	* util.c (getllval): Merge [SIZEOF_LONG > 4
	&& SIZEOF_LONG == SIZEOF_LONG_LONG]
	and [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] cases
	into a single [SIZEOF_KERNEL_LONG_T > 4] case.

2016-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	prctl: print pointer returned by PR_GET_TID_ADDRESS as kernel long.
	Since there is no compat handler for x32/n32, kernel returns kernel's
	long as a result of the call.

	Interesting, does any callee out there actually care to have enough room
	allocated for kernel long?

	* prctl.c (SYS_FUNC(prctl)): Use printnum_kptr instead of printnum_ptr
	to print the value stored at address pointed by addr2 argument
	of PR_GET_TID_ADDRESS operation.

2016-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add functions for printing pointers of kernel_ulong_t size.
	In cases where no compat for x32/n32 is implemented, pointer is of
	kernel's long size, so it should be printed appropriately.

	* defs.h [!current_klongsize] (printnum_addr_klong_int): New prototype.
	(printnum_kptr): New macro.
	* util.c [!current_klongsize] (printnum_addr_klong_int): New function.

2016-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Print indirect pointers as pointers.
	Originally, printnum_long_int was used, but it prints NULL incorrectly.

	* defs.h (DECL_PRINTNUM_ADDR): New macro.
	(DECL_PRINTNUM_ADDR(int), DECL_PRINTNUM_ADDR(int64)): New prototypes.
	[!current_wordsize] (printnum_addr_long_int): New prototype.
	[!current_wordsize] (printnum_ptr): Use it.
	[current_wordsize > 4] (printnum_ptr): Use printnum_addr_int64.
	[current_wordsize == 4] (printnum_ptr) Use printnum_addr_int.
	* util.c (DEF_PRINTNUM_ADDR): New macro.
	(DEF_PRINTNUM_ADDR(int, unsigned int),
	DEF_PRINTNUM_ADDR(int64, uint64_t)): New macro instantiations that
	provide printnum_addr_int and printnum_addr_int64, accordingly.
	[!current_wordsize] (printnum_addr_long_int): New function.
	* xet_robust_list.c (sprintaddr): New function.
	(main): Use it, update expected output.
	* tests/ipc_sem.c (main): Update expected output.

2016-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ipc_sem: print 4th argument of semctl syscall as an address.
	* ipc_sem.c (SYS_FUNC(semctl)): Print 4th argument using printaddr.
	* tests/ipc_sem.c (cleanup): Update expected output.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Do not define printnum_long_int on systems with constant current_wordsize
	* defs.h: Check [!current_wordsize] instead
	of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] to select
	definitions of printnum_slong, printnum_ulong, and printnum_ptr.
	* util.c: Check [!current_wordsize] instead
	of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] to decide
	whether to compile printnum_long_int.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	umoven: detect invalid addresses.
	Do not silently truncate tracee addresses to current_wordsize.
	After transition from long to kernel_ulong_t there should be no sign
	extension issues with tracee addresses, and invalid addresses should
	be printed properly.

	* util.c (umoven): Check [SIZEOF_KERNEL_LONG_T > 4] instead
	of [SIZEOF_LONG > 4], reject addresses that do not fit into
	current_wordsize.
	* tests/umoven-illptr.c: New file.
	* tests/umoven-illptr.test: New test.
	* tests/.gitignore: Add umoven-illptr.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add umoven-illptr.test.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	umovestr: detect invalid addresses.
	Do not silently truncate tracee addresses to current_wordsize.
	After transition from long to kernel_ulong_t there should be no sign
	extension issues with tracee addresses, and invalid addresses should
	be printed properly.

	* util.c (umovestr): Check [SIZEOF_KERNEL_LONG_T > 4] instead
	of [SIZEOF_LONG > 4], reject addresses that do not fit into
	current_wordsize.
	* tests/umovestr-illptr.c: New file.
	* tests/umovestr-illptr.test: New test.
	* tests/.gitignore: Add umovestr-illptr.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add umovestr-illptr.test.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	lseek: simplify _llseek syscall decoder.
	After transition from long to kernel_ulong_t the implementation
	could be made a bit simpler.

	* lseek.c (SYS_FUNC(llseek)): Use direct cast to long long instead
	of zero_extend_signed_to_ull.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	lseek: merge two different implementations of lseek syscall decoder.
	After transition from long to kernel_ulong_t there are no mo
	complications that required to keep a separate implementation
	for x32 and mips n32.

	* lseek.c (SYS_FUNC(lseek)): Merge two different implementations
	into a single one.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Remove HAVE_STRUCT_TCB_EXT_ARG, ext_arg, and u_lrval.
	After transition from long to kernel_ulong_t these fields
	are no longer needed.

	* defs.h (HAVE_STRUCT_TCB_EXT_ARG): Remove.
	(struct tcb) [HAVE_STRUCT_TCB_EXT_ARG]: Remove.
	[HAVE_STRUCT_TCB_EXT_ARG]: Remove.
	(RVAL_MASK): Update.
	* io.c (print_lld_from_low_high_val): Check
	[SIZEOF_KERNEL_LONG_T > SIZEOF_LONG]
	instead of [HAVE_STRUCT_TCB_EXT_ARG].
	Use u_arg instead of ext_arg.
	* linux/mips/get_error.c (get_error) [LINUX_MIPSN32]: Remove.
	* linux/mips/get_syscall_args.c (get_syscall_args) [LINUX_MIPSN32]:
	Remove.
	[LINUX_MIPSN64]: Extend to [LINUX_MIPSN32].
	* linux/x86_64/get_error.c (get_error) [X32]: Remove.
	* linux/x86_64/get_syscall_args.c (get_syscall_args) [X32]: Remove.
	* lseek.c: Check [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG]
	instead of [HAVE_STRUCT_TCB_EXT_ARG].
	[SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] (SYS_FUNC(lseek)): Use u_arg
	instead of ext_arg.  Use RVAL_UDECIMAL instead of RVAL_LUDECIMAL.
	* mem.c (SYS_FUNC(mmap)): Pass offset syscall argument directly
	to print_mmap.
	* syscall.c (trace_syscall_exiting) [HAVE_STRUCT_TCB_EXT_ARG]: Remove.
	* times.c (SYS_FUNC(times)): Use RVAL_UDECIMAL instead
	of RVAL_LUDECIMAL.
	* util.c (getllval): Check [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG]
	instead of [HAVE_STRUCT_TCB_EXT_ARG].  Use u_arg instead of ext_arg.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Remove getarg_klu.
	After transition from long to kernel_ulong_t we no longer need
	tcp->ext_arg, and therefore a function to access it is also no longer
	needed.

	* defs.h (getarg_klu): Remove prototype.
	* util.c (getarg_klu): Remove.
	(printargs): Access tcp->u_arg directly
	* bjm.c (SYS_FUNC(init_module)): Likewise.
	* clone.c (SYS_FUNC(unshare)): Likewise.
	* fadvise.c (SYS_FUNC(fadvise64)): Likewise.
	* kcmp.c (SYS_FUNC(kcmp)): Likewise.
	* kexec.c (SYS_FUNC(kexec_file_load)): Likewise.
	* keyctl.c (SYS_FUNC(keyctl)): Likewise.
	* lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise.
	* mem.c (do_mprotect): Likewise.
	* mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise.
	* pkeys.c (SYS_FUNC(pkey_alloc)): Likewise.
	* prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)):
	Likewise.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Remove printaddr_klu.
	After transition from long to kernel_ulong_t we no longer need
	two versions of printaddr function.

	* defs.h (printaddr): Remove.
	(printaddr_klu): Rename to printaddr.
	* util.c (printaddr_klu): Likewise.
	* bjm.c (SYS_FUNC(init_module)): Replace printaddr_klu with printaddr.
	* mem.c (do_mprotect): Likewise.

2016-12-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of a subset of prctl operations.
	Check decoding of prctl operations that take the second syscall argument
	as a pointer to an integer.

	* tests/prctl-arg2-intptr.c: New file.
	* tests/prctl-arg2-intptr.test: New test.
	* tests/.gitignore: Add prctl-arg2-intptr.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add prctl-arg2-intptr.test.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Automatically replace PRI_kr[dux] with PRI_kl[dux]
	Remove temporary macros created for transition from long
	to kernel_ulong_t.

	Automatically replace PRI_kr[dux] with PRI_kl[dux] using
	$ git grep -l 'PRI_kr[dux]' | xargs sed -ri 's/PRI_kr([dux])/PRI_kl\1/g'

	* defs.h (PRI_krd, PRI_kru, PRI_krx): Remove.  All users updated.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Automatically replace kernel_(scno|ureg)_t with kernel_ulong_t.
	Remove temporary types created for transition from long
	to kernel_ulong_t.

	Automatically replace kernel_scno_t and kernel_ureg_t with
	kernel_ulong_t using
	$ git grep -El 'kernel_(scno|ureg)_t' |
	  xargs sed -ri 's/kernel_(scno|ureg)_t/kernel_ulong_t/g'

	* kernel_types.h (kernel_scno_t, kernel_ureg_t): Remove.
	All users updated.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Redirect kernel_ureg_t and kernel_scno_t from unsigned long to kernel_ulong_t
	* defs.h (struct tcb): Change u_rval type from long to kernel_long_t.
	(PRI_krd, PRI_kru, PRI_krx): Redirect to PRI_kld, PRI_klu, and PRI_klx.
	* kernel_types.h (kernel_scno_t, kernel_ureg_t): Redirect
	to kernel_ulong_t.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Print kernel_ureg_t and kernel_scno_t using dedicated format strings.
	Prepare for the change of kernel_ureg_t and kernel_scno_t from
	unsigned long to kernel_ulong_t.

	* defs.h (PRI_krd, PRI_kru, PRI_krx): New temporary macros.
	All users updated.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	vm_read_mem: detect address truncation.
	When sizeof(kernel_ureg_t) > sizeof(long), the tracee address passed
	to vm_read_mem could be silently truncated.  Detect this situation
	and return EIO when the tracee address does not fit into unsigned long.

	* util.c (vm_read_mem): Save raddr argument into a temporary variable
	truncated_raddr of type unsigned long.  Set errno to EIO and return -1
	when truncated_raddr does not equal to raddr.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	trace_syscall_exiting: prepare personality check for u_rval type change.
	* syscall.c (trace_syscall_exiting): Check for sizeof(tcp->u_rval)
	instead of sizeof(long) when deciding how to print tcp->u_rval.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Use ptr_to_kulong instead of explicit casts of pointers to kernel_ureg_t
	Direct casts to kernel_ureg_t will not work after the change
	of kernel_ureg_t from unsigned long to kernel_ulong_t.

	* defs.h (ptr_to_kulong): New macro.
	* block.c (print_blkpg_req): Use it instead of explicit casts
	to kernel_ureg_t.
	* btrfs.c (btrfs_ioctl): Likewise.
	* evdev.c (ff_effect_ioctl): Likewise.
	* mmsghdr.c (dumpiov_in_mmsghdr): Likewise.
	* msghdr.c (print_struct_msghdr, dumpiov_in_msghdr): Likewise.
	* mtd.c (decode_mtd_oob_buf): Likewise.
	* printsiginfo.c (printsigval, print_si_info): Likewise.
	* scsi.c (print_sg_io_v3_req, print_sg_io_v3_res): Likewise.
	* sigaltstack.c (print_stack_t): Likewise.
	* sock.c (decode_ifconf): Likewise.
	* sysctl.c (SYS_FUNC(sysctl)): Likewise.
	* util.c (dumpiov_upto): Likewise.
	* v4l2.c (print_v4l2_framebuffer, print_v4l2_ext_control,
	print_v4l2_ext_controls): Likewise.

2016-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	umove*: remove redundant casts.
	* util.c (umoven, umovestr): Remove casts from unsigned long to pointer.

	upoke: remove redundant casts.
	* upoke.c (upoke): Remove casts from unsigned long to pointer.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	signal: cleanup decoding of sa_handler and sa_restorer.
	Change type of sa_handler and sa_restorer fields from function pointers
	to unsigned long.  This saves the code from a lot of casts between
	pointers and integers.

	Rename __sa_handler to sa_handler__ as names starting with underscore
	symbol are reserved and should not be used.

	* signal.c (old_sigaction): Rename __sa_handler to sa_handler__,
	all users updated.  Change the type of sa_handler__ and sa_restorer
	from pointer to unsigned long.
	(old_sigaction32): Rename __sa_handler to sa_handler__, all users
	updated.
	(decode_old_sigaction): Remove now redundant casts from
	old_sigaction32.sa_handler__ to old_sigaction.sa_handler__,
	from old_sigaction32.sa_restorer to old_sigaction.sa_restorer,
	and from old_sigaction.sa_handler__ to unsigned long.  Print
	old_sigaction.sa_restorer using printaddr.
	* signal.c (new_sigaction): Rename __sa_handler to sa_handler__,
	all users updated.  Change the type of sa_handler__ and sa_restorer
	from pointer to unsigned long.
	(new_sigaction32): Rename __sa_handler to sa_handler__, all users
	updated.
	(decode_new_sigaction): Remove now redundant casts from
	new_sigaction32.sa_handler__ to new_sigaction.sa_handler__,
	from new_sigaction32.sa_restorer to new_sigaction.sa_restorer,
	and from new_sigaction.sa_handler__ to unsigned long.  Print
	new_sigaction.sa_restorer using printaddr.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	signal: change signal handler address type from unsigned long to kernel_ureg_t
	* signal.c (get_sa_handler_str, print_sa_handler): Change handler type
	from unsigned long to kernel_ureg_t.

	quota: change address argument type from unsigned long to kernel_ureg_t.
	* quota.c (decode_cmd_data): Change the type of data argument
	from unsigned long to kernel_ureg_t.

	execve: prepare for handling big pointers.
	* execve.c (printargv): Change cp.p64 type from unsigned long
	to kernel_ulong_t so it could handle wordsize > sizeof(long) properly.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	clone: print clone flags without truncation.
	The flags argument is defined in kernel as unsigned long,
	so change its decoding to avoid truncation.

	* clone.c (SYS_FUNC(clone)): Change flags type from unsigned long
	to kernel_ureg_t, print it using printflags64 instead of printflags.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	Use printxval64 instead of printxval_long.
	After the change of tcb.u_arg type from long to kernel_ureg_t it is safe
	to stop using printxval_long proxy and pass syscall arguments directly
	to printxval64.

	* defs.h (printxval_long): Remove.
	* fcntl.c (print_fcntl): Replace printxval_long with printxval64.
	* mtd.c (mtd_ioctl): Likewise.
	* numa.c (SYS_FUNC(mbind)): Likewise.
	* or1k_atomic.c [OR1K] (SYS_FUNC(or1k_atomic)): Likewise.
	* sysmips.c [MIPS] (SYS_FUNC(sysmips)): Likewise.
	* term.c (term_ioctl): Likewise.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	Use printflags64 instead of printflags_long.
	After the change of tcb.u_arg type from long to kernel_ureg_t it is safe
	to stop using printflags_long proxy and pass syscall arguments directly
	to printflags64.

	* defs.h (printflags_long): Remove.
	* fcntl.c (print_fcntl): Replace printflags_long with printflags64.
	* numa.c (SYS_FUNC(get_mempolicy)): Likewise.
	* perf.c (SYS_FUNC(perf_event_open)): Likewise.
	* sram_alloc.c [BFIN] (SYS_FUNC(sram_alloc)): Likewise.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	upeek, upoke: change argument types from long to unsigned long.
	* defs.h (upeek, upoke): Change offset argument type from long
	to unsigned long.  Change res argument type from long to kernel_ureg_t.
	* upeek.c (upeek): Likewise.
	* upoke.c (upoke.c): Likewise.
	* syscall.c (print_pc) [ARCH_PC_PEEK_ADDR]: Change pc type from long
	to kernel_ureg_t.
	* linux/aarch64/arch_regs.c (arm_sp_ptr): Remove redundant cast.
	* linux/metag/get_syscall_args.c (get_syscall_args): Likewise.
	* linux/sh/get_syscall_result.c (get_syscall_result_regs): Likewise.
	* linux/sh64/get_syscall_result.c (get_syscall_result_regs): Likewise.
	* linux/powerpc/getregs_old.c (getregs_old): Remove redundant casts.
	* linux/alpha/arch_getrval2.c (getrval2): Change r20 type from long
	to unsigned long.
	* linux/alpha/arch_regs.c (alpha_r0, alpha_a3): Change type from long
	to unsigned long.
	* linux/bfin/arch_regs.c (bfin_r0): Likewise.
	* linux/crisv10/arch_regs.c (cris_r10): Likewise.
	* linux/hppa/arch_regs.c (hppa_r28): Likewise.
	* linux/ia64/arch_regs.c (IA64_PSR_IS): Likewise.
	* linux/microblaze/arch_regs.c (microblaze_r3): Likewise.
	* linux/sh/arch_regs.c (sh_r0): Likewise.
	* linux/sh64/arch_regs.c (sh64_r9): Likewise.
	* linux/xtensa/arch_regs.c (xtensa_a2): Likewise.
	* linux/alpha/arch_sigreturn.c (arch_sigreturn): Change addr type
	from long to unsigned long.
	* linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/alpha/get_scno.c (arch_get_scno): Update for the change
	of signedness.
	* linux/arc/get_syscall_args.c (get_syscall_args): Change arc_args type
	from pointer to long to pointer to unsigned long.
	* linux/arm/arch_regs.c (arm_sp_ptr): Change type from pointer to long
	to pointer to unsigned long.
	* linux/arm/arch_regs.h (arm_sp_ptr): Likewise.
	* linux/i386/arch_regs.c (i386_esp_ptr): Likewise.
	* linux/i386/arch_regs.h (i386_esp_ptr): Likewise.
	* linux/m68k/arch_regs.c (m68k_usp_ptr): Likewise.
	* linux/m68k/arch_regs.h (m68k_usp_ptr): Likewise.
	* linux/ia64/get_syscall_args.c (get_syscall_args): Use umove
	instead of umoven.
	* linux/sh/arch_getrval2.c (getrval2): Change val type from long
	to unsigned long.

	arch_sigreturn: change tracee address type from long to unsigned long.
	* linux/arm/arch_sigreturn.c (arch_sigreturn): Change addr variable
	type from long to unsigned long.
	* linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/m68k/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/powerpc/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/s390/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/sparc/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise.
	* linux/crisv10/arch_sigreturn.c (arch_sigreturn): Change the type
	of addr and regs variables from long to unsigned long.
	* linux/mips/arch_sigreturn.c (arch_sigreturn): Change addr variable
	type from long to kernel_ureg_t.
	* linux/x86_64/arch_sigreturn.c (arch_sigreturn): Change the type
	of offset and addr variables from long to kernel_ureg_t.

	kexec: change flags type from unsigned long to kernel_ureg_t.
	* kexec.c (SYS_FUNC(kexec_load)): Change n variable type
	from unsigned long to kernel_ureg_t.  Use printxval64 instead
	of printxval_long.  Use printflags64 instead of printflags_long.

	kexec: change types of pointers and sizes to kernel_ureg_t.
	* kexec.c (print_seg): Change the type of *seg and seg_buf variables
	from unsigned long to kernel_ureg_t.
	(print_kexec_segments): Change len argument type from unsigned long
	to kernel_ureg_t.  Change seg variable type from unsigned long
	to kernel_ureg_t.

	printsiginfo: change len argument type from unsigned long to kernel_ureg_t
	* printsiginfo.c (print_siginfo_array): Change len argument type
	from unsigned long to kernel_ureg_t.

	signal: change address argument type from unsigned long to kernel_ureg_t
	* signal.c (print_sigqueueinfo): Change address argument type
	from unsigned long to kernel_ureg_t.

	statfs64: change size argument type from unsigned long to kernel_ureg_t.
	* defs.h (print_struct_statfs64): Change size argument type
	from unsigned long to kernel_ureg_t.
	* print_statfs.c (print_struct_statfs64): Likewise.
	* fetch_struct_statfs.c (fetch_struct_statfs64): Likewise.
	* fstatfs64.c (SYS_FUNC(fstatfs64)): Pass size argument directly
	to print_struct_statfs64.
	* statfs64.c (SYS_FUNC(statfs64)): Likewise.

	Cast tcp->u_rval to kernel_ureg_t instead of unsigned long.
	* fcntl.c (print_fcntl): Cast tcp->u_rval to kernel_ureg_t instead
	of unsigned long.
	* membarrier.c (SYS_FUNC(membarrier)): Likewise.
	* prctl.c (SYS_FUNC(prctl)): Likewise.
	* sched.c (SYS_FUNC(sched_getscheduler)): Likewise.
	* time.c (do_adjtimex): Likewise.

	decode_sockbuf: change addrlen argument type from long to kernel_ureg_t.
	* net.c (decode_sockbuf): Change addrlen argument type from long
	to kernel_ureg_t.

	netlink: change size types from unsigned long to kernel_ureg_t.
	* defs.h (decode_netlink): Change len argument type from unsigned long
	to kernel_ureg_t.
	* netlink.c (fetch_nlmsghdr): Likewise.
	(decode_nlmsghdr_with_payload): Likewise.  Change nlmsg_len variable
	type from unsigned long to unsigned int.
	(decode_netlink): Change the type of len argument and next_len variable
	from unsigned long to kernel_ureg_t.  Change nlmsg_len variable type
	from unsigned long to unsigned int.

	ipc_msg: change size types from unsigned long to kernel_ureg_t.
	* ipc_msg.c (tprint_msgsnd): Change count argument type
	from unsigned long to kernel_ureg_t.  Change flags argument type
	from unsigned long to unsigned int.
	(tprint_msgrcv): Change the type of count and msgtyp arguments
	from unsigned long to kernel_ureg_t.
	(fetch_msgrcv_args): Change *pair type from unsigned long
	to kernel_ureg_t.
	(SYS_FUNC(msgrcv)): Change pair type from unsigned long
	to kernel_ureg_t.
	* print_msgbuf.c (tprint_msgbuf): Change count argument type
	from unsigned long to kernel_ureg_t.

	dumpiov_upto: change size types from unsigned long to kernel_ureg_t.
	* defs.h (dumpiov_upto): Change data_size argument type
	from unsigned long to kernel_ureg_t.
	* util.c (dumpiov_upto): Change the type of data_size argument
	and iov_len variable from unsigned long to kernel_ureg_t.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	msghdr: change cmsghdr size types from size_t to unsigned int.
	As the kernel does not accept control messages longer than the value
	of int sysctl_optmem_max kernel variable exported as
	/proc/sys/net/core/optmem_max, we do not print them either.

	Since unsigned int has enough room to contain any valid control message
	size, change all internal cmsghdr size types from size_t
	to unsigned int.

	* msghdr.c (print_scm_rights, print_scm_creds, print_scm_security,
	print_cmsg_ip_pktinfo, print_cmsg_uint, print_cmsg_uint8_t,
	print_cmsg_ip_opts, print_cmsg_ip_recverr, print_cmsg_ip_origdstaddr,
	cmsg_printer, print_cmsg_type_data): Change data_len argument type
	from size_t to unsigned int.
	(cmsg_socket_printers): Change min_len type from size_t to unsigned int.
	(decode_msg_control): Change the type of in_control_len argument,
	cmsg_len, and len variables from size_t to kernel_ureg_t.
	Change the type of cmsg_size, control_len, and buf_len variables
	from size_t to unsigned int.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	msghdr: change register based size types from unsigned long to kernel_ureg_t
	* defs.h (dumpiov_in_msghdr): Change data_size argument type
	from unsigned long to kernel_ureg_t.
	* msghdr.h (print_struct_msghdr): Likewise.
	* msghdr.c (print_struct_msghdr): Likewise.  Cast msghdr.msg_iovlen
	and msghdr.msg_controllen to kernel_ureg_t instead of unsigned long.
	(decode_msghdr, dumpiov_in_msghdr): Change data_size argument type
	from unsigned long to kernel_ureg_t.
	(SYS_FUNC(sendmsg)): Pass -1 instead of -1UL as data_size argument
	to decode_msghdr.
	* mmsghdr.c (print_struct_mmsghdr): Pass (kernel_ureg_t) -1 instead
	of -1UL as data_size argument to print_struct_msghdr.
	(dumpiov_in_mmsghdr): Cast msghdr.msg_iovlen to kernel_ureg_t instead
	of unsigned long.
	* syscall.c (dumpio): Pass -1 instead of -1UL as data_size argument
	to dumpiov_in_msghdr

	mq: remove redundant u_rval check.
	* mq.c (SYS_FUNC(mq_timedreceive)): Do not check for tcp->u_rval < 0,
	syserror(tcp) is enough, and printstrn can handle len < 0 anyway.

	io: change size types from unsigned long to kernel_ureg_t.
	* defs.h (tprint_iov_upto): Change the type of len and data_size
	arguments from unsigned long to kernel_ureg_t.
	(tprint_iov): Change the type of len argument from unsigned long
	to kernel_ureg_t.
	* io.c (print_iovec_config): Change data_size type from unsigned long
	to kernel_ureg_t.
	(print_iovec): Change the type of *iov, iov_buf, and len variables
	from unsigned long to kernel_ureg_t.
	(tprint_iov_upto): Change the type of len and data_size arguments, and
	the type of iov variable from unsigned long to kernel_ureg_t.

	mount: change flags type from unsigned long to kernel_ureg_t.
	* mount.c (SYS_FUNC(mount)): Change the type of flags from unsigned long
	to kernel_ureg_t, use printflags64 instead of printflags_long
	to print it.

	mem: change mmap arguments type from unsigned long to kernel_ureg_t.
	* mem.c (print_mmap): Change the type of len, prot, and flags
	from unsigned long to kernel_ureg_t.  Use printflags64 instead
	of printflags_long.  Use printxval64 instead of printxval_long.
	(SYS_FUNC(old_mmap)): Check for current_klongsize instead
	of [AARCH64 || X86_64] to take X32 into account.
	(SYS_FUNC(mremap)): Use printflags64 instead of printflags_long.
	(SYS_FUNC(remap_file_pages)): Change the type of size, prot, pgoff, and
	flags from unsigned long to kernel_ureg_t.  Use printflags64 instead
	of printflags_long.  Use printxval64 instead of printxval_long.
	[POWERPC] (SYS_FUNC(subpage_prot)): Change the type of len and nmemb
	from unsigned long to kernel_ureg_t.

	numa: change size arguments type from unsigned long to kernel_ureg_t.
	* numa.c (print_node, print_addr): Add kernel_ureg_t support.
	(print_nodemask): Change type of maxnodes argument from unsigned long
	to kernel_ureg_t.
	(SYS_FUNC(move_pages)): Change npages type from unsigned long
	to kernel_ureg_t.  Change buf type from long to kernel_ureg_t.

	print_sigset_addr_len: change len argument type from long to kernel_ureg_t
	* defs.h (print_sigset_addr_len): Change len argument type from long
	to kernel_ureg_t.
	* signal.c (print_sigset_addr_len_limit, print_sigset_addr_len): Likewise.

	process_vm: change size arguments type from unsigned long to kernel_ureg_t
	* process_vm.c (SYS_FUNC(process_vm_readv),
	SYS_FUNC(process_vm_writev)): Change the type of local_iovcnt,
	remote_iovcnt, and flags from unsigned long to kernel_ureg_t.

	printstr*: change len argument type from long to kernel_ureg_t.
	* defs.h (printstr_ex, printstrn): Change len argument type from long
	to kernel_ureg_t.
	* util.c (printstr_ex): Likewise.

	xattr: change size arguments type from unsigned long to kernel_ureg_t.
	* xattr.c (print_xattr_val): Change type of insize and size arguments
	from unsigned long to kernel_ureg_t.
	(print_xattr_list): Change type of size argument from unsigned long
	to kernel_ureg_t.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	printstr_ex: fix decoding of non-NUL-terminated strings when len == -1.
	Do not treat len == -1 in any special way.  All users who need the
	string to be handled as a NUL-terminated string set QUOTE_0_TERMINATED
	bit in user_style flags already.

	* util.c (printstr_ex): Remove (len == -1) check.
	* tests/printstr.c: New file.
	* tests/printstr.test: New test.
	* tests/.gitignore: Add printstr.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add printstr.test.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of sethostname syscall.
	The second argument of sethostname syscall is not an unsigned long but
	unsigned int.  The kernel does not look at the string argument when
	the length argument is too long.

	* hostname.c [HAVE_LINUX_UTSNAME_H]: Include <linux/utsname.h>.
	[!__NEW_UTS_LEN] (__NEW_UTS_LEN): Define.
	(SYS_FUNC(sethostname)): Treat the second argument as unsigned int.
	Print the first argument as a pointer when the second argument exceeds
	__NEW_UTS_LEN.
	* tests/sethostname.c [HAVE_LINUX_UTSNAME_H]: Include <linux/utsname.h>.
	[!__NEW_UTS_LEN] (__NEW_UTS_LEN): Define.
	(main): Use it.  Check that the second argument of sethostname
	is handled as unsigned int.  Check that the first argument is printed
	as a pointer when the second argument exceeds __NEW_UTS_LEN.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add F8ILL_KULONG_* and f8ill_ptr_to_kulong to tests.h.
	* tests/tests.h (F8ILL_KULONG_SUPPORTED, F8ILL_KULONG_MASK): New macros.
	(f8ill_ptr_to_kulong): New static inline function.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	printstr: rename to printstrn, add printstr as a thin wrapper.
	As about half of all printstr uses cases are invocations with the last
	argument set to -1, create a dedicated function for this use case.

	* defs.h (printstr): Rename to printstrn.  All callers updated.
	(printstr): New static inline function.  All callers updated.

2016-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	process: change ptrace arguments type from unsigned long to kernel_ureg_t
	(SYS_FUNC(ptrace)): Change type of request and data arguments
	from unsigned long to kernel_ureg_t.

	process: change tracee address type from unsigned long to kernel_ureg_t.
	* process.c (print_user_offset_addr): Change address argument type
	from unsigned long to kernel_ureg_t.
	(SYS_FUNC(ptrace)): Change addr variable type from unsigned long
	to kernel_ureg_t.

	net: change address argument type from long to kernel_ureg_t.
	* net.c (decode_sockbuf, decode_pair_fd, print_linger, print_ucred,
	print_tpacket_stats, print_icmp_filter, print_getsockopt, print_mreq,
	print_mreq6, print_group_req, print_tpacket_req, print_packet_mreq,
	print_setsockopt): Change address argument type from long
	to kernel_ureg_t.

	print_mq_attr: change address argument type from long to kernel_ureg_t.
	* print_mq_attr.c (printmqattr): Change address argument type from long
	to kernel_ureg_t.

	ipc_*: change address argument type from long to kernel_ureg_t.
	* ipc_msg.c (tprint_msgsnd, tprint_msgrcv, fetch_msgrcv_args): Change
	address argument type from long to kernel_ureg_t.
	* ipc_msgctl.c (print_msqid_ds): Likewise.
	* ipc_sem.c (tprint_sembuf_array): Likewise.
	* ipc_shmctl.c (print_shmid_ds): Likewise.

	print_msgbuf: change address argument type from long to kernel_ureg_t.
	* print_msgbuf.c (tprint_msgbuf): Change address argument type
	from long to kernel_ureg_t.

	desc: change tracee address type from long to kernel_ureg_t.
	* desc.c (decode_select): Rename arg to addr, change its type
	from long to kernel_ureg_t.

	uid: change address argument type from long to kernel_ureg_t.
	* uid.c (get_print_uid): Change address argument type
	from long to kernel_ureg_t.

	time: change address argument type from long to kernel_ureg_t.
	* time.c (print_timezone, do_adjtimex): Change address argument type
	from long to kernel_ureg_t.

	sched: change address argument type from long to kernel_ureg_t.
	* sched.c (print_sched_attr): Change address argument type
	from long to kernel_ureg_t.

	printsiginfo: change address argument type from long to kernel_ureg_t.
	* printsiginfo.c (printsiginfo_at): Change address argument type
	from long to kernel_ureg_t.

	print_timex: change address argument type from long to kernel_ureg_t.
	* print_timex.c (print_timex): Change address argument type
	from long to kernel_ureg_t.

	print_sigevent: change address argument type from long to kernel_ureg_t.
	* print_sigevent.c (print_sigevent): Change address argument type
	from long to kernel_ureg_t.

	poll: change address argument type from long to kernel_ureg_t.
	* poll.c (decode_poll_exiting): Change tracee address argument type
	from long to kernel_ureg_t.

	printrusage*: change tracee address argument type from long to kernel_ureg_t
	* defs.h [ALPHA] (printrusage32): Change address argument type
	from long to kernel_ureg_t.
	* printrusage.c (printrusage): Likewise.
	[ALPHA] (printrusage32): Likewise.
	* wait.c (printwaitn): Change the type of tracee address argument
	of print_rusage from long to kernel_ureg_t.

	print_time*: change tracee address argument type from long to kernel_ureg_t
	* defs.h [ALPHA] (sprint_timeval32, print_timeval32,
	print_timeval32_pair, print_itimerval32): Change address argument type
	from long to kernel_ureg_t.
	* desc.c (decode_select): Change the type of tracee address argument
	of print_tv_ts and sprint_tv_ts from long to kernel_ureg_t.
	* print_timespec.c (print_timespec, sprint_timespec,
	print_timespec_utime_pair, print_itimerspec): Change address argument
	type from long to kernel_ureg_t.
	* print_timeval.c (print_timeval, print_timeval_pair, sprint_timeval,
	print_itimerval, print_timeval32, print_timeval32_pair,
	print_itimerval32, sprint_timeval32): Likewise.

	rtc: change type of ioctl 3rd argument from long to kernel_ureg_t.
	* rtc.c (decode_rtc_time, decode_rtc_wkalrm, decode_rtc_pll_info):
	Change addr type from long to kernel_ureg_t.
	(rtc_ioctl): Change arg type from long to kernel_ureg_t.

	mtd: change type of ioctl 3rd argument from long to kernel_ureg_t.
	* mtd.c (decode_erase_info_user, decode_erase_info_user64,
	decode_mtd_oob_buf, decode_mtd_oob_buf64, decode_otp_info,
	decode_otp_select, decode_mtd_write_req, decode_mtd_info_user,
	decode_nand_oobinfo, decode_nand_ecclayout_user, decode_mtd_ecc_stats):
	Change addr type from long to kernel_ureg_t.
	(mtd_ioctl): Change arg type from long to kernel_ureg_t.

	hdio: change type of ioctl 3rd argument from long to kernel_ureg_t.
	* hdio.c (hdio_ioctl): Change arg type from long to kernel_ureg_t.

	v4l2: change type of ioctl 3rd argument from long to kernel_ureg_t.
	* v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format,
	print_v4l2_requestbuffers, print_v4l2_buffer, print_v4l2_framebuffer,
	print_v4l2_buf_type, print_v4l2_streamparm, print_v4l2_standard,
	print_v4l2_input, print_v4l2_control, print_v4l2_queryctrl,
	print_v4l2_cropcap, print_v4l2_crop, print_v4l2_ext_controls,
	print_v4l2_frmsizeenum, print_v4l2_frmivalenum,
	print_v4l2_create_buffers, v4l2_ioctl): Change arg type from long
	to kernel_ureg_t.

	evdev: change type of ioctl 3rd argument from long to kernel_ureg_t.
	* evdev.c (ff_effect_ioctl, abs_ioctl, keycode_ioctl, keycode_V2_ioctl,
	getid_ioctl, decode_bitset, mtslots_ioctl, repeat_ioctl, bit_ioctl,
	evdev_read_ioctl, evdev_write_ioctl, evdev_ioctl): Change arg type
	from long to kernel_ureg_t.

	btrfs: change type of ioctl 3rd argument from long to kernel_ureg_t.
	* btrfs.c (btrfs_print_balance, btrfs_ioctl): Change arg type from long
	to kernel_ureg_t.

	block: change type of ioctl 3rd argument from long to kernel_ureg_t.
	* block.c (block_ioctl): Change arg type from long to kernel_ureg_t.

	Change type of ioctl 3rd argument from long to kernel_ureg_t.
	* defs.h (DECL_IOCTL): Change arg type from long to kernel_ureg_t.
	* dm.c (dm_known_ioctl, dm_ioctl): Likewise.
	* file_ioctl.c (file_ioctl): Likewise.
	* fs_x_ioctl.c (fs_x_ioctl): Likewise.
	* ioctl.c (ioctl_decode): Likewise.
	* loop.c (decode_loop_info, decode_loop_info64): Change addr type
	from long to kernel_ureg_t.
	(loop_ioctl): Change arg type from long to kernel_ureg_t.
	* ptp.c (ptp_ioctl): Likewise.
	* scsi.c (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req,
	print_sg_io_v4_res, scsi_ioctl): Likewise.
	* sock.c (print_ifreq, sock_ioctl): Likewise.
	(decode_ifconf): Change addr type from long to kernel_ureg_t.
	* term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize,
	decode_modem_flags): Likewise.
	(term_ioctl): Change arg type from long to kernel_ureg_t.
	* ubi.c (ubi_ioctl): Likewise.
	* userfaultfd.c (uffdio_ioctl): Likewise.

	ldt: change address argument type from long to kernel_ureg_t.
	* defs.h [HAVE_STRUCT_USER_DESC] (print_user_desc): Change address
	argument type from long to kernel_ureg_t.
	* ldt.c [HAVE_STRUCT_USER_DESC] (print_user_desc): Likewise.

	fcntl: change address argument type from long to kernel_ureg_t.
	* fcntl.c (printflock64, printflock, print_f_owner_ex): Change
	address argument type from long to kernel_ureg_t.

	execve: change address argument type from long to kernel_ureg_t.
	* execve.c (printargv, printargc): Change address argument type
	from long to kernel_ureg_t.

	dirent: change address argument type from long to kernel_ureg_t.
	* dirent.c (print_old_dirent): Change address argument type from long
	to kernel_ureg_t.

	bpf: change address argument type from long to kernel_ureg_t.
	* bpf.c (bpf_map_create, bpf_map_update_elem, bpf_map_delete_elem,
	bpf_map_io, bpf_prog_load, SYS_FUNC(bpf)): Change address argument
	type from long to kernel_ureg_t.

	dump*: change address argument type from long to kernel_ureg_t.
	* defs.h (dumpiov_in_msghdr, dumpiov_in_mmsghdr, dumpiov_upto, dumpstr):
	Change address argument type from long to kernel_ureg_t.
	* mmsghdr.c (dumpiov_in_mmsghdr): Likewise.
	* msghdr.c (fetch_msghdr_namelen, decode_msghdr, dumpiov_in_msghdr):
	Likewise.
	* util.c (dumpiov_upto, dumpstr): Likewise.

	print_sigset_addr_len: change address argument type from long to kernel_ureg_t
	* defs.h (print_sigset_addr_len) Change address argument type from long
	to kernel_ureg_t.
	* signal.c (print_sigset_addr_len_limit, print_sigset_addr_len,
	decode_old_sigaction, decode_new_sigaction): Likewise.

	decode_sockaddr: change address argument type from long to kernel_ureg_t
	* defs.h (decode_sockaddr) Change tracee address argument type from long
	to kernel_ureg_t.
	* sockaddr.c (decode_sockaddr): Likewise.

	print_struct_statfs*: change address argument type from long to kernel_ureg_t
	* defs.h (print_struct_statfs, print_struct_statfs64): Change address
	argument type from long to kernel_ureg_t.
	* print_statfs.c (print_struct_statfs, print_struct_statfs64): Likewise.
	* fetch_struct_statfs.c (fetch_struct_statfs, fetch_struct_statfs64):
	Likewise.

	fetch_struct_flock: change address argument type from long to kernel_ureg_t
	* fetch_struct_flock.c (fetch_struct_flock, fetch_struct_flock64):
	Change address argument type from long to kernel_ureg_t.

	fetch_seccomp_fprog: change address argument type from long to kernel_ureg_t
	* fetch_seccomp_fprog.c (fetch_seccomp_fprog): Change address argument
	type from long to kernel_ureg_t.

	printnum_*, printpair_*: change address argument type from long to kernel_ureg_t
	* defs.h (DECL_PRINTNUM, DECL_PRINTPAIR, printnum_long_int): Change
	address argument type from long to kernel_ureg_t.
	* util.c (DEF_PRINTNUM, DEF_PRINTPAIR, printnum_long_int): Likewise.

	printpath*: change address argument type from long to kernel_ureg_t.
	* defs.h (printpath, printpathn): Change address argument type
	from long to kernel_ureg_t.
	* util.c (printpath, printpathn): Likewise.

	printstr*: change address argument type from long to kernel_ureg_t.
	* defs.h (printstr_ex, printstr_ex): Change address argument type
	from long to kernel_ureg_t.
	* util.c (printstr_ex): Likewise.

	umove*: change tracee address argument type from long to kernel_ureg_t.
	* defs.h (umovestr, umoven, umoven_or_printaddr,
	umoven_or_printaddr_ignore_syserror): Change tracee address argument
	type from long to kernel_ureg_t.
	(print_array): Change the type of tracee address argument of umoven_func
	from long to kernel_ureg_t.
	* util.c (vm_read_mem, umovestr, umoven, umoven_or_printaddr,
	umoven_or_printaddr_ignore_syserror): Change tracee address argument
	type from long to kernel_ureg_t.
	(print_array): Change the type of tracee address argument of umoven_func
	from long to kernel_ureg_t.
	* desc.c (umove_kulong_array_or_printaddr): Change tracee address
	argument type from long to kernel_ureg_t.
	* mmsghdr.c (fetch_struct_mmsghdr_or_printaddr): Likewise.

	futex: change address type from long to kernel_ureg_t.
	* futex.c (SYS_FUNC(futex)): Change address type from long
	to kernel_ureg_t.

	file_handle: change address type from long to kernel_ureg_t.
	* file_handle.c (SYS_FUNC(name_to_handle_at),
	SYS_FUNC(open_by_handle_at)): Change address type from long
	to kernel_ureg_t.

	printsiginfo: cast pointers to kernel_ureg_t instead of unsigned long.
	* printsiginfo.c (printsigval): Cast siginfo.si_ptr pointer
	to kernel_ureg_t instead of unsigned long.
	(print_si_info): Cast siginfo.si_addr and siginfo.si_call_addr pointers
	to kernel_ureg_t instead of unsigned long.

	sigaltstack: cast pointers and sizes to kernel_ureg_t instead of unsigned long
	* sigaltstack.c (print_stack_t): Cast sigaltstack.ss_sp pointer
	and sigaltstack.ss_size to kernel_ureg_t instead of unsigned long.

	v4l2: cast pointers to kernel_ureg_t instead of long.
	* v4l2.c (print_v4l2_ext_control): Cast v4l2_ext_control.string pointer
	to kernel_ureg_t instead of long.

	v4l2: cast pointers to kernel_ureg_t instead of unsigned long.
	* v4l2.c (print_v4l2_buffer): Remove redundant cast.
	(print_v4l2_framebuffer): Cast v4l2_framebuffer.base pointer
	to kernel_ureg_t instead of unsigned long.
	(print_v4l2_ext_controls): Cast v4l2_ext_controls.controls pointer
	to kernel_ureg_t instead of unsigned long.

2016-12-24  Dmitry V. Levin  <ldv@altlinux.org>

	sysctl: cast pointers to kernel_ureg_t instead of size_t.
	* sysctl.c (SYS_FUNC(sysctl)): Cast __sysctl_args.oldval and
	__sysctl_args.newval pointers to kernel_ureg_t instead of size_t.

	sysctl: cast pointers to kernel_ureg_t instead of long.
	* sysctl.c (SYS_FUNC(sysctl)): Cast __sysctl_args.oldlenp pointer
	to kernel_ureg_t instead of long.

	block: cast pointers to kernel_ureg_t instead of long.
	* block.c (print_blkpg_req): Cast blkpg_ioctl_arg.data pointer
	to kernel_ureg_t instead of long.

	dumpiov_upto: cast pointers to kernel_ureg_t instead of long.
	* util.c  (dumpiov_upto): Cast iovec.iov_base pointer to kernel_ureg_t
	instead of long.

	msghdr: cast pointers to kernel_ureg_t instead of long.
	* msghdr.c (print_struct_msghdr): Cast msghdr.msg_name pointer
	to kernel_ureg_t instead of long.
	(dumpiov_in_msghdr): Cast msghdr.msg_iov pointer to kernel_ureg_t
	instead of long.

	mmsghdr: cast pointers to kernel_ureg_t instead of long.
	* mmsghdr.c (dumpiov_in_mmsghdr): Cast msghdr.msg_iov pointer
	to kernel_ureg_t instead of long.

	Remove redundant casts of ptrace arguments.
	* strace.c (maybe_switch_tcbs, trace): Do not cast ptrace 4th argument
	from pointer to long type.

	ptrace_restart: cleanup.
	* strace.c (ptrace_restart): Replace the sequence of "if" statements
	with a "switch" statement.

	ptrace_restart: change types of integer arguments to unsigned.
	* strace.c (ptrace_restart): Change types of "op" and "sig"
	from int to unsigned int.

	process: remove redundant syserror checks.
	* process.c (SYS_FUNC(ptrace)): Remove syserror checks as both
	print_siginfo_array and print_seccomp_fprog do the right thing
	by using umoven_or_printaddr.

	sparc64: remove redundant casts.
	* linux/sparc64/get_syscall_args.c (get_syscall_args): Remove
	redundant casts from uint32_t to long.

2016-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	numa: change address argument type from unsigned long to kernel_ureg_t.
	* numa.c (print_nodemask): Change address argument type from
	unsigned long to kernel_ureg_t.

	net: change address argument type from unsigned long to kernel_ureg_t.
	* net.c (fetch_socklen): Change address argument type from
	unsigned long to kernel_ureg_t.

	mem: change tracee address type from unsigned long to kernel_ureg_t.
	* mem.c (print_mmap, SYS_FUNC(remap_file_pages),
	SYS_FUNC(subpage_prot)): Change the type of variables containing tracee
	addresses from unsigned long to kernel_ureg_t.

	kexec: change address argument type from unsigned long to kernel_ureg_t.
	* kexec.c (print_kexec_segments): Change address argument type
	from unsigned long to kernel_ureg_t.

	poll: change counter type from unsigned long to unsigned int.
	* poll.c (decode_poll_exiting): Change the type of printed and
	max_printed counters from unsigned long to unsigned int.

	xattr: change address argument type from unsigned long to kernel_ureg_t.
	* xattr.c (print_xattr_val, print_xattr_list): Change address
	argument type from unsigned long to kernel_ureg_t.

	uid: change address argument type from unsigned long to kernel_ureg_t.
	* uid.c (print_groups): Change address argument type
	from unsigned long to kernel_ureg_t.

	stat64: change address argument type from unsigned long to kernel_ureg_t
	* stat64.c (decode_struct_stat64): Change address argument type
	from unsigned long to kernel_ureg_t.

	stat: change address argument type from unsigned long to kernel_ureg_t.
	* stat.c (decode_struct_stat): Change address argument type
	from unsigned long to kernel_ureg_t.

	sigaltstack: change address argument type from unsigned long to kernel_ureg_t
	* sigaltstack.c (print_stack_t): Change address argument type
	from unsigned long to kernel_ureg_t.

	resource: change address argument type from unsigned long to kernel_ureg_t
	* resource.c (print_rlimit64, print_rlimit32, decode_rlimit): Change
	address argument type from unsigned long to kernel_ureg_t.

	printsiginfo: change address argument type from unsigned long to kernel_ureg_t
	* printsiginfo.c (print_siginfo_array): Change address argument type
	from unsigned long to kernel_ureg_t.

	poll: change tracee address type from unsigned long to kernel_ureg_t.
	* poll.c (decode_poll_entering, decode_poll_exiting): Change the type
	all tracee address variables from unsigned long to kernel_ureg_t.

	perf: change address argument type from unsigned long to kernel_ureg_t.
	* perf.c (fetch_perf_event_attr, print_perf_event_attr): Change
	address argument type from unsigned long to kernel_ureg_t.

	pathtrace: change tracee address type from unsigned long to kernel_ureg_t
	* pathtrace.c (upathmatch): Change address argument type
	from unsigned long to kernel_ureg_t.
	(pathtrace_match): Change the type of all tracee address variables
	from unsigned long to kernel_ureg_t.

	scsi: change address argument type from unsigned long to kernel_ureg_t.
	* scsi.c (print_sg_io_buffer): Change address argument type
	from unsigned long to kernel_ureg_t.

	dm: change address argument type from unsigned long to kernel_ureg_t.
	* dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps,
	dm_decode_dm_name_list, dm_decode_dm_target_versions,
	dm_decode_dm_target_msg, dm_decode_string): Change address argument type
	from unsigned long to kernel_ureg_t.

	oldstat: change address argument type from unsigned long to kernel_ureg_t
	* oldstat.c (print_old_kernel_stat): Change address argument type
	from unsigned long to kernel_ureg_t.

	capability: change address argument type from unsigned long to kernel_ureg_t
	* capability.c (get_cap_header, print_cap_header, print_cap_data):
	Change address argument type from unsigned long to kernel_ureg_t.

	btrfs: change address argument type from unsigned long to kernel_ureg_t.
	* btrfs.c (btrfs_print_qgroup_inherit): Change address argument type
	from unsigned long to kernel_ureg_t.

	affinity: change address argument type from unsigned long to kernel_ureg_t
	* affinity.c (print_affinitylist): Change address argument type from
	unsigned long to kernel_ureg_t.

	aio: change address type from unsigned long to kernel_ureg_t.
	* aio.c (print_iocb): Remove casts to unsigned long.
	(print_iocbp,  SYS_FUNC(io_submit)): Change address type
	from unsigned long to kernel_ureg_t.

	mmsghdr: change address argument type from unsigned long to kernel_ureg_t
	* mmsghdr.c (save_mmsgvec_namelen, decode_mmsgvec): Change
	address argument type from unsigned long to kernel_ureg_t.

	msghdr: change address argument type from unsigned long to kernel_ureg_t
	* msghdr.c (decode_msg_control): Change address argument type
	from unsigned long to kernel_ureg_t.

	fetch_struct_stat64: change address argument type from unsigned long to kernel_ureg_t
	* fetch_struct_stat64.c (fetch_struct_stat64): Change address argument
	type from unsigned long to kernel_ureg_t.

	fetch_struct_stat: change address argument type from unsigned long to kernel_ureg_t
	* fetch_struct_stat.c (fetch_struct_stat): Change address argument
	type from unsigned long to kernel_ureg_t.

	fetch_struct_msghdr: change address argument type from unsigned long to kernel_ureg_t
	* fetch_struct_msghdr.c (fetch_struct_msghdr): Change
	address argument type from unsigned long to kernel_ureg_t.

	fetch_struct_mmsghdr: change address argument type from unsigned long to kernel_ureg_t
	* fetch_struct_mmsghdr.c (fetch_struct_mmsghdr): Change
	address argument type from unsigned long to kernel_ureg_t.

	decode_netlink: change address argument type from unsigned long to kernel_ureg_t
	* defs.h (decode_netlink) Change address argument type
	from unsigned long to kernel_ureg_t.
	* netlink.c (fetch_nlmsghdr, decode_nlmsghdr_with_payload,
	decode_netlink): Likewise.

	print_seccomp_*: change address argument type from unsigned long to kernel_ureg_t
	* defs.h (print_seccomp_filter, print_seccomp_fprog): Change
	address argument type from unsigned long to kernel_ureg_t.
	* seccomp.c (print_seccomp_filter, print_seccomp_fprog,
	decode_seccomp_set_mode_strict): Likewise.

	tprint_iov*: change address argument type from unsigned long to kernel_ureg_t
	* defs.h (tprint_iov, tprint_iov_upto): Change address argument type
	from unsigned long to kernel_ureg_t.
	* io.c (tprint_iov, tprint_iov_upto): Likewise.

	print_array: change tracee address type from unsigned long to kernel_ureg_t
	* defs.h (print_array): Change start_addr type from unsigned long
	to kernel_ureg_t.
	* util.c (print_array): Likewise.  Change the type of all tracee
	address variables from unsigned long to kernel_ureg_t.

2016-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	Rename LONG_LONG to ULONG_LONG and change it to return unsigned long long
	In all places where LONG_LONG is used the destination already has type
	unsigned long long, so it is quite natural to change LONG_LONG as well.

	* defs.h (LONG_LONG): Rename to ULONG_LONG, change return type
	from long long to unsigned long long.  All callers updated.

2016-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	mem: remove redundant casts.
	* mem.c (SYS_FUNC(old_mmap)): Remove redundant cast
	from kernel_ureg_t to unsigned long.
	[S390] (SYS_FUNC(old_mmap_pgoff)): Remove redundant cast
	from unsigned int to unsigned long.

	desc: remove redundant casts.
	* desc.c (umove_kulong_array_or_printaddr): Remove redundant cast
	from uint32_t to kernel_ulong_t.
	(SYS_FUNC(pselect6)): Remove redundant casts from kernel_ulong_t
	to unsigned long.

2016-12-22  Dmitry V. Levin  <ldv@altlinux.org>

	print_sigevent: remove redundant cast.
	* print_sigevent.c (print_sigevent): Remove redundant cast from
	struct_sigevent.sigev_value.sival_ptr to unsigned long as the former
	is not a pointer but an unsigned integer.

	tests: fix xattr.test for the case when listxattr returns a long list.
	* tests/xattr.c (DEFAULT_STRLEN): New macro.
	(main): Use it to limit the length passed to print_quoted_memory.
	Print ellipsis when the list returned by listxattr is too long.

2016-12-22  Gabriel Laskar  <gabriel@lse.epita.fr>

	tests: test for correct ellipsis with -s in xattr.
	* tests/xattr-strings.c: New file.
	* tests/xattr-strings.test: New test.
	* tests/.gitignore: Add xattr-string.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add xattr-string.test.

2016-12-22  Gabriel Laskar  <gabriel@lse.epita.fr>

	xattr: use printstr_ex instead of print_quoted_string.
	This fixes the display when using `-s` to limit the string size
	of the values displayed by {get,set}xattr.

	* xattr.c (print_xattr_val): Remove static buffer.  Use printstr_ex
	instead of print_quoted_string.

	Reported-by: Марк Коренберг <socketpair@gmail.com>

2016-12-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: use scno.h in finit_module, kcmp, renameat2 tests.
	* tests/finit_module.c: Include "scno.h".
	* tests/kcmp.c: Likewise.
	* tests/renameat2.c: Likewise.

2016-12-21  Dmitry V. Levin  <ldv@altlinux.org>

	sock: cast pointers to kernel_ureg_t instead of unsigned long.
	* sock.c (decode_ifconf): Cast ifconf.ifc_buf pointer to kernel_ureg_t
	instead of unsigned long.

	scsi: cast pointers to kernel_ureg_t instead of unsigned long.
	* scsi.c (print_sg_io_v3_req, print_sg_io_v3_res): Cast sg_io_hdr.cmdp,
	sg_io_hdr.dxferp, and sg_io_hdr.sbp pointers to kernel_ureg_t instead
	of unsigned long.

	mtd: cast pointers to kernel_ureg_t instead of unsigned long.
	* mtd.c (decode_mtd_oob_buf): Cast mtd_oob_buf.ptr pointer
	to kernel_ureg_t instead of unsigned long.

	msghdr: cast pointers to kernel_ureg_t instead of unsigned long.
	* msghdr.c (print_struct_msghdr): Cast msghdr.msg_iov and
	msghdr.msg_control pointers to kernel_ureg_t instead of unsigned long.

	evdev: cast tcp->u_rval to kernel_ureg_t instead of unsigned long.
	* evdev.c (decode_bitset): Cast tcp->u_rval to kernel_ureg_t
	instead of unsigned long.

	evdev: cast pointers to kernel_ureg_t instead of unsigned long.
	* evdev.c (ff_effect_ioctl): Cast ff_periodic_effect.custom_data
	pointer to kernel_ureg_t instead of unsigned long.

	btrfs: cast pointers to kernel_ureg_t instead of unsigned long.
	* btrfs.c (btrfs_ioctl): Cast btrfs_ioctl_send_args.clone_sources
	and btrfs_ioctl_vol_args_v2.qgroup_inherit pointers to kernel_ureg_t
	instead of unsigned long.

	Rework ifdefery around print_user_desc.
	* configure.ac (AC_CHECK_TYPES): Check for struct user_desc
	in <asm/ldt.h>.
	* clone.c (print_tls_arg): New function.
	(SYS_FUNC(clone)): Use it.
	(print_user_desc): Move prototype ...
	* defs.h [HAVE_STRUCT_USER_DESC]: ... here.
	* ldt.c: Check for HAVE_STRUCT_USER_DESC instead of architectures.
	* linux/dummy.h: Likewise.

	Introduce DECL_IOCTL macro to declare *_ioctl functions.
	* defs.h (DECL_IOCTL): New macro.
	(dm_ioctl, file_ioctl, fs_x_ioctl, loop_ioctl, ptp_ioctl, scsi_ioctl,
	sock_ioctl, term_ioctl, ubi_ioctl, uffdio_ioctl): Rewrite prototypes
	using DECL_IOCTL.

	Introduce DECL_PRINT* macros to declare printnum_* and printpair_*
	* defs.h (DECL_PRINTNUM, DECL_PRINTPAIR): New macros.
	(printnum_short, printnum_int, printnum_int64): Rewrite prototypes
	using DECL_PRINTNUM.
	(printpair_int, printpair_int64): Rewrite prototypes
	using DECL_PRINTPAIR.

	ioctl: use uintptr_t for casts between 32-bit integers and pointers.
	* ioctl.c (compare): Cast pointer to uintptr_t before assigning
	it to an integer.
	(ioctl_lookup): Cast integer to uintptr_t before passing it
	as a pointer.

	scsi: use umove_or_printaddr.
	* scsi.c (scsi_ioctl): Use umove_or_printaddr.

	Remove dumpiov wrapper.
	* defs.h (dumpiov): Remove.
	* syscall.c (dumpio): Use dumpiov_upto instead of dumpiov.

	travis: fix enabling of gcc -Werror builds.
	* travis-build.sh: Use DISTCHECK_CONFIGURE_FLAGS instead
	of CHECK_CONFIGURE_FLAGS and ENABLE_GCC_WERROR.
	[$CC == gcc]: Add --enable-gcc-Werror to DISTCHECK_CONFIGURE_FLAGS
	instead of ENABLE_GCC_WERROR.
	[$CHECK == coverage]: Add --enable-code-coverage
	to DISTCHECK_CONFIGURE_FLAGS instead of CHECK_CONFIGURE_FLAGS.

	printaddr: change argument type to kernel_ureg_t.
	* defs.h (printaddr): Change argument type from unsigned long
	to kernel_ureg_t.

	tests: check decoding of unreadable ip_mreq and ipv6_mreq structures.
	* tests/ip_mreq.c (main): Check short read.

	tests: rewrite ip_mreq.c using arrays and iterators.
	* tests/ip_mreq.c (main): Create arrays of setsockopt arguments to test.
	Iterate over these arrays invoking setsockopt and printing expected
	output.

	tests: rewrite ip_mreq.c using tail_alloc.
	* tests/ip_mreq.c (main): Allocate objects of struct ip_mreq
	and struct ipv6_mreq using tail_alloc instead of using stack.

	tests: rewrite ip_mreq.c without asserts.
	* tests/ip_mreq.c: Do not include <assert.h>.
	(main): Do not use assert.  Use sprintrc instead of errno2name.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

	Remove NEED_PTRACE_PROTOTYPE_WORKAROUND.
	Remove the workaround for broken ptrace prototypes
	that seems to be unneeded for quite a long time.

	* defs.h [NEED_PTRACE_PROTOTYPE_WORKAROUND]: Remove.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use scno.h in tests of relatively new syscalls.
	* tests/add_key.c: Include "scno.h" after <asm/unistd.h>.
	* tests/copy_file_range.c: Likewise.
	* tests/execveat.c: Likewise.
	* tests/kexec_file_load.c: Likewise.
	* tests/membarrier.c: Likewise.
	* tests/memfd_create.c: Likewise.
	* tests/mlock2.c: Likewise.
	* tests/pkey_alloc.c: Likewise.
	* tests/pkey_free.c: Likewise.
	* tests/pkey_mprotect.c: Likewise.
	* tests/preadv2-pwritev2.c: Likewise.
	* tests/userfaultfd.c: Likewise.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: generate scno.h from syscallent.h for use by other tests.
	Provide scno.h with fallback definitions of all __NR_* constants known
	to strace for the personbality being tested.

	Some tests need just __NR_* constants without any kernel support.
	Such tests can include "scno.h" after <asm/unistd.h> to get definitions
	of these constants when system headers are too old.

	* tests/generate_scno.c: New file.
	* tests/.gitignore: Add generate_scno.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(scno.h): New rule.
	(BUILT_SOURCES, CLEANFILES): Add scno.h.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix potential errno clobbering in membarrier test.
	* tests/membarrier.c (main): Save errno.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

	Do not use widen_to_ulong in kexec.c and process_vm.c.
	Automatic argument truncation makes use of this function redundant.

	* kexec.c (SYS_FUNC(kexec_load)): Do not invoke widen_to_ulong.
	* process_vm.c (SYS_FUNC(process_vm_readv),
	SYS_FUNC(process_vm_writev)): Likewise.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

	x32: implement automatic argument truncation for compat syscalls.
	x32 syscalls starting with number 512 are compat syscalls that operate
	on compat types.  Set COMPAT_SYSCALL_TYPES flag to these syscall entries
	and make get_syscall_args truncate arguments of syscalls that have this
	flag set, to avoid unpleasant alternative of adding multiple
	widen_to_ulong invocations to individual syscall parsers.

	preadv, pwritev, preadv2, and pwritev2 are exceptions: while these
	syscalls operate on compat types, the offset argument has a regular
	64-bit type, so the automatic argument truncation cannot be applied.

	* defs.h (COMPAT_SYSCALL_TYPES): New macro.
	* syscall.c (CST): New macro, defined to COMPAT_SYSCALL_TYPES.
	* linux/ia64/syscallent.h: Do not include "../i386/syscallent.h"
	unless [CST > 0].
	* linux/x32/syscallent.h [512..533, 536..545]: Add CST flag.
	* linux/x86_64/get_syscall_args.c (get_syscall_args): Truncate arguments
	of compat syscalls to 32-bit values.
	* tests/ksysent.c (CST): New macro, defined to 0.
	* tests/nsyscalls.c (CST): Likewise.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

	x32: fix decoding of mprotect and pkey_mprotect syscall arguments.
	As there are no compat versions of mprotect or pkey_mprotect syscalls
	in x32 personality, "addr", "len", and "prot" syscall arguments have
	kernel_ulong_t type and should be printed accordingly.

	* mem.c (do_mprotect): Retrieve 1st, 2nd and 3rd arguments using
	getarg_klu, print them using printaddr_klu, PRI_klu format,
	and printflags64, correspondingly.

2016-12-20  Dmitry V. Levin  <ldv@altlinux.org>

	Make tprint_iov function a static inline wrapper.
	* io.c (tprint_iov): Move ...
	* defs.h: ... here, add static inline keywords.

2016-12-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	x32: fix decoding of 3rd argument of preadv* and pwritev* syscalls.
	In x32 personality these syscalls use compat type for the 3rd argument,
	therefore it has to be truncated there.

	* io.c (do_preadv, do_pwritev): Truncate tcp->u_arg[2] using
	widen_to_ulong.

2016-12-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: fix preadv2-pwritev2 test on x32.
	On x32 p(read|write)v(|2) syscalls are implemented via compat, which
	truncates len argument to unsigned int.

	* tests/preadv2-pwritev2.c (main): Print vlen argument as unsigned long.

2016-12-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	kexec: fix for the x32 ABI.
	There is no compat (and no 32-bit version, ever) for x32 ABI, so
	kernel's long type should be used for arguments' values.

	The only remaining thing is a pointer to cmdline string, but it is
	currently broken on x32 anyway.

	* kexec.c (SYS_FUNC(kexec_file_load)): Print the cmdline_len argument
	as kernel long, retrieve it via getarg_klu; use printflags64 for
	printing the flags argument, retrieve it via getarg_klu.

2016-12-19  Dmitry V. Levin  <ldv@altlinux.org>

	Check for current_klongsize instead of current_personality where appropriate
	current_klongsize checks are more universal, therefore they are usually
	shorter and easier to comprehend.

	* desc.c (umove_kulong_array_or_printaddr): Check for current_klongsize
	instead of current_personality and current_wordsize.
	* io.c (print_lld_from_low_high_val): Likewise.
	* lseek.c (SYS_FUNC(lseek)): Likewise.
	* resource.c (decode_rlimit): Likewise.
	* syscall.c (is_negated_errno): Likewise.
	* util.c (getllval, getarg_klu): Likewise.

2016-12-19  Dmitry V. Levin  <ldv@altlinux.org>

	Use kernel_ulong_t instead of unsigned long long where appropriate.
	* defs.h (printaddr_ull): Rename to printaddr_klu, change argument
	type from unsigned long long to kernel_ulong_t.  All callers updated.
	(getarg_ull): Rename to getarg_klu, change return value type
	from unsigned long long to kernel_ulong_t.  All callers updated.
	(PRI_kl, PRI_kld, PRI_klu, PRI_klx): New macros.
	* bjm.c (SYS_FUNC(init_module)): Print kernel_ulong_t type using
	PRI_klu format.
	* desc.c (SYS_FUNC(pselect6)): Likewise.
	* fadvise.c (SYS_FUNC(fadvise64)): Likewise.
	* lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise.
	* mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise.
	* kcmp.c (SYS_FUNC(kcmp)): Print kernel_ulong_t type using
	PRI_klx format.
	* keyctl.c (SYS_FUNC(keyctl)): Likewise.
	* pkeys.c (SYS_FUNC(pkey_alloc)): Likewise.
	* prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)):
	Print kernel_ulong_t type using PRI_kld, PRI_klu, or PRI_klx format.
	* util.c (printaddr_ull): Rename to printaddr_klu, change argument
	type from unsigned long long to kernel_ulong_t, print it using
	PRI_klx format.
	(getarg_ull): Rename to getarg_klu, change return value type
	from unsigned long long to kernel_ulong_t, print it using
	PRI_klx format.

	fcntl.c: print 64-bit fields of struct_kernel_flock64 using PRId64 format
	* fcntl.c (print_struct_flock64): Print l_start and l_len fields
	of struct_kernel_flock64 using PRId64 format.

	v4l2.c: print v4l2_ext_control.value64 using PRId64 format.
	* v4l2.c (print_v4l2_ext_control): Print value64 field
	of struct_v4l2_ext_control using PRId64 format.

	perf.c: print perf_event_attr.__reserved_1 using PRIx64 format.
	* perf.c (print_perf_event_attr): Print __reserved_1 field
	of perf_event_attr using PRIx64 format.

	btrfs.c: print 64-bit fields of btrfs_ioctl_vol_args_v2 using PRIu64 format
	* block.c (btrfs_ioctl): Print size and transid fields
	of struct_btrfs_ioctl_vol_args_v2 using PRIu64 format.

	block.c: change type of long long fileds to int64_t.
	* block.c (struct_blkpg_partition): Change type of start and length
	fields from long long to int64_t.
	(print_blkpg_req): Print them using PRId64 format.

2016-12-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Introduce current_klongsize in addition to current_wordsize.
	Subsequent commits are going to use current_klongsize
	as the tracee's size of kernel_ulong_t type.

	* defs.h (PERSONALITY0_KLONGSIZE): New macro.
	[X86_64] (PERSONALITY2_KLONGSIZE): Likewise.
	[SUPPORTED_PERSONALITIES > 1] (PERSONALITY1_KLONGSIZE): Likewise.
	[SUPPORTED_PERSONALITIES == 1] (current_klongsize): Likewise.
	[SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_KLONGSIZE ==
	PERSONALITY1_KLONGSIZE] (current_klongsize): Likewise.
	[SUPPORTED_PERSONALITIES != 1 && (SUPPORTED_PERSONALITIES != 2 ||
	PERSONALITY0_KLONGSIZE != PERSONALITY1_KLONGSIZE)] (current_klongsize):
	New variable prototype.
	* syscall.c [!current_klongsize] (current_klongsize): New variable.
	[!current_klongsize] (personality_klongsize): New array.
	(set_personality) [!current_klongsize]: Update current_klongsize
	with the appropriate value from personality_klongsize.

2016-12-19  Dmitry V. Levin  <ldv@altlinux.org>

	configure: define SIZEOF_KERNEL_LONG_T macro.
	Provide SIZEOF_KERNEL_LONG_T macro in addition to SIZEOF_LONG and
	SIZEOF_LONG_LONG for checking of kernel_long_t and kernel_ulong_t
	types at the time of preprocessing.

	* configure.ac (AC_CHECK_SIZEOF): Add kernel_long_t.

2016-12-19  Dmitry V. Levin  <ldv@altlinux.org>

	Remove getarg_ll.
	This function has never been used in the code, and in perspective
	the whole ext_arg thing will go away.

	* defs.h (getarg_ll): Remove prototype.
	* util.c (getarg_ll): Remove.

2016-12-19  Dmitry V. Levin  <ldv@altlinux.org>

	struct tcb: make types of syscall arguments unsigned.
	This is the first step in the direction of revisiting current practice
	of indiscriminate use of signed types for syscall arguments and memory
	addresses.

	* kernel_types.h (kernel_ureg_t): New type, typedef to unsigned long.
	* defs.h (struct tcb): Change type of u_arg from long to kernel_ureg_t.
	[HAVE_STRUCT_TCB_EXT_ARG]: Change type of ext_arg from long long
	to unsigned long long.
	* desc.c (decode_select): Change type of syscall arguments from long
	to kernel_ureg_t.
	(SYS_FUNC(oldselect)): Change type of select_args from long
	to kernel_ureg_t.
	* io.c (print_lld_from_low_high_val): Remove no longer needed cast
	of syscall arguments to unsigned long.
	* lseek.c (SYS_FUNC(lseek)): Cast syscall argument from unsigned long
	to long.
	* mem.c (print_mmap): Change type of syscall arguments from long
	to kernel_ureg_t.
	(SYS_FUNC(old_mmap), SYS_FUNC(old_mmap_pgoff)): Change type of u_arg
	from long to kernel_ureg_t.
	(SYS_FUNC(mmap), SYS_FUNC(mmap_pgoff), SYS_FUNC(mmap_pgoff)): Remove
	no longer needed cast of syscall arguments to unsigned long.
	* pathtrace.c (pathtrace_match): Change type of args and select_args
	from long to kernel_ureg_t.
	* util.c (getarg_ull): Remove no longer needed casts of syscall
	arguments to unsigned types.

2016-12-19  Dmitry V. Levin  <ldv@altlinux.org>

	s390: fix decoding of mmap2 syscall when arguments are not available.
	* mem.c [S390] (SYS_FUNC(old_mmap_pgoff)): Use umove_or_printaddr
	instead of umoven to fetch mmap arguments, fix return value when this
	fetch fails.

	Fix pathmatch of oldselect syscall on 64-bit architectures.
	* pathtrace.c (pathtrace_match): Fix fetching of 32-bit oldselect
	arguments on 64-bit architectures.

	Cleanup oldselect.
	* desc.c (SYS_FUNC(oldselect)): Rewrite without use of macros.

2016-12-18  Dmitry V. Levin  <ldv@altlinux.org>

	Change scno type from long to unsigned long.
	Use an unsigned type for syscall numbers as they are not intended
	for signed arithmetics.  Introduce kernel_scno_t as a typedef
	to unsigned long, that could be changed later to kernel_ulong_t.

	* kernel_types.h (kernel_scno_t): New type, typedef to unsigned long.
	* defs.h (struct tcb): Change type of scno field from long
	to kernel_scno_t.
	(syscall_name): Change argument type from long to kernel_scno_t.
	(scno_in_range, scno_is_valid): Change argument type from unsigned long
	to kernel_scno_t.
	* linux/aarch64/set_scno.c (arch_set_scno): Change scno argument type
	from long to kernel_scno_t.
	* linux/alpha/set_scno.c (arch_set_scno): Likewise.
	* linux/arc/set_scno.c (arch_set_scno): Likewise.
	* linux/arm/set_scno.c (arch_set_scno): Likewise.
	* linux/avr32/set_scno.c (arch_set_scno): Likewise.
	* linux/bfin/set_scno.c (arch_set_scno): Likewise.
	* linux/crisv10/set_scno.c (arch_set_scno): Likewise.
	* linux/hppa/set_scno.c (arch_set_scno): Likewise.
	* linux/i386/set_scno.c (arch_set_scno): Likewise.
	* linux/ia64/set_scno.c (arch_set_scno): Likewise.
	* linux/m68k/set_scno.c (arch_set_scno): Likewise.
	* linux/metag/set_scno.c (arch_set_scno): Likewise.
	* linux/microblaze/set_scno.c (arch_set_scno): Likewise.
	* linux/mips/set_scno.c (arch_set_scno): Likewise.
	* linux/nios2/set_scno.c (arch_set_scno): Likewise.
	* linux/or1k/set_scno.c (arch_set_scno): Likewise.
	* linux/powerpc/set_scno.c (arch_set_scno): Likewise.
	* linux/riscv/set_scno.c (arch_set_scno): Likewise.
	* linux/s390/set_scno.c (arch_set_scno): Likewise.
	* linux/sh/set_scno.c (arch_set_scno): Likewise.
	* linux/sh64/set_scno.c (arch_set_scno): Likewise.
	* linux/sparc/set_scno.c (arch_set_scno): Likewise.
	* linux/tile/set_scno.c (arch_set_scno): Likewise.
	* linux/x86_64/set_scno.c (arch_set_scno): Likewise.
	* linux/xtensa/set_scno.c (arch_set_scno): Likewise.
	* linux/aarch64/get_scno.c (arch_get_scno): Change scno variable type
	from long to kernel_scno_t.
	* linux/alpha/get_scno.c (arch_get_scno): Likewise.
	* linux/arm/get_scno.c (arch_get_scno): Likewise.
	* linux/sh/get_scno.c (arch_get_scno): Likewise.
	* linux/x86_64/get_scno.c (arch_get_scno): Likewise.
	* syscall.c (arch_set_scno): Likewise.
	(shuffle_scno): Change return type from long to kernel_scno_t.
	(syscall_name): Change argument type from long to kernel_scno_t.

2016-12-18  Dmitry V. Levin  <ldv@altlinux.org>

	Lowercase SCNO_IN_RANGE and SCNO_IS_VALID.
	* defs.h (SCNO_IN_RANGE): Rename to scno_in_range.  All callers updated.
	(SCNO_IS_VALID): Rename to scno_is_valid.  All callers updated.

	Turn SCNO_IN_RANGE and SCNO_IS_VALID into static inline functions.
	* defs.h (SCNO_IN_RANGE, SCNO_IS_VALID): Transform into static inline
	functions.

	count.c: use syserror instead of direct u_error access.
	* count.c (count_syscall): Use syserror instead of u_error.

	Replace "(unsigned long) -1L" with -1UL.
	* defs.h (dumpiov): Replace "(unsigned long) -1L" with -1UL.
	* io.c (print_iovec, tprint_iov): Likewise.
	* msghdr.c (SYS_FUNC(sendmsg)): Likewise.
	* syscall.c (dumpio): Likewise.
	* poll.c (decode_poll_exiting): Replace "(unsigned int) -1" with -1U.

	Add toplevel recursive check-valgrind rule.
	* Makefile.am (.PHONY): Add check-valgrind-local.
	(check-valgrind): New rule.
	* configure.ac (AM_EXTRA_RECURSIVE_TARGETS): Add it.

	m4: fix check-valgrind-* rules generated by AX_VALGRIND_CHECK.
	* m4/ax_valgrind_check.m4 (check-valgrind-$(1)): Depend
	on $(BUILT_SOURCES), honor $(AM_MAKEFLAGS), build check-am
	instead of check-TESTS.

	travis: do coverage using a dedicated build.
	* .travis.yml (after_success): Remove.
	(matrix): Create an entry for the regular x86_64 target.
	* travis-success.sh: Merge into ...
	* travis-build.sh: ... this file.  Disable optimization
	for coverage builds.
	* travis-install.sh: Rename COVERAGE=true to CHECK=coverage.

2016-12-17  Dmitry V. Levin  <ldv@altlinux.org>

	mips n32: provide fallback definitions of kernel_long_t/kernel_ulong_t.
	* kernel_types.h [!(HAVE___KERNEL_LONG_T && HAVE___KERNEL_ULONG_T) &&
	LINUX_MIPSN32] (kernel_long_t, kernel_ulong_t): Define to long long types.

2016-12-17  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: simplify definitions of bit mask constants in umovestr.
	* util.c (umovestr): Do not check for SIZEOF_LONG in definitions
	of bit mask constants.

	tests: check decoding of prctl operations without arguments.
	* tests/prctl-no-args.c: New file.
	* tests/prctl-no-args.test: New test.
	* tests/.gitignore: Add prctl-no-args.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add prctl-no-args.test.

	tests: check decoding of prctl PR_[GS]ET_SECUREBITS operations.
	* tests/prctl-securebits.c: New file.
	* tests/prctl-securebits.test: New test.
	* tests/.gitignore: Add prctl-securebits.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add prctl-securebits.test.

	tests: check decoding of prctl PR_[GS]ET_DUMPABLE operations.
	* tests/prctl-dumpable.c: New file.
	* tests/prctl-dumpable.test: New test.
	* tests/.gitignore: Add prctl-dumpable.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add prctl-dumpable.test.

	prctl: implement decoding of SUID_DUMP_* constants in PR_[GS]ET_DUMPABLE
	* xlat/pr_dumpable.in: New file.
	* prctl.c: Include "xlat/pr_dumpable.h".
	(SYS_FUNC(prctl)): Decode returned value of PR_GET_DUMPABLE operation
	and the second syscall argument of PR_SET_DUMPABLE operation
	as SUID_DUMP_* constants.

2016-12-16  Dmitry V. Levin  <ldv@altlinux.org>

	Include "kernel_types.h" in defs.h and tests/tests.h.
	As kernel_ulong_t type is going to be used in the definition
	of struct tcb and in many function prototypes, make it readily
	available for every source file by including "kernel_types.h"
	in defs.h and tests/tests.h files.

	* defs.h: Include "kernel_types.h".
	* tests/tests.h: Likewise.
	* desc.c: Do not include "kernel_types.h".
	* dirent.c: Likewise.
	* keyctl.c: Likewise.
	* syscall.c: Likewise.
	* linux/asm_stat.h: Likewise.
	* tests/answer.c: Likewise.
	* tests/epoll_pwait.c: Likewise.
	* tests/fanotify_init.c: Likewise.
	* tests/fanotify_mark.c: Likewise.
	* tests/file_handle.c: Likewise.
	* tests/ftruncate.c: Likewise.
	* tests/getdents.c: Likewise.
	* tests/init_delete_module.h: Likewise.
	* tests/inotify.c: Likewise.
	* tests/inotify_init1.c: Likewise.
	* tests/ioprio.c: Likewise.
	* tests/ipc_msgbuf.c: Likewise.
	* tests/kcmp.c: Likewise.
	* tests/kexec_file_load.c: Likewise.
	* tests/kexec_load.c: Likewise.
	* tests/keyctl.c: Likewise.
	* tests/lookup_dcookie.c: Likewise.
	* tests/lseek.c: Likewise.
	* tests/mq_sendrecv.c: Likewise.
	* tests/nsyscalls.c: Likewise.
	* tests/pkey_alloc.c: Likewise.
	* tests/pkey_free.c: Likewise.
	* tests/pkey_mprotect.c: Likewise.
	* tests/prctl-pdeathsig.c: Likewise.
	* tests/prctl-tsc.c: Likewise.
	* tests/preadv2-pwritev2.c: Likewise.
	* tests/process_vm_readv_writev.c: Likewise.
	* tests/read-write.c: Likewise.
	* tests/setfsugid.c: Likewise.
	* tests/setns.c: Likewise.
	* tests/truncate.c: Likewise.
	* tests/unshare.c: Likewise.
	* tests/xgetrlimit.c: Likewise.

2016-12-15  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.15-1.
	* strace.spec.in: Likewise.

2016-12-14  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: provide fallback definitions for NETLINK_* constants.
	As new constants have been added gradually over kernel releases, define
	all constant values to make newer constants decoded properly when strace
	is built with older kernel headers.

	* xlat/netlink_protocols.in: Add default values for constants.
	* net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG]: Remove.
	* socketutils.c: Likewise.

2016-12-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests: relax getaffinity return value check in tests/sched_xetaffinity.c
	* tests/sched_xetaffinity.c (errstr): New variable.
	(getaffinity, setaffinity): Initialize it.
	(main): Use it.  Allow getaffinity return value to be less than
	its cpusetsize argument.

	tests: fix threads-execve.test for large pids.
	* tests/threads-execve.c (main): Fix expected output for large pids.

2016-12-13  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.15 release.
	* NEWS: Update for 4.15 release.

	.mailmap: add addresses of Thomas De Schampheleire.
	* .mailmap: Add both addresses of Thomas De Schampheleire here to avoid
	duplications in CREDITS file.

	Sync strace.spec and debian/ with packages.
	* debian/control: Add Vcs-* metadata from 4.13-0.1.
	* debian/watch: Sync with 4.13-0.1.
	* strace.spec.in: Sync with 4.14.0.100.622a-1.

2016-12-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: workaround a bug in GNU grep.
	Workaround a bug introduced in GNU grep 2.27, for details see
	https://lists.gnu.org/archive/html/bug-grep/2016-12/msg00011.html

	* tests/init.sh (grep_pid_status): New function.
	* tests/detach-running.test: Use it instead of grep to search
	in /proc/$pid/status.
	* tests/detach-sleeping.test: Likewise.
	* tests/detach-stopped.test: Likewise.

2016-12-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: fix typo in comment inside prctl-tsc.c.

2016-12-13  Sean Stangl  <sstangl@mozilla.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Fix libunwind segfault when -p is passed before -k.
	* strace.c (init) [USE_LIBUNWIND]: Call unwind_tcb_init after
	unwind_init for all allocated tcb structures if stack trace is enabled.
	* unwind.c (unwind_tcb_init): Skip if tcb is already initialized.

2016-12-13  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Update NEWS.

2016-12-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip fault injection tests on unsupported platforms.
	* tests/fault_injection.sh: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/fault_injection-exit_group.test: Use it.
	* tests/fault_injection.test: Likewise.

	tests: introduce require_min_kernel_version_or_skip function.
	* tests/init.sh (kernel_version_code,
	require_min_kernel_version_or_skip): New functions.
	* tests/threads-execve.test: Use require_min_kernel_version_or_skip.

2016-12-07  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add descriptions to prctl-pdeathsig and prctl-tsc tests.

2016-12-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify prctl-pdeathsig.test and prctl-tsc.test.
	Rrobustify remaining prctl tests against unrelated prctl invocations

	* tests/prctl-pdeathsig.test: Filter out unrelated PR_GET_* and PR_SET_*
	prctl calls.
	* tests/prctl-tsc.test: Likewise.

2016-12-07  Thomas De Schampheleire  <thomas.de_schampheleire@nokia.com>

	Makefile.am: don't confuse CFLAGS and CFLAGS_FOR_BUILD.
	Commit dc427d50d96b15c9a64d7e78d97ce4d194622a63 enabled a number of extra
	warning flags through configure.ac.  The configure script will determine
	dynamically if CC supports these flags before adding them to WARN_CFLAGS.

	ioctlsort is compiled with CC_FOR_BUILD, rather than CC.  Nevertheless,
	the flags passed to this compilation also include WARN_CFLAGS (through
	AM_CFLAGS).  This is incorrect: in a cross-compilation use case, CC
	and CC_FOR_BUILD are not the same.  The former is the cross-compiler,
	the latter is the host compiler.  Both may be of different versions
	and support different warning flags.

	In particular, this posed a problem when cross-compiling with a host
	compiler gcc 4.1, which does not support all the new flags:

	    /usr/bin/gcc -DHAVE_CONFIG_H   -I./linux/arm -I./linux/arm -I./linux
	    -I./linux -I. -I. -I/host-sysroot/usr/include -Wall -Wempty-body
	    -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op
	    -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration
	    -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2
	    -I/host-sysroot/usr/include -DIOCTLSORT_INC=\"ioctls_all0.h\" -c -o
	    ioctlsort0.o ./ioctlsort.c
	    cc1: error: unrecognized command line option "-Wempty-body"
	    cc1: error: unrecognized command line option "-Wignored-qualifiers"
	    cc1: error: unrecognized command line option "-Wlogical-op"
	    cc1: error: unrecognized command line option "-Wmissing-parameter-type"
	    cc1: error: unrecognized command line option "-Wold-style-declaration"
	    cc1: error: unrecognized command line option "-Wtype-limits"
	    make[2]: *** [ioctlsort0.o] Error 1

	* Makefile.am (AM_CFLAGS_FOR_BUILD, AM_CPPFLAGS_FOR_BUILD): New
	variables.
	(ioctlsort_CPPFLAGS): Use AM_CPPFLAGS_FOR_BUILD instead of AM_CPPFLAGS.
	(ioctlsort_CFLAGS): Use AM_CFLAGS_FOR_BUILD instead of AM_CFLAGS.
	(ioctlsort_LDFLAGS): Use AM_LDFLAGS_FOR_BUILD instead of AM_LDFLAGS.
	* m4/ax_prog_cc_for_build.m4 (AX_PROG_CC_FOR_BUILD): Redirect
	WARN_CFLAGS and gl_unknown_warnings_are_errors, call st_WARN_CFLAGS,
	substitute WARN_CFLAGS_FOR_BUILD.

2016-12-07  Dmitry V. Levin  <ldv@altlinux.org>

	m4: prepare gl_WARN_ADD for simultaneous use of multiple compilers.
	* m4/warnings.m4 (gl_COMPILER_OPTION_IF): Change gl_Flags to use
	_AC_LANG_PREFIX[]FLAGS in unquoted form.  Change gl_Warn to use gl_Flags
	instead of _AC_LANG_ABBREV.  Change notification message to mention
	the variable name of the compiler.
	(gl_UNKNOWN_WARNINGS_ARE_ERRORS): Do nothing if
	gl_unknown_warnings_are_errors is set.
	(gl_WARN_ADD): Change the use of gl_UNKNOWN_WARNINGS_ARE_ERRORS from
	AC_REQUIRE to a regular call.

2016-12-07  Dmitry V. Levin  <ldv@altlinux.org>

	AX_PROG_CC_FOR_BUILD: redirect more variables related to C compiler.
	Some of these variables cannot be redirected using traditional
	pushdef/popdef mechanism because of complex constructions like
	[ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu] employed by autoconf macros.
	Use st_SAVE_VAR/st_RESTORE_VAR to workaround this issue.

	* m4/ax_prog_cc_for_build.m4: Redirect ac_cv_prog_cc_stdc,
	ac_cv_prog_cc_c11, ac_cv_prog_cc_c99, ac_cv_prog_cc_c89,
	am_cv_prog_cc_c_o, and am_cv_CC_dependencies_compiler_type using
	pushdef/popdef.
	Redirect ac_c_decl_warn_flag, ac_c_preproc_warn_flag, ac_c_werror_flag,
	ac_compile, ac_compiler_gnu, ac_cpp, ac_cv_c_compiler_gnu,
	ac_cv_c_decl_report, and ac_link using st_SAVE_VAR/st_RESTORE_VAR.

2016-12-07  Dmitry V. Levin  <ldv@altlinux.org>

	Move all gl_WARN_ADD calls to a separate m4 macro.
	This is going to be needed for the upcoming AX_PROG_CC_FOR_BUILD
	change.

	* configure.ac: Call st_WARN_CFLAGS before AX_PROG_CC_FOR_BUILD.
	Move all gl_WARN_ADD calls ...
	* m4/st_warn_cflags.m4: ... here.

2016-12-07  Dmitry V. Levin  <ldv@altlinux.org>

	m4: introduce st_SAVE_VAR and st_RESTORE_VAR macros.
	These new macros are going to be needed for the upcoming
	AX_PROG_CC_FOR_BUILD change.

	* m4/st_save_restore_var.m4: New file.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add valgrind support to "make check"
	* m4/ax_valgrind_check.m4: Import from the autoconf-archive package.
	* configure.ac: Invoke AX_VALGRIND_CHECK.
	* valgrind.supp: Move to tests/strace.supp.
	* Makefile.am (EXTRA_DIST): Remove valgrind.supp.
	* tests/Makefile.am: Add @VALGRIND_CHECK_RULES@.
	(VALGRIND_FLAGS, VALGRIND_SUPPRESSIONS_FILES): New variables.
	(EXTRA_DIST): Add strace.supp.
	* tests/init.sh: Add valgrind command prefix to $STRACE when appropriate.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify threads-execve.test against race conditions.
	Due to probabilistic nature of the test, try it several times.

	* tests/threads-execve.c (NUMBER_OF_ITERATIONS): Change to 1.
	* tests/threads-execve.test: Iterate up to 10 times.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix expected output in strace-ttt.test.
	If strace -ttt is running too long, it might happen that time stamps
	before and after its invocation differ for more than a second.
	Adjust expected output to handle this rare but possible case.

	* tests/strace-ttt.test: Allow any time stamp between start and finish
	of strace invocation.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix expected output in strace-tt.test.
	If strace -tt is running too long, it might happen that time stamps
	before and after its invocation differ for more than a second.
	Adjust expected output to handle this rare but possible case.

	* tests/strace-tt.test: Allow any time stamp between start and finish
	of strace invocation.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify redirect.test against race conditions.
	Introduce a synchronization mechanism between the tracee and its peer.

	* tests/redirect.test: Change timeout file to $OUT.  Let the tracee
	remove $LOG, wait for $LOG removal in its peer.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify attach-f-p.test against race conditions.
	Introduce a synchronization mechanism between attach-f-p and strace.

	* tests/attach-f-p-cmd.c: New file.
	* tests/Makefile.am (check_PROGRAMS): Add attach-f-p-cmd.
	* tests/attach-f-p.c: Include <sys/stat.h>.
	(main): Write to stdout instead of descriptor 3.  Wait for the peer
	writing to stdout.
	* tests/attach-f-p.test: Assume that ./attach-f-p-cmd works.
	Use $OUT for expected output.  Use attach-f-p-cmd for unlocking $OUT.

2016-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify attach-p-cmd.test against race conditions.
	Introduce a synchronization mechanism between attach-p-cmd-p
	and attach-p-cmd-cmd processes.

	* tests/attach-p-cmd-cmd.c: Include <errno.h> and <sys/stat.h>.
	(main): Wait for the lock directory creation by attach-p-cmd-p.
	* tests/attach-p-cmd-p.c: Include <errno.h> and <sys/stat.h>.
	(main): Create a lock directory and wait for its removal
	by attach-p-cmd-cmd.
	* tests/attach-p-cmd.test: Assume that test programs work.

2016-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	Rewrite remaining qual_* parsers using bit sets.
	* defs.h (struct fault_opts): Replace forward declaration
	with a definition.
	(qualbits_t, qualify_read, qualify_write, qualify_signals): Remove.
	(qual_flags): New function prototype.
	(nsyscall_vec, sysent_vec, fault_vec): New variable prototypes.
	* qualify.c (abbrev_set, fault_set, raw_set, trace_set, verbose_set):
	New variables.
	(qualify_read, qualify_write, qualify_signals): Add static qualifier.
	(find_errno_by_name, lookup_class, parse_fault_expression,
	parse_fault_token, qual_flags, qualify, qualify_abbrev, qualify_fault,
	qualify_raw, qualify_syscall, qualify_syscall_class,
	qualify_syscall_name, qualify_syscall_number, qualify_syscall_tokens,
	qualify_trace, qualify_verbose, strip_prefix): New functions.
	* syscall.c (nsyscall_vec, nsysent_vec): Remove static qualifier.
	(MAX_NSYSCALLS1, MAX_NSYSCALLS2, MAX_NSYSCALLS, qual_vec, qual_flags,
	qual_fault, qual_syscall, qual_options, fault_opts, qualify_one,
	qualify_scno, lookup_class, qualify_syscall_class, qualify_syscall_name,
	qual_syscall_ex, qual_syscall, strip_prefix, find_errno_by_name,
	parse_fault_token, parse_fault_expression, qual_fault, qualify): Remove.
	(decode_socket_subcall, decode_ipc_subcall, decode_mips_subcall,
	get_scno): Update use of qual_flags.
	(inject_syscall_fault_entering): Update per-personality allocation
	of tcp->fault_vec.
	* tests/fault_injection-exit_group.test: Check parsing of inversed
	fault sets.
	* tests/fault_injection.test: Check parsing of -efault=none.
	* tests/options-syntax.test: Check parsing of invalid syscall numbers.

	Change qual_vec/qual_fault into static fixed size arrays.
	* defs.h (qual_vec, num_quals): Remove.
	(qual_flags): Move ...
	* syscall.c: ... here.
	(num_quals, num_faults, MIN_QUALS, reallocate_vec, reallocate_qual,
	reallocate_fault): Remove.
	(qual_vec, qual_fault): Change into static fixed size arrays.
	(qualify_one): Remove reallocate_qual and reallocate_fault calls.
	(qualify): Likewise.  Replace num_quals and num_faults with
	MAX_NSYSCALLS.

	Rewrite qual_signal using bit sets.
	* defs.h (signal_set): New variable prototypes.
	(qualify_signals): New function prototypes.
	(QUAL_SIGNAL): Change to a value greater than 0xff.
	(QUAL_FAULT): Change to a lower value.
	* qualify.c (signal_set): New variable.
	(sigstr_to_uint, qualify_signals): New functions.
	* syscall.c (qual_signal): Remove.
	(qual_options): Replace qual_signal with NULL.
	(qualify): Use qualify_signals.
	* strace.c (print_signalled, print_stopped): Use is_number_in_set
	with signal_set argument.

2016-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	Rewrite qual_desc using bit sets.
	As a side effect, this also fixes support of negated sets
	of descriptors.

	* defs.h (struct number_set): New forward declaration.
	(read_set, write_set): New variable prototypes.
	(is_number_in_set, qualify_read, qualify_write): New function
	prototypes.
	(QUAL_READ, QUAL_WRITE): Change to values greater than 0xff.
	* qualify.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* syscall.c (qual_desc): Remove.
	(qual_options): Replace qual_desc with NULL.
	(qualify): Use qualify_read and qualify_write.
	(dumpio): Use is_number_in_set.
	* tests/options-syntax.test: Check invalid sets of descriptors.
	* tests/readv.test: Check dumping of negated sets of descriptors.

2016-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip redirect-fds.test when strace is wrapped with valgrind.
	valgrind is not as transparent as strace wrt standard descriptors,
	so if strace is wrapped with valgrind, the test would check valgrind
	transparency properties and fail imminently.

	* tests/redirect-fds.test: Skip the test when $STRACE shows a presence
	of valgrind.

2016-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	Add valgrind.supp.
	As valgrind is not quite happy about the way how get_cpuset_size uses
	sched_getaffinity, add a suppression file for this case.

	* valgrind.supp: New file.
	* Makefile.am (EXTRA_DIST): Add it.

2016-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	affinity: pass 0 as a pid to sched_getaffinity.
	* affinity.c (get_cpuset_size): Pass 0 instead of getpid()
	to sched_getaffinity.

	affinity: document the method of finding out the cpuset size.
	* affinity.c (get_cpuset_size): Add a comment about sched_getaffinity.

2016-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: make options-syntax.test tolerant of strace wrappers.
	Change the test to allow wrappers like STRACE="valgrind ./strace".

	* tests/options-syntax.test: Strip all words but last from $STRACE
	variable in all contexts where the name of strace executable is expected
	in its output.

2016-12-04  Dmitry V. Levin  <ldv@altlinux.org>

	Do not allocate memory for line buffered output.
	libc is perfectly capable of allocating memory for its buffers,
	so let it do its job.

	* strace.c (init): Do not allocate memory for setvbuf invocation.

2016-12-04  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.

	tests: use kernel_ulong_t as argument type in setfsuid/setfsgid tests.
	* setfsugid.c: Include "kernel_types.h".
	(main): Change type of entries of the "tests" array from long to
	kernel_ulong_t.

2016-12-04  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Elvira Khabirova  <lineprinter0@gmail.com>

	uid: print size as signed in setgroups/getgroups.
	As this is the type used in kernel.

	* uid.c (SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Print size parameter
	as "%d".
	* tests/getgroups.c: Update expected output.
	* tests/setgroups.c: Likewise.

2016-12-04  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Elvira Khabirova  <lineprinter0@gmail.com>

	uid: use printuid for printing UID/GID value.
	* uid.c (setfsuid, get_print_uid, print_gid): Use printuid.
	* tests/setfsugid.c (printuid): New function.
	(main): Use it to print UID/GID values.
	* tests/setgroups.c: Likewise.
	* tests/setugid.c (ugid2int): Remove.
	(printuid): New function.
	(main): Use it to print UID/GID values.

2016-12-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: additional check for PTRACE_SETSIGINFO ptrace command.
	* tests/ptrace.c (main): Add an additional PTRACE_SETSIGINFO check.

2016-12-01  Dmitry V. Levin  <ldv@altlinux.org>

	syscall_name: clear __X32_SYSCALL_BIT from syscall number on x32.
	* linux/x86_64/get_scno.c (X32_PERSONALITY_NUMBER): New macro.
	* syscall.c (syscall_name) [X32_PERSONALITY_NUMBER && __X32_SYSCALL_BIT]:
	Clear __X32_SYSCALL_BIT from scno on x32 personality.

2016-12-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Print syscall names only for defined syscalls.
	The string literal "__NR_syscall_4294967295" is semantically incorrect
	as there is no such constant defined.

	* syscall.c (syscall_name): Return NULL if there is no syscall
	corresponding to the given number.
	* defs.h (syscall_name): Document this behaviour.
	* printsiginfo.c (print_si_info): Print syscall name with "__NR_" prefix
	only if there is a syscall corresponding to si_syscall number; print
	a plain syscall number otherwise.
	* tests/ptrace.c (main): Update expected output.

2016-12-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	affinity: print cpu set as an array.
	* affinity.c: Add comma between elements of cpu set.
	* tests/sched_xetaffinity.c (main): Update expected output.

	statfs: fix printing format of f_fsid field.
	* print_statfs.c: Print f_fsid as a structure containing field "val"
	which, in turn, is an array of two elements that used to be printed
	as members of f_fsid structure.
	* tests/statfs.expected: Update expected output.
	* tests/xstatfsx.c (print_statfs): Likewise.

	swap: always print priority value.
	* swapon.c (SYS_FUNC(swapon)): Do not check for non-zero the value
	of the prio variable in order to print it.
	* tests/swap.c (main): Update expected output.

2016-12-01  Elvira Khabirova  <lineprinter0@gmail.com>

	tests: show pattern line number in match_grep.
	This makes debugging of failing test  a bit easier.

	* tests/init.sh (match_grep): Add the cnt variable, increment it on every
	pattern line read, print it as a prefix for non-matched pattern.

2016-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Elvira Khabirova  <lineprinter0@gmail.com>

	futex: make output of the val3 argument of the FUTEX_WAKE_OP command more structured
	It is a number which consists of several xlat values, not a structure.

	* futex.c (SYS_FUNC(futex)): Modify output of the val3 argument
	of the FUTEX_WAKE_OP futex syscall command.
	* tests/futex.c (main): Update expected output.

2016-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: additional checks for prctl-* tests.
	* tests/prctl-pdeathsig.c (main): Additional checks.
	* tests/prctl-tsc.c (main): Likewise.
	* tests/prctl-pdeathsig.test: Update value of -a argument.
	* tests/prctl-tsc.test: Likewise.

2016-11-30  JingPiao Chen  <chenjingpiao@foxmail.com>

	tests: add prctl-pdeathsig.test and prctl-tsc.test.
	* tests/prctl-pdeathsig.c: New file.
	* tests/prctl-tsc.c: Likewise.
	* tests/prctl-pdeathsig.test: New test.
	* tests/prctl-tsc.test: Likewise.
	* tests/.gitignore: Add prctl-pdeathsig and prctl-tsc.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add prctl-pdeathsig.test and prctl-tsc.test.

2016-11-30  Dmitry V. Levin  <ldv@altlinux.org>

	syscall: Simplify strip_prefix.
	* syscall.c (strip_prefix): Use strncmp instead of strlen+memcmp.

	util: fix integer overflow check in string_to_uint_ex.
	* util.c (string_to_uint_ex): Fix the check for integer overflow
	on systems where LONG_MAX == INT_MAX.

	Check dumping of io syscalls when descriptor arguments are sensibly large
	* tests/tests.h (pipe_maxfd): New prototype.
	* tests/pipe_maxfd.c: New file.
	* tests/print_maxfd.c: Likewise.
	* tests/.gitignore: Add print_maxfd.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(libtests_a_SOURCES): Add pipe_maxfd.c.
	* tests/readv.c (main): Use pipe_maxfd() instead of pipe(),
	fds[0] instead of 0, fds[1] instead of 1.
	* tests/readv.test: Use print_maxfd to specify dump descriptor numbers.

	dumpio: remove useless check.
	* syscall.c (dumpio): Remove SEN_printargs check.  Use tcp->s_ent->sen
	directly.

2016-11-29  Dmitry V. Levin  <ldv@altlinux.org>

	Fix dumping of io syscalls when descriptor argument has unused bits set.
	* syscall.c (dumpio): Explicitly cast the first argument of syscall
	to "int", the same way as the kernel does.
	* tests/read-write.c: Include <asm/unistd.h> and "kernel_types.h".
	(k_read, k_write): New functions.
	(test_dump, main): Use them.

	x32: fix preadv2-pwritev2.test.
	* tests/preadv2-pwritev2.c: Include "kernel_types.h".
	(main): Use kernel_ulong_t instead of unsigned long as types
	of arguments of preadv2 and pwritev2 syscalls.

	x32: wire up preadv2 and pwritev2 syscalls.
	* linux/x32/syscallent.h [546]: Add preadv2 entry.
	[547]: Add pwritev2 entry.

2016-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Elvira Khabirova  <lineprinter0@gmail.com>

	signal: fix omission of field names in sigaction printers.
	* signal.c (decode_old_sigaction, decode_new_sigaction): Add printing
	of the field names.
	* tests/sigaction.awk: Update expected output.

2016-11-29  Elvira Khabirova  <lineprinter0@gmail.com>

	Make date output format conform to ISO 8601.
	* util.c (sprinttime): Make date output conform to ISO 8601.
	* tests/utime.c (print_tm): Update expected output.
	* tests/xstatx.c (print_time): Likewise.

2016-11-29  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite utime.test without relying on libc utime wrapper.
	* tests/utime.c (k_utime): New function, a thin wrapper around
	syscall(__NR_utime).
	(main): Use it instead of utime.
	* tests/utime.test: Update.

2016-11-29  Dmitry V. Levin  <ldv@altlinux.org>

	Fix meaning of negated sets in fault expressions.
	Change the parser of fault expression to follow the POLA:
	-e fault=!SET
	means that all syscalls except those from SET are subject to fault
	injection;
	-e fault=!SET1:error=ERRNO1, -e fault=!SET2:error=ERRNO2
	means that all syscalls except those from SET2 are subject to fault
	injection with error code ERRNO2, and all syscalls from SET2 that are
	not in SET1 are subject to fault injection with error code ERRNO1.

	* syscall.c (qualify_scno, qualify_syscall_class, qualify_syscall_name):
	Handle negated QUAL_FAULT case differently.
	* tests/fault_syntax.test: Add checks of negated sets.

2016-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_sigevent: fix field names of sigev_value structure.
	* print_sigevent.c (print_sigevent): Change "int" to "sival_int", "ptr"
	to "sival_ptr".
	* tests/mq_sendrecv.c (main): Update expected output in accordance with
	fixed field names.
	* tests/timer_create.c (main): Likewise.

	tests: add more utime checks.
	* tests/utime.c: Include <unistd.h> and <asm/unistd.h>.
	(main): Add checks for invalid pointers.

	utime: fix omission of field names in utimbuf structure printing.
	* utime.c (SYS_FUNC(utime)): Print struct utimbuf as a structure,
	not as an array (use curly brackets instead of square ones).
	Add field names to the output.
	* tests/utime.c (main): Update expected output.

	mem: print mincore output as an array.
	* mem.c (SYS_FUNC(minore)): Print commas between elements.
	* tests/mincore.c (print_mincore): Update expected output in accordance
	with syscall decoder formatting change.

2016-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: provide information whether xlat value has been found.
	This is necessary for the upcoming change in the output format
	of the val3 argument of the FUTEX_WAKE_OP futex command.

	* defs.h (printxvals, printxval_searchn): Change return type to int.
	(printxval64, printxval, printxval_long): Likewise.  Forward the value
	returned by printxvals call.
	* util.c (printxvals, printxval_searchn): Change return type to int,
	return 1 if xlat value has been found, 0 otherwise.

2016-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: check dflt argument for NULL in printxvals.
	This is necessary for the upcoming change in the output format
	of the val3 argument of the FUTEX_WAKE_OP futex command.

	* util.c (printxvals): Do not print dflt if it is NULL.

2016-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	capability: fix omission of capability structure field names.
	* capability.c (print_cap_header, print_cap_data): Add field names
	to the output.
	* tests/caps.awk: Update test output.

2016-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix "comparison between signed and unsigned" compilation warnings
	* tests/readv.c (main): Cast r_len to int.
	* tests/preadv2-pwritev2.c (dumpio): Likewise.

	aarch64, arm, sparc: add comments on fault injection support in kernel.
	* linux/aarch64/set_scno.c: Note the kernel commit that introduced
	NT_ARM_SYSTEM_CALL support.
	* linux/arm/set_scno.c: Note the kernel commit that introduced
	PTRACE_SET_SYSCALL support.
	* linux/sparc/set_scno.c: Note the kernel commit that introduced
	reloading from the syscall number register.

	tests: check -C option.
	* tests/strace-C.expected: New file.
	* tests/strace-C.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add strace-C.test.
	(EXTRA_DIST): Add strace-C.expected.

	tests: check basic options syntax.
	* tests/options-syntax.test: New file.
	* tests/Makefile.am (MISC_TESTS): Add it.

2016-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	Fix -r option syntax.
	While -r option implies -t, it should not literally have the effect
	of -t option, e.g. -rr should not increment tflag twice.

	* strace.c (init): In the getopt loop, do not increment tflag for each
	occurrence of -r option.  After the getopt loop, if rflag is set, set
	tflag to 1.  Issue a warning that -tt has no effect with -r.

2016-11-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Print timeval pair as an array of timeval entries.
	* print_timeval.c (print_timeval_item): New function.
	(print_timeval_pair): Use it as a print_function in print_array call.
	* tests/futimesat.c (main): Update to test new behaviour.
	* tests/utimes.c (main): Likewise.

	tests: treat tv_sec/tv_usec as signed types in futimesat and utimes tests
	* tests/futimesat.c: Print tv_sec and tv_usec fields as signed types.
	* tests/utimes.c: Likewise.

2016-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: print struct timeval32 consistently.
	* defs.h [ALPHA] (timeval32_t): New type.
	[ALPHA] (print_timeval32_t): New prototype.
	* print_timeval.c [ALPHA] (timeval32_t): Remove.
	[ALPHA] (print_timeval32_t): Remove static keyword.
	* printrusage.c [ALPHA] (printrusage32): Use timeval32_t instead
	of local definition of struct timeval32.  Use print_timeval32_t.

2016-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	Print struct timeval consistently.
	Use print_struct_timeval interface to print struct timeval.

	* print_timeval.c (print_struct_timeval): New mpers printer.
	* print_timex.c (print_timex): Use it.
	* printrusage.c (printrusage): Likewise.
	* v4l2.c (print_v4l2_buffer): Likewise.
	* tests/getrusage.c (main): Print tv_sec and tv_usec fields as signed.
	* tests/waitid.c (sprint_rusage): Likewise.

	Suggested-by: Eugene Syromyatnikov <evgsyr@gmail.com>

2016-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	Split print_time.c.
	After commit v4.14-136-g151d1d1 that removed the last object common
	for timespec and timeval parsers there is no need to keep them all
	in a single file.

	* print_timespec.c: New file.
	* print_timeval.c: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* print_time.c: Move all timespec related code to print_timespec.c.
	Move all timeval related code to print_timeval.c.

2016-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of threads when a non-leader thread invokes execve
	* tests/threads-execve.c: New file.
	* tests/threads-execve.test: New test.
	* tests/.gitignore: Add threads-execve.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(threads_execve_LDADD): New variable.
	(MISC_TESTS): Add threads-execve.test.

2016-11-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of fault injected exit_group syscall.
	* tests/answer.c: New file.
	* tests/fault_injection-exit_group.expected: Likewise.
	* tests/fault_injection-exit_group.test: New test.
	* tests/.gitignore: Add answer.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add fault_injection-exit_group.test.
	(EXTRA_DIST): Add fault_injection-exit_group.expected.

2016-11-27  Dmitry V. Levin  <ldv@altlinux.org>

	Set PTRACE_O_TRACEEXIT option and handle PTRACE_EVENT_EXIT events.
	Do not assume that some syscalls do not generate syscall-exit-stops.
	When syscalls fail for any reason they may generate syscall-exit-stops.

	The solution is to wait for an actual exit reported by PTRACE_EVENT_EXIT
	and print the end of unfinished exiting syscall properly.

	* exit.c: Remove.
	* Makefile.am (strace_SOURCES): Remove exit.c.
	* linux/dummy.h (sys_exit): Alias to printargs_d.
	* strace.c (ptrace_setoptions): Add PTRACE_O_TRACEEXIT bit.
	(print_event_exit): New function.
	(trace): Use it in case of PTRACE_EVENT_EXIT.
	* syscall.c (trace_syscall_entering): Remove special handling
	of SEN_exit.

2016-11-27  Dmitry V. Levin  <ldv@altlinux.org>

	Change printargs to return RVAL_DECODED.
	As printargs is invoked as a generic syscall decoder only and
	it is not supposed to print anything on exiting, change printargs
	to return RVAL_DECODED so it would not be called on exiting at all.

	* util.c (printargs): Print args unconditionally, return RVAL_DECODED.

2016-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance error diagnostics of exit/exit_group decoder.
	* exit.c (SYS_FUNC(exit)): Print the name of syscall that has returned.

2016-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	Restrain from fault injection while the trace executes strace code.
	There is little use in injections of faults into syscalls made by strace.

	* syscall.c (trace_syscall_entering): Clear QUAL_FAULT bit from
	tcp->qual_flg when tcp->flags has TCB_HIDE_LOG bit set.

2016-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	Move two global flags to tracee scope.
	A simultaneous use of -p option and tracing of a command available
	since commit v4.11-183-gfa8c286 introduces a race condition because
	the flags whether the first exec has happened are global.

	Fix the race by moving hide_log_until_execve and hide_log_until_execve
	global variables to TCB_HIDE_LOG and TCB_SKIP_DETACH_ON_FIRST_EXEC bits
	in struct tcb.flags, correspondingly.

	* defs.h (TCB_HIDE_LOG, TCB_SKIP_DETACH_ON_FIRST_EXEC, hide_log):
	New macros.
	(hide_log_until_execve): Remove prototype.
	* strace.c (skip_one_b_execve, hide_log_until_execve): Remove.
	(startup_child): Set TCB_HIDE_LOG and TCB_SKIP_DETACH_ON_FIRST_EXEC bits
	in the allocated tcb structure.
	(init): Remove initialization of hide_log_until_execve and
	skip_one_b_execve.
	(print_stopped): Use hide_log() instead of hide_log_until_execve.
	(trace): Check and clear TCB_SKIP_DETACH_ON_FIRST_EXEC flag instead
	of skip_one_b_execve.
	* syscall.c (trace_syscall_entering): Clear TCB_HIDE_LOG flag instead of
	hide_log_until_execve.
	(trace_syscall_entering, trace_syscall_exiting): Check hide_log()
	instead of hide_log_until_execve.

2016-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	Treat execveat as an execve family syscall.
	* syscall.c (trace_syscall_entering): Clear hide_log_until_execve flag
	also when SEN_execveat is encountered.

2016-11-25  Dmitry V. Levin  <ldv@altlinux.org>

	Change parser of fault expressions to conform the documentation.
	Make expressions like fault=SYSCALL1,SYSCALL2:error=EPERM work
	as documented, i.e. fail both SYSCALL1 and SYSCALL2 with EPERM.

	* syscall.c (parse_fault_expression): Remove const qualifier from
	"name" and "token: variables, as well as from the return value.
	(qual_fault): Remove const qualifier from "name" variables.
	Split "name" into comma delimited tokens and pass each token
	to individual qual_syscall_ex call.
	(qualify): For QUAL_FAULT options, pass the whole option value
	to their qualify methods without prior splitting into comma
	delimited tokens.
	* tests/fault_injection.test: Check it.
	* tests/fault_syntax.test: Check empty syscall sets.

2016-11-24  Dmitry V. Levin  <ldv@altlinux.org>

	Simplify parse_fault_expression.
	* syscall.c (parse_fault_expression): Rewrite iterator over strtok_r
	in a more concise way.

2016-11-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Fix omission of field names in printers of timeval structure.
	* print_time.c (time_fmt): Remove.
	(timeval_fmt): New constant.
	(print_timeval_t, sprint_timeval, print_timeval32_t, sprint_timeval32):
	Use it instead of time_fmt.
	* print_timex.c (print_timex): Print field names of the time field.
	* printrusage.c (printrusage, printrusage32): Print field names
	of ru_utime and ru_stime fields.
	* tests/adjtimex.c (main): Add field names to expected output.
	* tests/clock_nanosleep.c (main): Likewise.
	* tests/futimesat.c (main): Likewise.
	* tests/getrusage.c (main): Likewise.
	* tests/nanosleep.c (main): Likewise.
	* tests/oldselect.expected: Likewise.
	* tests/utimes.c (main): Likewise.
	* tests/wait4.c (sprint_rusage): Likewise.
	* tests/waitid.c (sprint_rusage): Likewise.
	* tests/xetitimer.c (main): Likewise.
	* tests/xettimeofday.c (main): Likewise.
	* tests/xselect.c (main): Likewise.

	Fix omission of field names in printers of timespec structure.
	* print_time.c (timespec_fmt): New constant.
	(print_timespec_t, sprint_timespec): Use it instead of time_fmt.
	* tests/aio.c: Add field names to expected output.
	* tests/clock_nanosleep.c (main): Likewise.
	* tests/clock_xettime.c (main): Likewise.
	* tests/futex.c (main): Likewise.
	* tests/mq_sendrecv.c (do_send, do_recv): Likewise.
	* tests/nanosleep.c (main): Likewise.
	* tests/ppoll-v.expected: Likewise.
	* tests/ppoll.expected: Likewise.
	* tests/pselect6.c (main): Likewise.
	* tests/recvmmsg-timeout.c (main): Likewise.
	* tests/restart_syscall.c (main): Likewise.
	* tests/rt_sigtimedwait.c (iterate, main): Likewise.
	* tests/sched_rr_get_interval.c (main): Likewise.
	* tests/semop.c (main): Likewise.
	* tests/strace-T.expected: Likewise.
	* tests/timer_xettime.c (main): Likewise.
	* tests/timerfd_xettime.c (main): Likewise.
	* tests/utimensat.c (print_ts): Likewise.

2016-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify prctl-name.test against unrelated prctl invocations.
	* tests/prctl-name.test: Filter out unrelated PR_GET_* prctl calls.

2016-11-22  Dmitry V. Levin  <ldv@altlinux.org>

	tests: cleanup prctl-name.c.
	* tests/prctl-name.c (main): Remove "len" variable, rename "len1"
	to "len".  Remove "name1" variable, use "name" instead.

	Move KVM_* ioctl entries from ioctls_inc*.h to ioctls_arch*.h.
	* linux/32/ioctls_inc_align32.h: Regenerate.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/arm/ioctls_arch0.h: Likewise.
	* linux/i386/ioctls_arch0.h: Likewise.
	* linux/powerpc/ioctls_arch0.h: Likewise.
	* linux/s390/ioctls_arch0.h: Likewise.
	* linux/s390x/ioctls_arch0.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/x86_64/ioctls_arch0.h: Likewise.

	maint: add more workarounds for alpha and powerpc.
	* maint/ioctls_sym.sh: Skip asm/core_*.h.  Filter out from
	asm-generic/ioctls.h those macros that are defined using unavailable
	struct termios2 on alpha and powerpc.

2016-11-22  Andreas Schwab  <schwab@linux-m68k.org>

	Add ioctl definitions for 16-bit alignment.
	* Makefile.am (EXTRA_DIST): Add linux/32/ioctls_inc_align16.h.
	* linux/32/ioctls_inc_align16.h: New file.
	* linux/32/ioctls_inc.h [M68K]: Include it.

2016-11-22  Dmitry V. Levin  <ldv@altlinux.org>

	maint: move KVM_* constants from ioctls_inc.h to ioctls_arch.h.
	* maint/ioctls_gen.sh: Place constants defined in linux/kvm.h
	into ioctls_arch.h instead of ioctls_inc.h.

2016-11-21  Dmitry V. Levin  <ldv@altlinux.org>

	maint: harmonize use of ioctls_sym.sh.
	* maint/ioctls_gen.sh: Consistently specify INCLUDES for all
	ioctls_sym.sh invocations.  Use $mydir to specify ioctls_sym.sh
	location.

	maint: rework workarounds for linux/kvm.h.
	* maint/ioctls_sym.sh: Remove pre-include linux/kvm.h workarounds.
	Skip linux/kvm.h on those architectures that have no asm/kvm.h file.
	Introduce post-process workarounds, add post-process workarounds
	for linux/kvm.h.

2016-11-20  Elvira Khabirova  <lineprinter0@gmail.com>

	Restructure strace.1.
	* strace.1 (OPTIONS): Add subsections.
	(PROBLEMS): Rename to REPORTING BUGS.
	(SEE ALSO): Move to the bottom.

2016-11-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	prctl: implement decoding of PR_SET_FP_MODE and PR_GET_FP_MODE options.
	* xlat/pr_fp_mode.in: New file.
	* prctl.c: Include "xlat/pr_fp_mode.h".
	(SYS_FUNC(prctl)): Add handling for PR_SET_FP_MODE and PR_GET_FP_MODE
	options.

	prctl: add braces for conditional blocks with else/else-if blocks having braces

2016-11-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	prctl: cast arg2 to int in PR_SET_PTRACER handler.
	Kernel code does this when compares it with -1 (apart from comparing it with
	PR_SET_PTRACER_ANY, which is also -1) in security/yama/yama_lsm.c.

	* prctl.c (SYS_FUNC(prctl)) <PR_SET_PTRACER>: Cast arg2 to int before
	comparing it with -1.

2016-11-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	prctl: use getarg_ull for option value retrieval.
	The prctl syscall does not use compat on x32/n32, so argument types
	are in fact kernel_ulong_t.

	* prctl.c (print_prctl_args): Use getarg_ull, print as "%#llx" instead
	of "%#lx".
	(SYS_FUNC(prctl)): Use getarg_ull to store call arguments in arg2, arg3,
	arg4, arg5 variables of type unsigned long long.  Use them in printing
	routines.
	(SYS_FUNC(arch_prctl)): Use getarg_ull to store call argument in addr
	variable of type unsigned long long.  Print it as "%#llx" instead of
	"%#lx".

2016-11-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	block: add some definitions from <linux/blkpg.h>
	This is done in order to fix build error on old distributions where
	struct blkpg_ioctl_arg declaration is broken:

	In file included from block.c:35:
	/usr/include/linux/blkpg.h:36: error: expected ':', ',', ';', '}' or '__attribute__' before '*' token
	block.c: In function 'print_blkpg_req':
	block.c:113: error: 'struct_blkpg_ioctl_arg' has no member named 'data'

	(from SLE10)

	* block.c: Include <linux/ioctl.h> instead of <linux/blkpg.h>.
	(BLKPG, BLKPG_DEVNAMELTH, BLKPG_VOLNAMELTH): New macros.
	(struct_blkpg_ioctl_arg, struct_blkpg_partition): New definitions,
	copied from blkpg_ioctl_arg and blkpg_partition structures defined
	in <linux/blkpg.h>.

2016-11-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add values to new ARCH_* constants.
	Since UAPI header declares them under CONFIG_CHECKPOINT_RESTORE
	and they would never be defined in user space.

	* xlat/archvals.in: Add numeric values to ARCH_MAP_VDSO_* constants.

2016-11-20  Dmitry V. Levin  <ldv@altlinux.org>

	prctl: include <linux/prctl.h> instead of <sys/prctl.h>
	There are no users of prctl function in prctl.c, and all the rest
	is provided by <linux/prctl.h> anyway.

	* prctl.c: Include <linux/prctl.h> instead of <sys/prctl.h>.

2016-11-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of prctl PR_GET_NAME/PR_SET_NAME operations.
	* tests/prctl-name.c: New file.
	* tests/prctl-name.test: New test.
	* tests/.gitignore: Add prctl-name.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add prctl-name.test.

	prctl: fix printing of PR_SET_NAME's argument.
	* prctl.c (SYS_FUNC(prctl)): Use printstr_ex with QUOTE_0_TERMINATED
	instead of printstr to print the argument of PR_SET_NAME and PR_GET_NAME
	operations.

	printstr_ex: fix handling of last byte when QUOTE_0_TERMINATED bit set.
	* util.c (printstr_ex): Simplify handling of size == 0 case.
	Do not artificially decrement size when QUOTE_0_TERMINATED bit is set.
	Ensure that str[size] byte is non-zero if it hasn't been fetched.

2016-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	printstr_ex: handle QUOTE_0_TERMINATED bit consistently.
	When user_style has QUOTE_0_TERMINATED bit set, printstr_ex prints
	the fetched string as a NUL-terminated.
	After this change, the string is being fetched as a NUL-terminated, too.

	* util.c (printstr_ex): Use umovestr instead of umoven
	if QUOTE_0_TERMINATED bit is set.

2016-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	Cleanup fetch part of printstr_ex.
	* util.c (printstr_ex): Initialize "style" early, unify error handling.

2016-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	Update prctl ARCH_* constants.
	* xlat/archvals.in: Add ARCH_MAP_VDSO_X32, ARCH_MAP_VDSO_32, and
	ARCH_MAP_VDSO_64 introduced by linux kernel commit v4.9-rc1~155^2~6.

	Update V4L2_* constants.
	* xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_TOUCH introduced
	by linux kernel commit v4.9-rc4~7^2~422.
	* xlat/v4l2_input_types.in: Add V4L2_CAP_TOUCH introduced
	by linux kernel commit v4.9-rc4~7^2~422.

	Update fs *_MAGIC constants.
	* xlat/fsmagic.in: Add DAXFS_MAGIC introduced by linux kernel commit
	v4.9-rc1~45^2^2~5.

	Update MS_* constants.
	* xlat/mount_flags.in: Add MS_NOREMOTELOCK introduced
	by linux kernel commit v4.9-rc1~57^2~1^2~7.

	Update FALLOC_* constants.
	* xlat/falloc_flags.in: Add FALLOC_FL_UNSHARE_RANGE introduced
	by linux kernel commit v4.9-rc1~31^2~69.

	Update BTRFS_* constants.
	* xlat/btrfs_features_compat_ro.in: Add
	BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID introduced
	by linux kernel commit v4.9-rc1~7^2^2~4.

	Update BPF_* constants.
	* xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_PERF_EVENT introduced
	by linux kernel commit v4.9-rc1~127^2~302^2~4.

2016-11-18  Eugene Syromyatnikov  <evgsyr@gmail.com>

	make-dist: use HEAD for making distribution package.
	* make-dist: Use HEAD commit instead of master branch by default.

2016-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix btrfs build error on some old systems.
	Fix the following build error on SLE 11 SP4:

	btrfs.c: In function 'btrfs_test_dev_replace_ioctl':
	btrfs.c:1570: error: unknown field 'start' specified in initializer

	* tests/btrfs.c (btrfs_test_dev_replace_ioctl): Move initialization
	of struct btrfs_ioctl_dev_replace_args.start.srcdevid out of the
	designated initializer.

2016-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of ERESTARTSYS error code.
	* tests/erestartsys.c: New file.
	* tests/erestartsys.test: New test.
	* tests/.gitignore: Add erestartsys.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add erestartsys.test.

2016-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	Fix signame usage in qual_signal.
	Do not assume that the string returned by signame starts with "SIG"
	prefix, this is not always the case.

	* syscall.c (qual_signal): Skip signame return value
	when it does not have "SIG" prefix.

2016-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check -e signal=set syntax.
	* tests/qual_signal.c: New file.
	* tests/qual_signal.test: New test.
	* tests/.gitignore: Add qual_signal.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add qual_signal.test.

2016-11-17  Dmitry V. Levin  <ldv@altlinux.org>

	Make -e fault= expressions cumulative.
	Change the way how subsequent -e fault= expressions are interpreted
	to implement a cumulative behavior.  For example,
	-e fault=file:when=3+ -e fault=chdir
	now specifies that all chdir syscalls and 3+ file related syscalls
	except chdir are subject for fault injection.

	* syscall.c (qualify): Do not reset qual_vec for QUAL_FAULT.
	* tests/fault_injection.test: Check it.

2016-11-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check syscall fault injection.
	* tests/fault_injection.c: New file.
	* tests/fault_injection.test: New test.
	* tests/fault_syntax.test: Likewise.
	* tests/.gitignore: Add fault_injection.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add fault_injection.test and fault_syntax.test.

2016-11-16  Dmitry V. Levin  <ldv@altlinux.org>

	Implement syscall fault injection.
	Introduce new -e fault=EXPR syntax that can be used to specify a subset
	of syscalls that are subject of syscall fault injection, an error code
	that has to be injected, and a frequency of injection.

	The expression specifying syscall fault injection has the following
	format: SET[:error=ERRNO][:when=FIRST[+[STEP]]]
	where only SET is a required part and all the rest is optional.

	The method used to implement syscall fault injection is the following:
	on entering syscall the syscall number is substituted by an invalid
	syscall number -1, and on exiting syscall the error code returned by
	the kernel is substituted with the error code specified in the fault
	expression.

	This implementaion is based on the prototype developed
	by Nahim El Atmani as a part of his GSoC 2016 strace project.

	* defs.h (struct fault_opts): New forward declaration.
	(struct tcb): Add fault_vec field.
	(TCB_FAULT_INJ, QUAL_FAULT): New macros.
	* strace.1: Document -e fault expression syntax.
	* strace.c (usage): Mention -e fault expression.
	(droptcb): Deallocate fault_vec member.
	* syscall.c (qual_fault, arch_set_scno, arch_set_error): New prototypes.
	(qual_options): Add "fault" option.
	(struct fault_opts): New structure.
	(num_faults): New variable.
	(fault_vec): New array.
	(syscall_fault_injected, tcb_fault_opts, reallocate_fault,
	find_errno_by_name, qual_syscall_ex, strip_prefix, parse_fault_token,
	parse_fault_expression, qual_fault, inject_syscall_fault_entering,
	update_syscall_fault_exiting): New functions.
	(qual_syscall): Use qual_syscall_ex.
	(qualify_one): Add argument: a pointer to struct fault_opts, all callers
	changed.  Copy struct fault_opts from the pointer to fault_vec.
	Use reallocate_fault.
	(qualify_scno, qualify_syscall_class, qualify_syscall_name): Add
	argument: a pointer to struct fault_opts.
	(qualify): Use reallocate_fault.  Do not check "all" class for
	QUAL_FAULT qualifier.
	(lookup_class): Check for "all" class.
	(trace_syscall_entering): Use inject_syscall_fault_entering.
	(trace_syscall_exiting): Use update_syscall_fault_exiting.  Clear
	TCB_FAULT_INJ flag along with TCB_INSYSCALL.  Print " (INJECTED)" suffix
	when the syscall has been injected successfully.
	[ARCH_REGS_FOR_GETREGSET && !HAVE_GETREGS_OLD]
	(ptrace_setregset): New function.
	(ptrace_setregset_or_setregs): Define to ptrace_setregset.
	[ARCH_REGS_FOR_GETREGS && !HAVE_GETREGS_OLD]
	(ptrace_setregs): New function.
	(ptrace_setregset_or_setregs): Define to ptrace_setregs.
	[ptrace_setregset_or_setregs] (set_regs): New function.
	Include "set_scno.c" and "set_error.c"
	* NEWS: Mention this enhancement.

2016-11-16  Dmitry V. Levin  <ldv@altlinux.org>

	Implement arch specific methods of changing syscall number and error code
	This introduces arch_set_error and arch_set_scno functions for each
	supported architecture, needed to implement syscall fault injection.

	* linux/aarch64/set_error.c: New file.
	* linux/aarch64/set_scno.c: Likewise.
	* linux/alpha/set_error.c: Likewise.
	* linux/alpha/set_scno.c: Likewise.
	* linux/arc/set_error.c: Likewise.
	* linux/arc/set_scno.c: Likewise.
	* linux/arm/set_error.c: Likewise.
	* linux/arm/set_scno.c: Likewise.
	* linux/avr32/set_error.c: Likewise.
	* linux/avr32/set_scno.c: Likewise.
	* linux/bfin/set_error.c: Likewise.
	* linux/bfin/set_scno.c: Likewise.
	* linux/crisv10/set_error.c: Likewise.
	* linux/crisv10/set_scno.c: Likewise.
	* linux/crisv32/set_error.c: Likewise.
	* linux/crisv32/set_scno.c: Likewise.
	* linux/hppa/set_error.c: Likewise.
	* linux/hppa/set_scno.c: Likewise.
	* linux/i386/set_error.c: Likewise.
	* linux/i386/set_scno.c: Likewise.
	* linux/ia64/set_error.c: Likewise.
	* linux/ia64/set_scno.c: Likewise.
	* linux/m68k/set_error.c: Likewise.
	* linux/m68k/set_scno.c: Likewise.
	* linux/metag/set_error.c: Likewise.
	* linux/metag/set_scno.c: Likewise.
	* linux/microblaze/set_error.c: Likewise.
	* linux/microblaze/set_scno.c: Likewise.
	* linux/mips/set_error.c: Likewise.
	* linux/mips/set_scno.c: Likewise.
	* linux/nios2/set_error.c: Likewise.
	* linux/nios2/set_scno.c: Likewise.
	* linux/or1k/set_error.c: Likewise.
	* linux/or1k/set_scno.c: Likewise.
	* linux/powerpc/set_error.c: Likewise.
	* linux/powerpc/set_scno.c: Likewise.
	* linux/powerpc64/set_error.c: Likewise.
	* linux/powerpc64/set_scno.c: Likewise.
	* linux/riscv/set_error.c: Likewise.
	* linux/riscv/set_scno.c: Likewise.
	* linux/s390/set_error.c: Likewise.
	* linux/s390/set_scno.c: Likewise.
	* linux/s390x/set_error.c: Likewise.
	* linux/s390x/set_scno.c: Likewise.
	* linux/sh/set_error.c: Likewise.
	* linux/sh/set_scno.c: Likewise.
	* linux/sh64/set_error.c: Likewise.
	* linux/sh64/set_scno.c: Likewise.
	* linux/sparc/set_error.c: Likewise.
	* linux/sparc/set_scno.c: Likewise.
	* linux/sparc64/set_error.c: Likewise.
	* linux/sparc64/set_scno.c: Likewise.
	* linux/tile/set_error.c: Likewise.
	* linux/tile/set_scno.c: Likewise.
	* linux/x32/set_error.c: Likewise.
	* linux/x32/set_scno.c: Likewise.
	* linux/x86_64/set_error.c: Likewise.
	* linux/x86_64/set_scno.c: Likewise.
	* linux/xtensa/set_error.c: Likewise.
	* linux/xtensa/set_scno.c: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.

2016-11-16  Dmitry V. Levin  <ldv@altlinux.org>

	cris: add syscall tables.
	The incomplete CRIS support introduced by commit v4.5.18-77-gea0e6e8
	should not have been merged because it lacks essential parts, e.g.
	syscall tables.

	This change adds missing syscall tables for crisv10 and crisv32.

	* linux/crisv10/syscallent.h: New file.
	* linux/crisv32/syscallent.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.

2016-11-16  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce string_to_uint_ex and string_to_uint_upto functions.
	* defs.h (string_to_uint_ex): New prototype.
	(string_to_uint_upto): New function, a thin wrapper around
	string_to_uint_ex.
	* util.c (string_to_uint_ex): New function.
	(string_to_uint): Change into a thin wrapper around string_to_uint_upto.
	* strace.c (init): Use string_to_uint_upto.
	* syscall.c (qualify_scno, qual_signal, qual_desc): Use
	string_to_uint_upto instead of string_to_uint.

2016-11-16  Dmitry V. Levin  <ldv@altlinux.org>

	Split qual_syscall into separate functions.
	Split qual_syscall into qualify_scno, qualify_syscall_class,
	and qualify_syscall_name.
	This might be needed later to implement syscall fault injection.

	* syscall.c (qualify_scno, qualify_syscall_class, qualify_syscall_name):
	New functions.
	(qual_syscall): Use them.

2016-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	xtensa: wire up new syscalls.
	* linux/xtensa/syscallent.h [342..347]: New entries.

2016-11-14  Dmitry V. Levin  <ldv@altlinux.org>

	arc: wire up new syscalls.
	* linux/arc/syscallent.h [247, 248]: New entries.

2016-11-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix potential compilation warning in ioctl_block.c.
	ioctl_block.c:48: warning: 'init_magic' defined but not used

	* tests/ioctl_block.c (init_magic): Define only for
	[BLKTRACESETUP && HAVE_STRUCT_BLK_USER_TRACE_SETUP].

2016-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add support for pkey_mprotect, pkey_alloc, pkey_free syscalls.
	* linux/32/syscallent.h: Add syscall entries for pkey_* calls.
	* linux/64/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* mem.c (do_mprotect): New function, common handler for mprotect and
	pkey_mprotect.
	(SYS_FUNC(mprotect)): Convert to wrapper around do_mprotect.
	(SYS_FUNC(pkey_mprotect)): New function.
	* xlat/pkey_access.in: New file.
	* pkeys.c: New file containing implementation of pkey_alloc and
	pkey_free.
	* Makefile.am: Add it.
	* NEWS: Mention this enhancement.
	* tests/.gitignore: Add pkey_alloc, pkey_free, and pkey_mprotect.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add pkey_alloc.test, pkey_free.test, and
	pkey_mprotect.test.
	* tests/pkey_alloc.c: New file.
	* tests/pkey_free.c: Likewise.
	* tests/pkey_mprotect.c: Likewise.
	* tests/pkey_alloc.test: New test.
	* tests/pkey_free.test: Likewise.
	* tests/pkey_mprotect.test: Likewise.

2016-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: fix "constant is too large" compilation warnings.
	alarm.c: In function 'main':
	alarm.c:41: warning: integer constant is too large for 'long' type
	aio.c: In function 'main':
	aio.c:162: warning: integer constant is too large for 'long' type
	btrfs.c: In function 'btrfs_test_sync_ioctls':
	btrfs.c:202: warning: integer constant is too large for 'long' type
	btrfs.c: In function 'btrfs_test_subvol_ioctls':
	btrfs.c:289: warning: integer constant is too large for 'long' type
	btrfs.c:290: warning: integer constant is too large for 'long' type
	dup2.c: In function 'main':
	dup2.c:12: warning: integer constant is too large for 'long' type
	dup2.c:13: warning: integer constant is too large for 'long' type
	dup3.c: In function 'main':
	dup3.c:13: warning: integer constant is too large for 'long' type
	dup3.c:14: warning: integer constant is too large for 'long' type
	epoll_create.c: In function 'main':
	epoll_create.c:12: warning: integer constant is too large for 'long' type
	epoll_ctl.c: In function 'invoke_syscall':
	epoll_ctl.c:14: warning: integer constant is too large for 'long' type
	faccessat.c: In function 'main':
	faccessat.c:13: warning: integer constant is too large for 'long' type
	fchdir.c: In function 'main':
	fchdir.c:12: warning: integer constant is too large for 'long' type
	struct_flock.c: In function 'invoke_test_syscall':
	struct_flock.c:48: warning: integer constant is too large for 'long' type
	struct_flock.c: In function 'test_flock_einval':
	struct_flock.c:58: warning: integer constant is too large for 'long' type
	struct_flock.c:59: warning: integer constant is too large for 'long' type
	fcntl64.c: In function 'test_flock64_einval':
	fcntl64.c:44: warning: integer constant is too large for 'long' type
	fcntl64.c:45: warning: integer constant is too large for 'long' type
	fcntl.c: In function 'test_flock64_einval':
	fcntl.c:44: warning: integer constant is too large for 'long' type
	fcntl.c:45: warning: integer constant is too large for 'long' type
	fdatasync.c: In function 'main':
	fdatasync.c:12: warning: integer constant is too large for 'long' type
	flock.c: In function 'main':
	flock.c:13: warning: integer constant is too large for 'long' type
	xstatx.c: In function 'main':
	xstatx.c:255: warning: integer constant is too large for 'long' type
	xstatx.c:290: warning: integer constant is too large for 'long' type
	xstatx.c:290: warning: integer constant is too large for 'long' type
	xstatx.c:290: warning: integer constant is too large for 'long' type
	xstatx.c:290: warning: integer constant is too large for 'long' type
	xstatx.c:290: warning: integer constant is too large for 'long' type
	xstatx.c:290: warning: integer constant is too large for 'long' type
	xstatx.c:290: warning: integer constant is too large for 'long' type
	xstatx.c:290: warning: integer constant is too large for 'long' type
	xstatx.c:290: warning: integer constant is too large for 'long' type
	xstatx.c:294: warning: integer constant is too large for 'long' type
	xstatx.c:294: warning: integer constant is too large for 'long' type
	xstatx.c:294: warning: integer constant is too large for 'long' type
	xstatx.c:294: warning: integer constant is too large for 'long' type
	xstatx.c:294: warning: integer constant is too large for 'long' type
	xstatx.c:294: warning: integer constant is too large for 'long' type
	xstatx.c:294: warning: integer constant is too large for 'long' type
	xstatx.c:294: warning: integer constant is too large for 'long' type
	xstatx.c:294: warning: integer constant is too large for 'long' type
	xstatfsx.c: In function 'main':
	xstatfsx.c:113: warning: integer constant is too large for 'long' type
	fsync.c: In function 'main':
	fsync.c:12: warning: integer constant is too large for 'long' type
	ftruncate64.c: In function 'main':
	ftruncate64.c:39: warning: integer constant is too large for 'long' type
	futimesat.c: In function 'main':
	futimesat.c:52: warning: integer constant is too large for 'long' type
	futimesat.c:59: warning: integer constant is too large for 'long' type
	get_mempolicy.c: In function 'main':
	get_mempolicy.c:83: warning: integer constant is too large for 'long' type
	get_mempolicy.c:84: warning: integer constant is too large for 'long' type
	get_mempolicy.c:85: warning: integer constant is too large for 'long' type
	get_mempolicy.c:86: warning: integer constant is too large for 'long' type
	getdents.c: In function 'main':
	getdents.c:109: warning: integer constant is too large for 'long' type
	getdents.c:110: warning: integer constant is too large for 'long' type
	getdents.c:114: warning: integer constant is too large for 'long' type
	getdents64.c: In function 'main':
	getdents64.c:114: warning: integer constant is too large for 'long' type
	getdents64.c:115: warning: integer constant is too large for 'long' type
	getdents64.c:119: warning: integer constant is too large for 'long' type
	xgetrlimit.c: In function 'main':
	xgetrlimit.c:71: warning: integer constant is too large for 'long' type
	ioctl_block.c:44: warning: integer constant is too large for 'long' type
	ioctl_block.c: In function 'main':
	ioctl_block.c:136: warning: integer constant is too large for 'long' type
	ioctl_block.c:137: warning: integer constant is too large for 'long' type
	ioctl_block.c:161: warning: integer constant is too large for 'long' type
	ioctl_block.c:170: warning: integer constant is too large for 'long' type
	ioctl_block.c:171: warning: integer constant is too large for 'long' type
	ioctl_evdev.c:42: warning: integer constant is too large for 'long' type
	ioctl_mtd.c:46: warning: integer constant is too large for 'long' type
	ioctl_rtc.c:40: warning: integer constant is too large for 'long' type
	ioperm.c: In function 'main':
	ioperm.c:12: warning: integer constant is too large for 'long' type
	ioctl_v4l2.c: In function 'main':
	ioctl_v4l2.c:409: warning: integer constant is too large for 'long' type
	ipc.c: In function 'ipc_call':
	ipc.c:52: warning: integer constant is too large for 'long' type
	kill.c: In function 'main':
	kill.c:59: warning: integer constant is too large for 'long' type
	kill.c:62: warning: integer constant is too large for 'long' type
	kill.c:63: warning: integer constant is too large for 'long' type
	kill.c:68: warning: integer constant is too large for 'long' type
	linkat.c: In function 'main':
	linkat.c:14: warning: integer constant is too large for 'long' type
	linkat.c:15: warning: integer constant is too large for 'long' type
	mbind.c: In function 'main':
	mbind.c:41: warning: integer constant is too large for 'long' type
	mbind.c:43: warning: integer constant is too large for 'long' type
	mbind.c:44: warning: integer constant is too large for 'long' type
	migrate_pages.c: In function 'main':
	migrate_pages.c:41: warning: integer constant is too large for 'long' type
	In file included from mkdirat.c:10:
	umode_t.c: In function 'test_syscall':
	umode_t.c:47: warning: integer constant is too large for 'long' type
	mknod.c: In function 'call_mknod':
	mknod.c:16: warning: integer constant is too large for 'long' type
	mknod.c: In function 'main':
	mknod.c:23: warning: integer constant is too large for 'long' type
	mknod.c:49: warning: integer constant is too large for 'long' type
	mknod.c:56: warning: integer constant is too large for 'long' type
	mknodat.c:12: warning: integer constant is too large for 'long' type
	mknodat.c: In function 'call_mknodat':
	mknodat.c:17: warning: integer constant is too large for 'long' type
	mknodat.c: In function 'main':
	mknodat.c:24: warning: integer constant is too large for 'long' type
	mknodat.c:50: warning: integer constant is too large for 'long' type
	mknodat.c:57: warning: integer constant is too large for 'long' type
	mmap.c: In function 'main':
	mmap.c:51: warning: integer constant is too large for 'long' type
	move_pages.c: In function 'print_stat_pages':
	move_pages.c:139: warning: integer constant is too large for 'long' type
	move_pages.c: In function 'print_move_pages':
	move_pages.c:166: warning: integer constant is too large for 'long' type
	move_pages.c: In function 'main':
	move_pages.c:188: warning: integer constant is too large for 'long' type
	mq_sendrecv.c: In function 'main':
	mq_sendrecv.c:238: warning: integer constant is too large for 'long' type
	mq_sendrecv.c:401: warning: integer constant is too large for 'long' type
	mq_sendrecv.c:403: warning: integer constant is too large for 'long' type
	nsyscalls.c: In function 'test_syscall':
	nsyscalls.c:64: warning: integer constant is too large for 'long' type
	nsyscalls.c:65: warning: integer constant is too large for 'long' type
	nsyscalls.c:66: warning: integer constant is too large for 'long' type
	nsyscalls.c:67: warning: integer constant is too large for 'long' type
	nsyscalls.c:68: warning: integer constant is too large for 'long' type
	nsyscalls.c:69: warning: integer constant is too large for 'long' type
	preadv-pwritev.c: In function 'main':
	preadv-pwritev.c:162: warning: comparison between signed and unsigned
	prlimit64.c: In function 'main':
	prlimit64.c:65: warning: integer constant is too large for 'long' type
	prlimit64.c:70: warning: integer constant is too large for 'long' type
	remap_file_pages.c: In function 'main':
	remap_file_pages.c:42: warning: integer constant is too large for 'long' type
	remap_file_pages.c:43: warning: integer constant is too large for 'long' type
	remap_file_pages.c:45: warning: integer constant is too large for 'long' type
	renameat.c: In function 'main':
	renameat.c:15: warning: integer constant is too large for 'long' type
	renameat.c:16: warning: integer constant is too large for 'long' type
	rt_sigqueueinfo.c: In function 'main':
	rt_sigqueueinfo.c:41: warning: integer constant is too large for 'long' type
	rt_tgsigqueueinfo.c: In function 'k_tgsigqueueinfo':
	rt_tgsigqueueinfo.c:45: warning: integer constant is too large for 'long' type
	rt_tgsigqueueinfo.c:46: warning: integer constant is too large for 'long' type
	rt_tgsigqueueinfo.c:47: warning: integer constant is too large for 'long' type
	rt_tgsigqueueinfo.c: In function 'main':
	rt_tgsigqueueinfo.c:67: warning: integer constant is too large for 'long' type
	sendfile.c: In function 'main':
	sendfile.c:110: warning: integer constant is too large for 'long' type
	sendfile64.c: In function 'main':
	sendfile64.c:100: warning: integer constant is too large for 'long' type
	set_mempolicy.c: In function 'main':
	set_mempolicy.c:129: warning: integer constant is too large for 'long' type
	set_mempolicy.c:130: warning: integer constant is too large for 'long' type
	setrlimit.c: In function 'main':
	setrlimit.c:44: warning: integer constant is too large for 'long' type
	socketcall.c: In function 'test_socketcall':
	socketcall.c:58: warning: integer constant is too large for 'long' type
	splice.c: In function 'main':
	splice.c:41: warning: integer constant is too large for 'long' type
	splice.c:42: warning: integer constant is too large for 'long' type
	splice.c:45: warning: integer constant is too large for 'long' type
	splice.c:46: warning: integer constant is too large for 'long' type
	symlinkat.c: In function 'main':
	symlinkat.c:12: warning: integer constant is too large for 'long' type
	sync_file_range.c: In function 'main':
	sync_file_range.c:42: warning: integer constant is too large for 'long' type
	sync_file_range.c:43: warning: integer constant is too large for 'long' type
	syslog.c: In function 'main':
	syslog.c:14: warning: integer constant is too large for 'long' type
	tee.c: In function 'main':
	tee.c:41: warning: integer constant is too large for 'long' type
	tee.c:42: warning: integer constant is too large for 'long' type
	timer_create.c: In function 'main':
	timer_create.c:52: warning: integer constant is too large for 'long' type
	timer_create.c:84: warning: integer constant is too large for 'long' type
	timer_create.c:85: warning: integer constant is too large for 'long' type
	truncate64.c: In function 'main':
	truncate64.c:41: warning: integer constant is too large for 'long' type
	xgetrlimit.c: In function 'main':
	xgetrlimit.c:71: warning: integer constant is too large for 'long' type
	umode_t.c: In function 'test_syscall':
	umode_t.c:46: warning: integer constant is too large for 'long' type
	unlinkat.c: In function 'main':
	unlinkat.c:13: warning: integer constant is too large for 'long' type
	waitpid.c: In function 'main':
	waitpid.c:43: warning: integer constant is too large for 'long' type
	waitid.c: In function 'poison':
	waitid.c:141: warning: integer constant is too large for 'long' type
	xetpriority.c: In function 'main':
	xetpriority.c:15: warning: integer constant is too large for 'long' type
	xetpriority.c:19: warning: integer constant is too large for 'long' type
	xetpriority.c:20: warning: integer constant is too large for 'long' type
	xetpgid.c: In function 'main':
	xetpgid.c:43: warning: integer constant is too large for 'long' type
	xetpgid.c:47: warning: integer constant is too large for 'long' type
	xetpgid.c:48: warning: integer constant is too large for 'long' type

	(SLES 11SP4, i386)

	* tests/alarm.c (main): Add proper suffix to integer constant.
	* tests/aio.c (main): Likewise.
	* tests/btrfs.c (btrfs_test_sync_ioctls, btrfs_test_subvol_ioctls): Likewise.
	* tests/dup2.c (main): Likewise.
	* tests/dup3.c (main): Likewise.
	* tests/epoll_create.c (main): Likewise.
	* tests/epoll_ctl.c (invoke_syscall): Likewise.
	* tests/faccessat.c (main): Likewise.
	* tests/fchdir.c (main): Likewise.
	* tests/fcntl.c (test_flock64_einval): Likewise.
	* tests/fcntl64.c (test_flock64_einval): Likewise.
	* tests/fdatasync.c (main): Likewise.
	* tests/flock.c (main): Likewise.
	* tests/fstat64.c (SAMPLE_SIZE): Likewise.
	* tests/fstat.c (SAMPLE_SIZE): Likewise.
	* tests/fsync.c (main): Likewise.
	* tests/ftruncate64.c (main): Likewise.
	* tests/futimesat.c (main): Likewise.
	* tests/get_mempolicy.c (main): Likewise.
	* tests/getdents.c (main): Likewise.
	* tests/getdents64.c (main): Likewise.
	* tests/ioctl_block.c (lmagic, main): Likewise.
	* tests/ioctl_evdev.c (lmagic): Likewise.
	* tests/ioctl_mtd.c (lmagic): Likewise.
	* tests/ioctl_rtc.c (lmagic): Likewise.
	* tests/ioctl_v4l2.c (main): Likewise.
	* tests/ioperm.c (main): Likewise.
	* tests/ipc.c (ipc_call): Likewise.
	* tests/kill.c (main): Likewise.
	* tests/linkat.c (main): Likewise.
	* tests/lstat64.c (SAMPLE_SIZE): Likewise.
	* tests/lstat.c (SAMPLE_SIZE): Likewise.
	* tests/mbind.c (main): Likewise.
	* tests/migrate_pages.c (main): Likewise.
	* tests/mkdirat.c (TEST_SYSCALL_PREFIX_ARGS): Likewise.
	* tests/mknod.c (call_mknod, main): Likewise.
	* tests/mknodat.c (fd, call_mknodat, main): Likewise.
	* tests/mmap.c (main): Likewise.
	* tests/move_pages.c (print_stat_pages, print_move_pages): Likewise.
	* tests/mq_sendrecv.c (main): Likewise.
	* tests/nsyscalls.c (test_syscall): Likewise.
	* tests/prlimit64.c (main): Likewise.
	* tests/remap_file_pages.c (main): Likewise.
	* tests/renameat.c (main): Likewise.
	* tests/rt_sigqueueinfo.c (main): Likewise.
	* tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo, main): Likewise.
	* tests/sendfile.c (main): Likewise.
	* tests/sendfile64.c (main): Likewise.
	* tests/set_mempolicy.c (main): Likewise.
	* tests/setrlimit.c (main): Likewise.
	* tests/socketcall.c (test_socketcall): Likewise.
	* tests/splice.c (main): Likewise.
	* tests/stat64.c (SAMPLE_SIZE): Likewise.
	* tests/stat.c (SAMPLE_SIZE): Likewise.
	* tests/struct_flock.c (invoke_test_syscall, test_flock_einval): Likewise.
	* tests/symlinkat.c (main): Likewise.
	* tests/sync_file_range.c (main): Likewise.
	* tests/syslog.c (main): Likewise.
	* tests/tee.c (main): Likewise.
	* tests/timer_create.c (main): Likewise.
	* tests/truncate64.c (main): Likewise.
	* tests/umode_t.c (test_syscall): Likewise.
	* tests/unlinkat.c (main): Likewise.
	* tests/waitid.c (main): Likewise.
	* tests/waitpid.c (main): Likewise.
	* tests/xetpgid.c (main): Likewise.
	* tests/xetpriority.c (main): Likewise.
	* tests/xgetrlimit.c (main): Likewise.
	* tests/xstatfsx.c (main) [CHECK_ODD_SIZE]: Likewise.
	* tests/xstatx.c (main): Likewise.

2016-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: fix "comparison between signed and unsigned" compilation warnings
	preadv-pwritev.c: In function 'main':
	preadv-pwritev.c:162: warning: comparison between signed and unsigned
	readv.c: In function 'main':
	readv.c:148: warning: comparison between signed and unsigned
	recvmsg.c: In function 'main':
	recvmsg.c:148: warning: comparison between signed and unsigned

	* tests/preadv-pwritev.c (main): Cast r_len to int.
	* tests/readv.c (main): Likewise.
	* tests/recvmsg.c (main): Likewise.

2016-11-13  Dmitry V. Levin  <ldv@altlinux.org>

	syscall.c: refactor getregs_old fallback in get_regs.
	This change moves remaining arch specific getregs_old code into
	appropriate arch subdirectories and removes unnecessary code
	duplication.

	* linux/getregs_old.h: New file.
	* linux/powerpc/getregs_old.h: Likewise.
	* linux/powerpc64/getregs_old.h: Likewise.
	* linux/x86_64/getregs_old.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* syscall.c: Include "getregs_old.h".
	[X86_64 || POWERPC]: Remove.
	[ARCH_REGS_FOR_GETREGSET] (ptrace_getregset_or_getregs): Define
	to ptrace_getregset.
	[ARCH_REGS_FOR_GETREGS] (ptrace_getregset_or_getregs): Define
	to ptrace_getregs.
	(get_regs): Check for ptrace_getregset_or_getregs instead
	of ARCH_REGS_FOR_GETREGSET and ARCH_REGS_FOR_GETREGS.  Use
	ptrace_getregset_or_getregs instead of ptrace_getregset and
	ptrace_getregs.  Check for HAVE_GETREGS_OLD instead of X86_64
	and POWERPC.  Use use_getregs_old instead of getregset_support
	and old_kernel.

2016-11-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Rename BUILD_BUG_ON_ZERO macro.
	In order to avoid name clash on distributions which decide to include
	kernel headers instead of UAPI ones.  For example, on SLES 11SP4:

	gcc -DHAVE_CONFIG_H -I./linux/x86_64 -I./linux -I. -Wall -O2 -c net.c
	In file included from /usr/include/linux/sysctl.h:25:0,
	                 from /usr/include/linux/netfilter.h:6,
	                 from /usr/include/linux/netfilter_arp.h:8,
	                 from /usr/include/linux/netfilter_arp/arp_tables.h:14,
	                 from net.c:60:
	net.c: In function 'print_packet_mreq':
	gcc_compat.h:59:27: error: negative width in bit-field '<anonymous>'
	 # define MUST_BE_ARRAY(a) BUILD_BUG_ON_ZERO(!SAME_TYPE((a), &(a)[0]))
	                           ^
	defs.h:76:53: note: in expansion of macro 'MUST_BE_ARRAY'
	 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]) + MUST_BE_ARRAY(a))
	                                                     ^
	net.c:747:22: note: in expansion of macro 'ARRAY_SIZE'
	   if (mreq.mr_alen > ARRAY_SIZE(mreq.mr_address))
	                      ^
	due to the fact BUILD_BUG_ON_ZERO is already defined in <linux/kernel.h>.

	* gcc_compat.h (BUILD_BUG_ON_ZERO): Rename to FAIL_BUILD_ON_ZERO.
	(MUST_BE_ARRAY): Update usage.

2016-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	syscall.c: factor out ptrace_getregs from get_regs.
	Move the code that calls ptrace(PTRACE_GETREGS) to a separate function.

	* syscall.c (ptrace_getregs): New function.
	(get_regs): Use it.

2016-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	syscall.c: rename get_regset to ptrace_getregset.
	* syscall.c (get_regset): Rename to ptrace_getregset.
	(get_regs): Rename get_regset to ptrace_getregset.

2016-11-12  Andreas Schwab  <schwab@linux-m68k.org>

	m68k: switch to PTRACE_GETREGS.
	* Makefile.am (EXTRA_DIST): Add linux/m68k/arch_regs.h, remove
	linux/m68k/get_syscall_result.c.
	* linux/m68k/arch_regs.c (m68k_d0, ARCH_PC_PEEK_ADDR): Don't
	define.
	(m68k_regs, m68k_usp_ptr, ARCH_PC_REG, ARCH_REGS_FOR_GETREGS):
	Define.
	* linux/m68k/arch_regs.h: New file.
	* linux/m68k/arch_sigreturn.c (arch_sigreturn): Use m68k_usp_ptr.
	* linux/m68k/get_error.c (get_error): Use m68k_regs.d0.
	* linux/m68k/get_scno.c (arch_get_scno): Use m68k_regs.orig_d0.
	* linux/m68k/get_syscall_args.c (get_syscall_args): Use m68k_regs.
	* linux/m68k/get_syscall_result.c: Remove.

	tests: do not run old_mmap test on m68k.
	* tests/old_mmap.c: Skip test on m68k.

2016-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	syscall.c: introduce reallocate_vec function.
	This might be needed later to implement syscall fault injection.

	* syscall.c (reallocate_vec): New function.
	(reallocate_qual): Use it.

2016-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	Fix prototypes of qual_desc, qual_signal, and qual_syscall functions.
	* syscall.c (qual_desc, qual_signal, qual_syscall): Fix prototypes.
	(struct qual_options): Fix type of "qualify" member.

2016-11-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	linux/x32/syscallent.h: fix syscallent array initialisation on x32.
	Why gcc didn't complain about it? It is definitely an index clash.

	* linux/x32/syscallent.h: Change initializer indices for empty records from
	[327 ... 511] to [329 ... 511].

2016-11-11  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce upoke function.
	This will be needed to implement fault injection on those architectures
	that lack PTRACE_SETREGSET/PTRACE_SETREGS support.

	* defs.h (upoke): New prototype.
	* upoke.c: New file.
	* Makefile.am (libstrace_a_SOURCES): Add it.

2016-11-11  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux 4.9.
	* linux/32/ioctls_inc_align32.h: Update from linux v4.9 using ioctls_gen.sh.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* NEWS: Mention this.

2016-11-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Update NEWS.

2016-11-10  Mikulas Patocka  <mpatocka@redhat.com>
	    Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add support for decoding of DM_* ioctl commands.
	* dm.c: New file.
	* xlat/dm_flags.in: Likewise.
	* Makefile.am (strace_SOURCES): Add dm.c.
	* configure.ac (AC_CHECK_HEADERS): Add linux/dm-ioctl.h.
	* defs.h (dm_ioctl): New prototype.
	* ioctl.c (ioctl_decode) [HAVE_LINUX_DM_IOCTL_H]: Call dm_ioctl
	for 0xfd ioctl type.
	* tests/ioctl_dm.c: New file.
	* tests/ioctl_dm-v.c: Likewise.
	* tests/ioctl_dm.test: New test.
	* tests/ioctl_dm-v.test: Likewise.
	* tests/.gitignore: Add ioctl_dm and ioctl_dm-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioctl_dm.test and ioctl_dm-v.test.

2016-11-10  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce ALIGNOF macro.
	* gcc_compat.h (ALIGNOF): New macro.

2016-11-10  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: add support for QUOTE_0_TERMINATED in user_style to ptrintstr_ex.
	This enables printing size-limited (expectedly) ASCIZ strings.

	This is done by increasing umoven size limit for sized strings by one
	byte above max_strlen (enabling copying possible NUL byte in case len is
	greater than max_strlen) and decreasing size after copying by one byte
	in case QUOTE_0_TERMINATED is set (due to user_style or usage of len of
	-1).  As a result, there is one excess byte for string_quote in case
	QUOTE_0_TERMINATED is set so string_quote can check for NUL termination
	of strings up to size bytes in size (which is len or max_strlen, whatever
	is greater).

	The catch here is that when string is not properly NUL-terminated and
	QUOTE_0_TERMINATED is provided in user_style and len is less than
	max_strlen then last non-NUL byte is not printed.  But ellipsis is
	printed instead, being indication that string is not terminated
	properly.  QUOTE_OMIT_TRAILING_0 should be used instead in case this
	behaviour is not intended.

	* util.c (printstr_ex): Copy one excess byte in case of non-negative len
	provided and it is more than max_strlen; handle case of max_strlen of 0
	in case QUOTE_0_TERMINATED is set separately; check for need of printing
	ellipsis by checking resulting style against QUOTE_0_TERMINATED.

2016-11-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of mq_{notify,open,timedreceive,timedsend,unlink}
	* tests/mq_sendrecv.c: New file.
	* tests/mq_sendrecv-read.c: Likewise.
	* tests/mq_sendrecv-write.c: Likewise.
	* tests/mq_sendrecv.test: New test.
	* tests/mq_sendrecv-read.test: Likewise.
	* tests/mq_sendrecv-write.test: Likewise.
	* tests/.gitignore: Add mq_sendrecv, mq_sendrecv-read,
	and mq_sendrecv-write.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(mq_sendrecv_LDADD, mq_sendrecv_read_LDADD, mq_sendrecv_write_LDADD):
	New variables.
	(DECODER_TESTS): Add mq_sendrecv.test, mq_sendrecv-read.test,
	and mq_sendrecv-write.test.

2016-11-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip times.test if CLOCK_PROCESS_CPUTIME_ID does not work.
	* tests/times.c (main): Skip if clock_gettime consistenly returns zero
	for CLOCK_PROCESS_CPUTIME_ID timer.

2016-10-31  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add tests for perf_event_attr structure decoding in perf_event_open
	* configure.ac: Add checks for presence of various fields of struct
	perf_event_attr defined in kernel headers.
	* tests/perf_event_open.c: New file.
	* tests/perf_event_open_unabbrev.c: Likewise.
	* tests/perf_event_open.test: New test.
	* tests/perf_event_open_unabbrev.test: Likewise.
	* tests/.gitignore: Add perf_event_open, perf_event_open_unabbrev.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add perf_event_open.test, perf_event_open_unabbrev.test.

	Implement decoding of perf_event_attr structure in perf_event_open syscall
	* linux/perf_event_struct.h: New file, definition of struct perf_event_attr
	from Linux 4.8
	* Makefile.am (strace_SOURCES): Add it.
	* xlat/hw_breakpoint_len.in: New file.
	* xlat/hw_breakpoint_type.in: Likewise.
	* xlat/perf_attr_size.in: Likewise.
	* xlat/perf_branch_sample_type.in: Likewise.
	* xlat/perf_event_read_format.in: Likewise.
	* xlat/perf_event_sample_format.in: Likewise.
	* xlat/perf_hw_cache_id.in: Likewise.
	* xlat/perf_hw_cache_op_id.in: Likewise.
	* xlat/perf_hw_cache_op_result_id.in: Likewise.
	* xlat/perf_hw_id.in: Likewise.
	* xlat/perf_sw_ids.in: Likewise.
	* xlat/perf_type_id.in: Likewise.
	* perf.c [HAVE_LINUX_PERF_EVENT_H]: Remove inclusion of
	<linux/perf_event.h>.
	(PRINT_XLAT): New macro for simplifying printing values from
	sorted xlat.
	(printxlat_search): New function, wrapper for xlat_search with behaviour
	similar to printval.
	(print_perf_event_attr): New print_event_attr structure fetching and
	printing function.
	(SYS_FUNC(perf_event_open)): Use print_perf_event_attr for displaying
	attr argument contents.
	* tests/perf_event_open.c: Renamed to
	tests/perf_event_open_nonverbose.c.
	* tests/perf_event_open.test: add -e verbose=none in order to preserve
	output format being checked (in case verbose output is enabled,
	contents of attr arguments are shown now); rename to
	tests/perf_event_open_nonverbose.test; add -e trace=perf_event_open.

	tests: fix name spelling.

2016-10-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: fix name spelling.

	Update NEWS.

	Fix typo in comment in tests/quotactl.h.

	tests: fix invalid pointer checks in quotactl test.
	* tests/quotactl.h (bogus_special, bogus_addr): Move it...
	* tests/quotactl.c (main): ... here; remove static and const qualifiers,
	use memory after tail_alloc instead of magic numbers.
	* tests/quotactl-xfs.c (main): Likewise.

	tests: fix invalid pointer checks in getcpu test.
	* test/getcpu.c (main): Replace magic numbers deemed invalid pointers
	with addresses after memory returned by tail_alloc.

	tests: fix invalid pointer checks in request_key test.
	* test/request_key.c (main): Replace magic numbers deemed invalid pointers
	with addresses after memory returned by tail_alloc.

	tests: fix invalid pointer checks in add_key test.
	* test/add_key.c (main): Replace magic numbers deemed invalid pointers
	with addresses after memory returned by tail_alloc.

	statfs: use printxval_search.
	* print_statfs.c (print_statfs_type): Use printxval_search for printing
	FS magic xlat value.

	util: add printing helper for sorted xlat arrays.
	* util.c (printxval_searchn): New function.
	* defs.h (printxval_searchn): New prototype.
	(printxval_search): New helper macro useful in conjunction with static
	xlat arrays.

	defs: add check for argument being array to ARRAY_SIZE macro.
	* gcc_compat.h [GNUC_PREREQ(3, 0)] (BUILD_BUG_ON_ZERO): New macro.
	(SAME_TYPE, MUST_BE_ARRAY): Likewise.
	* defs.h (ARRAY_SIZE): Add MUST_BE_ARRAY for build-time type check.

	tests: check decoding of oldfstat, oldlstat, and oldstat syscalls.
	* tests/oldfstat.c: New file.
	* tests/oldlstat.c: Likewise.
	* tests/oldstat.c: Likewise.
	* tests/oldfstat.test: New test.
	* tests/oldlstat.test: Likewise.
	* tests/oldstat.test: Likewise.
	* tests/xstatx.c [!OLD_STAT]: define OLD_STAT to 0.
	(print_stat) [OLD_STAT]: Print predefined values for
	st_blksize/st_blocks.
	(print_stat): Check for !OLD_STAT in nanosecond precision checks.
	(main) [OLD_STAT]: Ignore EOVERFLOW.
	(main): Test for successful rc in returned size value check;
	print address only on non-successful rc.
	* tests/.gitignore: Add oldfstat, oldlstat, and oldstat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add oldfstat.test, oldlstat.test, and oldstat.test.

	tests: additional tests of stat decoders.
	* tests/fstatx.c (IS_FSTAT): Define to 1.
	* tests/fstatat64.c [__GLIBC__ && __sparc64__] (TEST_BOGUS_STRUCT_STAT):
	Define to 0.
	* tests/xstatx.c [!IS_STAT] (IS_STAT): Define to 0.
	[!TEST_BOGUS_STRUCT_STAT] (TEST_BOGUS_STRUCT_STAT): Define to 1.
	(main): Add a check for non-available pointer and a check
	for block device file.
	* tests/statx.sh: Add tracing of /dev/full file, specify alignment.
	* tests/fstat.test: Specify alignment.

2016-10-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: prepare for additional tests of stat decoders.
	PRINT_SYSCALL_HEADER/PRINT_SYSCALL_FOOTER now contain open/close brace
	pair in order to save errno.  PRINT_SYSCALL_FOOTER now uses sprintrc for
	printing rc/errno.

	* tests/xstatx.c: Include <errno.h>.
	(main): Update PRINT_SYSCALL_FOOTER call convention.
	* tests/fstatat.c (PRINT_SYSCALL_HEADER): Add errno saving.
	(PRINT_SYSCALL_FOOTER): Restore errno.
	* tests/fstatx.c: Likewise.
	* tests/lstatx.c: Likewise.

2016-10-28  Dmitry V. Levin  <ldv@altlinux.org>

	Provide a safe definition of O_ACCMODE.
	Some libcs e.g. musl are guilty of messing up with O_ACCMODE.

	* open.c (O_ACCMODE): Redefine to 03.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Implement dumping of mq_timedsend and mq_timedreceive syscalls.
	* syscall.c (dumpio): Add SEN_mq_timedreceive and SEN_mq_timedsend.

	mq: print msg_prio as a pointer, not as an immediate value.
	* mq.c (SYS_FUNC(mq_timedreceive)): Use printnum_int for printing
	msg_prio argument.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mq: print msg payload only in case of successful mq_timedreceive call.
	Also, use u_rval for determining message size.

	* mq.c (SYS_FUNC(mq_timedreceive)): Check for syserror and non-negative
	u_rval before calling printstr on msg_ptr argument, or use printaddr otherwise;
	provide u_rval as string size.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mq: Print msg_prio parameter as unsigned int in mq_timedsend.
	* mq.c (SYS_FUNC(mq_timedsend)): Change conversion specifier from "%ld"
	to "%u", cast argument value to unsigned int.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mq: Properly print mq_flags field.
	mq_flags field of struct mq_attr can contain only O_NONBLOCK flag (other
	flags are treated as invalid by mq_getsetattr). Moreover, this field is
	ignored by mq_open at all (O_NONBLOCK is set via oflag, not via attr
	attribute).

	* xlat/mq_attr_flags.in: New file.
	* print_mq_attr.c: Include xlat/mq_attr_flags.h.
	(printmqattr): New parameter, bool decode_flags; cast members of struct
	mq_attr to long long type; use mq_attr_flags xlat for printing mq_flags;
	print mq_flags as flags only in case decode_flags parameter is set
	to true.
	* mq.c (SYS_FUNC(mq_open)): Specify value of false for decode_flags
	parameter of printmqattr call.
	(SYS_FUNC(mq_getsetattr)): Specify value of true for decode_flags
	parameter of printmqattr call.
	* tests/mq.expected: Update expected output.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mq: Print msg_len parameter as kernel_ulong_t.
	* mq.c (SYS_FUNC(mq_timedsend)): Change conversion specifier from "%lu"
	to "%llu", use getarg_ull for obtaining msg_len parameter.
	(SYS_FUNC(mq_timedreceive)): Likewise.

	print_mq_attr: fix typo.
	* print_mq_attr.c (printmqattr): Print field name "mq_curmsgs"
	instead of "mq_curmsg".
	* tests/mq.expected: Update expected output.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mq: print mqdes parameter as int.
	It is defined as int in <linux/posix_types.h>.

	* mq.c (SYS_FUNC(mq_timedsend)): Use "%d" conversion specifier instead
	of "%ld" for printing mqdes (0th parameter), cast parameter value to
	int.
	(SYS_FUNC(mq_timedreceive)): Likewise.
	(SYS_FUNC(mq_notify)): Likewise.
	(SYS_FUNC(mq_getsetattr)): Likewise.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	mq: curly brackets usage fix.
	Use curly brackets for denoting blocks in both of if branches if they
	are already used in at least one branch.

	tests: additional name_to_handle_at/open_by_handle_at checks.
	* tests/file_handle.c: Additional name_to_handle_at/open_by_handle_at
	checks.

	tests: require only presence of __NR_* macros for file_handle test.
	* tests/file_handle.c: replace fcntl.h include with asm/unistd.h.
	[MAX_HANDLE_SZ]: change to defined __NR_name_to_handle_at
	&& defined __NR_open_by_handle_at, add fcntl.h include
	[!MAX_HANDLE_SZ]: Add definition of MAX_HANDLE_SZ and struct
	file_handle.
	(main): Change name_to_handle_at and open_by_handle_at calls to syscall.

	tests: proper type conversion in keyctl test.
	* tests/keyctl.c (printarg): Add intermediate conversion of arg to uintptr_t
	since kernel_ulong_t may be of different size.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	file_handle: use separate xlat for name_ta_handle_at flags.
	Since the only two flags supported are AT_SYMLINK_FOLLOW and
	AT_EMPTY_PATH.

	* xlat/name_to_handle_at_flags.in: New file.
	* file_handle.c (SYS_FUNC(name_to_handle_at)): Use name_to_handle_at_flags
	for printing flags parameter.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of kexec_file_load and kexec_load syscalls.
	* tests/kexec_file_load.c: New file.
	* tests/kexec_load.c: Likewise.
	* tests/kexec_file_load.test: New test.
	* tests/kexec_load.test: Likewise.
	* tests/.gitignore: Add kexec_file_load and kexec_load.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add kexec_file_load.test and kexec_load.test.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	kexec: use widen_to_ulong since kexec_load has compat on x32/n32.
	Curiously, kexec_load uses compat on x32/n32, so its parameters should
	be 4 bytes in size on these ABIs.

	* kexec.c (SYS_FUNC(kexec_load)): Use widen_to_ulong for casting
	parameters to proper size on x32/n32.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	kexec: fix zeroing of higher bits of flags parameter in kexec_load.
	* kexec.c (SYS_FUNC(kexec_load)): Perform type conversion before
	negation in order to properly negate higher bits of KEXEC_ARCH_MASK.

	kexec: add printing of struct kexec_segment field names.
	* kexec.c (print_seg): Print field names of the kexec_segment structure.

	tests: check decoding of unshare syscall.
	* tests/unshare.c: New file.
	* tests/unshare.test: New test.
	* tests/.gitignore: Add unshare.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add unshare.test.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	clone: use kernel_ulong_t as type of flags parameter of unshare call.
	Kernel declares flags parameter as long and looks like x32 and n32
	implement no compat for this call.

	* clone.c (SYS_FUNC(unshare)): Use getarg_ull and printflags64 for
	obtaining and parsing flags parameter.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	clone: use separate flag list for unshare.
	Not all clone flags could be passed to unshare (see check_unshare_flags
	function in kernel/fork.c).

	* xlat/unshare_flags.in: New file.
	* clone.c (SYS_FUNC(unshare)): Use unshare_flags for printing flags
	parameter.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of setns syscall.
	* tests/setns.c: New file.
	* tests/setns.test: New test.
	* tests/.gitignore: Add setns.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setns.test.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	clone: use separate xlat for nstype parameter of setns syscall.
	nstype is not flag set but specific type value against which it is
	compared in kernel (see kernel/nsproxy.c, SYSCALL_DEFINE2(setns, ...)).

	* xlat/setns_types.in: New file.
	* clone.c: Use printxval and setns_types for nstype parameter.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check non-verbose capget/capset output.
	* tests/caps-abbrev.awk: New file.
	* tests/caps-abbrev.c: Likewise.
	* tests/caps-abbrev.test: New test.
	* tests/.gitignore: Add caps-abbrev.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add caps-abbrev.test.
	(EXTRA_DIST): Add caps-abbrev.awk.

	tests: additional capset decoder checks.
	* tests/caps.awk: Add patterns for additional checks.
	* tests/caps.c: Implement additional checks.

	tests: check decoding of fanotify_init syscall.
	* tests/fanotify_init.c: New file.
	* tests/fanotify_init.test: New test.
	* tests/.gitignore: Add fanotify_init.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add fanotify_init.test.

	tests: some additional checks for fanotify_mark.
	* tests/fanotify_mark.c (do_call): New function.
	(main): Use it.

	tests: use sprintrc in tests/fanotify_mark.c.
	* tests/fanotify.c (main): Use sprintrc.

	tests: check decoding of {init,finit,delete}_module syscalls.
	* tests/delete_module.c: New file.
	* tests/finit_module.c: Likewise.
	* tests/init_delete_module.h: Likewise.
	* tests/init_module.c: Likewise.
	* tests/delete_module.test: New test.
	* tests/finit_module.test: Likewise.
	* tests/init_module.test: Likewise.
	* tests/.gitignore: Add delete_nodule, finit_module, and init_module.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add delete_module.test, finit_module.test,
	and init_module.test.
	(EXTRA_DIST): Add init_delete_module.h.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	bjm: use getarg_ull for retrieving first two parameters of init_module syscall
	As init_module has no compat wrapper, its first parameter is a pointer
	and the second is length, they both have the same size as kernel_ulong_t
	type.

	* bjm.c (SYS_FUNC(init_module)): Obtain first two parameters using
	getarg_ull, print address argument using printaddr_ull, print length
	argument using "%llu" conversion specifier.

2016-10-28  Dmitry V. Levin  <ldv@altlinux.org>

	Add printaddr_ull, change printaddr into a thin wrapper around it.
	* defs.h (printaddr_ull): New prototype.
	(printaddr): Change to a static inline wrapper around printaddr_ull.
	* util.c (printaddr): Rename to printaddr_ull, change argument type
	to unsigned long long, change print format to %#llx.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add values for MODULE_INIT_* constants.
	* bjm.c (MODULE_INIT_IGNORE_MODVERSIONS, MODULE_INIT_IGNORE_VERMAGIC):
	Remove.
	* xlat/module_init_flags.in: Add values for
	MODULE_INIT_IGNORE_MODVERSIONS and MODULE_INIT_IGNORE_VERMAGIC records.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Remove parser of create_module syscall.
	Since create_module syscall is present only in kernels before Linux 2.6
	and strace does not support those kernels, there is no use to keep this
	parser any longer.

	* bjm.c (SYS_FUNC(create_module)): Remove.
	* linux/dummy.h (sys_create_module): Add stub alias.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of process_vm_readv and process_vm_writev syscalls
	* tests/process_vm_readv.c: New file.
	* tests/process_vm_readv_writev.c: Likewise.
	* tests/process_vm_writev.c: Likewise.
	* tests/process_vm_readv.test: New test.
	* tests/process_vm_writev.test: Likewise.
	* tests/.gitignore: Add process_vm_readv and process_vm_writev.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add process_vm_readv.test and process_vm_writev.test.
	(EXTRA_DIST): Add process_vm_readv_writev.c.

	process_vm: use widen_to_ulong for local_iovcnt, renote_iovcnt, and flags
	* process_vm.c (SYS_FUNC(process_vm_readv),
	SYS_FUNC(process_vm_writev)): Use widen_to_ulong for local_iovcnt,
	renote_iovcnt, and flags parameters.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs: add widen_to_ulong macro.
	This is similar to widen_to_long, but for unsigned values.

	* defs.h (widen_to_ulong): New macro.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	process_vm: print pid argument as int.
	* process_vm.c (SYS_FUNC(process_vm_readv),
	SYS_FUNC(process_vm_writev)): Change conversion specifier for pid
	argument from "%ld" to "%d".

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	process_vm: remove syserror check for iovec printing.
	This check had been done by print_array inside tprint_iov anyway.

	* process_vm.c (SYS_FUNC(process_vm_readv)): Use tprint_iov_upto for
	printing local_iov; do not check for syserror, provide decode_iov
	parameter to tprint_iov{,_upto} based on its value instead.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	io: use umoven_or_printaddr_ignore_syserror as umove function in tprint_iov_upto
	This enables printing of iovec arrays even in case of failed syscall
	(failed syscall doesn't mean that iovec itself is inaccessible and
	useless).  One caveat here is that we should explicitly provide proper
	IOV_DECODE_* value based on syserror value in case printing is performed
	on exiting; we can't simply override it to IOV_DECODE_ADDR on exiting
	when syserror is up, since this may be called by code which tries to
	print iovec containing local data, which should be perfectly accessible
	(on the other hand, there are no cases of such behaviour at the moment).

	Since iovecs themselves are printed even if syscall has failed now,
	preadv test is updated to reflect this.  It is notable, though, that this
	is the only place where this case is checked.

	* io.c (tprint_iov_upto): Specify umoven_or_printaddr_ignore_syserror
	instead of umoven_or_printaddr as umoven_func parameter.
	(SYS_FUNC(readv), do_preadv): Specify decode_iov parameter value
	based on syserror(tcp) value.
	* scsi.c: (print_sg_io_v3_res, print_sg_io_v4_res): Likewise.
	* tests/preadv.c: Update expected output for the case when preadv
	with singe-item iovec failed.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Move umoven_or_printaddr_ignore_syserror to util.c.
	* defs.h (umoven_or_printaddr_ignore_syserror): New prototype.
	* v4l2.c (umoven_or_printaddr_ignore_syserror): Move ...
	* util.c: ... here.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	v4l2: check for verbose flag in umoven_or_printaddr_ignore_syserror.
	This change makes behaviour of umoven_or_printaddr_ignore_syserror in
	line with umoven_or_printaddr when verbose flag is disabled.

	* v4l2.c (umoven_or_printaddr_ignore_syserror): Simply call printaddr
	when verbose flag is unset.

2016-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of kcmp syscall.
	* tests/kcmp.c: New file.
	* tests/kcmp.test: New test.
	* tests/.gitignore: Add kcmp.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add kcmp.test.

2016-10-28  Dmitry V. Levin  <ldv@altlinux.org>

	kcmp: print index parameters of unknown commands as kernel_ulong_t.
	* lookup_dcookie.c (SYS_FUNC(kcmp)): Use getarg_ull to retrieve idx1
	and idx2, print them using %#llx format in case of unknown command.

2016-10-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of inotify family syscalls.
	* tests/inotify.c: New file.
	* tests/inotify_init1.c: Likewise.
	* tests/inotify.test: New test.
	* tests/inotify_init1.test: Likewise.
	* tests/.gitignore: Add inotify and inotify_init1.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add inotify.test and inotify_init1.test.

	xlat: use IN_* prefix for inotify_init1 flag constants.
	* xlat/inotify_init_flags.in: Replace O_* prefix with IN_* prefix for
	O_NONBLOCK and O_CLOEXEC constants, provide fallback definitions.

	tests: check decoding of lookup_dcookie syscall.
	* tests/lookup_dcookie.c: New file.
	* tests/lookup_dcookie.test: New test.
	* tests/.gitignore: Add lookup_dcookie.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add lookup_dcookie.test.

2016-10-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	lookup_dcookie: print len parameter as kernel_ulong_t.
	It is size_t and without compat on x32/n32.

	* lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Change conversion
	specifier from "%lu" to "%llu", use getarg_ull for len argument
	retrieval.

2016-10-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs.h: add offsetofend macro.
	Analogous to offsetof but returns structure offset after the specified
	field.  Useful for checking whether specific field is present in obtained
	data or specifying amount of data to copy based on the (last) field needed.

	* defs.h (offsetofend): New macro.

2016-10-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: move ARG_STR and similar macros to tests.h.
	* tests/add_key.c (_STR, ARG_STR): Move ...
	* tests/tests.h: ... here.
	(ARG_ULL_STR): New macro.
	* tests/keyctl.c (ARG_STR): Remove.
	* tests/quotactl.h (ARG_STR): Likewise.
	* tests/request_key.c (ARG_STR): Likewise.

	tests: move LL_PAIR and LL_VAL_TO_PAIR macros to tests.h.
	* tests/fadvise.h (LL_PAIR, LL_VAL_TO_PAIR): Move ...
	* tests/tests.h: ... here.

	tests: check decoding of ioprio_get and ioprio_set syscalls.
	* tests/ioprio.c: New file.
	* tests/ioprio.test: New test.
	* tests/.gitignore: Add ioprio.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioprio.test.

2016-10-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for CLOCK_* constants.
	Since new values have been added gradually over various kernel versions,
	it's better to define them explicitly in order to avoid situations when
	strace built with older kernel headers cannot decode some recently
	defined values.

	* xlat/clocknames.in: Add values for constants.

2016-10-26  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: move fill_memory and fill_memory_ex into a separate file.
	* tests/fill_memory.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.
	* tests/quotactl.h (fill_memory, fill_memory_ex): Move to fill_memory.c.
	* tests/tests.h (fill_memory, fill_memory_ex): New prototypes.

	tests: add period parameter to fill_memory_ex.
	* tests/quotactl.h (fill_memory_ex): Add period parameter,
	use it as a divisor in non-constant part of value.
	(fill_memory): Specify period of 0x80 to fill_memory_ex call.
	* tests/quotactl-xfs.c (main): Likewise.

2016-10-05  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.14-1.
	* strace.spec.in: Likewise.

2016-10-04  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.14 release.
	* NEWS: Update for 4.14 release.

	Generate SEN numbers in a locale independent order.
	* generate_sen.sh: Sort SEN numbers using C collation rules.

2016-10-04  Dmitry V. Levin  <ldv@altlinux.org>

	Assume that offsetof is provided by stddef.h.
	According to C89, <stddef.h> shall define offsetof macro.

	* defs.h: Include <stddef.h> unconditionally.
	[!offsetof]: Remove.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of add_key, keyctl, and request_key syscalls.
	* tests/add_key.c: New file.
	* tests/keyctl.c: Likewise.
	* tests/request_key.c: Likewise.
	* tests/add_key.test: New test.
	* tests/keyctl.test: Likewise.
	* tests/request_key.test: Likewise.
	* tests/.gitignore: Add add_key, keyctl, and request_key.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add add_key.test, keyctl.test, and request_key.test.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	keyctl: use kernel_ulong_t and getarg_ull instead of long.
	This potentially fixes keyctl decoder for x32 personality.

	* keyctl.c (keyctl_update_key, keyctl_read_key, keyctl_instantiate_key,
	keyctl_instantiate_key_iov, keyctl_dh_compute): Change addr and len
	arguments to kernel_ulong_t.  Print len using %llu format.
	(keyctl_keyring_search): Change addr1 and addr2 arguments
	to kernel_ulong_t.
	(print_dh_params): Change addr argument to kernel_ulong_t.
	(SYS_FUNC(keyctl)): Retrieve arguments via getarg_ull, pass them
	to the appropriate handlers.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	keyctl: fix parameter signedness.
	* keyctl.c (keyctl_update_key): Change addr and len arguments
	to unsigned.
	(keyctl_read_key): Likewise.
	(keyctl_instantiate_key): Likewise.
	(keyctl_instantiate_key_iov): Likewise.
	(keyctl_dh_compute): Likewise.
	(keyctl_keyring_search): Change addr1 and addr2 arguments to unsigned.
	(keyctl_chown_key): Change user and group arguments to unsigned.
	(keyctl_get_persistent): Change uid argument to unsigned.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	keyctl: use printstr_ex for printing out buffer.
	keyctl_read_key had subtle bug by treating out buffer in KEYCTL_READ
	as NUL-terminated, which is not true.  We fix it by adding parameter to
	keyctl_read_key signalising whether buffer is NUL-terminated and using
	printstr_ex for printing (expectedly) NUL-terminated strings.

	* keyctl.c (keyctl_read_key): Add has_nul parameter.  Do not use -1 as
	string len.  Use printstr_ex for buffer output with user style depending
	on has_nul value.
	(SYS_FUNC(keyctl)): Specify has_nul parameter to keyctl_read_key
	by comparing cmd value with KEYCTL_READ.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add printstr_ex which allows for providing user quotation style.
	This is useful for providing QUOTE_OMIT_TRAILING_0 and maybe other
	flags.

	* defs.h (printstr_ex): New prototype.
	(printstr): Change to a wrapper around printstr_ex with zero user style.
	* util.c (printstr): Rename to ...
	(printstr_ex) ... new function, add user_style argument which is or'ed
	with computed style.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: add quote_string flag signalising that string is NUL-terminated.
	It is useful in cases strings with size provided are expected to be
	NUL-terminated but are not trustworthy enough to call just plain
	printstr(str, -1).

	* defs.h (QUOTE_OMIT_TRAILING_0): New constant definition.
	* util.c (string_quote): Swallow terminating NUL if
	QUOTE_OMIT_TRAILING_0 is set.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	keyctl: add support for KEYCTL_DH_COMPUTE.
	* keyctl.c (struct keyctl_dh_params): New structure.
	(print_dh_params, keyctl_dh_compute): New functions.
	(SYS_FUNC(keyctl)): Add support for KEYCTL_DH_COMPUTE cmd value.

2016-10-03  Dmitry V. Levin  <ldv@altlinux.org>

	x86_64: fix is_negated_errno for x32 personality.
	* syscall.c (is_negated_errno) [X86_64]: Do not truncate kernel_ulong_t
	to uint32_t for x32 personality.

	tests: fix another regression in qual_syscall.test.
	* tests/qual_syscall.test: Fix pattern_nonabbrev_verbose pattern.
	(check_output_mismatch): Print the pattern that triggered match failure.

	Use err_name, print unrecognized errno values as numbers.
	* syscall.c (trace_syscall_exiting): Use err_name() instead
	of open-coding it.  Print unrecognized errno values using %lu format
	instead of ERRNO_%lu as the latter prodices an invalid constant.

2016-10-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	keyctl: print errno name in KEYCTL_REJECT in case it is available.
	* keyctl.c (keyctl_reject_key): Get errno string via err_name
	and print it if it is not NULL.

	Add function for getting errno string.
	* defs.h (err_name): New prototype.
	* syscall.c (err_name): New function.

2016-10-03  Dmitry V. Levin  <ldv@altlinux.org>

	struct tcb: change the type of u_error field from int to unsigned long.
	This is the type actually used for the error code on architectures
	that use a dedicated register.

	* defs.h (struct tcb): Change the type of u_error to unsigned long.
	* syscall.c (trace_syscall_exiting): Change the type of u_error variable
	to unsigned long, print it using %lu format, drop no longer needed
	explicit cast to unsigned long.
	(saved_u_error): Change type to unsigned long.

2016-10-02  Dmitry V. Levin  <ldv@altlinux.org>

	Use tprints instead of tprintf in a few more places.
	* btrfs.c (btrfs_print_qgroup_inherit, btrfs_print_tree_search,
	btrfs_ioctl): Replace tprintf with tprints for printing strings without
	format specifiers.
	* net.c (print_group_req): Likewise.
	* scsi.c (scsi_ioctl): Likewise.
	* term.c (decode_termios, decode_termio): Likewise.
	* userfaultfd.c (uffdio_ioctl): Likewise.

2016-10-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	keyctl: do not print comma for KEYCTL_SESSION_TO_PARENT command.
	Since this command doesn't have any additional arguments, the comma does
	not needed.  Since this is the only command which lacks additional
	arguments, it's better to add special case for it rather than add
	printing of comma to all other commands.

	* keyctl.c (SYS_FUNC(keyctl)): Add check for command not being
	KEYCTL_SESSION_TO_PARENT when printing comma dividing cmd argument
	from the rest.

2016-10-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	keyctl: use getarg_ull for printing generic arguments.
	Otherwise it is erroneous on x32, for example.

	* keyctl.c (SYS_FUNC(keyctl)): Use "%#llx" conversion specifier
	and getarg_ull for fallback argument printing.

2016-10-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	keyctl: use printuid for printing UID/GID.
	UID/GID are unsigned except special -1 value (which is also special in
	context of specific keyctl commands), so special printing function
	should be used.

	* keyctl.c (keyctl_chown_key, keyctl_get_persistent): Use printuid
	instead of printf with "%d" conversion for printing UID/GID.

2016-10-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	io: handle data_size of -1 as unlimited data in print_iovec.
	Otherwise it can be depleted and print_iovec starts printing empty
	strings.

	* io.c (print_iovec): Interpret c->data_size of -1 as unlimited data
	and do not decrease it in this case.

2016-10-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix typo in qual_syscall.test.
	Fix test regression introduced by commit v4.13-225-g55334ef.

	* tests/qual_syscall.test: Fix typo.

2016-09-30  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance -e abbrev=set, -e raw=set, and -e verbose=set.
	Enhance abbrev=, raw=, and verbose= to accept the same syntax as trace=.
	For example, this allows such syntax as -e verbose=file.

	* syscall.c (lookup_class): Define before qual_syscall.
	(qualify): Move the loop based on lookup_class ...
	(qual_syscall): ... here.
	* tests/qual_syscall.test: Check it.

2016-09-30  Dmitry V. Levin  <ldv@altlinux.org>

	tests/qual_syscall.test: rewrite without ls.
	* tests/qual_syscall.test: Invoke ./umovestr instead of ls.
	Update expected output.

2016-09-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of fadvise64 and fadvise64_64 syscalls.
	* tests/fadvise.h: New file.
	* tests/fadvise64.c: Likewise.
	* tests/fadvise64_64.c: Likewise.
	* tests/fadvise64.test: New test.
	* tests/fadvise64_64.test: Likewise.
	* tests/.gitignore: Add fadvise64 and fadvise64_64.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add fadvise64.test, fadvise64_64.test.
	(EXTRA_DIST): Add fadvise.h.

2016-09-28  Dmitry V. Levin  <ldv@altlinux.org>

	mips o32: implement fetching the 7th subcall argument.
	* syscall.c [LINUX_MIPSO32] (decode_mips_subcall): Fetch the last
	argument of 7-arg syscalls.

2016-09-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	x32: use proper decoder for fadvise64 syscall.
	fadvise_64_64 decoder used before this change prints different sign
	of the "len" argument (loff_t vs size_t).

	* linux/x32/syscallent.h (fadvise64): Replace SEN(fadvise64_64)
	with SEN(fadvise64).

2016-09-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	fadvise: use getarg_ull for obtaining len argument of fadvise64 syscall.
	Since its type is size_t, it is 64-bit wide on x32 and special care
	should be taken in order to obtain it.

	* fadvise.c (SYS_FUNC(fadvise64)): Use getarg_ull for obtaining value
	of "len" syscall argument.

2016-09-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: add getarg_ll and getarg_ull functions.
	These allow retrieving specific argument in full taking into account
	peculiarities of runtimes which employ tcp->ext_arg (e.g. x32).

	* defs.h (getarg_ll, getarg_ull): New prototypes.
	* util.c (getarg_ll, getarg_ull): New functions.
	(printargs): Use getarg_ull.

2016-09-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	fadvise: change printing of len argument to unsigned in fadvise64 syscall
	The kernel declares fadvise64 as
	long sys_fadvise64(int fd, loff_t offset, size_t len, int advice);

	* fadvise.c (SYS_FUNC(fadvise64)): Change conversion specifier from
	"%ld" to "%lu" for printing len argument since kernel expects argument
	of type size_t.

2016-09-28  Dmitry V. Levin  <ldv@altlinux.org>

	sh64, sparc64: use proper decoder for fadvise64_64 syscall.
	This change is no-op yet, but things will change when decoder
	of fadvise64 syscall get fixed.

	* linux/sh64/syscallent.h (fadvise64_64): Replace SEN(fadvise64)
	with SEN(fadvise64_64).
	* linux/sparc64/syscallent.h (fadvise64_64): Likewise.

2016-09-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of fallocate syscall.
	* configure.ac (AC_CHECK_FUNCS): Add fallocate.
	* tests/fallocate.c: New file.
	* tests/fallocate.test: New test.
	* tests/.gitignore: Add fallocate.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add fallocate.test.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	fallocate: change print format of offset and len arguments to signed.
	Since types of these arguments are off_t and kernel actually expects
	signed values in order to fail when negative values are provided,
	lets display these values as signed.

	* fallocate.c (SYS_FUNC(fallocate)): Change conversion specifier for
	printing "offset" and "len" syscall arguments from %llu to %lld.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add default values for falloc_flags constants.
	In order to avoid dependence of declared constants to headers available
	on build system.

	* xlat/falloc_flags.in: Add default values for constants.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of getcpu syscall.
	* tests/getcpu.c: New file.
	* tests/getcpu.test: New test.
	* tests/.gitignore: Add getcpu.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add getcpu.test.

	tests: make magic values in ioctl_block test distinctive.
	* tests/ioctl.block (init_magic): Add iterator value to magic value
	in order to enable detection of potential 4-byte aligned shifts.

	tests: additional getcwd decoding checks.
	* tests/getcwd.c (main): Add more checks for getcwd arguments decoding.

	tests: check decoding of quotactl syscall.
	* configure.ac (AC_CHECK_HEADERS): Add linux/dqblk_xfs.h, linux/quota.h,
	and sys/quota.h.
	* tests/.gitignore: Add quotactl, quotactl-v, quotactl-xfs,
	and quotactl-xfs-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add quotactl.test, quotactl-v.test,
	quotactl-xfs.test, and quotactl-xfs-v.test.
	(EXTRA_DIST): Add quotactl.h
	* quotactl.h: New file.
	* quotactl.c: Likewise.
	* quotactl-v.c: Likewise.
	* quotactl-xfs.c: Likewise.
	* quotactl-xfs-v.c: Likewise.
	* quotactl.test: New test.
	* quotactl-v.test: Likewise.
	* quotactl-xfs.test: Likewise.
	* quotactl-xfs-v.test: Likewise.

2016-09-27  Dmitry V. Levin  <ldv@altlinux.org>

	quota: ensure that names of structure fields are printed properly.
	* quota.c (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X): New macros.
	(decode_cmd_data): Use them to print structure fields.

	Enhance zero_extend_signed_to_ull and sign_extend_unsigned_to_ll macros.
	* defs.h (zero_extend_signed_to_ull, sign_extend_unsigned_to_ll):
	Add support of char types.
	* tests/tests.h (zero_extend_signed_to_ull, sign_extend_unsigned_to_ll):
	Likewise.

	quota: move Q_QUOTAON handling to subcommand switch statement.
	* quota.c (SYS_FUNC(quotactl)): Move handling of Q_QUOTAON subcommand ...
	(decode_cmd_data): ... here.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	quota: remove legacy subcommand decoding support code.
	Support for these quota subcommands by linux kernels has been dropped
	long time ago (between 2.5.16 and 2.5.17), so lets drop it in order
	to minimize amount of code which should be subjected to testing and
	structured conversion.

	* quota.c (struct v1_dqblk, struct v2_dqblk, struct v2_dqinfo,
	struct v1_dqstats, struct v2_dqstats): Remove.
	(decode_cmd_data): Remove handling of Q_V1_GETQUOTA, Q_V1_SETQUOTA,
	Q_V2_GETQUOTA, Q_V2_SETQUOTA, Q_V2_GETINFO, Q_V2_SETINFO, Q_V1_GETSTATS,
	and Q_V2_GETSTATS subcommands.
	(SYS_FUNC(quotactl)): Remove handling of Q_V1_QUOTAON subcommand.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	quota: add realtime block limits fields to XFS disk quota printing code.
	* quota.c (decode_cmd_data): Add printing of d_rtb_hardlimit
	and d_rtb_softlimit fields to struct xfs_dqblk printing code.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	quota: add packed attribute to struct if_dqblk definition.
	Since the only difference between 32-bit and 64-bit environments
	regarding this structure is its padding, lets just add packed attribute
	to its definition instead of going full mpers.

	* quota.c (struct if_dqblk): Add ATTRIBUTE_PACKED.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	quota: Add decoding for Q_XQUOTARM subcommand.
	* quota.c (decode_cmd_data): Add Q_XQUOTARM handling to subcommand
	  switch.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	quota: add dispatch of SYNC subcommands.
	Q_XQUOTASYNC is no-op, but it does not require id/addr arguments anyway.

	* quota.c (decode_cmd_data): Add Q_SYNC and Q_XQUOTASYNC to subcommand
	dispatch switch since id/addr arguments for these subcommands are known
	to be ignored.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	quota: add missing prefixes to struct field names.
	* quota.c (decode_cmd_data): Print field names in accordance with
	their definition.

	quota: fix indentation inside subcommand dispatching switch statement.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	quota: avoid printing id argument for those commands that ignore it.
	As id argument is not used for Q_QUOTAOFF, Q_GETFMT, Q_V2_GETINFO,
	Q_GETINFO, Q_V2_SEETINFO, Q_SETINFO, Q_SYNC, Q_XQUOTAON, Q_XQUOTAOFF,
	Q_XQUOTARM, Q_XGETQSTAT, Q_XGETQSTATV, Q_XQUOTASYNC, Q_V1_GETSTATS, and
	Q_V2_GETSTATS subcommands, do not print it for these subcommands.

	* quota.c (decode_cmd_data): Add id argument parameter, add printing
	of id argument for Q_GETQUOTA, Q_SETQUOTA, Q_GETNEXTQUOTA,
	Q_V1_GETQUOTA, Q_V1_SETQUOTA, Q_V2_GETQUOTA, Q_V2_SETQUOTA,
	Q_XGETQUOTA, Q_XGETNEXTQUOTA, Q_XSETQLIM, and unknown subcommands.
	(SYS_FUNC(quotactl)): Remove printing of id argument, pass it
	to decode_cmd_data.

2016-09-27  Eugene Syromyatnikov  <evgsyr@gmail.com>

	quota: use printuid for id parameter printing.
	* quota.c (SYS_FUNC(quotactl)): Since id call argument is used for
	user/group/project ID which all have special semantics for -1,
	print it the same way as UIDs are printed.

	quota: display quota subcommand as a macro.
	* quota.c (SYS_FUNC(quotactl)): Replace disjunction of two xlat values
	(which also lacks shift of the left part) with QCMD macro call.

2016-09-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use VERBOSE macro in waitid and waitid-v tests.
	* tests/waitid-v.c (VERBOSE_RUSAGE): Remove.
	(VERBOSE): Define to 1.
	* tests/waitid.c (sprint_rusage): Check VERBOSE instead
	of VERBOSE_RUSAGE.

	tests: use VERBOSE macro in wait4 and wait4-v tests.
	* tests/wait4-v.c (VERBOSE_RUSAGE): Remove.
	(VERBOSE): Define to 1.
	* tests/wait4.c (sprint_rusage): Check VERBOSE instead
	of VERBOSE_RUSAGE.

	tests: use VERBOSE macro in msg_control and msg_control-v tests.
	* tests/msg_control-v.c (VERBOSE_MSGHDR): Remove.
	(VERBOSE): Define to 1.
	* tests/msg_control.c (print_fds, print_ip_opts): Check VERBOSE instead
	of VERBOSE_MSGHDR.

	tests: use VERBOSE macro in mmsg_name and mmsg_name-v tests.
	* tests/mmsg_name-v.c (VERBOSE_MMSGHDR): Remove.
	(VERBOSE): Define to 1.
	* tests/mmsg_name.c (test_mmsg_name): Check VERBOSE instead
	of VERBOSE_MMSGHDR.

	tests: use VERBOSE macro in ioctl_rtc and ioctl_rtc-v tests.
	* tests/ioctl_rtc-v.c (VERBOSE_IOCTL): Remove.
	(VERBOSE): Define to 1.
	* tests/ioctl_rtc.c (print_rtc_time): Check VERBOSE instead
	of VERBOSE_IOCTL.

	tests: use VERBOSE macro in ioctl_evdev and ioctl_evdev-v tests.
	* tests/ioctl_evdev-v.c (VERBOSE_IOCTL): Remove.
	(VERBOSE): Define to 1.
	* tests/ioctl_evdev.c: Check VERBOSE instead of VERBOSE_IOCTL.

	tests: use VERBOSE macro in execveat and execveat-v tests.
	* tests/execveat-v.c (VERBOSE_EXECVEAT): Remove.
	(VERBOSE): Define to 1.
	* tests/execveat.c (main): Check VERBOSE instead of VERBOSE_EXECVEAT.

	tests: use VERBOSE macro in execve and execve-v tests.
	* tests/execve-v.c (VERBOSE_EXECVE): Remove.
	(VERBOSE): Define to 1.
	* tests/execve.c (main): Check VERBOSE instead of VERBOSE_EXECVE.

2016-09-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add VERBOSE macro.
	Introduce VERBOSE macro (defaults to 0) that is expected to be defined
	to 1 by code testing "strace -v" output.

	* tests/tests.h [!VERBOSE] (VERBOSE): New macro.

2016-09-20  Dmitry V. Levin  <ldv@altlinux.org>

	decode_open: print the mode argument when O_TMPFILE flag is set.
	O_TMPFILE reqires the mode argument (just like O_CREAT), so print it.

	* open.c (STRACE_O_TMPFILE): New macro.
	(decode_open): Print the mode argument when O_TMPFILE flag is set.
	* tests/open.c (main): Check it.
	Fixes RH#1377846.

2016-09-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use sprintrc in tests/ptrace.c.
	* tests/ptrace.c (errstr): New static variable.
	(do_ptrace): Initialize it using sprintrc.
	(test_peeksiginfo, main): Use errstr.

	tests: use sprintrc in tests/netlink_protocol.c.
	* tests/netlink_protocol.c (main): Use sprintrc.

	tests: use sprintrc in tests/fchownat.c.
	* tests/fchownat.c (main): Use sprintrc.

	tests: use sprintrc in tests/fchmodat.c.
	* tests/fchmodat.c (main): Use sprintrc.  Add more fchmodat decoding tests.

	tests: use sprintrc in tests/fchmod.c.
	* tests/fchmod.c (main): Use sprintrc.  Add more fchmod decoding tests.
	* tests/fchmod.test: Update the value specified for strace -a parameter.

	tests: use sprintrc in tests/getgroups.c.
	* tests/getgroups.c (main): Use sprintrc.

	tests: use sprintrc in tests/setgroups.c.
	* tests/setgroups.c (main): Use sprintrc.

2016-09-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests/utime.c: rewrite without assert.
	* tests/utime.c: Do not include <assert.h>.
	(main): Use sprintrc instead of assert.

	tests/xattr.c: rewrite without assert.
	* tests/xattr.c: Do not include <assert.h>.
	(main): Use sprintrc instead of assert.

	tests: use sprintrc in tests/xchownx.c.
	* tests/xchownx.c (main): Do not include <errno.h>.  Use sprintrc.

	tests/xstatfsx.c: fix potential errno clobbering.
	* tests/xstatfsx.c (main): Use sprintrc.

2016-09-19  Dmitry V. Levin  <ldv@altlinux.org>

	Add more fs magic constants.
	Add *_MAGIC constants defined for some relatively widespread
	non-mainline filesystems.

	* xlat/fsmagic.in: Add AUFS_SUPER_MAGIC, GPFS_SUPER_MAGIC,
	VZFS_SUPER_MAGIC, and ZFS_SUPER_MAGIC constants.

2016-09-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: fix whitespace for explicit type casts in futex test.

2016-09-14  Dmitry V. Levin  <ldv@altlinux.org>

	Add more fs magic constants.
	Add *_MAGIC constants defined inside linux fs but not explicitly
	exported via linux uapi.

	* xlat/fsmagic.in: Add HFS_SUPER_MAGIC, HFSPLUS_SUPER_MAGIC,
	EXOFS_SUPER_MAGIC, CEPH_SUPER_MAGIC, UBIFS_SUPER_MAGIC, JFS_SUPER_MAGIC,
	BEFS_SUPER_MAGIC, NTFS_SB_MAGIC, XFS_SB_MAGIC, CONFIGFS_MAGIC,
	FUSE_CTL_SUPER_MAGIC, FUSE_SUPER_MAGIC, AFS_FS_MAGIC, OCFS2_SUPER_MAGIC,
	VXFS_SUPER_MAGIC, LOGFS_MAGIC, SMB2_MAGIC_NUMBER, and CIFS_MAGIC_NUMBER
	constants.

2016-09-14  Dmitry V. Levin  <ldv@altlinux.org>

	Update fs *_MAGIC constants.
	Add fs *_MAGIC constants exported by linux uapi.

	* xlat/fsmagic.in: Add BFS_MAGIC, GFS2_MAGIC, and ROMFS_MAGIC constants
	defined in linux/bfs_fs.h, linux/gfs2_ondisk.h, and linux/romfs_fs.h,
	respectively.

2016-09-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: workaround limited semctl implementation in musl.
	musl libc forwards semctl command argument for 8 known commands only,
	for all the rest it passes 0 instead.

	* tests/ipc_sem.c (main): Update semctl expected output.

2016-09-13  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add more IPC decoding checks.
	* tests/ipc_msg.c: Additional msgget (parameter format) and msgctl
	(parameter format, decoding of struct msqid_ds in IPC_SET/IPC_STAT
	commands) checks.
	* tests/ipc_sem.c: Additional semget and semctl checks.
	* tests/ipc_shm.c: Additional shmget and shmctl checks.
	* tests/semop.c: Additional semop checks.  Add checks for semtimedop.
	* tests/semop.test: Add explicit -e parameter in order to trace both
	semop and semtimedop.
	* tests/shmxt.c: Additional shmat and shmdt checks.

2016-09-12  Dmitry V. Levin  <ldv@altlinux.org>

	.mailmap: add addresses of Dr. David Alan Gilbert.
	* .mailmap: Add both addresses of Dr. David Alan Gilbert here to avoid
	duplications in CREDITS file.

2016-09-12  Eugene Syromyatnikov  <evgsyr@gmail.com>

	.mailmap: add canonical name for Eugene Syromyatnikov.
	This is needed due to apparent deviation in spelling of commit author
	name in several commits.

	* .mailmap: Add canonical name for Eugene Syromyatnikov.

2016-09-12  Dmitry V. Levin  <ldv@altlinux.org>

	Update generic ioctl entries from linux 4.8.
	* linux/64/ioctls_inc.h: Update from linux v4.8 using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.

2016-09-12  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	x32: update ioctl entries from linux 4.8.
	* linux/x32/ioctls_inc0.h: Update from linux v4.8 using ioctls_gen.sh.

	maint: update for linux 4.8.
	* maint/ioctls_sym.sh: Add workarounds for linux/atm_zatm.h and
	xen/evtchn.h files.

2016-09-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use sprintrc_grep in tests/ipc_shm.c.
	* tests/ipc_shm.c (main): Use sprintrc_grep.

	tests: use sprintrc_grep in tests/ipc_sem.c.
	* tests/ipc_sem.c (main): Use sprintrc_grep.

2016-09-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use sprintrc_grep in tests/ipc_msg.c.
	* tests/ipc_msg.c (main): Use sprintrc_grep.

2016-09-10  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use sprintrc in tests/chmod.c.
	* tests/chmod.c (main): Use sprintrc.  Add more chmod decoding tests.

2016-09-09  Dmitry V. Levin  <ldv@altlinux.org>

	ipc: fix printing of nsops argument of semop and semtimedop syscalls.
	According to POSIX, nsops argument of semop syscall has type size_t,
	but the kernel treats nsops argument of semop and semtimedop syscalls
	as unsigned int.

	* ipc_sem.c (tprint_sembuf_array): Change type of "count" argument
	from unsigned long to unsigned int, print it using %u format.

2016-09-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/aio.c: bring indentation in conformance with the rest of the file.

2016-09-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: use predefined constant in aio_context_t checks in aio test.
	Also fix io_cancel and io_destroy checks which did not check correct
	printing of context argument properly.

	* tests/aio.c (main): Update syscall checks in order to use newly
	defined bogus_ctx constant.

2016-09-09  Dmitry V. Levin  <ldv@altlinux.org>

	Mark io_setup and io_destroy as memory mapping related syscalls.
	As io_setup syscall allocates some memory using do_mmap_pgoff, and
	io_destroy deallocates this memory using vm_munmap, set TRACE_MEMORY
	flag for all sysentries of io_setup and io_destroy using the following
	oneliner:
	sed -ri '/io_setup|io_destroy/ s/0,/TM,/' linux/*/syscallent*.h

	* linux/*/syscallent*.h (io_setup, io_destroy): Change sys_flags to TM.

2016-09-08  Dmitry V. Levin  <ldv@altlinux.org>

	travis: add x86 musl.
	* .travis.yml (matric): Add musl-gcc/x86.
	* travis-build.sh [TARGET == x86]: Specify --target along with --build
	to configure.
	* travis-install.sh [CC == musl-gcc && TARGET == x32]: Add -mx32 to $CC.
	[CC == musl-gcc && TARGET == x86]: Add -m32 to $CC.  Specify --build
	and --target to musl configure invocation.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: use PRI__*64 macros in aio test.
	It was incorrectly assumed that __*64 types are long long on all
	platforms, despite strace having specially crafted macros in order
	to handle precisely this architecture discrepancy.
	The commit fixes this oversight.

	* tests/aio.c (main): Use PRI__*64 macros for correct format conversion
	specifiers for __*64-typed values.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ipc: fix printing of integer arguments.
	* ipc_msgctl.c (SYS_FUNC(msgctl)): As msqid argument is treated as int
	by the kernel, cast it to int and print it using %d format.
	* ipc_sem.c (SYS_FUNC(semop), SYS_FUNC(semtimedop)): Likewise,
	for semid argument.
	(SYS_FUNC(semget)): Likewise, for nsems argument.
	(SYS_FUNC(semctl)): Likewise, for semid and semnum arguments.
	* ipc_shm.c (SYS_FUNC(shmat)): Likewise, for shmid argument.
	* ipc_shmctl.c (SYS_FUNC(shmctl)): Likewise.

2016-09-08  Dmitry V. Levin  <ldv@altlinux.org>

	ipc: fix printing key_t arguments of msgget, semget, and shmget syscalls
	* ipc_msg.c (SYS_FUNC(msgget)): As key_t type in the kernel
	is __kernel_key_t (i.e. int), cast key_t argument to int
	and print it using %#x format.
	* ipc_sem.c (SYS_FUNC(semget)): Likewise.
	* ipc_shm.c (SYS_FUNC(shmget)): Likewise.
	* tests/ipc_msg.c (main): Test it.
	* tests/ipc_sem.c (main): Likewise.
	* tests/ipc_shm.c (main): Likewise.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add more sched_getattr and sched_setattr decoding checks.
	* tests/sched_xetattr.c (main): Add more sched_getattr and sched_setattr
	decoding checks.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: change type of sched_nice field to signed in sched_xetattr test.
	Kernel headers declare this field as s32, and strace prints it with %d
	specifier.

	* tests/sched_xetattr.c (main): Change type of sched_nice field of struct
	sched_attr to int32_t, update format specifiers accordingly.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add sprintrc_grep function to libtests.
	New sprintrc_grep function is sprintrc function equivalent suitable for
	tests where grep-base pattern matching is employed.

	* tests/tests.h (sprintrc_grep): New prototype.
	* tests/sprintrc.c (enum sprintrc_fmt): New sprintrc format enumeration.
	(sprintrc_ex): New function, renamed from sprintrc and updated to
	support different formats.
	(sprintrc): Change to use sprintrc_ex with SPRINTRC_FMT_RAW.
	(sprintrc_grep): New function, calls sprintrc_ex with SPRINTRC_FMT_GREP.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: perform more strict structure allocation in sched_xetattr test.
	Use tail_alloc with precise size of the structure.

	* tests/sched_xetattr.c (main): Eliminate usage of anonymous union type.
	Rename sched to sched_attr.  Change type of sched_attr to struct
	pointer.  Use tail_alloc for sched_attr allocation, update printf
	statements accrodingly.

2016-09-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: split long lines in sched_xetattr test.
	* tests/sched_xetattr.c (main): Split long lines.

2016-09-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests/aio.c: fix for x32 personality.
	* tests/aio.c (main): Do not pass 64-bit aio_context_t to io_submit
	and io_getevents until strace learns how to print 64-bit pointers on x32
	and on x86_64 for x32 personality.

2016-09-07  Dmitry V. Levin  <ldv@altlinux.org>

	aio: print aio_context_t as a pointer type.
	As aio_context_t is treated by the kernel as a pointer,
	print it using printaddr.

	* aio.c (SYS_FUNC(io_setup)): Print the pointer to aio_context_t
	argument using printnum_ptr.
	(SYS_FUNC(io_destroy), SYS_FUNC(io_submit), SYS_FUNC(io_cancel),
	SYS_FUNC(io_getevents)): Print aio_context_t argument using printaddr.
	* tests/aio.c (sprint_aio_context_t): Remove.
	(main): Update expected output.

2016-09-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests/aio.c: rewrite without assert.
	* tests/aio.c: Do not include <assert.h>.
	(main): Use sprintrc instead of assert.

2016-09-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add more aio decoding checks.
	* tests/aio.c (sprint_aio_context_t): New function.
	(main): Use it; add more checks.

2016-09-06  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add suffix and cast to 64-bit constants in aio test.
	This helps to avoid warnings like
	"integer constant is too large for ‘long’ type"
	reported by some versions of gcc on 32-bit platforms.

	* tests/aio.c (main): Add ULL suffix to 64-bit constants
	and cast them to unsigned long.

2016-09-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of perf_event_open syscall.
	* tests/perf_event_open.c: New file.
	* tests/perf_event_open.test: New test.
	* tests/.gitignore: Add perf_event_open.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add perf_event_open.test.

	Makefile.am: use pwd instead of realpath.
	* Makefile.am (CODE_COVERAGE_GENHTML_OPTIONS): Use standard pwd(1)
	instead of less widespread realpath(1) utility from GNU coreutils.

2016-09-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use sprintrc in tests/xetpriority.c.
	* tests/xetpriority.c (main): Use sprintrc.

	tests: use sprintrc in vhangup.test.
	* tests/vhangup.c (main): Use sprintrc.

	tests: use sprintrc in tests/sockname.c.
	* tests/sockname.c (test_sockname_syscall): Use sprintrc.

	tests: use sprintrc in signalfd4.test.
	* tests/signalfd4.c (main): Use sprintrc.

	tests: use sprintrc in setrlimit.test.
	* tests/setrlimit.c (main): Use sprintrc.

	tests: use sprintrc in set_mempolicy.test.
	* tests/set_mempolicy.c (main, print_nodes): Use sprintrc.

	tests: use sprintrc in openat.test.
	* tests/openat.c (main): Use sprintrc.

	tests: use sprintrc in open.test.
	* tests/open.c (main): Use sprintrc.

	tests: use sprintrc in move_pages.test.
	* tests/move_pages.c (print_stat_pages, print_move_pages): Use sprintrc.

	tests: use sprintrc in mlockall.test.
	* tests/mlockall.c (main): Use sprintrc.

	tests: use sprintrc in mlock.test.
	* tests/mlock.c (main): Use sprintrc.

	tests: use sprintrc in epoll_create1.test.
	* tests/epoll_create1.c (main): Use sprintrc.

2016-09-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: fix printing of min_nr and nr arguments of io_getevents syscall.
	* tests/aio.c (main): Change output format for min_nr and nr arguments
	in io_getevents check to %ld, cast these arguments to long.

	tests: use sprintrc for return code output in aio test.
	* tests/aio.c (main): Use sprintrc for return code output.

	tests: add more tests for ched_rr_get_interval decoding.
	* tests/sched_rr_get_interval.c (main): Check decoding of invalid
	timespec pointer and successful syscall invocation.

	tests: use sprintrc for return code output in sched_rr_get_interval test
	* tests/sched_rr_get_interval.c (main): Use sprintrc for return code
	output.

	tests: add more tests for sched_getscheduler and sched_xetscheduler.
	* tests/sched_xetscheduler.c (main): Check for decoding of invalid PID
	in sched_getscheduler and sched_setscheduler, invalid address
	of sched_param structure, and invalid policy value.

	tests: use sprintrc for return code output in sched_xetscheduler test.
	* tests/sched_xetscheduler.c (main): Use sprintrc for return code output.

2016-09-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	aio: use printfd for fd printing.
	struct iocb contains two fields with fd semantics: aio_fildes and
	aio_resfd.  It is quite reasonable to use the appropriate function for
	printing them (apart from just "%d").

	* aio.c (print_common_flags): Add struct tcb pointer to parameter list;
	use printfd for printing aio_resfd field.
	(print_iocb_header): Add struct tcb pointer to parameter list;
	use printfd for printing aio_fildes field.
	(print_iocb): Provide tcp argument to print_iocb_header
	and print_common_flags.
	(SYS_FUNC(io_cancel)): Likewise.

2016-09-05  Dmitry V. Levin  <ldv@altlinux.org>

	sh64: wire up new syscalls.
	* linux/sh64/syscallent.h [380..393]: New entries.

2016-09-02  Dmitry V. Levin  <ldv@altlinux.org>

	sh: wire up new syscalls.
	* linux/sh/syscallent.h [369..382]: New entries.

2016-09-05  Dmitry V. Levin  <ldv@altlinux.org>

	avr32: wire up preadv2 and pwritev2 syscalls.
	* linux/avr32/syscallent.h [326]: Add preadv2 entry.
	[327]: Add pwritev2 entry.

2016-09-05  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: check decoding of readahead syscall.
	* configure.ac (AC_CHECK_FUNCS): Add readahead.
	* tests/readahead.c: New file.
	* tests/readahead.test: New test.
	* tests/.gitignore: Add readahead.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add readahead.test.

2016-09-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: move sprintrc function to libtests.
	* tests/tests.h (sprintrc): New prototype.
	* tests/futex.c (sprintrc): Move to ...
	* tests/sprintrc.c: ... new file.
	* tests/Makefile.am (libtests_a_SOURCES): Add sprintrc.c.

	tests/futex: add support to sprintrc for return codes other than 0 and -1
	* tests/futex.c (sprintrc): Print the actual return code provided,
	not just "0".  Check snprintf return code.

	tests/futex: increase sprintrc static buffer size.
	* tests/futex.c (sprintrc): Increase buffer size from 256 to 4096.

	tests/futex: rename retstr to sprintrc.
	* tests/futex.c (retstr): Rename to sprintrc.
	(main): Convert all retstr calls to sprintrc.

2016-09-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	readahead: fix print format for the "count" argument.
	According to documentation and kernel's syscalls.h, its type is size_t,
	so "%lu" format should be used instead of "%ld".

	* readahead.c (SYS_FUNC(readahead)): Fix conversion specifier
	for the "count" argument.

2016-08-31  Dmitry V. Levin  <ldv@altlinux.org>

	tests/xstatx.c: use zero_extend_signed_to_ull/sign_extend_unsigned_to_ll
	Use zero_extend_signed_to_ull and sign_extend_unsigned_to_ll macros
	instead of explicit casts with unpredictable sign extension semantics.

	* tests/xstatx.c (print_time, main): Use zero_extend_signed_to_ull
	instead of explicit cast.
	(print_stat): Use zero_extend_signed_to_ull and
	sign_extend_unsigned_to_ll instead of explicit casts.

2016-08-31  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add sign_extend_unsigned_to_ll macro.
	* tests/tests.h (sign_extend_unsigned_to_ll): New macro from defs.h.

2016-08-31  Eugene Syromiatnikov  <evgsyr@gmail.com>

	Refactor common sa_handler printing code.
	* xlat/sa_handler_values.in: New file.
	* signal.c: Include "xlat/sa_handler_values.h".
	(get_sa_handler_str, print_sa_handler): New functions.
	(SYS_FUNC(sigsetmask), SYS_FUNC(signal), decode_new_sigaction): Use them.

2016-08-31  Dmitry V. Levin  <ldv@altlinux.org>

	Update TCP* constants.
	* xlat/socktcpoptions.in: Add TCP_REPAIR_WINDOW introduced by linux
	kernel commit v4.8-rc1~140^2~226.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

	Update SCTP_* constants.
	* xlat/socksctpoptions.in: Add SCTP_PR_SUPPORTED, SCTP_DEFAULT_PRINFO,
	and SCTP_PR_ASSOC_STATUS introduced by linux kernel commits
	v4.8-rc1~140^2~148^2~5, v4.8-rc1~140^2~148^2~4, and
	v4.8-rc1~140^2~148^2~3, respectively.

	Update fs *_MAGIC constants.
	* xlat/fsmagic.in: Add BALLOON_KVM_MAGIC and ZSMALLOC_MAGIC introduced
	by linux kernel commits v4.8-rc1~147^2~82 and v4.8-rc1~147^2~74,
	respectively.

	Update KEXEC_ARCH_* constants.
	* xlat/kexec_arch_values.in: Add KEXEC_ARCH_AARCH64 introduced by linux
	kernel commit v4.8-rc1~16^2~41.

	Update ETH_P_* constants.
	* xlat/ethernet_protocols.in: Add ETH_P_NCSI introduced by linux kernel
	commit v4.8-rc1~140^2~65^2~8.

	Update BPF_* constants.
	* xlat/bpf_map_types.in: Add BPF_MAP_TYPE_CGROUP_ARRAY introduced
	by linux kernel commit v4.8-rc1~140^2~212^2~2.
	* xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_XDP introduced
	by linux kernel commit v4.8-rc1~140^2~64^2~10.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

	Remove HAVE_SIGACTION checks.
	The syscall parsers guarded by HAVE_SIGACTION check have to be compiled
	regardless of libc sigaction function availability.

	* configure.ac (AC_CHECK_FUNCS): Remove sigaction.
	* signal.c: Remove HAVE_SIGACTION checks.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

	Remove obsolescent autoconf macro AC_TYPE_SIGNAL.
	All supported systems are expected to have C89 conforming sematics.

	* configure.ac (AC_TYPE_SIGNAL): Remove.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

	Remove obsolescent autoconf macro AC_C_CONST.
	All supported systems are expected to have the 'const' keyword.

	* configure.ac (AC_C_CONST): Remove.

2016-08-30  Eugene Syromiatnikov  <evgsyr@gmail.com>

	tests: check decoding of futex syscall.
	* tests/futex.c: New file.
	* tests/futex.test: New test.
	* tests/.gitignore: Add futex.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add futex.test.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	futex: do not pretend <linux/futex.h> is included.
	As configure.ac does not check for linux/futex.h, HAVE_LINUX_FUTEX_H is
	never defined and therefore the inclusion of <linux/futex.h> guarded by
	HAVE_LINUX_FUTEX_H makes no sense.

	Moreover, <linux/futex.h> used to have an incorrect definition
	of FUTEX_WAIT_BITSET_PRIVATE and FUTEX_WAKE_BITSET_PRIVATE:
	since kernel commit v2.6.24-6320-gcd68998 where these definitions
	were initially introduced and up to v2.6.31-7082-gf8d1e54 where they
	were finally fixed these macros had been incorrectly defined via
	FUTEX_WAIT_BITS and FUTEX_WAKE_BITS instead of FUTEX_WAIT_BITSET
	and FUTEX_WAKE_BITSET, and these incorrect definitions made their way
	into some distributions still in use.

	* futex.c [HAVE_LINUX_FUTEX_H]: Remove.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	futex: avoid printing val when it is not used by the futex command.
	This is analogous to timeout argument omitting in FUTEX_WAKE_BITSET
	command.

	* futex.c (SYS_FUNC(futex)): Remove common printing of val argument.
	Add printing of val argument for all futex commands except
	FUTEX_LOCK_PI, FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add FUTEX_WAIT* commands with FUTEX_CLOCK_REALTIME bit set.
	* xlat/futexops.in: Add FUTEX_WAIT|FUTEX_CLOCK_REALTIME and
	FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME values supported by linux kernel
	since commit v4.5-rc1~172^2.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	futex: fix formatting of unknown command argument.
	Use alternate form for printing hexadecimal numbers to avoid confusion.
	Use printaddr to print uaddr as the latter is interpreted as a pointer
	in all currently supported futex operations.

	* futex.c (SYS_FUNC(futex)): Fix formatting of unknown command
	argument.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	futex: add handling of FUTEX_FD command.
	Since obsolete FUTEX_FD command is known and used to have some expected
	argument format, print FUTEX_FD using that format.

	* futex.c (SYS_FUNC(futex)): Handle FUTEX_FD command.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	futex: fix formatting of val3 hexadecimal argument.
	* futex.c (SYS_FUNC(futex)): In FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET,
	print hexadecimal val3 argument in alternate form to avoid confusion.

2016-08-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	futex: fix FUTEX_WAKE_OP compare function mask.
	According to the initial and current (v4.7) kernel implementations,
	in FUTEX_WAKE_OP case the compare function does not have
	FUTEX_OP_OPARG_SHIFT flag and occupies 4 bits starting with bit 24.

	* futex.c (SYS_FUNC(futex)): Do not print FUTEX_OP_OPARG_SHIFT
	for 27th bit of val3 in FUTEX_WAKE_OP case.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use correct m32/mx32 st_mtime_nsec checks in tests/xstatx.c.
	* bootstrap: Add -DMPERS_IS_$(MPERS_NAME) to ARCH_MFLAGS.
	* tests/xstatx.c [USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]:
	Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
	to HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC.
	[USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]:
	Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
	to HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC.
	[USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]:
	Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
	to HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC.
	[USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]:
	Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
	to HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC.

	Based on patch by James Clarke <jrtc27@jrtc27.com>.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

	Remove redundant check for PTRACE_LISTEN availability.
	As ptrace.h already ensures that PTRACE_LISTEN is defined,
	there is no need to check this fact in other places.

	* strace.c (ptrace_restart): Do not check that PTRACE_LISTEN is defined.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unused autoconf macro AC_TYPE_GETGROUPS.
	strace code does not use GETGROUPS_T.

	* configure.ac (AC_TYPE_GETGROUPS): Remove.

2016-08-30  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unused autoconf macro AC_TYPE_MODE_T.
	strace code already redefines mode_t.

	* configure.ac (AC_TYPE_MODE_T): Remove.

2016-08-30  James Clarke  <jrtc27@jrtc27.com>

	Use PTRACE_SUNDETACH everywhere on SPARC and SPARC64.
	SPARC has a different PTRACE_DETACH value correctly defined in
	sys/ptrace.h, but linux/ptrace.h clobbers it with the standard one.
	PTRACE_SUNDETACH is also defined to the correct value by sys/ptrace.h,
	so use that instead.

	* strace.c (detach) [SPARC]: Move redefinition of PTRACE_DETACH
	to PTRACE_SUNDETACH ...
	* ptrace.h [SPARC || SPARC64]: ... here.

2016-08-29  Dmitry V. Levin  <ldv@altlinux.org>

	Remove obsolescent autoconf macro AC_HEADER_STDC.
	All systems supported by strace are expected to have C89 conforming
	header files.

	* configure.ac (AC_HEADER_STDC): Remove.

2016-08-29  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unneeded autoconf macro AC_HEADER_DIRENT.
	strace code already includes <dirent.h> unconditionally.

	* configure.ac (AC_HEADER_DIRENT): Remove.

2016-08-28  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unneeded autoconf macro AC_HEADER_STDBOOL.
	strace code assumes C99.

	* configure.ac (AC_HEADER_STDBOOL): Remove.
	* defs.h: Include <stdbool.h> unconditionally.

2016-08-27  Dmitry V. Levin  <ldv@altlinux.org>

	Remove obsolescent autoconf macro AC_HEADER_STAT.
	No systems supported by strace are expected to have the bug workarounded
	by AC_HEADER_STAT macro.

	* configure.ac (AC_HEADER_STAT): Remove.

2016-08-29  Dmitry V. Levin  <ldv@altlinux.org>

	Do not use AC_HEADER_MAJOR, include <sys/sysmacros.h> unconditionally.
	glibc, starting with commit glibc-2.24-28-gdbab657, has deprecated
	inclusion of <sys/sysmacros.h> by <sys/types.h>.  The method used
	for deprecation breaks AC_HEADER_MAJOR: this autoconf macro no longer
	defines MAJOR_IN_SYSMACROS, which consequently breaks build.

	Let's assume that all systems supported by strace provide major, minor,
	and makedev macros via <sys/sysmacros.h>.

	* configure.ac (AC_HEADER_MAJOR): Remove.
	* mknod.c [MAJOR_IN_SYSMACROS, MAJOR_IN_MKDEV]: Remove.
	Include <sys/sysmacros.h> unconditionally.
	* print_struct_stat.c: Likewise.
	* tests/mknod.c: Likewise.
	* tests/mknodat.c: Likewise.
	* tests/xstatx.c: Likewise.

2016-08-29  Dmitry V. Levin  <ldv@altlinux.org>

	btrfs: mpersify struct btrfs_ioctl_vol_args_v2.
	This complements commit v4.11-719-gfb0c609.

	* btrfs.c (struct_btrfs_ioctl_vol_args_v2): New type.  Mpersify it.
	(btrfs_print_qgroup_inherit): Change qgi_addr type to unsigned long.
	(btrfs_ioctl): Replace struct btrfs_ioctl_vol_args_v2 with
	struct_btrfs_ioctl_vol_args_v2.

2016-08-29  Elvira Khabirova  <lineprinter0@gmail.com>

	mpers.awk: relax union member name absence check.
	This fixes mpersing of unions containing nameless members,
	e.g. struct btrfs_ioctl_vol_args_v2.

	* mpers.awk (what_is): Print names of union_type members as is.

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

	Revert "tests/xstatx.c: fix stat syscall tests on mips64"
	Previous commit effectively changed types of st_atime, st_ctime, and
	st_mtime members of struct stat and struct stat64 to signed integers,
	making the mips64 workaround obsolete.

	This reverts commit 3fb84bfc79949c145197c61fbf04ce18464e9112.

	* tests/xstatx.c (create_sample) [__mips64]: Remove.

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

	Mpersify parsers of struct stat and struct stat64.
	On many architectures that support multiple personalities,
	struct stat differ between personalities.  While old code could handle
	these differences, there are some architectures, e.g. sparc64, that also
	have different struct stat64.  Rewrite parsers using mpers functionality
	to fix these issues.

	* fetch_struct_stat.c: New file.
	* fetch_struct_stat64.c: Likewise.
	* print_struct_stat.c: Likewise.
	* oldstat.c: Likewise.
	* stat.c: Likewise.
	* stat.h: Likewise.
	* stat64.c: Likewise.
	* file.c: Remove.
	* printstat.h: Likewise.
	* linux/aarch64/stat32.h: Likewise.
	* linux/powerpc64/stat32.h: Likewise.
	* linux/riscv/stat32.h: Likewise.
	* linux/sparc64/stat32.h: Likewise.
	* linux/tile/stat32.h: Likewise.
	* linux/x32/stat32.h: Likewise.
	* linux/x86_64/stat32.h: Likewise.
	* Makefile.am (strace_SOURCES): Add fetch_struct_stat.c,
	fetch_struct_stat64.c, print_struct_stat.c, oldstat.c, stat.c, stat.h,
	and stat64.c.  Remove file.c, printstat.h, linux/aarch64/stat32.h,
	linux/powerpc64/stat32.h, linux/riscv/stat32.h, linux/sparc64/stat32.h,
	linux/tile/stat32.h, linux/x32/stat32.h, and linux/x86_64/stat32.h.
	* configure.ac (AC_CHECK_MEMBERS): Add struct stat64.st_mtime_nsec.
	* defs.h (struct strace_stat): New declaration.
	(print_struct_stat): New prototype.
	* linux/dummy.h (sys_fstatat64): Remove.

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.m4: check for struct stat64, struct stat, and their members.
	* m4/mpers.m4 (st_MPERS_STRUCT_STAT): New macro.
	(st_MPERS): Use it.

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

	mpers: add MPERS_IS_* to CFLAGS passed to mpers.sh.
	This allows testing of MPERS_IS_* macros in pre-MPERS_DEFS parts
	of source code.

	* Makefile.am (mpers-m%.stamp): Add -DMPERS_IS_$(mpers_NAME) to CFLAGS
	passed to mpers.sh.
	* mpers_test.sh: Likewise.

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

	Move redefinition of stat types to asm_stat.h.
	* file.c: Move redefinition of types that might be used
	to define struct stat ...
	* linux/asm_stat.h: ... here.
	* tests/xstatx.c: Remove redefinition of stat types.

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

	x86_64: provide a replacement of <asm/stat.h> for x32 personality.
	For the reason described in commit v4.10-517-gcfde1e3, a correct
	definition of struct stat for x32 personality is necessary to enable
	"asm_stat.h" with -mx32 on x86_64.

	* linux/x32/asm_stat.h: Rename to ...
	* linux/x86_64/asm_stat.h: ... new file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/x32/asm_stat.h: New file, include "x86_64/asm_stat.h".

2016-08-24  Dmitry V. Levin  <ldv@altlinux.org>

	x32/asm_stat.h: provide definitions for i386 personality.
	This enables x32/asm_stat.h with -m32.

	* linux/x32/asm_stat.h [__x86_64__ && __ILP32__]: Redirect stat.
	Include "linux/asm_stat.h".
	(struct stat): Define for [__x86_64__ && __ILP32__] only.
	(struct __old_kernel_stat): Remove.

2016-08-23  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce a separate SEN entry for fstatat64 syscall.
	* linux/dummy.h (sys_fstatat64): Redirect to sys_newfstatat.
	* linux/32/syscallent.h: Replace SEN(newfstatat) with SEN(fstatat64).
	* linux/alpha/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* pathtrace.c (pathtrace_match): Handle SEN_fstatat64.

2016-08-23  Dmitry V. Levin  <ldv@altlinux.org>

	Do not check for struct stat.st_{a,c}time_nsec.
	Assume that the check for struct stat.st_mtime_nsec is enough.
	Likewise, do not check for struct stat.st_{a,c}tim.tv_nsec.

	* configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_atime_nsec,
	struct stat.st_ctime_nsec, struct stat.st_atim.tv_nsec,
	and struct stat.st_ctim.tv_nsec.
	* file.c (HAVE_STRUCT_STAT_ST_ATIME_NSEC,
	HAVE_STRUCT_STAT_ST_CTIME_NSEC): Remove.
	* printstat.h (HAVE_STRUCT_STAT_ST_ATIME_NSEC,
	HAVE_STRUCT_STAT_ST_CTIME_NSEC): Replace with
	HAVE_STRUCT_STAT_ST_MTIME_NSEC.
	* tests/xstatx.c: Likewise.

2016-08-23  Dmitry V. Levin  <ldv@altlinux.org>

	Add sign_extend_unsigned_to_ll macro.
	* defs.h (sign_extend_unsigned_to_ll): New macro, mirrors
	zero_extend_signed_to_ull.

	zero_extend_signed_to_ull: add short int support.
	* defs.h (zero_extend_signed_to_ull): Add short int support.
	* tests/tests.h: Likewise.

	Rename widen_to_ull to zero_extend_signed_to_ull.
	* defs.h (widen_to_ull): Rename to zero_extend_signed_to_ull.
	All callers changed.
	* tests/tests.h: Likewise.

2016-08-23  Dmitry V. Levin  <ldv@altlinux.org>

	sparc, sparc64: remove obsolete code.
	Remove remains of solaris personality support.
	This complements commit v4.10-45-gdf4dd8b.

	* file.c [SPARC || SPARC64] (SYS_FUNC(xstat), SYS_FUNC(fxstat)): Remove.

2016-08-22  Dmitry V. Levin  <ldv@altlinux.org>

	sparc64: fix decoding of struct stat64 related syscalls.
	For some reason, struct stat and struct stat64 are different on sparc64.
	This change fixes decoding of struct stat64 related syscalls for sparc64
	personality, sparc32 personality on sparc64 needs more work.

	* file.c (printstat64) [SPARC64]: Do not use printstat.
	(SYS_FUNC(newfstatat)): Likewise.

2016-08-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: fill old_value argument in timer{,fd}_xettime tests.
	This is needed in order to differentiate it from the value returned
	by the call.  As a consequence, it enables revealing possible bugs
	in syscall parsers, for example, when the value read on syscall
	entering and not on syscall exiting, as it was the case with
	timerfd_settime parser.

	* tests/timer_xettime.c (main): Fill old.its field with value different
	from the expected one upon call return.
	* tests/timerfd_xettime.c: Likewise.

2016-08-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Fix old_value argument retrieval in timerfd_settime parser.
	This is done similar to timer_settime syscall parser.

	* time.c (SYS_FUNC(timerfd_settime)): Retrieve old_value argument
	on exiting and not on entering.  Return 0 instead of RVAL_DECODED
	since the call hasn't been decoded in full on entering.

2016-08-21  Richard W.M. Jones  <rjones@redhat.com>

	Add RISC-V architecture support.
	The original port of strace was done by Palmer Dabbelt
	(eecs.berkeley.edu), based on strace 4.9.

	* configure.ac: Define RISCV for riscv*.
	* clone.c [RISCV]: Define ARG_* macros as for OR1K.
	* defs.h [RISCV] (SUPPORTED_PERSONALITIES): Define to 2.
	[RISCV] (NEED_UID16_PARSERS): Define to 1.
	* linux/riscv/arch_regs.c: New file.
	* linux/riscv/errnoent1.h: Likewise.
	* linux/riscv/get_error.c: Likewise.
	* linux/riscv/get_scno.c: Likewise.
	* linux/riscv/get_syscall_args.c: Likewise.
	* linux/riscv/ioctls_arch0.h: Likewise.
	* linux/riscv/ioctls_arch1.h: Likewise.
	* linux/riscv/ioctls_inc0.h: Likewise.
	* linux/riscv/ioctls_inc1.h: Likewise.
	* linux/riscv/signalent1.h: Likewise.
	* linux/riscv/stat32.h: Likewise.
	* linux/riscv/syscallent.h: Likewise.
	* linux/riscv/syscallent1.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.

2016-08-21  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Move SH-specific argument number calculation to getllval.
	This change prevents scattering of ll-related hacks and simplifies
	pread/pwrite syscalls parsers' logic a bit.

	* util.c (getllval): Add fixup for arg_no for SuperH when argument
	number is equal to 3.
	* io.c (PREAD_OFFSET_ARG): Remove.
	(SYS_FUNC(pread)): Always use argument number 3 for "count" argument
	printing.
	(SYS_FUNC(pwrite)): Likewise.

2016-08-21  Dmitry V. Levin  <ldv@altlinux.org>

	sparc64: fix sigreturn decoding for sparc personality.
	* linux/sparc/arch_sigreturn.c (arch_sigreturn): Parametrize
	member types of struct signal_frame.
	* linux/sparc64/arch_sigreturn.c (sparc64_arch_sigreturn,
	sparc32_arch_sigreturn): New functions.
	(arch_sigreturn): Use them.

2016-08-20  Dmitry V. Levin  <ldv@altlinux.org>

	Fix compat decoding of struct sigaction.sa_mask on big endian architectures
	* signal.c (decode_new_sigaction) [SUPPORTED_PERSONALITIES > 1 &&
	SIZEOF_LONG > 4]: Use LONG_LONG to convert sa_mask from 32-bit
	struct sigaction to 64-bit struct sigaction.

2016-08-19  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of indirect shmat's return code for non-native personalities
	* ipc_shm.c (SYS_FUNC(shmat)): Fetch current_wordsize bytes of data
	to obtain return code of indirect shmat subcall.

2016-08-18  Dmitry V. Levin  <ldv@altlinux.org>

	sparc64: fix sparc personality decoding of mmap64's offset argument.
	* linux/sparc64/syscallent1.h: Remove redirection of sys_mmap_4koff.

2016-08-19  Dmitry V. Levin  <ldv@altlinux.org>

	sparc64: fix decoding of the forth argument of semctl syscall.
	On sparc64, unlike all other architectures where semctl is an indirect
	ipc subcall, the forth argument is passed directly.

	* ipc_sem.c (SYS_FUNC(semctl)) [SPARC64]: Print 4th argument without
	indirection in case of native personality.

2016-08-16  Dmitry V. Levin  <ldv@altlinux.org>

	Add sparc64 specific ptrace constants.
	* xlat/ptrace_cmds.in: Add PTRACE_GETREGS64, PTRACE_SETREGS64,
	PTRACE_GETFPREGS64, and PTRACE_SETFPREGS64.

	sparc64: fix sign extension bug of syscall args for sparc personality.
	* linux/sparc64/get_syscall_args.c (get_syscall_args): Zero-extend
	syscall args from 32 bit for sparc personality.

2016-08-16  Dmitry V. Levin  <ldv@altlinux.org>

	sparc64: fix tty ioctl numbers.
	The structures defined in asm/termbits.h have the same size
	on sparc and sparc64.

	* linux/sparc64/ioctls_arch0.h (TCGETS, TCGETS2, TCSETS, TCSETS2,
	TCSETSF, TCSETSF2, TCSETSW, TCSETSW2): Sync with
	linux/sparc/ioctls_arch0.h

2016-08-15  Dmitry V. Levin  <ldv@altlinux.org>

	evdev.c: fix typo in comment.

2016-08-15  Dmitry V. Levin  <ldv@altlinux.org>

	Drop support of dummy members of struct stat.
	As st_flags, st_fstype, and st_gen members of struct stat are not filled
	by the kernel, there is no use supporting them.

	* configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_flags,
	struct stat.st_fstype, and struct stat.st_gen.
	* file.c [STAT32_PERSONALITY, HAVE_STRUCT_STAT64]: Do not undefine
	HAVE_STRUCT_STAT_ST_FLAGS, HAVE_STRUCT_STAT_ST_FSTYPE,
	and HAVE_STRUCT_STAT_ST_GEN.
	* printstat.h (DO_PRINTSTAT): Do not check for
	HAVE_STRUCT_STAT_ST_FLAGS, HAVE_STRUCT_STAT_ST_FSTYPE,
	and HAVE_STRUCT_STAT_ST_GEN.

2016-08-15  Dmitry V. Levin  <ldv@altlinux.org>

	Assume that struct stat contains st_blksize, st_blocks, and st_rdev.
	Our test suite already assumes that struct stat contains st_blksize,
	st_blocks, and st_rdev members, and there haven't been any complaints.

	* configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_blksize,
	struct stat.st_blocks, and struct stat.st_rdev.
	* printstat.h (DO_PRINTSTAT): Do not check for
	HAVE_STRUCT_STAT_ST_BLKSIZE, HAVE_STRUCT_STAT_ST_BLOCKS,
	and HAVE_STRUCT_STAT_ST_RDEV.

2016-08-15  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix pause.test when pause syscall is not available.
	* tests/pause.c (main): Fix expected output when pause syscall
	is not available.

2016-08-14  Dmitry V. Levin  <ldv@altlinux.org>

	powerpc64, sparc64: fix redefinitions of ARCH_PC_REG.
	This fixes compilation warning that ARCH_PC_REG is redefined.

	* linux/powerpc64/arch_regs.c (ARCH_PC_REG): Undefine before
	the new definition.
	* linux/sparc64/arch_regs.c (ARCH_PC_REG): Likewise.

2016-08-14  Dmitry V. Levin  <ldv@altlinux.org>

	s390x, x32: remove redundant definitions of ARCH_PC_REG.
	* linux/s390x/arch_regs.c (ARCH_PC_REG): Remove, it is already defined
	in just included linux/s390/arch_regs.c.
	* linux/x32/arch_regs.c (ARCH_PC_REG): Remove, it is already defined
	in just included linux/x86_64/arch_regs.c.

2016-08-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check for leaks of placeholder descriptors.
	* tests/redirect-fds.c: New file.
	* tests/redirect-fds.test: New test.
	* tests/.gitignore: Add redirect-fds.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add redirect-fds.test.

	tests/init.sh: print exit code of failed commands.
	* init.sh (run_prog, run_prog_skip_if_failed): When the program fails,
	add its exit code to the diagnostic message.
	(run_strace): When strace fails, add its exit code to the diagnostic
	message.
	(run_strace_merge): When strace-log-merge fails, add its exit code
	to the diagnostic message.

2016-08-13  Dmitry V. Levin  <ldv@altlinux.org>

	Fix leakage of placeholder descriptors to tracees.
	As a side effect of commit v4.11-211-g0736d4e, strace used to leak
	placeholders for standard descriptors to tracees thus affecting their
	behaviour.  Fix this by setting close-on-exec flag on placeholder
	descriptors.

	* strace.c (open_dummy_desc): Set close-on-exec flag on the descriptor
	that is going to be returned to the caller.
	(fd_is_placeholder): New array.
	(ensure_standard_fds_opened, redirect_standard_fds): New functions.
	(startup_child): Use redirect_standard_fds.
	(init): Use ensure_standard_fds_opened.

2016-08-12  Dmitry V. Levin  <ldv@altlinux.org>

	sparc64: fix decoding of uid and gid-related syscalls.
	sparc64 has no native 16-bit uid/gid syscalls.

	* linux/sparc64/syscallent.h (chown, lchown, setuid, getuid, setgid,
	getgid, geteuid, getegid, getgroups, setgroups, fchown, setreuid,
	setregid, setfsuid, setfsgid): Change handlers from 16-bit to 32-bit.

2016-08-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix *stat64 tests on alpha.
	On some architectures including alpha, <asm/stat.h> provides a
	definition of struct stat that has no st_atime_nsec, st_mtime_nsec, and
	st_ctime_nsec fields.  At the same time, struct stat64 always has these
	fields.  Fix tests to take this difference into account.

	* tests/fstat64.c (STRUCT_STAT_IS_STAT64): New macro, defined to 1.
	* tests/lstat64.c (STRUCT_STAT_IS_STAT64): Likewise.
	* tests/stat64.c (STRUCT_STAT_IS_STAT64): Likewise.
	* tests/xstatx.c [!STRUCT_STAT] (STRUCT_STAT_IS_STAT64): New macro,
	defined to 0.
	[USE_ASM_STAT && STRUCT_STAT_IS_STAT64]:
	(HAVE_STRUCT_STAT_ST_ATIME_NSEC, HAVE_STRUCT_STAT_ST_CTIME_NSEC,
	HAVE_STRUCT_STAT_ST_MTIME_NSEC): Redefine to 1.

2016-08-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip rt_tgsigqueueinfo.test when the syscall is not available.
	* tests/rt_tgsigqueueinfo.c (main): Skip the test when the syscall
	is not available.

2016-08-11  James Cowgill  <james410@cowgill.org.uk>

	tests/fcntl.c: fix fcntl test on mips64.
	On mips64 the F_GETLK and F_SETLKW64 constants have identical values which
	causes the "wrong" constant to be printed by strace.

	tests/fcntl.c (test_flock64): Do not test F_SETLKW64 on mips64.

2016-08-11  James Cowgill  <james410@cowgill.org.uk>

	tests/nsyscalls.test: only trace the "syscall" syscall on mips o32.
	The "syscall" syscall only exists on o32 and causes strace to error out on
	64-bit mips ABIs. Pass MIPS_ABI from the configure script through to
	nsyscalls.test so the MIPS ABI can be checked.

	* configure.ac (MIPS_ABI): Substitute into output files.
	* tests/Makefile.am (MIPS_ABI): Export via AM_TEST_LOG_FLAGS.
	* tests/nsyscalls.test: Restrict special mips handling to mips o32.

2016-08-11  James Cowgill  <james410@cowgill.org.uk>

	tests/xstatx.c: fix stat syscall tests on mips64.
	For historical reasons the kernel struct stat represents times as unsigned
	32-bit integers on mips64. Therefore, while it's possible to give a file a
	timestamp before 1970 with futimens, reading the same timestamp through
	struct stat will give a positive time (around 2106).
	Workaround by using positive timestamps for testing on mips64.

	* tests/xstatx.c (create_sample): Use positive timestamps on mips64.

2016-08-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests/mlock2.c: fix test failure on mips64.
	* tests/mlock2.c (main): Pass unsigned long arguments to mlock2 syscall
	explicitly, to avoid unwanted sign extension issues.

	Based on patch by James Cowgill <james410@cowgill.org.uk>

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

	Use <asm/unistd.h> instead of <sys/syscall.h>
	There are no users of SYS_* macros provided by <sys/syscall.h>,
	and definitions of __NR_* macros could be obtained directly
	from <asm/unistd.h>.

	* defs.h: Include <asm/unistd.h> instead of <sys/syscall.h>.
	* test/seccomp.c: Likewise.
	* test/threaded_execve.c: Likewise.
	* test/x32_lseek.c: Likewise.
	* test/x32_mmap.c: Likewise.
	* tests/_newselect.c: Likewise.
	* tests/access.c: Likewise.
	* tests/acct.c: Likewise.
	* tests/aio.c: Likewise.
	* tests/alarm.c: Likewise.
	* tests/attach-f-p.c: Likewise.
	* tests/bpf.c: Likewise.
	* tests/brk.c: Likewise.
	* tests/chmod.c: Likewise.
	* tests/chown.c: Likewise.
	* tests/chown32.c: Likewise.
	* tests/chroot.c: Likewise.
	* tests/clock_adjtime.c: Likewise.
	* tests/clock_nanosleep.c: Likewise.
	* tests/clock_xettime.c: Likewise.
	* tests/copy_file_range.c: Likewise.
	* tests/creat.c: Likewise.
	* tests/dup2.c: Likewise.
	* tests/dup3.c: Likewise.
	* tests/epoll_create.c: Likewise.
	* tests/epoll_create1.c: Likewise.
	* tests/epoll_ctl.c: Likewise.
	* tests/epoll_pwait.c: Likewise.
	* tests/epoll_wait.c: Likewise.
	* tests/eventfd.c: Likewise.
	* tests/execveat.c: Likewise.
	* tests/faccessat.c: Likewise.
	* tests/fchdir.c: Likewise.
	* tests/fchmod.c: Likewise.
	* tests/fchmodat.c: Likewise.
	* tests/fchown.c: Likewise.
	* tests/fchown32.c: Likewise.
	* tests/fchownat.c: Likewise.
	* tests/fcntl.c: Likewise.
	* tests/fcntl64.c: Likewise.
	* tests/fdatasync.c: Likewise.
	* tests/flock.c: Likewise.
	* tests/fstat.c: Likewise.
	* tests/fstat64.c: Likewise.
	* tests/fstatat64.c: Likewise.
	* tests/fstatfs.c: Likewise.
	* tests/fstatfs64.c: Likewise.
	* tests/fsync.c: Likewise.
	* tests/ftruncate.c: Likewise.
	* tests/ftruncate64.c: Likewise.
	* tests/futimesat.c: Likewise.
	* tests/get_mempolicy.c: Likewise.
	* tests/getcwd.c: Likewise.
	* tests/getdents.c: Likewise.
	* tests/getdents64.c: Likewise.
	* tests/getegid.c: Likewise.
	* tests/getegid32.c: Likewise.
	* tests/geteuid.c: Likewise.
	* tests/geteuid32.c: Likewise.
	* tests/getgid.c: Likewise.
	* tests/getgid32.c: Likewise.
	* tests/getgroups.c: Likewise.
	* tests/getgroups32.c: Likewise.
	* tests/getpgrp.c: Likewise.
	* tests/getrandom.c: Likewise.
	* tests/getresgid.c: Likewise.
	* tests/getresgid32.c: Likewise.
	* tests/getresuid.c: Likewise.
	* tests/getresuid32.c: Likewise.
	* tests/getrlimit.c: Likewise.
	* tests/getrusage.c: Likewise.
	* tests/getuid.c: Likewise.
	* tests/getuid32.c: Likewise.
	* tests/getxxid.c: Likewise.
	* tests/ioctl_uffdio.c: Likewise.
	* tests/ioperm.c: Likewise.
	* tests/iopl.c: Likewise.
	* tests/ipc.c: Likewise.
	* tests/kill.c: Likewise.
	* tests/lchown.c: Likewise.
	* tests/lchown32.c: Likewise.
	* tests/libmmsg.c: Likewise.
	* tests/libsocketcall.c: Likewise.
	* tests/link.c: Likewise.
	* tests/linkat.c: Likewise.
	* tests/llseek.c: Likewise.
	* tests/lseek.c: Likewise.
	* tests/lstat.c: Likewise.
	* tests/lstat64.c: Likewise.
	* tests/mbind.c: Likewise.
	* tests/membarrier.c: Likewise.
	* tests/memfd_create.c: Likewise.
	* tests/migrate_pages.c: Likewise.
	* tests/mkdir.c: Likewise.
	* tests/mkdirat.c: Likewise.
	* tests/mknod.c: Likewise.
	* tests/mknodat.c: Likewise.
	* tests/mlock.c: Likewise.
	* tests/mlock2.c: Likewise.
	* tests/move_pages.c: Likewise.
	* tests/newfstatat.c: Likewise.
	* tests/nsyscalls.c: Likewise.
	* tests/old_mmap.c: Likewise.
	* tests/oldselect.c: Likewise.
	* tests/open.c: Likewise.
	* tests/openat.c: Likewise.
	* tests/pause.c: Likewise.
	* tests/poll.c: Likewise.
	* tests/prctl-seccomp-filter-v.c: Likewise.
	* tests/prctl-seccomp-strict.c: Likewise.
	* tests/preadv2-pwritev2.c: Likewise.
	* tests/prlimit64.c: Likewise.
	* tests/pselect6.c: Likewise.
	* tests/ptrace.c: Likewise.
	* tests/readdir.c: Likewise.
	* tests/readlink.c: Likewise.
	* tests/readlinkat.c: Likewise.
	* tests/reboot.c: Likewise.
	* tests/remap_file_pages.c: Likewise.
	* tests/rename.c: Likewise.
	* tests/renameat.c: Likewise.
	* tests/renameat2.c: Likewise.
	* tests/rmdir.c: Likewise.
	* tests/rt_sigpending.c: Likewise.
	* tests/rt_sigprocmask.c: Likewise.
	* tests/rt_sigsuspend.c: Likewise.
	* tests/rt_sigtimedwait.c: Likewise.
	* tests/rt_tgsigqueueinfo.c: Likewise.
	* tests/sched_get_priority_mxx.c: Likewise.
	* tests/sched_rr_get_interval.c: Likewise.
	* tests/sched_xetaffinity.c: Likewise.
	* tests/sched_xetattr.c: Likewise.
	* tests/sched_xetparam.c: Likewise.
	* tests/sched_xetscheduler.c: Likewise.
	* tests/sched_yield.c: Likewise.
	* tests/seccomp-filter-v.c: Likewise.
	* tests/seccomp-filter.c: Likewise.
	* tests/seccomp-strict.c: Likewise.
	* tests/select.c: Likewise.
	* tests/sendfile.c: Likewise.
	* tests/sendfile64.c: Likewise.
	* tests/set_mempolicy.c: Likewise.
	* tests/setdomainname.c: Likewise.
	* tests/setfsgid.c: Likewise.
	* tests/setfsgid32.c: Likewise.
	* tests/setfsuid.c: Likewise.
	* tests/setfsuid32.c: Likewise.
	* tests/setgid.c: Likewise.
	* tests/setgid32.c: Likewise.
	* tests/setgroups.c: Likewise.
	* tests/setgroups32.c: Likewise.
	* tests/sethostname.c: Likewise.
	* tests/setregid.c: Likewise.
	* tests/setregid32.c: Likewise.
	* tests/setresgid.c: Likewise.
	* tests/setresgid32.c: Likewise.
	* tests/setresuid.c: Likewise.
	* tests/setresuid32.c: Likewise.
	* tests/setreuid.c: Likewise.
	* tests/setreuid32.c: Likewise.
	* tests/setrlimit.c: Likewise.
	* tests/setuid.c: Likewise.
	* tests/setuid32.c: Likewise.
	* tests/signalfd4.c: Likewise.
	* tests/socketcall.c: Likewise.
	* tests/splice.c: Likewise.
	* tests/stat.c: Likewise.
	* tests/stat64.c: Likewise.
	* tests/statfs.c: Likewise.
	* tests/statfs64.c: Likewise.
	* tests/swap.c: Likewise.
	* tests/symlink.c: Likewise.
	* tests/symlinkat.c: Likewise.
	* tests/sync.c: Likewise.
	* tests/sync_file_range.c: Likewise.
	* tests/sync_file_range2.c: Likewise.
	* tests/syslog.c: Likewise.
	* tests/tee.c: Likewise.
	* tests/time.c: Likewise.
	* tests/timer_create.c: Likewise.
	* tests/timer_xettime.c: Likewise.
	* tests/timerfd_xettime.c: Likewise.
	* tests/times-fail.c: Likewise.
	* tests/times.c: Likewise.
	* tests/truncate.c: Likewise.
	* tests/truncate64.c: Likewise.
	* tests/ugetrlimit.c: Likewise.
	* tests/umount.c: Likewise.
	* tests/umount2.c: Likewise.
	* tests/uname.c: Likewise.
	* tests/unix-pair-send-recv.c: Likewise.
	* tests/unlink.c: Likewise.
	* tests/unlinkat.c: Likewise.
	* tests/userfaultfd.c: Likewise.
	* tests/utimes.c: Likewise.
	* tests/vhangup.c: Likewise.
	* tests/vmsplice.c: Likewise.
	* tests/waitid.c: Likewise.
	* tests/waitpid.c: Likewise.
	* tests/xet_robust_list.c: Likewise.
	* tests/xetpgid.c: Likewise.
	* tests/xetpriority.c: Likewise.
	* tests/xettimeofday.c: Likewise.

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: replace SYS_clone2 with __NR_clone2.
	Migrate to __NR_* the last user of SYS_* macros provided
	by <sys/syscall.h>.

	* clone.c [IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Replace
	SYS_clone2 with __NR_clone2.

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

	Make sure that tcp->s_ent and tcp->s_prev_ent do not point to freed memory
	This complements commit v4.13-33-g60d7ec8.

	* syscall.c (sysent_buf): New structure.
	(free_sysent_buf): New function.
	(get_scno): Use them.

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

	file.c: move definitions of struct stat32 to separate files.
	* linux/aarch64/stat32.h: New file.
	* linux/powerpc64/stat32.h: Likewise.
	* linux/sparc64/stat32.h: Likewise.
	* linux/tile/stat32.h: Likewise.
	* linux/x32/stat32.h: Likewise.
	* linux/x86_64/stat32.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* file.c [SUPPORTED_PERSONALITIES > 1]: Remove arch specific definitions
	of struct stat32, include "stat32.h" instead.

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

	sparc, sparc64: remove obsolete code.
	Remove remains of solaris personality support.
	This complements commit v4.10-45-gdf4dd8b.

	* file.c [SPARC || SPARC64]: Remove the code related to struct solstat.
	(printstat, printoldstat) [SPARC || SPARC64]: Remove.

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

	sparc64: fix decoding of stat family syscalls.
	This complements commit v4.13-28-gaebfe83.

	* file.c [SPARC64]: Change STAT32_PERSONALITY to 1.

2016-08-09  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of invalid syscalls mapped to indirect subcalls.
	When the syscall number returned by arch_get_scno is a mapped indirect
	subcall (i.e. mapped subcall of socketcall or ipc syscall), do not
	mistakenly treat it as a valid indirect subcall.

	* defs.h (SCNO_IS_VALID): Treat scno with TRACE_INDIRECT_SUBCALL flag
	as invalid.
	* syscall.c (syscall_name): Do no shuffle scno.
	(trace_syscall_entering, trace_syscall_exiting): Use
	tcp->s_ent->sys_name instead of syscall_name.
	(get_scno): In case of invalid syscall, allocate a dynamic struct sysent
	containing an appropriate .sys_name.
	* tests/nsyscalls.c (main) [SYS_socket_subcall]: Check decoding
	of direct syscall number SYS_socket_subcall+1.
	(main) [SYS_ipc_subcall]: Check decoding of direct syscall number
	SYS_ipc_subcall+1.

2016-08-08  Dmitry V. Levin  <ldv@altlinux.org>

	linux/subcall.h: remove redundant definitions.
	* linux/subcall.h: Remove definitions of non-existent socket
	and ipc subcalls.

	defs.h: simplify SUPPORTED_PERSONALITIES definition.
	* defs.h: Group definition of SUPPORTED_PERSONALITIES by value.

2016-08-08  Dmitry V. Levin  <ldv@altlinux.org>

	defs.h: simplify PERSONALITY1_WORDSIZE definition.
	Move definition of PERSONALITY1_WORDSIZE macro outside arch specific
	ifdefs.

	* defs.h [SPARC64 || X86_64 || X32 || AARCH64 || POWERPC64 || TILE]
	(PERSONALITY1_WORDSIZE): Remove.
	[SUPPORTED_PERSONALITIES > 1] (PERSONALITY1_WORDSIZE): Define to 4
	unconditionally.

2016-08-08  Dmitry V. Levin  <ldv@altlinux.org>

	defs.h: simplify PERSONALITY0_WORDSIZE definition.
	Move definition of PERSONALITY0_WORDSIZE macro outside arch specific
	ifdefs.

	* defs.h (PERSONALITY0_WORDSIZE): Define to SIZEOF_LONG unconditionally.

2016-08-08  Dmitry V. Levin  <ldv@altlinux.org>

	sparc64: swap personality numbers.
	Fix inconsistency between syscall and ioctl entries on sparc64.
	Make layout of personalities on sparc64 the same as on other
	architectures that support two personalities.

	* defs.h [SPARC64] (PERSONALITY0_WORDSIZE): Change to 8.
	[SPARC64] (PERSONALITY1_WORDSIZE): Change to 4.
	* linux/sparc64/get_scno.c (arch_get_scno): Swap personality numbers.
	* linux/sparc64/ioctls_arch1.h: Rename to ioctls_arch0.h.
	* linux/sparc64/ioctls_arch0.h: Rename to ioctls_arch1.h.
	* linux/sparc64/ioctls_inc0.h: Rename to ioctls_inc1.h.
	* linux/sparc64/ioctls_inc1.h: Rename to ioctls_inc0.h.

2016-08-08  Dmitry V. Levin  <ldv@altlinux.org>

	defs.h: cleanup personality specific macro definitions.
	Move the code that defines PERSONALITY[12]_INCLUDE_FUNCS,
	PERSONALITY[12]_INCLUDE_PRINTERS_DECLS,
	PERSONALITY[12]_INCLUDE_PRINTERS_DEFS, and MPERS_{m,mx}32_IOCTL_MACROS
	macros outside arch specific ifdefs.

	* defs.h [SPARC] (PERSONALITY0_WORDSIZE): Remove.
	[SPARC64 && HAVE_M32_MPERS]: Remove.
	[X86_64 && HAVE_M32_MPERS]: Remove.
	[X86_64 && HAVE_MX32_MPERS]: Remove.
	[X32 && HAVE_M32_MPERS]: Remove.
	[AARCH64 && HAVE_M32_MPERS]: Remove.
	[POWERPC64 && HAVE_M32_MPERS]: Remove.
	[TILE && HAVE_M32_MPERS]: Remove.
	(PERSONALITY0_INCLUDE_PRINTERS_DECLS,
	PERSONALITY0_INCLUDE_PRINTERS_DEFS): Define unconditionally.
	[SUPPORTED_PERSONALITIES > 1 && HAVE_M32_MPERS]
	(PERSONALITY1_INCLUDE_PRINTERS_DECLS,
	PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_FUNCS,
	MPERS_m32_IOCTL_MACROS): Define for
	[SUPPORTED_PERSONALITIES > 1 && HAVE_M32_MPERS] case.
	(PERSONALITY2_INCLUDE_PRINTERS_DECLS,
	PERSONALITY2_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_FUNCS,
	MPERS_mx32_IOCTL_MACROS): Define for
	[SUPPORTED_PERSONALITIES > 2 && HAVE_MX32_MPERS] case.

2016-08-07  Dmitry V. Levin  <ldv@altlinux.org>

	Change #include guard trailing part comments.
	* defs.h: Change comment of the trailing part of #include guard.
	* flock.h: Likewise.
	* gcc_compat.h: Likewise.
	* ipc_defs.h: Likewise.
	* kernel_types.h: Likewise.
	* mpers_type.h: Likewise.
	* msghdr.h: Likewise.
	* printsiginfo.h: Likewise.
	* ptrace.h: Likewise.
	* regs.h: Likewise.
	* seccomp_fprog.h: Likewise.
	* sigevent.h: Likewise.
	* statfs.h: Likewise.
	* xlat.h: Likewise.

2016-08-08  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Unify usage of #include guards.
	This commit is an attempt to unify usage of include guards (in top-level
	headers, at least).  As a side note, different files with *.h extension
	have different semantics: for example, printargs.h is included multiple
	times in order to generate slightly varying code depending on values of
	macro definitions - maybe it's better to change extension of such files
	to something like *.inc.

	* defs.h: Add #include guard.
	* flock.h: Likewise.
	* ipc_defs.h: Likewise.
	* mpers_type.h: Likewise.
	* printsiginfo.h: Likewise.
	* ptrace.h: Likewise.
	* regs.h: Likewise.
	* seccomp_fprog.h: Likewise.
	* gcc_compat.h: Rename the macro used for #include guard.
	* msghdr.h: Likewise.
	* sigevent.h: Likewise.
	* kernel_types.h: Comment the trailing part of #include guard.
	* xlat.h: Add missing macro definition for #include guard.

2016-08-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add #include guards.
	* tests/tests.h: Add #include guard.

2016-08-05  Dmitry V. Levin  <ldv@altlinux.org>

	linux: add #include guards.
	* linux/dummy.h: Add #include guard.
	* linux/inet_diag.h: Likewise.
	* linux/netlink_diag.h: Likewise.
	* linux/sock_diag.h: Likewise.
	* linux/syscall.h: Likewise.
	* linux/unix_diag.h: Likewise.

2016-08-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests/umode_t.c: guard against libc printf format errors.
	* tests/umode_t.c (test_syscall): Use different printf format specifiers
	to detect libc printf format errors.

2016-08-04  Dmitry V. Levin  <ldv@altlinux.org>

	travis: use a suitable musl revision.
	There seems to be no readily available binary packages of musl that are
	sufficiently up to date to be used to build and test strace, so prepare
	a suitable musl from source.

	* travis-install.sh (musl-gcc): Do not add an extra repository,
	do not install musl-tools and linux-musl-dev packages.
	Download, build, and install a suitable musl revision instead.

2016-08-03  Dmitry V. Levin  <ldv@altlinux.org>

	Fix printing of mode_t, umode_t, and umask types.
	Print numeric umode_t type using %#03ho format.
	Print return value of umask syscall using %#03lo format.
	When printing symbolic mode_t type, always print lower 9 bits,
	and print the numeric part using %#03o format.

	* defs.h (sprintmode): Remove.
	(print_symbolic_mode_t, print_numeric_umode_t,
	print_numeric_long_umask): New prototypes.
	* printmode.c (sprintmode): Remove.
	(print_symbolic_mode_t, print_numeric_umode_t,
	print_numeric_long_umask): New functions.
	* chmod.c (decode_chmod): Use print_numeric_umode_t.
	* ipc_msg.c (SYS_FUNC(msgget)): Likewise.
	* ipc_msgctl.c (print_msqid_ds): Likewise.
	* ipc_sem.c (SYS_FUNC(semget)): Likewise.
	* ipc_shm.c (SYS_FUNC(shmget)): Likewise.
	* ipc_shmctl.c (print_shmid_ds): Likewise.
	* mq.c (SYS_FUNC(mq_open)): Likewise.
	* open.c (decode_open, SYS_FUNC(creat)): Likewise.
	* umask.c (SYS_FUNC(umask)): Likewise.
	* mknod.c (decode_mknod): Use print_symbolic_mode_t.
	* printstat.h (DO_PRINTSTAT): Likewise.
	* syscall.c (trace_syscall_exiting): Use print_numeric_long_umask.
	* tests/umode_t.c: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/creat.c: Rewrite as a thin wrapper around umode_t.c
	* tests/mkdir.c: Likewise.
	* tests/mkdirat.c: Likewise.
	* tests/mknod.c: Extend test coverage of mknod syscall.
	* tests/mknodat.c: Extend test coverage of mknodat syscall.
	* tests/umask.c: Extend test coverage of umask syscall.
	* tests/creat.test: Update the value specified for strace -a parameter.
	* tests/mkdir.test: Likewise.
	* tests/mkdirat.test: Likewise.
	* tests/mknodat.test: Likewise.

2016-08-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests: simplify attach-f-p.test.
	* tests/attach-f-p.c Simplify communications between threads
	by replacing per-thread timers with pipes.
	* tests/attach-f-p.test: Do not ignore signals.

	tests: cleanup attach-p-cmd.test.
	* tests/attach-p-cmd-cmd.c (main): Cleanup expected output.
	* tests/attach-p-cmd-p.c (main): Print expected output.
	* tests/attach-p-cmd.test: Do not print expected output.

	ip_mreq.test: rewrite from match_grep to match_diff.
	* tests/ip_mreq.c (main): Print expected output.
	* tests/ip_mreq.test: Use run_strace_match_diff.
	* tests/ip_mreq.expected: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove it.

	fanotify_mark.test: rewrite from match_grep to match_diff.
	* tests/fanotify_mark.c (main): Print expected output.
	* tests/fanotify_mark.test: Use run_strace_match_diff.
	* tests/fanotify_mark.expected: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove it.

	signalfd4.test: rewrite from match_grep to match_diff.
	* tests/signalfd4.c (get_sigset_size): New function.
	(main): Use it.  Print expected output.
	* tests/signalfd4.test: Use run_strace_match_diff.
	* tests/signalfd4.expected: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove it.

2016-07-31  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rename signalfd.test to signalfd4.test.
	* tests/signalfd.c: Rename to signalfd4.c.
	* tests/signalfd.test: Rename to signalfd4.test.
	* tests/signalfd.expected: Rename to signalfd4.expected.
	* tests/.gitignore: Replace signalfd with signalfd4.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Replace signalfd.test with signalfd4.test.
	(EXTRA_DIST): Replace signalfd.expected with signalfd4.expected.

2016-07-30  Dmitry V. Levin  <ldv@altlinux.org>

	memfd_create.test: rewrite from match_grep to match_diff.
	* tests/memfd_create.c (main): Print expected output.
	* tests/memfd_create.test: Use run_strace_match_diff.
	* tests/memfd_create.expected: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove it.

2016-07-29  Dmitry V. Levin  <ldv@altlinux.org>

	Set exit status to 1 if strace has not traced any processes.
	* strace.c (main): Initialize exit_code with 1 when no processes
	has been attached.
	* strace.1: Document it.
	* NEWS: Mention this change.

	Attach to the target process before attempting to attach to its siblings
	* strace.c (attach_tcb): Attach to tcp->pid first.

	Report the name of ptrace command when ptrace_attach_or_seize fails.
	* strace.c (ptrace_attach_cmd): New variable.
	(ptrace_attach_or_seize): Save last ptrace command's name
	to ptrace_attach_cmd.
	(attach_tcb, startup_child): Use it in error diagnostics.

	strace.c: refactor startup_attach.
	* strace.c (startup_attach): Move the inner part of the big loop
	over tcbtab elements ...
	(attach_tcb): ... to this new function.

	startup_attach: do not use atoi.
	* strace.c (startup_attach): Replace atoi with string_to_uint.

2016-07-28  Dmitry V. Levin  <ldv@altlinux.org>

	Do not enable mpers runtime checks if mpers is not enabled.
	* m4/mpers.m4 (HAVE_RUNTIME): Enable iff both mpers and runtime
	work properly.

2016-07-28  Dmitry V. Levin  <ldv@altlinux.org>

	linux/dummy_check.sh: remove obsolete script.
	Starting with commit v4.10-62-ga0bd374, function prototypes
	of syscall parsers are generated at build time.

	* linux/dummy_check.sh: Remove.

2016-07-28  Dmitry V. Levin  <ldv@altlinux.org>

	generate_xlat_in.sh: remove obsolete script.
	This script has been created by commit v4.8-180-g0ed617b
	for the one-shot job of automatic convertion of xlat structures
	from *.c files to xlat/*.in files.

	* generate_xlat_in.sh: Remove.

2016-07-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use terse notation in designated initializers where appropriate.
	* tests/btrfs.c (btrfs_test_dev_replace_ioctl): Initialize
	struct btrfs_ioctl_dev_replace_args using terse notation.
	* tests/clock_nanosleep.c (main): Initialize struct timespec
	using terse notation.
	* tests/nanosleep.c (main): Likewise.

2016-07-28  Dmitry V. Levin  <ldv@altlinux.org>

	Consistently use extended regular expressions where appropriate.
	When grep or sed is used with basic regular expressions containing
	'(', ')', '{', '}', '|', '?', and '+' special characters, convert them
	to extended regular expressions for better portability and readability.

	* generate_mpers_am.sh: Convert grep and sed BREs to EREs.
	* Makefile.am (ioctl_redefs%.h, m%_type_defs.h, m%_funcs.h,
	mpers_printer_decl_pattern, printers.h, %_printer_decls.h,
	%_printer_defs.h): Convert sed BREs to EREs.
	* generate_sen.sh: Likewise.
	* linux/mips/genstub.sh: Likewise.
	* make-dsc: Likewise.
	* mpers.sh: Likewise.
	* xlat/gen.sh: Likewise.
	* tests/Makefile.am (ksysent.h): Likewise.
	* tests/ksysent.sed: Likewise.
	* tests/pc.test: Likewise.
	* tests/strace-S.test: Likewise.
	* tests/strace-V.test: Likewise.
	* tests/strace-k.test: Likewise.

2016-07-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix extended regexps.
	* tests/adjtimex.c (main): Consistently quote curly braces
	in expected output.
	* tests/uio.expected: Likewise.

2016-07-27  Dmitry V. Levin  <ldv@altlinux.org>

	Post-release administrivia.
	* NEWS: Add header line for the next release.
	* debian/changelog.in: Add a changelog entry for 4.13-1.
	* strace.spec.in: Likewise.

2016-07-26  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.13 release.
	* NEWS: Update for 4.13 release.

	Fix one more code pattern that might break gcc strict aliasing rules.
	* btrfs.c (btrfs_ioctl): Add one more expicit cast to "void *",
	to avoid breaking strict-aliasing rules reported by some gcc compilers.
	* syscall.c (decode_socket_subcall): Likewise.
	* util.c (next_set_bit): Likewise.
	* tests/btrfs.c (btrfs_test_send_ioctl): Likewise.

	Fix casts of ptrace's third argument.
	* strace.c (maybe_allocate_tcb): Replace "(char *) 0" with NULL
	as ptrace's third argument.
	* linux/sparc64/get_scno.c (arch_get_scno): Cast third argument
	of ptrace to "void *'.
	* syscall.c (get_regs): Likewise.
	* upeek.c (upeek): Likewise.
	* util.c (umoven): Likewise.

	tests/btrfs.c: do not include the same header file twice.
	* tests/btrfs.c: Do not include <sys/fcntl.h>, <fcntl.h> is enough.

	tests: fix accept4.test on systems that lack SOCK_CLOEXEC definition.
	* tests/accept4.c: Check that O_CLOEXEC is defined.  Use O_CLOEXEC
	instead of SOCK_CLOEXEC.

2016-07-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix vhangup.test.
	* tests/vhangup.c (main): Fix expected output for the case when
	the calling process has CAP_SYS_TTY_CONFIG capability.

	Reported-by: Yun-Chih Chen <b03902074@ntu.edu.tw>

2016-07-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix chown.test.
	* tests/chown.test: Fix the value specified for strace -a parameter.

	Reported-by: Yun-Chih Chen <b03902074@ntu.edu.tw>

2016-07-25  Dmitry V. Levin  <ldv@altlinux.org>

	x32: fix syscall entries for x86_64 variants of io_setup and io_submit.
	* linux/x32/syscallent.h (64:io_setup, 64:io_submit): Change handler
	to printargs.

	tests/ipc.c: fix typo.

2016-07-24  Dmitry V. Levin  <ldv@altlinux.org>

	NEWS: Prepare for 4.13 release.

2016-07-23  Dmitry V. Levin  <ldv@altlinux.org>

	debian: add gcc-multilib to Build-Depends for relevant architectures.
	* debian/control (Build-Depends) [amd64, ppc64, sparc64, x32]:
	Add gcc-multilib to enable multiple personalities support.

2016-07-22  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of ipc syscall.
	* tests/ipc.c: New file.
	* tests/ipc.test: New test.
	* tests/.gitignore: Add ipc.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ipc.test.

	Fix corner cases of ipc syscall decoding.
	* xlat/ipccalls.in: New file.
	* ipc.c: New file.
	* Makefile.am (libstrace_a_SOURCES): Add it.
	* linux/dummy.h (sys_ipc): Remove stub alias.
	* syscall.c (decode_ipc_subcall): Treat 1st argument of ipc syscall
	as "unsigned int".
	[S390 || S390X]: Skip ipc cubcalls that have non-zero version.
	[SPARC64]: Likewise, for the native personality.
	Save ipc cubcall version for later use by specific ipc parsers.
	* ipc_msg.c (SYS_FUNC(msgrcv)): Handle non-zero ipc subcall version.
	[SPARC64]: Handle non-ipc_kludge case for the native personality.
	* linux/subcall.h (msgrcv): Change nargs from 4 to 5.
	* linux/s390/syscallent.h (ipc): Change nargs from 6 to 5.
	* linux/s390x/syscallent.h (ipc): Likewise.

2016-07-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip netlink_protocol.test on old systems.
	* tests/netlink_protocol.c: Check that HAVE_SYS_XATTR_H is defined.
	Include <stdlib.h> and <sys/xattr.h>.
	(main): Check that system.sockprotoname attribute is supported.

	Do not print too many arguments of socketcall syscall.
	* socketcall.c (SYS_FUNC(socketcall)): Print just "call" and "args"
	syscall arguments.
	* tests/socketcall.c (test_socketcall): Update expected output.
	* tests/socketcall.test: Likewise.

2016-07-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests/nsyscalls.c: change the type of syscall arguments to kernel_ulong_t
	As most syscalls on x32 and mips n32 are actually 64-bit,
	check that 64-bit syscall arguments are decoded properly.

	This also workarounds x32 gcc sign extension bug
	reported by Eugene Syromyatnikov at
	https://sourceforge.net/p/strace/mailman/message/35150860/

	* tests/nsyscalls.c: Include "kernel_types.h".
	(main): Change the type of syscall arguments to kernel_ulong_t.

2016-07-20  Dmitry V. Levin  <ldv@altlinux.org>

	x32, mips n32: make printargs print full 64-bit syscall arguments.
	As most of x32 syscalls are regular x86_64 syscalls, they should be
	printed by default as 64-bit syscalls, and syscall parsers at their
	discretion might print syscalls differently.  This is already
	implemented in 64-bit strace tracing x32 personality processes,
	and now x32 strace will also behave this way.

	Similar reasoning applies to mips n32.

	* util.c (printargs) [HAVE_STRUCT_TCB_EXT_ARG]: Print syscall arguments
	from ext_arg array using %llx format.

2016-07-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of socketcall syscall.
	* tests/socketcall.c: New file.
	* tests/socketcall.test: New test.
	* tests/.gitignore: Add socketcall.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add socketcall.test.

	Fix corner cases of socketcall syscall.
	* xlat/socketcalls.in: New file.
	* socketcall.c: New file.
	* Makefile.am (libstrace_a_SOURCES): Add it.
	* linux/dummy.h (sys_socketcall): Remove stub alias.
	* syscall.c (decode_socket_subcall): Treat 1st argument of socketcall
	as "int".  Do not substitute syscall until all socketcall arguments
	have been fetched successfully.

2016-07-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding and dumping of send and recv syscalls.
	* tests/unix-pair-send-recv.c: New file.
	* tests/unix-pair-send-recv.expected: Likewise.
	* tests/unix-pair-send-recv.test: New test.
	* tests/.gitignore: Add unix-pair-send-recv.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add unix-pair-send-recv.test.
	(EXTRA_DIST): Add unix-pair-send-recv.expected.

	tests: rename unix-pair-send-recv to unix-pair-sendto-recvfrom.
	* dumpio.expected: Rename to unix-pair-sendto-recvfrom.expected.
	* dumpio.test: Rename to unix-pair-sendto-recvfrom.test.
	* unix-pair-send-recv.c: Rename to unix-pair-sendto-recvfrom.c
	* .gitignore: Rename unix-pair-send-recv to unix-pair-sendto-recvfrom.
	* Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add unix-pair-sendto-recvfrom.test.
	(MISC_TESTS): Remove dumpio.test.
	(EXTRA_DIST): Rename dumpio.expected
	to unix-pair-sendto-recvfrom.expected.

	tests: check decoding of shutdown syscall.
	* tests/shutdown.c: New file.
	* tests/shutdown.test: New test.
	* tests/.gitignore: Add shutdown.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add shutdown.test.

	xlat/shutdown_modes.in: convert to modern syntax.
	* xlat/shutdown_modes.in: Replace open-coded xlat table with a list
	of constants.

	tests: check silent decoding of sendmmsg and recvmmsg syscalls.
	* tests/mmsg-silent.c: New file.
	* tests/mmsg-silent.test: New test.
	* tests/.gitignore: Add mmsg-silent.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add mmsg-silent.test.

	Print unsent messages of failed sendmmsg syscall.
	* mmsghdr.c (decode_mmsgvec): Clear syserror for the time of printing
	struct mmsghdr array in !use_msg_len case.
	(SYS_FUNC(sendmmsg)): As failed sendmmsg syscall does not
	set msg_len fields, tell this to decode_mmsgvec.
	* tests/mmsg_name.c (test_mmsg_name): Check it.

	Print unsent messages of sendmmsg syscall.
	* defs.h (decode_mmsgvec): Add int argument.
	* mmsghdr.c (print_struct_mmsghdr_config): Add msg_len_vlen field.
	(print_struct_mmsghdr): Print struct mmsghdr.msg_len only for
	msg_len_vlen first elements of struct mmsghdr array.
	(decode_mmsgvec): Add msg_len_vlen argument.
	(SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Pass to decode_mmsgvec
	the number of elements of struct mmsghdr array that contain meaningful
	struct mmsghdr.msg_len.
	* tests/mmsg_name.c (test_mmsg_name): Check it.

	tests: check verbose decoding of msg_name* fields of struct mmsghdr array
	* tests/mmsg_name-v.c: New file.
	* tests/mmsg_name-v.test: New test.
	* tests/.gitignore: Add mmsg_name-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add mmsg_name-v.test.

	tests: check decoding of msg_name* fields of struct mmsghdr array.
	* tests/mmsg_name.c: New file.
	* tests/mmsg_name.test: New test.
	* tests/.gitignore: Add mmsg_name.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add mmsg_name.test.

2016-07-19  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of msg_name* fields of recvmmsg syscall's msghdr array argument
	As msg_namelen fields of recvmmsg syscall's struct msghdr array have
	the same read-write semantics as struct msghdr argument of recvmsg
	syscall, parser of recvmmsg syscall needs a similar fix.

	* mmsghdr.c (print_struct_mmsghdr): Increment p_user_msg_namelen field.
	(mmsgvec_data): New structure.
	(free_mmsgvec_data, save_mmsgvec_namelen): New functions.
	(decode_mmsgvec): Take into account the data saved
	by save_mmsgvec_namelen function.
	(SYS_FUNC(recvmmsg)): Use save_mmsgvec_namelen.

2016-07-19  Dmitry V. Levin  <ldv@altlinux.org>

	mmsghdr.c: rewrite decode_mmsgvec using print_array.
	* fetch_struct_mmsghdr.c (sizeof_struct_mmsghdr): New mpers printer.
	* mmsghdr.c: Include <limits.h>.
	(print_struct_mmsghdr_config): New structure.
	(fetch_struct_mmsghdr_or_printaddr, print_struct_mmsghdr): New functions.
	(decode_mmsgvec): Rewrite using them and print_array.

	tests: check decoding of timeout argument of recvmmsg syscall.
	* tests/recvmmsg-timeout.c: New file.
	* tests/recvmmsg-timeout.test: New test.
	* tests/.gitignore: Add recvmmsg-timeout.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add recvmmsg-timeout.test.

	Fix printing of remaining timeout of recvmmsg syscall.
	* mmsghdr.c (SYS_FUNC(recvmmsg)): Do not print remaining timeout
	when the 5th syscall argument is NULL.
	* tests/mmsg.c (main): Update expected output.

	Remove configure checks for recvmmsg and sendmmsg.
	* configure.ac (AC_CHECK_FUNCS): Remove recvmmsg and sendmmsg.

	tests: add recv_mmsg and send_mmsg functions to libtests.
	* tests/tests.h (recv_mmsg, send_mmsg): New prototype.
	* tests/libmmsg.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.
	* tests/mmsg.c Do not check for __NR_sendmmsg, __NR_recvmmsg,
	HAVE_SENDMMSG, and HAVE_RECVMMSG.  Do not include unused headers.
	(recv_mmsg, send_mmsg): Remove.

	tests: add socketcall function to libtests.
	* tests/tests.h (socketcall): New prototype.
	* tests/libsocketcall.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.

2016-07-18  Dmitry V. Levin  <ldv@altlinux.org>

	Use IOV_MAX instead of UIO_MAXIOV.
	IOV_MAX appears to be more portable than UIO_MAXIOV.

	* msghdr.c: Include <limits.h>. Remove fallback defintion of UIO_MAXIOV.
	(get_optmem_max): Replace UIO_MAXIOV with IOV_MAX.
	* tests/msg_control.c: Likewise.

2016-07-18  Dmitry V. Levin  <ldv@altlinux.org>

	Unabuse struct tcb.auxstr.
	As we've got a proper mechanism that parsers can use for storing private
	data between entering and exiting stages, all cases of struct tcb.auxstr
	abuse should go.

	* btrfs.c (btrfs_ioctl): Use set_tcb_priv_ulong and get_tcb_priv_ulong
	instead of abusing tcp->auxstr.
	* file_handle.c (SYS_FUNC(name_to_handle_at)): Likewise.
	* msghdr.c (SYS_FUNC(recvmsg)): Likewise.
	* net.c (decode_sockname, SYS_FUNC(recvfrom)): Likewise.
	* v4l2.c (print_v4l2_queryctrl): Likewise.

2016-07-18  Dmitry V. Levin  <ldv@altlinux.org>

	Fix race condition in decoding timeout argument of recvmmsg syscall.
	As the value returned by sprint_timespec points to a static area and may
	be overwritten by subsequent calls to sprint_timespec, it is not safe to
	save this value on entering syscall and use it later on exiting.

	* mmsghdr.c (SYS_FUNC(recvmmsg)): On entering syscall, copy the value
	returned by sprint_timespec to a dynamically allocated memory, and save
	the pointer using set_tcb_priv_data.  On exiting, restore it using
	get_tcb_priv_data.

2016-07-18  Dmitry V. Levin  <ldv@altlinux.org>

	Fix race condition in decoding rt_sigtimedwait's timeout argument.
	As the value returned by sprint_timespec points to a static area and may
	be overwritten by subsequent calls to sprint_timespec, it is not safe to
	save this value on entering syscall and use it later on exiting.

	* signal.c (SYS_FUNC(rt_sigtimedwait)): On entering syscall, copy the
	value returned by sprint_timespec to a dynamically allocated memory,
	and save the pointer using set_tcb_priv_data.  On exiting, restore it
	using get_tcb_priv_data.

2016-07-18  Patrik Jakobsson  <patrik.jakobsson@linux.intel.com>

	Add private data field to struct tcb.
	We need to be able to store private data in the struct tcb across it's
	lifetime.  To ensure proper deallocation of this stored data a callback
	must be provided along with the data.  The callback is executed
	automatically on exiting syscall, and when the life of the tcb ends.

	* defs.h (struct tcb): Add _priv_data and _free_priv_data fields.
	(get_tcb_priv_data, set_tcb_priv_data, free_tcb_priv_data):
	New prototypes.
	(get_tcb_priv_ulong, set_tcb_priv_ulong): New static inline functions.
	* strace.c (get_tcb_priv_data, set_tcb_priv_data, free_tcb_priv_data):
	New functions.
	(droptcb): Call free_tcb_priv_data.
	* syscall.c (trace_syscall_exiting): Call free_tcb_priv_data
	when clearing TCB_INSYSCALL flag.

2016-07-18  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: move parsers of sendmsg and recvmsg syscalls to msghdr.c.
	* defs.h (fetch_msghdr_namelen, decode_msghdr): Remove.
	* net.c (SYS_FUNC(sendmsg), SYS_FUNC(recvmsg)): Move ...
	* msghdr.c: ... here.
	(fetch_msghdr_namelen, decode_msghdr): Add static qualifier.

	net.c: move parsers of sendmmsg and recvmmsg syscalls to mmsghdr.c.
	* defs.h (decode_mmsgvec): Remove.
	* net.c: Do not include "msghdr.h".
	(SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Move ...
	* mmsghdr.c: ... here.
	(decode_mmsgvec): Add static qualifier.

	msghdr.c: move all mmsghdr parsers to a separate file.
	* msghdr.h (print_struct_msghdr): New prototype.
	* msghdr.c (print_msghdr): Rename to print_struct_msghdr, remove
	static qualifier, all callers changed.
	(decode_mmsghdr, decode_mmsgvec, dumpiov_in_mmsghdr): Move to ...
	* mmsghdr.c: ... new file.
	* Makefile.am (strace_SOURCES): Add it.

2016-07-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests: disable part of msg_name test on non-glibc systems.
	Sadly, musl recvmsg wrapper blindly dereferences 2nd argument,
	so limit the affected part of the test to glibc that doesn't.

	* tests/msg_name.c (test_msg_name) [!__GLIBC__]: Do not test
	with inaccessible 2nd argument.

2016-07-13  Dmitry V. Levin  <ldv@altlinux.org>

	Print struct iovec as a regular structure.
	* io.c (print_iovec): Print names of iov_base and iov_len fields.
	* tests/aio.c (main): Update expected output.
	* tests/inet-cmsg.c (main): Likewise.
	* tests/mmsg.c (main): Likewise.
	* tests/msg_name.c (test_msg_name): Likewise.
	* tests/preadv-pwritev.c (main): Likewise.
	* tests/preadv2-pwritev2.c (main): Likewise.
	* tests/preadv.c (main): Likewise.
	* tests/pwritev.c (main): Likewise.
	* tests/readv.c (main): Likewise.
	* tests/recvmsg.c (main): Likewise.
	* tests/vmsplice.c (main): Likewise.
	* tests/scm_rights-fd.test: Likewise.
	* tests/uio.expected: Likewise.

	tests: check decoding of msghdr.msg_name* arguments of recvmsg syscall.
	* tests/msg_name.c: New file.
	* tests/msg_name.test: New test.
	* tests/.gitignore: Add msg_name.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add msg_name.test.

2016-07-13  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of struct msghdr.msg_name* arguments of recvmsg syscall.
	As the msghdr.msg_namelen argument of recvmsg syscall has the same
	read-write semantics as the address length argument of recvfrom syscall,
	parser of recvmsg syscall needs a similar fix.

	* defs.h (fetch_msghdr_namelen): New prototype.
	(decode_msghdr): Add "int *" argument.
	* msghdr.c (print_msghdr): Likewise.  Treat it as a pointer to struct
	msghdr.msg_namelen passed to the kernel.  Pass to decode_sockaddr
	the size of socket address actually returned by the kernel.
	Print both user and kernel address lengths when the value changes.
	(decode_msghdr, decode_mmsghdr): Add "int *" argument,
	forward it to print_msghdr.
	(decode_mmsgvec): Update decode_mmsghdr invocation.
	(fetch_msghdr_namelen): New function.
	* net.c (SYS_FUNC(sendmsg)): Update decode_msghdr invocation.
	(SYS_FUNC(recvmsg)): Use fetch_msghdr_namelen on entering to save
	struct msghdr.msg_namelen.  On exiting, pass the saved value
	to decode_msghdr.

2016-07-12  Dmitry V. Levin  <ldv@altlinux.org>

	Update generic ioctl entries from linux 4.7.
	* linux/64/ioctls_inc.h: Update from linux v4.7 using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.

2016-07-12  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	x32: update ioctl entries from linux 4.7.
	* linux/x32/ioctls_inc0.h: Update from linux v4.7 using ioctls_gen.sh.

	maint: update for linux 4.7.
	* maint/ioctls_sym.sh: Drop obsolete workarounds for linux/btrfs.h.

2016-07-12  Dmitry V. Levin  <ldv@altlinux.org>

	block.c: remove BLKDAXGET support.
	BLKDAXGET was removed by linux kernel commit v4.7-rc1~78^2^2~4.

	* block.c: Do not define BLKDAXGET.
	(block_ioctl): Remove BLKDAXGET support.
	* tests/ioctl_block.c (main): Remove BLKDAXGET test.

2016-07-12  Dmitry V. Levin  <ldv@altlinux.org>

	Fix printing of socklen argument of bind and sendto syscalls.
	* net.c (SYS_FUNC(bind)): Print 3rd syscall argument using %d format.
	(SYS_FUNC(sendto)): Print 6th syscall argument using %d format.

	tests: check decoding of sockaddr related arguments of recvfrom syscall.
	* configure.ac (AC_CHECK_FUNCS): Add recvfrom.
	* tests/recvfrom.c: New file.
	* tests/recvfrom.test: New test.
	* tests/.gitignore: Add recvfrom.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add recvfrom.test.

	Fix decoding of sockaddr related arguments of recvfrom syscall.
	* net.c (SYS_FUNC(recvfrom)): Use fetch_socklen.  Save the address
	length passed to the kernel and print it on error.  Do not print more
	bytes of the socket address than actually returned by the kernel.
	Print both user and kernel address lengths when the returned address
	is truncated.

	tests: check decoding of accept4 syscall.
	* configure.ac (AC_CHECK_FUNCS): Add accept4.
	* tests/accept4.c: New file.
	* tests/accept4.test: New test.
	* tests/.gitignore: Add accept4.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add accept4.test.

	tests: check decoding of accept syscall.
	* tests/accept.c: New file.
	* tests/accept.test: New test.
	* tests/.gitignore: Add accept.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add accept.test.

	tests: check decoding of getpeername syscall.
	* tests/getpeername.c: New file.
	* tests/getpeername.test: New test.
	* tests/.gitignore: Add getpeername.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add getpeername.test.

	tests: check decoding of getsockname syscall.
	* tests/getsockname.c: New file.
	* tests/getsockname.test: New test.
	* tests/sockname.c: New file.
	* tests/.gitignore: Add getsockname.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add getsockname.test.
	(EXTRA_DIST): Add sockname.c.

	Print both values of changing address length in sockname family syscalls
	* net.c (decode_sockname): Print both user and kernel address lengths
	when the value changes.
	* tests/net-y-unix.c (main): Update expected output.
	* tests/net-yy-unix.c (main): Likewise.
	* tests/net.expected: Likewise.

	Enhance diagnostics of address truncation in sockname family syscalls.
	* net.c (decode_sockname): Print both user and kernel address lengths
	when the returned address is truncated.
	* tests/sun_path.expected: Update expected output.

	Fix decoding of getsockname, getpeername, accept, and accept4 syscalls.
	* net.c (fetch_socklen): New function.
	(decode_sockname): Use it.  On entering syscall, decode early
	and return RVAL_DECODED when possible.  On error, print the address
	length passed to the kernel.  Do not print more bytes of the socket
	address than actually returned by the kernel.

2016-07-11  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare parsers of sockname family syscalls for the upcoming fix.
	* net.c (do_sockname): Rename to decode_sockname, drop second argument,
	do not print sock_type_flags, return RVAL_DECODED on exiting.
	(SYS_FUNC(accept), SYS_FUNC(getsockname)): Use decode_sockname instead
	of do_sockname, take its return code into account.
	(SYS_FUNC(accept4)): Likewise.  Print sock_type_flags when
	decode_sockname returns RVAL_DECODED.

2016-07-08  Dmitry V. Levin  <ldv@altlinux.org>

	netlink: handle multipart netlink messages.
	Handle multipart netlink messages made of multiple struct nlmsghdr
	headers with associated payload in one byte stream.

	* netlink.c (fetch_nlmsghdr, print_nlmsghdr,
	decode_nlmsghdr_with_payload): New functions.
	(decode_netlink): Use them.
	* tests/netlink_parsing.c (send_query): Check them.

2016-07-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend netlink protocol check.
	* tests/netlink_protocol.c (send_query): Check that no part
	of netlink message is fetched beyond the end of message.
	Check decoding of zero address and zero length messages.
	Check decoding of messages with nlmsg_len exceeding message length.

2016-07-07  Fabien Siron  <fabien.siron@epita.fr>

	tests: check decoding of netlink protocol.
	* tests/netlink_protocol.test: New test.
	* tests/netlink_protocol.c: New file.
	* tests/.gitignore: Add netlink_protocol.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add netlink_protocol.test.

2016-07-07  Fabien Siron  <fabien.siron@epita.fr>

	Add a general netlink socket parser.
	Introduce a general socket netlink parser which prints the header and
	a string for the remaining part of the buffer.  It doesn't handle all
	the netlink flags and types yet because the parser needs more
	information, this will be implemented later.

	* net.c (decode_sockbuf): New function.
	(SYS_FUNC(send), SYS_FUNC(sendto), SYS_FUNC(recv), SYS_FUNC(recvfrom)):
	Use it instead of printstr.
	* msghdr.c (print_msghdr): Pass IOV_DECODE_NETLINK to tprint_iov_upto()
	for netlink sockets.
	* netlink.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (decode_netlink, getfdproto): New prototypes.
	(iov_decode): Add IOV_DECODER_NETLINK.
	* io.c (print_iovec): Use decode_netlink().
	* util.c (getfdproto): Remove static keyword.
	* xlat/netlink_flags.in: New file.
	* xlat/netlink_types.in: New file.

2016-07-07  Dmitry V. Levin  <ldv@altlinux.org>

	Update sigaltstack SS_* constants.
	* xlat/sigaltstack_flags.in: Add SS_AUTODISARM introduced
	by linux kernel commit v4.7-rc1~195^2.

	Update fs *_MAGIC constants.
	* xlat/fsmagic.in: Add NSFS_MAGIC, TRACEFS_MAGIC, BPF_FS_MAGIC,
	and UDF_SUPER_MAGIC introduced by linux kernel commits
	v3.19-rc1~53^2~7^2~1, v4.1-rc1~147^2~4, v4.4-rc1~141^2~17^2~1,
	and v4.7-rc1~161^2, respectively.

2016-07-05  Dmitry V. Levin  <ldv@altlinux.org>

	Update KEYCTL_* constants.
	* xlat/keyctl_commands.in: Add KEYCTL_DH_COMPUTE introduced
	by linux kernel commit v4.7-rc1~124^2~2^2~2^2.

	Update input event constants.
	* xlat/evdev_keycode.in: Add KEY_* constants introduced
	by linux kernel commit v4.7-rc6~32^2~6^2.

2016-07-04  Dmitry V. Levin  <ldv@altlinux.org>

	Update RWF_* constants.
	* xlat/rwf_flags.in: Add RWF_DSYNC and RWF_SYNC introduced
	by linux kernel commit v4.7-rc1~158^2~1.

2016-07-07  Dmitry V. Levin  <ldv@altlinux.org>

	Update BPF_MAP_TYPE_* constants.
	* xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_TRACEPOINT introduced
	by linux kernel commit v4.7-rc1~154^2~332^2~6.

2016-07-03  Dmitry V. Levin  <ldv@altlinux.org>

	msghdr.c: limit output when printing excessively large messages.
	Limit output of struct msghdr.msg_control when
	struct msghdr.msg_controllen is greater than the maximum ancillary
	buffer size specified in /proc/sys/net/core/optmem_max file.

	* configure.ac (AC_CHECK_FUNCS): Add open64.
	* defs.h (read_int_from_file): New prototype.
	* util.c (read_int_from_file): New function.
	* msghdr.c (get_optmem_max): New function based on read_int_from_file.
	(decode_msg_control): Use it to check control_len argument.
	* tests/msg_control.c (test_big_len): New function.
	(main): Use it to test printing of excessively large messages.

2016-07-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add read_int_from_file function to libtests.
	* tests/overflowuid.c (read_int_from_file): New function.
	(check_overflow_id): Use it.
	* tests/tests.h (read_int_from_file): New prototype.

2016-07-02  Dmitry V. Levin  <ldv@altlinux.org>

	msghdr.c: limit IP_RECVOPTS/IP_RETOPTS output in abbrev mode.
	* msghdr.c (print_cmsg_ip_opts): Do not print more than max_strlen
	bytes of ip options in abbrev mode.
	* tests/msg_control.c (print_ip_opts): Use DEFAULT_STRLEN.
	(test_sol_ip): Test IP_RETOPTS output in abbrev mode.

	msghdr.c: limit SCM_RIGHTS output in abbrev mode.
	* msghdr.c (print_scm_rights): Do not print more than max_strlen
	descriptors in abbrev mode.
	* tests/msg_control.c (DEFAULT_STRLEN): New macro.
	(print_fds): Use it.
	(test_scm_rights3): New function.
	(main): Use it to test SCM_RIGHTS output in abbrev mode.
	* tests/msg_control-v.c: New file.
	* tests/msg_control-v.test: New test.
	* tests/.gitignore: Add msg_control-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add msg_control-v.test.

2016-07-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of struct msghdr ancillary data.
	* tests/msg_control.c: New file.
	* tests/msg_control.test: New test.
	* tests/.gitignore: Add msg_control.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add msg_control.test.

2016-06-30  Dmitry V. Levin  <ldv@altlinux.org>

	msghdr.c: reorganize struct cmsghdr handler.
	* msghdr.c (sock_ee): New structure.
	(print_scm_rights, print_scm_creds, print_scm_security,
	print_cmsg_ip_pktinfo, print_cmsg_uint, print_cmsg_ip_opts,
	print_cmsg_ip_recverr, print_cmsg_ip_origdstaddr): Remove data_len
	argument validity check, don't print ", cmsg_data=" prefix here.
	(print_cmsg_ip_tos): Likewise.  Rename to print_cmsg_uint8_t.
	(cmsg_printer): New type.
	(cmsg_socket_printers, cmsg_ip_printers): New arrays.
	(print_cmsg_type_data): Use them to handle struct cmsghdr
	and its cmsg_data.

	msghdr.c: merge print_cmsg_ip_ttl and print_cmsg_ip_checksum.
	* msghdr.c (print_cmsg_ip_ttl): Rename to print_cmsg_uint.
	(print_cmsg_ip_checksum): Remove.
	(print_cmsg_type_data): Replace print_cmsg_ip_ttl
	and print_cmsg_ip_checksum with print_cmsg_uint.

	msghdr.c: enhance representation of unprintable part of msg_control array
	* msghdr.c (decode_msg_control): When msg_control array has an
	unprintable part, print its address.

	msghdr.c: apply a sane limit to the length of IP_ORIGDSTADDR address.
	* msghdr.c (print_cmsg_ip_origdstaddr): Limit address length to the size
	of struct sockaddr_storage.

	msghdr.c: fix printing SCM_RIGHTS array.
	* msghdr.c (print_scm_rights): Do not print array elements outside
	bounds defined by struct cmsghdr.cmsg_len.

	msghdr.c: print unrecognized struct cmsghdr.cmsg_type in hex.
	* msghdr.c (print_cmsg_type_data): Use %#x format when printing
	struct cmsghdr.cmsg_type as an integer.

	msghdr.c: fix printing of struct in_pktinfo.
	* msghdr.c (print_cmsg_ip_pktinfo): Fix printing
	of struct in_pktinfo.ipi_addr.

	msghdr.c: fix representation of struct cmsghdr.cmsg_data integer arrays.
	* msghdr.c (print_cmsg_ip_opts): Print struct cmsghdr.cmsg_data
	as an array of hexadecimal integers.
	* tests/inet-cmsg.c (print_opts): Update expected output.

	msghdr.c: fix representation of integer struct cmsghdr.cmsg_data values.
	* msghdr.c (print_cmsg_ip_ttl, print_cmsg_ip_tos,
	print_cmsg_ip_checksum): Print struct cmsghdr.cmsg_data value as an
	array element.
	* tests/inet-cmsg.c (print_ttl, print_tos): Update expected output.

	msghdr.c: when printing struct struct cmsghdr.cmsg_data, also print its name
	* msghdr.c (print_scm_rights, print_scm_creds, print_scm_security,
	print_cmsg_ip_pktinfo, print_cmsg_ip_ttl, print_cmsg_ip_tos,
	print_cmsg_ip_checksum, print_cmsg_ip_opts, print_cmsg_ip_recverr,
	print_cmsg_ip_origdstaddr): Print "cmsg_data=" before its contents.
	* tests/inet-cmsg.c (print_pktinfo, print_ttl, print_tos, print_opts,
	print_origdstaddr): Update expected output.
	* tests/scm_rights-fd.test: Likewise.

2016-06-27  Dmitry V. Levin  <ldv@altlinux.org>

	msghdr.c: print struct mmsghdr as a regular structure.
	* msghdr.c (decode_mmsghdr): Print names of msg_hdr and msg_len fields.
	* tests/mmsg.c (main): Update expected output.

	net.c: move all msghdr and mmsghdr parsers to a separate file.
	* defs.h (msg_flags, socketlayers, decode_msghdr, decode_mmsg):
	New prototypes.
	* msghdr.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* net.c: Move all msghdr and mmsghdr parsers to msghdr.c.

	Mpersify fetchers of struct msghdr and struct mmsghdr.
	* fetch_struct_msghdr.c: New file.
	* fetch_struct_mmsghdr.c: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* net.c (struct msghdr32, struct mmsghdr32, copy_from_msghdr32,
	fetch_msghdr, fetch_mmsghdr): Remove.
	(decode_msghdr, dumpiov_in_msghdr): Use fetch_struct_msghdr instead
	of fetch_msghdr.
	(decode_mmsghdr): Change msg_len argument to use_msg_len.
	Use fetch_struct_mmsghdr instead of fetch_mmsghdr.
	Return fetch_struct_mmsghdr's return code.
	(decode_mmsg): Rename to decode_mmsgvec.  Take addr and len arguments.
	Do not print vlen and flags.  Check decode_mmsghdr's return code.
	Print mmsghdr array using square brackets.
	(dumpiov_in_mmsghdr): Use fetch_struct_mmsghdr instead of fetch_mmsghdr.
	(SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Use decode_mmsgvec instead
	of decode_mmsg.  Print vlen and flags.
	* tests/mmsg.c (main): Update expected output.

	net.c: move fallback definition of struct mmsghdr to a separate file.
	* msghdr.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* net.c: Include it.  Move fallback definition of struct mmsghdr there.
	* tests/mmsg.c: Include "msghdr.h".  Remove fallback definition
	of struct mmsghdr.

2016-06-26  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: print struct msghdr as a regular structure.
	* net.c (print_msghdr): Print msg_name, msg_namelen, msg_iov,
	and msg_iovlen fields like other regular fields.
	* tests/inet-cmsg.c (main): Update expected output.
	* tests/mmsg.c (main): Likewise.
	* tests/recvmsg.c (main): Likewise.
	* tests/scm_rights-fd.test: Likewise.

	net.c: rename some internal functions for consistency and readability.
	* net.c (printcmsghdr): Rename to decode_msg_control.
	(do_msghdr): Rename to print_msghdr.
	(extractmsghdr): Rename to fetch_msghdr.
	(extractmmsghdr): Rename to fetch_mmsghdr.
	(printmsghdr): Rename to decode_msghdr.
	(printmmsghdr): Rename to decode_mmsghdr.
	All callers updated.

	net.c: when printing struct msghdr.msg_control, also print its name.
	* net.c (printcmsghdr): Skip control messages of zero length.
	Always print "msg_control=" before the control message.
	(do_msghdr): Print control message before its length, not after.
	* tests/inet-cmsg.c (main): Update expected output.
	* tests/scm_rights-fd.test: Likewise.

	Assume that libc provides struct msghdr.msg_control.
	* configure.ac (AC_CHECK_MEMBERS): Remove struct msghdr.msg_control.
	* net.c (do_msghdr): Remove HAVE_STRUCT_MSGHDR_MSG_CONTROL check.

2016-06-25  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: move all sockaddr parsers to a separate file.
	* sockaddr_ll.c: Rename to sockaddr.c
	(print_sockaddr_data_ll): Add static keyword.
	* Makefile.am (strace_SOURCES): Likewise.
	* defs.h (print_sockaddr_data_ll): Remove.
	(addrfams): New prototype.
	* net.c: Move all sockaddr parsers to sockaddr.c.

	net.c: rename printsock to decode_sockaddr.
	* defs.h (printsock): Rename to decode_sockaddr.
	* net.c (printsock): Likewise.
	(do_msghdr, SYS_FUNC(bind), do_sockname, SYS_FUNC(sendto),
	SYS_FUNC(recvfrom)): Replace printsock with decode_sockaddr.

	defs.h: remove unused prototype.
	* defs.h (print_sock_optmgmt): Remove.

	tests: check decoding of sockaddr structures.
	* tests/net-sockaddr.c: New file.
	* tests/net-sockaddr.test: New test.
	* tests/.gitignore: Add net-sockaddr.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add net-sockaddr.test.

2016-06-24  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: fix printing AF_PACKET socket addresses.
	* defs.h (print_ifindex, print_sockaddr_data_ll): New prototypes.
	* net.c: Stop including "xlat/af_packet_types.h".
	(print_ifindex): Remove static keyword.
	(print_sockaddr_data_l): Remove.
	* sockaddr_ll.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* xlat/arp_hardware_types.in: New file.
	* xlat/ethernet_protocols.in: Likewise.

	net.c: skip details of too short socket addresses, part 2.
	* net.c (sa_printers): Add minimal address length for each socket family.
	(print_sockaddr): Call socket family specific sockaddr printer
	only when socket address length is greater or equal
	the minimal address length for the socket family.

	net.c: fix printing AF_BLUETOOTH socket addresses.
	* xlat/hci_channels.in: New file.
	* net.c (print_sockaddr_data_raw): New function.
	(print_sockaddr): Use it.
	[HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/hci_channels.h".
	[HAVE_BLUETOOTH_BLUETOOTH_H] (print_sockaddr_data_bt): Fix printing
	sockaddr_hci, sockaddr_sco, sockaddr_rc, and sockaddr_l2 structures.

	net.c: fix printing AF_IPX sockets addresses, part 2.
	* net.c (print_sockaddr_data_ipx): Print sockaddr_ipx.sipx_network
	using %#08x format.  Print elements of sockaddr_ipx.sipx_node array
	and sockaddr_ipx.sipx_type using %#02x format.

2016-06-24  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: fix printing AF_UNIX abstract socket addresses.
	AF_UNIX abstract socket address specified by sockaddr_un.sun_path
	is not a NUL-terminated string.

	* net.c (SIZEOF_SA_FAMILY): New macro.
	(print_sockaddr_data_un): Use it.  Specify actual address length
	in print_quoted_string calls.  Do not set QUOTE_0_TERMINATED flag
	when printing an abstract socket address.

2016-06-24  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: fix printing field names of struct sockaddr_nl.
	* net.c (print_sockaddr_data_nl): Change "pid" to "nl_pid", "groups"
	to "nl_groups".  Print sockaddr_nl.nl_groups using %#08x format.
	* tests/net-yy-netlink.c (main): Update.

	net.c: fix printing struct sockaddr_in6.sin6_flowinfo.
	* net.c (print_sockaddr_data_in6): Convert sockaddr_in6.sin6_flowinfo
	from network order to host order before printing.

2016-06-23  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: do not print sockaddr_in6.sin6_scope_id unnecessarily.
	Prior to RFC2553, struct sockaddr_in6 had no sin6_scope_id field.
	As the kernel still accepts RFC2133 editions of struct sockaddr_in6,
	print sockaddr_in6.sin6_scope_id only when it is specified.

	* net.c (SIN6_MIN_LEN): New macro.
	(print_sockaddr_data_in6): Print sockaddr_in6.sin6_scope_id only when
	socket address length exceeds SIN6_MIN_LEN.

2016-06-23  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: fix printing raw data of socket addresses.
	* net.c (print_sockaddr): When printing socket address raw data, read
	exactly the number of data bytes specified for the socket addess.

	net.c: skip details of too short socket addresses.
	* net.c (print_sockaddr): Print socket address details only when
	the address size is greater than sizeof(struct sockaddr.sa_family).
	(print_sockaddr_data_un): Remove handling of addrlen == 2.
	* tests/net-y-unix.c (main): Update expected pattern.
	* tests/net-yy-unix.c (main): Likewise.
	* tests/net.expected: Likewise.

2016-06-22  Dmitry V. Levin  <ldv@altlinux.org>

	Assume that libc provides struct sockaddr_in6.sin6_scope_id.
	* configure.ac (AC_CHECK_MEMBERS): Remove
	struct sockaddr_in6.sin6_scope_id.
	* net.c (print_sockaddr_data_in6): Remove
	HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID check.

	Split print_sockaddr.
	* net.c (sockaddr_buf_t): Remove.
	(sockaddr_printer): New type.
	(sa_printers): New array of sockaddr_printer.
	(print_sockaddr): Use it.  Move printers of family specific
	sockaddr data to separate funcions.

2016-06-22  Fabien Siron  <fabien.siron@epita.fr>

	Add a enum for decoding to tprint_iov() and tprint_iov_upto()
	Introduce a new type iov_decode which will be used instead of the integer
	"decode" as a parameter.

	* defs.h (iov_decode): New enum.
	(tprint_iov, tprint_iov_upto): Change type of "decode_iov" to enum iov_decode.
	* aio.c (print_iocb): Change type of "decode_iov" to enum iov_decode in
	tprint_iov() call.
	* keyctl.c (keyctl_instantiate_key_iov): Likewise.
	* process.c (ptrace): Likewise.
	* process_vm.c (process_vm_readv, process_vm_writev): Likewise.
	* io.c (writev, do_pwritev, vmsplice): Likewise.
	(print_iovec): Replace the condition with a switch.
	(tprint_iov_upto): Change type of "decode_iov" to enum iov_decode.
	(readv, do_preadv): Change type of "decode_iov" to enum iov_decode in
	tprint_iov_upto() call.
	* scsi.c (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req,
	print_sg_io_v4_res): Likewise.
	* net.c (do_msghdr): Adapt call of tprint_iov_upto().

2016-06-22  Dmitry V. Levin  <ldv@altlinux.org>

	printsock: fix zero padding of sockaddr buffer.
	Before this change printsock used to erroneously clear the last byte
	of sockaddr buffer.

	* net.c (printsock): Use struct sockaddr_storage as a sockaddr buffer.
	Reserve additional byte after the sockaddr buffer for zero padding.
	Do not clear memory that is going to be overwritten by umoven.
	Clear the tail of sockaddr buffer that was not overwritten by umoven.

2016-06-21  Fabien Siron  <fabien.siron@epita.fr>

	Change printsock to return socket family.
	* defs.h (printsock): Change return type to int.
	* net.c (printsock): Likewise.  Return socket family on success
	and -1 in case of an error.

2016-06-21  Dmitry V. Levin  <ldv@altlinux.org>

	Unexport addrfams.
	* defs.h (addrfams): Remove.

	sock.c: use print_sockaddr.
	* sock.c (print_ifreq_addr): Remove.
	(PRINT_IFREQ_ADDR): New macro.
	(print_ifreq, decode_ifconf): Use it instead of print_ifreq_addr.

	Export print_sockaddr function.
	* defs.h (print_sockaddr): New prototype.
	* net.c (print_sockaddr): Remove static keyword.
	Change type of address pointer to "const void *".
	(print_cmsg_ip_recverr, print_group_req): Remove redundant casts
	in print_sockaddr invocations.

	xlat/addrfams.in: provide fallback definitions.
	* xlat/addrfams.in: add fallback definitions for constants.

	Update AF_* constants.
	* xlat/addrfams.in: Add AF_QIPCRTR.

	Assume that libc provides inet_ntop and inet_pton.
	* configure.ac (AC_CHECK_FUNCS): Remove inet_ntop and inet_pton.
	* net.c (sockaddr_buf_t, print_sockaddr, print_mreq6): Remove
	HAVE_INET_NTOP checks.
	* tests/ip_mreq.c: Remove HAVE_INET_PTON check.

	net.c: use SO_LINGER unconditionally.
	* net.c (print_linger, print_getsockopt, print_setsockopt): Do not check
	for SO_LINGER availability.

	net.c: use AF_BLUETOOTH unconditionally.
	* net.c (print_sockaddr, SYS_FUNC(socket)): Do not check
	for AF_BLUETOOTH availability.

2016-06-20  Dmitry V. Levin  <ldv@altlinux.org>

	Consistently use AF_UNIX over AF_LOCAL.
	As these constants have the same value 1, let's use and print only one
	of them, e.g. AF_UNIX.

	* xlat/addrfams.in (AF_LOCAL): Remove.
	* tests/net-accept-connect.c (main): Replace AF_LOCAL with AF_UNIX.
	* tests/net-y-unix.c: Likewise.
	* tests/net-yy-unix.c: Likewise.
	* tests/netlink_unix_diag.c: Likewise.

2016-06-19  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: fix printing AF_IPX sockets.
	* net.c (print_sockaddr): Print sockaddr_ipx as a regular structure.
	(SYS_FUNC(socket)): Remove special handling of AF_IPX.

	net.c: use AF_IPX unconditionally.
	* net.c (sockaddr_buf_t, print_sockaddr, SYS_FUNC(socket)): Do not check
	for AF_IPX availability.

	Cleanup netipx/ipx.h availability check.
	* configure.ac (AC_CHECK_HEADERS): Add netipx/ipx.h.
	* net.c: Check for HAVE_NETIPX_IPX_H instead of __GLIBC__.

2016-06-19  Fabien Siron  <fabien.siron@epita.fr>

	Make getfdproto return enum instead of string.
	Introduce a new enum type sock_proto and use it instead of strings for socket
	protocols identification.

	* defs.h (sock_proto): New enum.
	(get_proto_by_name): New function.
	* socketutils.c (protocols): New static table.
	(print_sockaddr_by_inode): Use it.  Change type of "proto" argument
	to sock_proto.
	(get_proto_by_name): New function.
	* util.c (getfdproto): Use it.  Change return type to sock_proto.
	(printfd): Update.

2016-06-18  Dmitry V. Levin  <ldv@altlinux.org>

	Split travis-ci.sh.
	* travis-ci.sh: Split into travis-build.sh, travis-install.sh,
	and travis-success.sh files.
	* .travis.yml (before_install, after_success, git): New mappings.
	(script): Change to travis-build.sh.
	(addons, install): Remove.
	(env): Remove matrix.
	(matrix): Replace exclude list with include list.

2016-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce HAVE_STRUCT_TCB_EXT_ARG macro.
	Check for "if HAVE_STRUCT_TCB_EXT_ARG" instead of
	"if defined LINUX_MIPSN32 || defined X32".

	* defs.h (HAVE_STRUCT_TCB_EXT_ARG): Define for LINUX_MIPSN32 || X32.
	(struct tcb): Check it instead of LINUX_MIPSN32 || X32.
	(RVAL_LUDECIMAL): Likewise.
	* io.c (print_lld_from_low_high_val): Likewise.
	* lseek.c (SYS_FUNC(lseek)): Likewise.
	* mem.c (SYS_FUNC(mmap)): Likewise.
	* syscall.c (trace_syscall_exiting): Likewise.
	* util.c (getllval): Likewise.

2016-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	btrfs: fix build with fresh linux/btrfs.h.
	Fix build with fresh <linux/btrfs.h> that provides a slightly different
	definition of struct btrfs_ioctl_defrag_range_args.

	* btrfs.c (btrfs_ioctl): Cast "len" member of
	struct btrfs_ioctl_defrag_range_args to uint64_t.
	* tests/btrfs.c (btrfs_print_defrag_range_args): Cast "start" and "len"
	members of struct btrfs_ioctl_defrag_range_args to uint64_t.

2016-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	btrfs: provide fallback definitions for BTRFS_IOC_QUOTA_RESCAN*
	<linux/btrfs.h> was introduced in linux v3.9-rc1 while some
	of btrfs ioctls were added later, e.g. BTRFS_IOC_QUOTA_RESCAN
	and BTRFS_IOC_QUOTA_RESCAN_STATUS in v3.10-rc2,
	or BTRFS_IOC_QUOTA_RESCAN_WAIT in v3.11-rc1.

	* btrfs.c [!BTRFS_IOC_QUOTA_RESCAN]
	(struct btrfs_ioctl_quota_rescan_args): New structure.
	(BTRFS_IOC_QUOTA_RESCAN, BTRFS_IOC_QUOTA_RESCAN_STATUS): New macros.
	[!BTRFS_IOC_QUOTA_RESCAN_WAIT] (BTRFS_IOC_QUOTA_RESCAN_WAIT): New macro.
	* tests/btrfs.c: Likewise.

	Reported-by: Li Er <phoooyb@gmail.com>

2016-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	configure.ac: fix checks for btrfs specific structures.
	* configure.ac (AC_CHECK_MEMBERS): Fix typo in the check for
	struct btrfs_ioctl_defrag_range_args.start and
	struct btrfs_ioctl_search_args_v2.buf_size.

2016-06-16  Elvira Khabirova  <lineprinter0@gmail.com>

	README: add system requirements and beautify the file.

2016-06-16  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add signal_receive.test.
	* tests/signal_receive.c: New file.
	* tests/signal_receive.test: New test.
	* tests/.gitignore: Add signal_receive.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add signal_receive.test.

	tests: add signal2name function to libtests.
	* tests/tests.h (signal2name): New prototype.
	* tests/signal2name.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.

2016-06-16  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: use AF_INET6 unconditionally.
	* net.c (SYS_FUNC(socket)): Do not check for AF_INET6 availability.

2016-06-16  Dmitry V. Levin  <ldv@altlinux.org>

	configure.ac: do not check for linux/in6.h.
	The last user of <linux/in6.h> was removed by commit v4.9-252-gf362a33.

	* configure.ac (AC_CHECK_HEADERS): Remove linux/in6.h.

2016-06-16  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: use AF_PACKET unconditionally.
	* net.c: Do not check for AF_PACKET availability.

	net.c: include <linux/if_packet.h> unconditionally.
	* configure.ac (AC_CHECK_HEADERS): Remove linux/if_packet.h.
	* net.c: Include <linux/if_packet.h> unconditionally.

	net.c: use ICMP_FILTER unconditionally.
	* net.c: Do not check for ICMP_FILTER availability.

	net.c: include <linux/icmp.h> unconditionally.
	* configure.ac (AC_CHECK_HEADERS): Remove linux/icmp.h.
	* net.c: Follow the example of tests/net-icmp_filter.c and include
	<linux/icmp.h> unconditionally.

2016-06-14  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: use AF_NETLINK unconditionally.
	* net.c: Do not check for AF_NETLINK availability.

	net.c: include <linux/netlink.h> unconditionally.
	* configure.ac (AC_CHECK_HEADERS): Remove linux/netlink.h.
	* net.c: Follow the example of socketutils.c and include
	<linux/netlink.h> unconditionally.

2016-06-14  Elvira Khabirova  <lineprinter0@gmail.com>

	Remove UNDEFINED_SCNO.
	Since UNDEFINED_SCNO is set if and only if !SCNO_IS_VALID
	and since tcp->s_ent can only be set to &sysent[tcp->scno]
	(or to &unknown, but only when !SCNO_IS_VALID), there is no need
	to check for UNDEFINED_SCNO before calling syscall_name(tcp->scno).

	* defs.h (UNDEFINED_SCNO): Remove.
	* syscall.c (get_scno, trace_syscall_entering, trace_syscall_exiting):
	Remove checks for UNDEFINED_SCNO.

2016-06-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests/attach-f-p.c: fix typo in comment.

2016-06-14  Elvira Khabirova  <lineprinter0@gmail.com>

	strace.c: fix style in function definition.
	* strace.c (kill_save_errno): Move the type of return value
	to another line.

	Turn on more compiler warnings.
	* configure.ac (gl_WARN_ADD): Add -Wempty-body, -Wformat-security,
	-Wignored-qualifiers, -Winit-self, -Wlogical-op,
	-Wmissing-parameter-type, -Wnested-externs, -Wold-style-declaration,
	-Wold-style-definition, -Wtype-limits.

	strace.c: fix a warning reported by -Wold-style-definition.
	* strace.c (usage): Add void to the list of function argments.

2016-06-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests/ioctl_evdev.c: fix typo in comment.

2016-06-14  Elvira Khabirova  <lineprinter0@gmail.com>

	Move printargs* functions to util.c.
	* syscall.c (printargs, printargs_u, printargs_d): Move ...
	* util.c: ... here.

	tests/xgetrlimit.c: fix a warning reported by -Wtype-limits.
	* tests/xgetrlimit.c (sprint_rlim): Explicitly cast constants
	to the type of argument.

2016-06-11  Dmitry V. Levin  <ldv@altlinux.org>

	Consistently use printaddr for printing addresses.
	* bjm.c (SYS_FUNC(init_module)): Use printaddr.
	* clone.c (SYS_FUNC(clone)): Likewise.
	* evdev.c (ff_effect_ioctl): Likewise.
	* mtd.c (decode_mtd_oob_buf): Likewise.
	* net.c (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg), SYS_FUNC(getsockopt)):
	Likewise.
	* print_sigevent.c (print_sigevent): Likewise.
	* printsiginfo.c (printsigval, print_si_info): Likewise.
	* signal.c (decode_new_sigaction): Likewise.
	* sysmips.c (SYS_FUNC(sysmips)): Likewise.
	* util.c (printpathn, printstr, umoven_or_printaddr): Likewise.
	* v4l2.c (print_v4l2_buffer, print_v4l2_framebuffer,
	umoven_or_printaddr_ignore_syserror): Likewise.
	* tests/net-icmp_filter.c (main): Update.

	Based on patch by Eugene Syromyatnikov <evgsyr@gmail.com>.

2016-06-10  Dmitry V. Levin  <ldv@altlinux.org>

	tests/attach-p-cmd-p.c: cleanup.
	* attach-p-cmd-p.c (handler): Move code ...
	(main): ... here.  Unblock SIGALRM only.
	Use alarm() instead of setitimer().
	Replace endless loop with a pause() call.
	Check that chdir() returns ENOENT.

	tests: enhance test coverage of SIGCHLD siginfo_t.
	* tests/siginfo.c: New file.
	* tests/siginfo.test: New test.
	* tests/wait.c: Remove.
	* tests/wait.expected: Remove.
	* tests/wait.test: Remove.
	* tests/.gitignore: Add siginfo, remove wait.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add siginfo.test, remove wait.test.
	(EXTRA_DIST): Remove wait.expected.

	tests: extend test coverage of waitid syscall.
	* tests/waitid.c: New file.
	* tests/waitid-v.c: Likewise.
	* tests/waitid.test: New test.
	* tests/waitid-v.test: Likewise.
	* tests/.gitignore: Add waitid and waitid-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add waitid.test and waitid-v.test.

	tests: extend test coverage of wait4 syscall.
	* tests/wait4.c: New file.
	* tests/wait4-v.c: Likewise.
	* tests/wait4.test: New test.
	* tests/wait4-v.test: Likewise.
	* tests/.gitignore: Add wait4 and wait4-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add wait4.test and wait4-v.test.

	tests: add widen_to_ull macro to tests.h.
	* tests.h (widen_to_ull): New macro, copied from defs.h

	Fix sign extension issues in the parser of struct rusage.
	* printrusage.c (printrusage): Do not cast members of struct rusage
	to type long, use widen_to_ull instead.

2016-06-09  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of waitpid syscall.
	* tests/waitpid.c: New file.
	* tests/waitpid.test: New test.
	* tests/.gitignore: Add waitpid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add waitpid.test.

2016-06-09  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add strace-E.test.
	* tests/strace-E.expected: New file.
	* tests/strace-E.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.
	(EXTRA_DIST): Add strace-E.expected.

2016-06-08  Dmitry V. Levin  <ldv@altlinux.org>

	strace.spec.in: enable libunwind on more platforms.
	* strace.spec.in: Add libunwind-devel to BuildRequires for RHEL8 family.

2016-06-08  Dmitry V. Levin  <ldv@altlinux.org>

	make-dist: generate strace-*.tar.gz, strace.dsc, and strace.spec.
	Change make-dist to generate strace-*.tar.gz, strace.dsc,
	and strace.spec in addition to strace-*.tar.xz.

	* configure.ac (AM_INIT_AUTOMAKE): Remove no-dist-gzip.
	* make-dsc: New file.
	* make-dist: Use it.
	* .gitignore: Add strace-*.tar.gz, strace.dsc, and strace.spec.

2016-06-08  Dmitry V. Levin  <ldv@altlinux.org>

	Parametrize debian/changelog.
	* configure.ac (CHANGELOGTIME): Rename to RPM_CHANGELOGTIME.
	(DEB_CHANGELOGTIME): New variable.
	(AC_CONFIG_FILES): Add debian/changelog.
	* strace.spec.in: Rename CHANGELOGTIME to RPM_CHANGELOGTIME.
	* debian/changelog: Rename to ...
	* debian/changelog.in: ... this file.  Add parametrized entry.
	* debian/.gitignore: New file.

	git-version-gen: replace '-' with '.' in generated version.
	* git-version-gen: Replace '-' with '.' so version conforms to policies
	* configure.ac (SPEC_VERSION): Remove.
	* strace.spec.in: Replace SPEC_VERSION with PACKAGE_VERSION.
	Remove %srcname.

2016-06-07  Dmitry V. Levin  <ldv@altlinux.org>

	Parametrize strace.spec.
	* configure.ac (SPEC_VERSION, CHANGELOGTIME): Define.
	(AC_CONFIG_FILES): Add strace.spec.
	* strace.spec: Rename to ...
	* strace.spec.in: ... this file.  Parametrize Version, srcname,
	and the last %changelog entry.  Initialize .tarball-version file.

	strace.spec: adopt for OBS.
	* strace.spec: Parametrize libunwind-devel BRs, BuildRoot, and %defattr.

2016-06-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: remove obsolete strace-f.test.
	strace-f.test is too inexact while fork-f.test does the right thing.

	* tests/strace-f.test: Remove.
	* tests/Makefile.am (MISC_TESTS): Remove it.
	* strace.spec (BuildRequires): Remove time.

2016-06-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: always distribute strace-k.test.
	Fix distribution of tests/strace-k.test file when configured
	without libunwind.

	* tests/Makefile.am (EXTRA_DIST): Add strace-k.test.

2016-06-07  Dmitry V. Levin  <ldv@altlinux.org>

	make-dist: skip news-check for non-releases.
	* make-dist: Run news-check only when the commit being built
	matches a release tag.

2016-06-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of setrlimit, getrlimit, and ugetrlimit syscalls.
	* tests/getrlimit.c: New file.
	* tests/setrlimit.c: Likewise.
	* tests/ugetrlimit.c: Likewise.
	* tests/xgetrlimit.c: Likewise.
	* tests/getrlimit.test: New test.
	* tests/setrlimit.test: Likewise.
	* tests/ugetrlimit.test: Likewise.
	* tests/.gitignore: Add getrlimit, setrlimit, and ugetrlimit.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add getrlimit.test, setrlimit.test,
	and ugetrlimit.test.
	(EXTRA_DIST): Add xgetrlimit.c.

	tests: check decoding of prlimit64 syscall.
	* tests/prlimit64.c: New file.
	* tests/prlimit64.test: New test.
	* tests/.gitignore: Add prlimit64.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add prlimit64.test.

	Fix decoding of pid_t argument of prlimit64 syscall.
	* resource.c (SYS_FUNC(prlimit64)): Print pid_t syscall
	argument using %d format.

2016-06-06  Dmitry V. Levin  <ldv@altlinux.org>

	Do not check for old sysctl enums.
	Assume that sysctl enums defined since linux v2.6 are always defined,
	with a signle exception: check for CTL_PROC which definition was removed
	in v2.6.18 and restored later in v2.6.23.

	* configure.ac (AC_CHECK_DECLS): Remove old constants.
	* xlat/sysctl_kern.in: Mark constants older than KERN_PRINTK_RATELIMIT
	as unconditional.
	* xlat/sysctl_net.in: Mark constants older than NET_LLC
	as unconditional.
	* xlat/sysctl_net_core.in: Mark constants older than NET_CORE_BUDGET
	as unconditional.
	* xlat/sysctl_net_ipv4.in: Mark constants older than
	NET_IPV4_IGMP_MAX_MSF as unconditional.
	* xlat/sysctl_net_ipv4_conf.in: Mark constants older than
	NET_IPV4_CONF_FORCE_IGMP_VERSION as unconditional.
	* xlat/sysctl_net_ipv4_route.in: Mark constants older than
	NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS as unconditional.
	* xlat/sysctl_net_ipv6.in: Mark constants older than
	NET_IPV6_MLD_MAX_MSF as unconditional.
	* xlat/sysctl_net_ipv6_route.in: Mark constants older than
	NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS as unconditional.
	* xlat/sysctl_net_unix.in: Mark all constants as unconditional.
	* xlat/sysctl_root.in: Mark constants older than CTL_ARLAN
	as unconditional.
	* xlat/sysctl_vm.in: Mark constants older than VM_MAX_MAP_COUNT
	as unconditional.

2016-06-06  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: extend syntax.
	* xlat/gen.sh: Implement #conditional directive that turns on
	preprocessor checks turned off earlier by #unconditional directive.

2016-06-06  Elvira Khabirova  <lineprinter0@gmail.com>

	mpers.awk: remove unnecessary type attribute retrieval.
	* mpers.awk (what_is): Do not retrieve "type" attribute
	for "enumeration_type".

	tests/ptrace.c: fix fork() return value check.
	* tests/ptrace.c (test_peeksiginfo): Explicitly cast fork() return value
	to pid_t.

	.gitignore: add missing files that should be ignored.
	* .gitignore: Add ioctl_redefs[12].h and libstrace.a.

2016-06-06  Dmitry V. Levin  <ldv@altlinux.org>

	debian: sync with the package.
	* debian/control (Build-Depends) [amd64]: Remove libunwind-dev.
	* debian/changelog: Sync with 4.12-3.
	* debian/rules: Likewise.

2016-06-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests/strace-S.test: fix testing 64-bit strace using a 32-bit userspace.
	* tests/strace-S.test: Measure wall clock time instead of system time.
	Use local "./readv" instead of system "date" as a sample executable.

	Reported-by: Steve McIntyre <steve@einval.com>

2016-06-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests/strace-S.test: enhance error diagnostics.
	* tests/strace-S.test: If strace output does not meet expectations,
	print the output.

2016-06-02  Dmitry V. Levin  <ldv@altlinux.org>

	.gitignore: sort the list of ignored patterns.
	* .gitignore: Sort.

2016-06-01  Dmitry V. Levin  <ldv@altlinux.org>

	maint: post-release administrivia.
	* NEWS: Add header line for the next release.

2016-05-31  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.12 release.
	* NEWS: Update for 4.12 release.
	* debian/changelog: 4.12-1.
	* strace.spec: 4.12-1.

	Sync strace.spec and debian/changelog with packages.
	* debian/changelog: Sync with 4.11-1.
	* strace.spec: Sync with 4.11.0.163.9720-2.

2016-05-30  Dmitry V. Levin  <ldv@altlinux.org>

	Mpersify hdio.c.
	* defs.h (hdio_ioctl): Remove.
	* hdio.c: Mpersify struct hd_geometry.
	(hdio_ioctl): Mpersify.

2016-05-29  Dmitry V. Levin  <ldv@altlinux.org>

	loop.c: decode LOOP_SET_DIRECT_IO.
	* loop.c (loop_ioctl) [LOOP_SET_DIRECT_IO] : Handle LOOP_SET_DIRECT_IO.

	loop.c: fix printing of arrays.
	* loop.c (decode_loop_info): Use square brackets to print
	struct loop_info.lo_init and struct loop_info.reserved arrays.
	(decode_loop_info64): Use square brackets to print
	struct loop_info64.lo_init array.

	loop.c: fix printing of structure members' names.
	* loop.c (decode_loop_info, decode_loop_info64): Do not strip "lo_"
	prefix from printed names.

	loop.c: optimize decoding of paired ioctls.
	* loop.c (loop_ioctl): Optimize decoding of LOOP_[GS]ET_STATUS
	and LOOP_[GS]ET_STATUS64 ioctl pairs.

2016-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests/ioctl_evdev.c: check EVIOCGUNIQ decoding.
	* tests/ioctl_evdev.c (main): Check EVIOCGUNIQ(0) decoding.

	tests/ioctl_mtd.c: fix build with musl.
	* tests/ioctl_mtd.c: Include <linux/ioctl.h>.

	tests: check decoding of 'M' type ioctls.
	* tests/ioctl_mtd.c: New file.
	* tests/ioctl_mtd.test: New test.
	* tests/.gitignore: Add ioctl_mtd.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioctl_mtd.test.

	Mpersify mtd.c.
	* defs.h (mtd_ioctl): Remove.
	* mtd.c: Mpersify struct mtd_oob_buf and ioctl numbers.
	(mtd_ioctl): Mpersify.

	mtd.c: refactor.
	* mtd.c (mtd_ioctl): Move parsers of structures to separate functions.

	Move parser of UBI_* ioctls to a separate file.
	* mtd.c (ubi_ioctl): Move to ...
	* ubi.c: ... new file.
	* Makefile.am (strace_SOURCES): Add it.

	tests: check decoding of EVIOC* ioctls.
	* tests/ioctl_evdev.c: New file.
	* tests/ioctl_evdev-v.c: Likewise.
	* tests/ioctl_evdev.test: New test.
	* tests/ioctl_evdev-v.test: Likewise.
	* tests/.gitignore: Add ioctl_evdev and ioctl_evdev-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioctl_evdev.test and ioctl_evdev-v.test.

	Mpersify EVIOC* ioctl parser.
	* defs.h (evdev_abs): New xlat prototype.
	(evdev_ioctl): Remove.
	* evdev.c: Do not include "xlat/evdev_abs.h".
	Mpersify struct ff_effect and ioctl numbers.
	(evdev_ioctl): Mpersify.
	* NEWS: Mention this enhancement.

	evdev.c: fix printing of unrecognized event type passed to EVIOCGBIT.
	* evdev.c (bit_ioctl): If event type is not unrecognized,
	print the argument as an address.

	evdev.c: fix printing of EV_PWR's argument.
	* evdev.c (bit_ioctl): Fix printing of comma before EV_PWR's argument.

	evdev.c: fix indentation.
	* evdev.c: Fix indentation of print formats.

	evdev.c: fix decoding of EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ.
	* evdev.c (evdev_read_ioctl): Fix printing of the string returned
	in response to EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ requests.

	evdev.c: fix EVIOCGVERSION decoding.
	* evdev.c (evdev_read_ioctl): Print EVIOCGVERSION's argument
	using #x format.

	evdev.c: fix EVIOCGMTSLOTS decoding.
	* evdev.c (mtslots_ioctl): Use umove_or_printaddr.

	evdev.c: fix bitset decoding.
	* evdev.c (decode_bitset): Use umove_or_printaddr.

	evdev.c: fix decoding of struct input_id.
	* evdev.c (getid_ioctl): Use umove_or_printaddr.

	evdev.c: fix decoding of struct input_keymap_entry.
	* evdev.c (keycode_V2_ioctl): Use umove_or_printaddr.

	evdev.c: fix decoding of EVIOCGKEYCODE/EVIOCSKEYCODE.
	* evdev.c (keycode_ioctl): Use umove_or_printaddr.

	evdev.c: fix decoding of struct input_absinfo.
	* evdev.c (abs_ioctl): Use umove_or_printaddr.

	evdev.c: fix decoding of struct ff_effect.
	* evdev.c (ff_effect_ioctl): Use umove_or_printaddr.
	Fix printing of struct ff_effect.u member names.

	evdev.c: fix printing of struct ff_envelope.fade_level.
	* evdev.c (decode_envelope): Print struct ff_envelope.fade_level
	using #x format.

	evdev.c: fix decoding of EVIOCGRAB and EVIOCREVOKE.
	* evdev.c (evdev_write_ioctl): Print argument of EVIOCGRAB
	and EVIOCREVOKE as unsigned long.

	evdev.c: fix EVIOCRMFF decoding.
	* evdev.c (evdev_write_ioctl): Print EVIOCRMFF's argument as int.

	evdev.c: move handling of EVIOCGBIT to a separate function.
	* evdev.c (evdev_read_ioctl): Move EVIOCGBIT handling to ...
	(bit_ioctl): ... new function.

2016-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	evdev.c: reorder ioctl command checks.
	Change the order of ioctl command cheks to match the kernel:
	1st, check for fixed-number fixed-length commands,
	2nd, check for fixed-number variable-length commands,
	3rd, check for multi-number fixed-length commands,
	4thm check for multi-number variable-length commands.

	* evdev.c (evdev_read_ioctl, evdev_write_ioctl): Reorder
	ioctl command checks.

2016-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	evdev.c: decode all directions except _IOC_READ on entering syscall.
	* evdev.c (evdev_write_ioctl): Remove exiting check.
	(evdev_read_ioctl): Move entering check ...
	(evdev_ioctl): ... here.  Add RVAL_DECODED to return code in _IOC_WRITE
	and default cases.

	evdev.c: fix indentation of preprocessor directives.
	* evdev.c: Fix indentation of preprocessor directives.
	Move inclusion of <linux/ioctl.h> into [HAVE_LINUX_INPUT_H].

2016-05-28  Jeff Mahoney  <jeffm@suse.com>

	file_ioctl.c: print first two extents for FIDEDUPERANGE in abbrev mode.
	* file_ioctl.c (file_ioctl, print_file_dedupe_range_info): Print first
	two elements of info array in abbrev mode.
	* tests/btrfs.c (btrfs_test_extent_same_ioctl): Handle newly
	printed elements.

2016-05-27  Dmitry V. Levin  <ldv@altlinux.org>

	ioctl.c: fix typo in decoding of EVIOCSABS's parameter.
	* ioctl.c (evdev_decode_number): Fix typo in printxval default value.

2016-05-27  Jeff Mahoney  <jeffm@suse.com>

	tests: check decoding of btrfs RDWR ioctls returned data.
	* tests/btrfs-vw.test: New file.
	* tests/btrfs-w.test: New file.
	* tests/Makefile.am (DECODER_TESTS): Add them.

	tests/btrfs.c: fix live btrfs_test_search_ioctls output.
	* tests/btrfs.c (btrfs_test_search_ioctls): Use print_tree_search_buf
	for BTRFS_IOC_TREE_SEARCH and fix missing whitespace.

	btrfs.c: don't use print_array in btrfs_print_tree_search.
	* btrfs.c (btrfs_print_tree_search): Don't use print_array.  The buffer
	represents a series of variable sized records, not an array.

	btrfs.c: fix print_array usage in btrfs_print_logical_ino_container.
	* btrfs.c: (btrfs_print_logical_ino_container) Fix the element count
	to reflect the number of records rather than the number of items.

2016-05-26  Jeff Mahoney  <jeffm@suse.com>

	tests/btrfs.c: fix btrfs-v for BTRFS_IOC_TREE_SEARCH.
	* tests/btrfs.c (btrfs_test_send_ioctl): Assign key_reference
	to search_args for BTRFS_IOC_TREE_SEARCH ioctl tests.

2016-05-26  Fabien Siron  <fabien.siron@epita.fr>

	Fix -yy documentation.
	* strace.c (usage): Fix description of -yy option.
	* strace.1: Likewise.

2016-05-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests/ioctl_block.c: tweak magic constants to make the test more reliable
	* tests/ioctl_block.c (main): Change bad pointer to make
	its lower 32-bit part closer to -1U.

	tests/btrfs.c: check basic decoding of read-only ioctls.
	* tests/btrfs.c (btrfs_test_read_ioctls): New function.
	(main): Use it.

	tests: check decoding of BLK* ioctls.
	* configure.ac (AC_CHECK_TYPES): Add struct blk_user_trace_setup.
	* tests/ioctl_block.c: New file.
	* tests/ioctl_block.test: New test.
	* tests/.gitignore: Add ioctl_block.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioctl_block.test.

	Mpersify BLK* ioctl parser.
	* defs.h (block_ioctl): Remove.
	* block.c: Mpersify struct blk_user_trace_setup,
	struct blkpg_ioctl_arg, struct blkpg_partition, and ioctl numbers.
	(block_ioctl): Mpersify.
	* NEWS: Mention this enhancement.

	block.c: optimize decoding of paired ioctls.
	* block.c (block_ioctl): Optimize decoding of commands that return
	a signed int.

	block.c: fix printing of uint64_t pairs.
	* block.c (block_ioctl): Print uint64_t values using PRIu64 format.

	block.c: fix printing of struct blk_user_trace_setup.
	* block.c (block_ioctl): Fix printing of comma before
	struct blk_user_trace_setup.name on exiting syscall.

	Move parser of 'X' type ioctls to a separate file.
	* fs_x_ioctl.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* block.c: (block_ioctl): Move parser of FITRIM, FIFREEZE, and FITHAW
	to fs_x_ioctl.c.
	* defs.h (fs_x_ioctl): New prototype.
	* ioctl.c (ioctl_decode): Call fs_x_ioctl for ioctl type 'X'.

	Move parser of HDIO_* ioctls to a separate file.
	* hdio.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* block.c: Do not include <linux/hdreg.h>.
	(block_ioctl): Move parser of HDIO_GETGEO to hdio.c.
	* defs.h (hdio_ioctl): New prototype.
	* ioctl.c (ioctl_decode): Call hdio_ioctl for ioctl type 0x03.

	Fix explicit casts of signed integer types to unsigned long long.
	* defs.h (widen_to_ull): New macro.
	* dirent.c (print_old_dirent, SYS_FUNC(getdents)): Use it in place
	of explicit casts to unsigned long long.
	* io.c (print_lld_from_low_high_val): Likewise.
	* lseek.c (SYS_FUNC(llseek)): Likewise.
	* printsiginfo.c (print_si_info): Likewise.
	* printstat.h (DO_PRINTSTAT): Likewise.
	* sysinfo.c (SYS_FUNC(sysinfo)): Likewise.
	* times.c (SYS_FUNC(times)): Likewise.
	* fetch_struct_statfs.c (ASSIGN_NUMBER): Remove.
	(fetch_struct_statfs, fetch_struct_statfs64): Replace ASSIGN_NUMBER
	with widen_to_ull.

	scsi.c: print __u64 types using PRI__u64 format.
	* scsi.c (print_sg_io_v4_req, print_sg_io_v4_res): Remove explicit casts
	to unsigned long long, print fields of type __u64 using PRI__u64 format.

2016-05-25  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of RTC_* ioctls.
	* configure.ac (AC_CHECK_FUNCS): Add ioctl_rtc.
	* tests/ioctl_rtc.c: New file.
	* tests/ioctl_rtc-v.c: Likewise.
	* tests/ioctl_rtc.test: New test.
	* tests/ioctl_rtc-v.test: Likewise.
	* tests/.gitignore: Add ioctl_rtc and ioctl_rtc-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioctl_rtc.test and ioctl_rtc-v.test.

	Mpersify RTC_* ioctl parser.
	* defs.h (rtc_ioctl): Remove.
	* rtc.c: Mpersify struct rtc_pll_info and ioctl numbers.
	(rtc_ioctl): Mpersify.
	* NEWS: Mention this enhancement.

	rtc.c: fix decoding of struct rtc_wkalrm.
	* rtc.c (decode_rtc_wkalrm): Print field name of struct rtc_wkalrm.time.

	file_ioctl.c: print file descriptors using printfd.
	* file_ioctl.c (print_file_dedupe_range_info): Print
	struct file_dedupe_range_info.dest_fd using printfd.
	(file_ioctl): Print struct file_clone_range.src_fd using printfd.

	rtc.c: do not print argument of ioctls that have no arguments.
	* rtc.c (rtc_ioctl): Do not print argument of RTC_{A,U,P,W}IE_{ON,OFF}
	and RTC_VL_CLR ioctls.

	rtc.c: decode RTC_PLL_GET and RTC_PLL_SET.
	* rtc.c (rtc_ioctl): Decode RTC_PLL_GET and RTC_PLL_SET

	rtc.c: optimize decoding of paired ioctls.
	* rtc.c (rtc_ioctl): Optimize decoding of RTC_ALM_READ/RTC_ALM_SET,
	RTC_RD_TIME/RTC_SET_TIME, and RTC_WKALM_RD/RTC_WKALM_SET ioctl pairs.

	block.c: handle BLKDAXGET.
	* block.c [!BLKDAXGET] (BLKDAXGET): Define.
	(block_ioctl): Handle it.

	tests: check decoding of mount syscall.
	* tests/mount.c: New file.
	* tests/mount.test: New test.
	* tests/.gitignore: Add mount.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add mount.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

	tests/vhangup.c: diassociate from the controlling terminal first.
	* tests/vhangup.c (main): Call setsid before vhangup.

2016-05-24  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add vhangup.test.
	* tests/vhangup.c: New file.
	* tests/vhangup.test: New test.
	* tests/.gitignore: Add vhangup.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add vhangup.test.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

	NEWS: Prepare for 4.12 release.

2016-05-24  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	tests/btrfs.c: fix build on x32.
	* tests/btrfs.c (btrfs_test_ino_path_ioctls): Fix printing of st_ino.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

	tests/btrfs.c: fix build with u64 based BTRFS_IOC_DEFAULT_SUBVOL.
	* tests/btrfs.c: Fix build on systems where BTRFS_IOC_DEFAULT_SUBVOL
	is defined using unexported type "u64".

	btrfs.c: fix build on systems without BTRFS_IOC_FILE_EXTENT_SAME.
	* btrfs.c (btrfs_ioctl): Skip BTRFS_IOC_FILE_EXTENT_SAME case
	if this constant is not defined.
	* tests/btrfs.c (btrfs_test_extent_same_ioctl): Skip this part
	of the test if BTRFS_IOC_FILE_EXTENT_SAME is not defined.

	tests/btrfs.c: fix printing struct btrfs_ioctl_clone_range_args.
	* tests/btrfs.c (btrfs_test_clone_ioctls): Print __u64 members
	of struct btrfs_ioctl_clone_range_args using PRI__u64 format.

	tests/btrfs.c: tweak magic constants to make the test more reliable.
	* tests/btrfs.c (btrfs_test_sync_ioctls): Change u64val
	to 0xdeadbeefbadc0ded.
	(btrfs_test_subvol_ioctls): Likewise.  Change bad_pointer
	to make their lower 32-bit parts closer to -1U.

	btrfs.c: print file descriptors using printfd.
	* btrfs.c (btrfs_ioctl): Print struct btrfs_ioctl_send_args.send_fd,
	struct btrfs_ioctl_vol_args.fd, and struct btrfs_ioctl_vol_args_v2.fd
	using printfd.
	* tests/btrfs.c (btrfs_print_vol_args_v2, btrfs_test_subvol_ioctls,
	btrfs_test_device_ioctls, btrfs_test_clone_ioctls,
	btrfs_test_send_ioctl): Update.

	tests/btrfs.c: do not print errno in case of fs type mismatch.
	* tests/btrfs.c (main): Use error_msg_and_fail instead of
	perror_msg_and_fail when the fs type of the given directory
	is not BTRFS_SUPER_MAGIC.

	tests/btrfs.c: fix indentation.
	* tests/btrfs.c: Fix indentation of preprocessor directives
	and function prototypes.

	tests/btrfs.c: sort included headers.
	* tests/btrfs.c: Sort included headers.

	tests/btrfs.c: do not use alloca.
	* tests/btrfs.c: Don't include <alloca.h>.
	(btrfs_test_subvol_ioctls): Allocate
	struct btrfs_ioctl_vol_args_v2.qgroup_inherit using tail_alloc.

	tests/btrfs.c: fix build on systems without <linux/btrfs.h> or <linux/fiemap.h>
	* tests/btrfs.c: Include "tests.h" first.
	Skip the test if [!HAVE_LINUX_BTRFS_H].  Skip parts of the test
	that use struct fiemap if [!HAVE_LINUX_FIEMAP_H].

2016-05-24  Jeff Mahoney  <jeffm@suse.com>

	tests: add testing for btrfs ioctls.
	* tests/btrfs.c: New file.
	* tests/btrfs.test: New test.
	* tests/btrfs-v.test: Likewise.
	* tests/.gitignore: Add btrfs.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add btrfs.test and btrfs-v.test.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

	tests/file_ioctl.c: use tail_alloc.
	* tests/file_ioctl.c (main): Allocate struct fiemap using tail_alloc.

	tests/file_ioctl.c: fix build on systems without <linux/fiemap.h>
	* tests/file_ioctl.c: Include "tests.h" first.
	Skip the test if [!HAVE_LINUX_FIEMAP_H].

2016-05-24  Jeff Mahoney  <jeffm@suse.com>

	tests: add testing for FS_IOC_FIEMAP.
	This is limited to FIEMAP.  FICLONE* and FIDEDUPERANGE originated in
	btrfs and will be tested there.

	* tests/file_ioctl.c: New file.
	* tests/file_ioctl.test: New test.
	* tests/.gitignore: Add file_ioctl.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add file_ioctl.test.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

	Mpersify btrfs.c.
	* btrfs.c: Mpersify 3 arch-specific structures
	and corresponding ioctl numbers.
	(btrfs_ioctl): Mpersify.
	* defs.h (btrfs_ioctl): Remove.

	btrfs.c: use print_array.
	* btrfs.c (print_btrfs_data_container_logical_ino,
	print_btrfs_data_container_ino_path, print_uint64,
	print_btrfs_ioctl_search_header, print_objectid_callback,
	print_btrfs_ioctl_space_info): New functions.
	(btrfs_print_logical_ino_container, btrfs_print_ino_path_container):
	Rewrite printers of struct btrfs_data_container.val array
	using print_array.
	(btrfs_print_qgroup_inherit): Rewrite printer of
	struct btrfs_qgroup_inherit.qgroups array using print_array.
	(btrfs_print_tree_search): Rewrite printer of
	struct btrfs_ioctl_search_header array using print_array.
	(btrfs_ioctl): Rewrite printer of
	struct btrfs_ioctl_send_args.clone_sources and
	struct btrfs_ioctl_space_args.spaces using print_array.

	btrfs.c: simplify BTRFS_IOC_GET_FSLABEL parser.
	* btrfs.c (btrfs_ioctl): Share code of parser of BTRFS_IOC_SET_FSLABEL
	with parser of BTRFS_IOC_GET_FSLABEL only on BTRFS_IOC_GET_FSLABEL's
	entering.

	btrfs.c: fix BTRFS_IOC_TREE_SEARCH_V2 output.
	* btrfs.c (btrfs_ioctl): Fix BTRFS_IOC_TREE_SEARCH_V2 output
	in case of EOVERFLOW and failed umove.

	btrfs.c: cleanup use of tcp->auxstr.
	* btrfs.c (btrfs_ioctl): Reset tcp->auxstr only if it is set.

	btrfs.c: cleanup struct btrfs_ioctl_get_dev_stats.nr_items check.
	* btrfs.c (btrfs_ioctl): Cleanup check of iterator of
	btrfs_ioctl_get_dev_stats.values array.

	btrfs.c: do not use BTRFS_SUBVOL_NAME_MAX.
	* btrfs.c [BTRFS_SUBVOL_NAME_MAX]: Remove.
	(btrfs_ioctl): Use sizeof(struct btrfs_ioctl_vol_args_v2.name)
	instead of BTRFS_SUBVOL_NAME_MAX + 1.

	btrfs.c: mark some function arguments as const.
	* btrfs.c (btrfs_print_balance_args, btrfs_print_features,
	btrfs_print_qgroup_limit, btrfs_print_data_container_header,
	btrfs_print_logical_ino_container, btrfs_print_ino_path_container,
	btrfs_print_qgroup_inherit): Mark some function arguments as const.

	btrfs.c: use umove instead of umoven.
	* btrfs.c: Use umove instead of umoven and umove_or_printaddr
	instead of umoven_or_printaddr.

	btrfs.c: remove unused variable.
	* btrfs.c (btrfs_ioctl): Remove "ret" variable.

	btrfs.c: use printxval/printxval64 instead of printxvals.
	* btrfs.c (btrfs_ioctl): Do not call printxvals directly,
	use printxval/printxval64 wrappers that do the right thing.

	btrfs.c: fix indentation.
	* btrfs.c: Fix indentation of preprocessor directives and print formats.

	xlat/btrfs_dev_stats_values.in: cleanup.
	* xlat/btrfs_dev_stats_values.in: Remove HAVE_DECL_* defines,
	use #unconditional instead.

	file_ioctl.c: use print_array.
	* file_ioctl.c (file_ioctl): Rewrite printers of
	struct file_dedupe_range_info and struct fiemap_extent arrays
	using print_array.

	file_ioctl.c: fix indentation.
	* file_ioctl.c: Fix indentation of preprocessor directives
	and print formats.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

	file_ioctl.c: include <linux/ioctl.h> instead of <sys/ioctl.h>
	Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings
	no benefits for this parser.

	* file_ioctl.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

	file_ioctl.c: fix build on systems without <linux/fiemap.h>
	* configure.ac (AC_CHECK_HEADERS): Add linux/fiemap.h.
	* file_ioctl.c: Do not include <linux/fiemap.h> and xlat/fiemap_*.h
	if [!HAVE_LINUX_FIEMAP_H].
	(file_ioctl): Do not parse FS_IOC_FIEMAP if [!HAVE_LINUX_FIEMAP_H].

	ioctl.c: fix build.
	* ioctl.c (ioctl_decode): Move definition of "ret" variable
	to [ALPHA || POWERPC] case.
	[ALPHA || POWERPC]: Fix syntax error.

2016-05-24  Jeff Mahoney  <jeffm@suse.com>

	ioctl: add decoding for FS_IOC_FIEMAP.
	* file_ioctl.c: Include <linux/fiemap.h>, "xlat/fiemap_flags.h",
	and "xlat/fiemap_extent_flags.h".
	(file_ioctl): Handle FS_IOC_FIEMAP.
	* ioctl.c (ioctl_decode): Use file_ioctl for decoding 'f' code ioctls.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

	Add xlat/fiemap_flags.in and xlat/fiemap_extent_flags.in.
	* xlat/fiemap_flags.in: New file.
	* xlat/fiemap_extent_flags.in: Likewise.

2016-05-24  Jeff Mahoney  <jeffm@suse.com>

	ioctl: add decoding support for btrfs ioctls.
	* btrfs.c: New file.
	* file_ioctl.c: Likewise.
	* Makefile.am (strace_SOURCES): Add them.
	* configure.ac (AC_CHECK_HEADERS): Add linux/btrfs.h.
	(AC_CHECK_MEMBERS): Add struct btrfs_ioctl_feature_flags.compat_flags,
	struct btrfs_ioctl_fs_info_args.nodesize,
	struct btrfs_ioctl_defrag_range_args.start,
	and struct btrfs_ioctl_search_args_v2.buf_size.
	(AC_CHECK_DECLS): Add BTRFS_COMPRESS_* enums.
	* defs.h (btrfs_ioctl, file_ioctl): New prototypes.
	* ioctl.c (ioctl_decode) [HAVE_LINUX_BTRFS_H]: Use btrfs_ioctl.
	* xlat/btrfs_balance_args.in: New file.
	* xlat/btrfs_balance_ctl_cmds.in: Likewise.
	* xlat/btrfs_balance_flags.in: Likewise.
	* xlat/btrfs_balance_state.in: Likewise.
	* xlat/btrfs_compress_types.in: Likewise.
	* xlat/btrfs_defrag_flags.in: Likewise.
	* xlat/btrfs_dev_replace_cmds.in: Likewise.
	* xlat/btrfs_dev_replace_results.in: Likewise.
	* xlat/btrfs_dev_replace_state.in: Likewise.
	* xlat/btrfs_dev_stats_flags.in: Likewise.
	* xlat/btrfs_dev_stats_values.in: Likewise.
	* xlat/btrfs_features_compat.in: Likewise.
	* xlat/btrfs_features_compat_ro.in: Likewise.
	* xlat/btrfs_features_incompat.in: Likewise.
	* xlat/btrfs_key_types.in: Likewise.
	* xlat/btrfs_qgroup_ctl_cmds.in: Likewise.
	* xlat/btrfs_qgroup_inherit_flags.in: Likewise.
	* xlat/btrfs_qgroup_limit_flags.in: Likewise.
	* xlat/btrfs_qgroup_status_flags.in: Likewise.
	* xlat/btrfs_scrub_flags.in: Likewise.
	* xlat/btrfs_send_flags.in: Likewise.
	* xlat/btrfs_snap_flags_v2.in: Likewise.
	* xlat/btrfs_space_info_flags.in: Likewise.
	* xlat/btrfs_tree_objectids.in: Likewise.

2016-05-24  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	x32: update ioctl entries from linux 4.6.
	* linux/x32/ioctls_inc0.h: Update from linux v4.6 using ioctls_gen.sh.

2016-05-24  Dmitry V. Levin  <ldv@altlinux.org>

	tests/attach-f-p.c: sleep a bit more to let the tracer catch up.
	On noticeably lagging systems, the parent process may invoke its chdir
	call before the tracer gets notified about completion of its last child
	process.  Add extra sleep in the parent process to win the race.

	* tests/attach-f-p.c (main): Change timerid into a static array.
	Arm a timer in the parent process and wait for it.

2016-05-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests/attach-p-cmd-cmd.c: fix potential errno clobbering.
	* tests/attach-p-cmd-cmd.c (main): Call getpid before chdir.

	tests/net-yy-netlink.c: robustify against libc specific issues.
	* tests/net-yy-netlink.c (main): Use getsockname instead of recvmsg
	as the latter has notible implementation differences that make
	the test unreliable.

	tests/net-yy-netlink.c: robustify against os specific issues.
	* tests/net-yy-netlink.c (main): Pass a pointer to a real struct msghdr
	as NULL doesn't work well on some systems.

	tests/net-yy-{inet,netlink}.test: cleanup.
	* tests/net-yy-inet.test: Do not pass arguments to net-yy-inet
	as the latter does not accept them.
	* tests/net-yy-netlink.test: Do not pass arguments to net-yy-netlink
	as the latter does not accept them.

2016-05-22  Jeff Mahoney  <jeffm@suse.com>

	tests: define PRI__[dux]64 macros to print __s64 and __u64 values.
	Rather than cast every __u64 or __s64 before printing,
	define printing helpers for those types directly.

	This complements commit 1f3482bedad505a41caf1d61b3a4e7e09a2f4330.

	* tests/tests.h (PRI__d64, PRI__u64, PRI__x64): New macros.

2016-05-22  Dmitry V. Levin  <ldv@altlinux.org>

	tests: remove manual creation of memory mapping holes.
	We used to call tail_alloc(1) to create memory mapping holes around
	regular tail_alloc allocations.  This is no longer needed since regular
	tail_alloc allocations create additional memory mapping holes.

	* tests/clock_adjtime.c (main): Remove creation of memory mapping holes
	using tail_alloc(1).
	* tests/futimesat.c (main): Likewise.
	* tests/get_mempolicy.c (print_nodes, main): Likewise.
	* tests/getgroups.c (main): Likewise.
	* tests/getresugid.c (main): Likewise.
	* tests/ioctl_uffdio.c (main): Likewise.
	* tests/ioctl_v4l2.c (main): Likewise.
	* tests/move_pages.c (main): Likewise.
	* tests/net-icmp_filter.c (main): Likewise.
	* tests/ptrace.c (test_peeksiginfo, main): Likewise.
	* tests/pwritev.c (main): Likewise.
	* tests/set_mempolicy.c (print_nodes): Likewise.
	* tests/setgroups.c (main): Likewise.
	* tests/umovestr3.c (main): Likewise.
	* tests/utimes.c (main): Likewise.
	* tests/xattr.c (main): Likewise.

2016-05-22  Dmitry V. Levin  <ldv@altlinux.org>

	tests: make tail_alloc create additional memory mapping holes.
	* tests/tail_alloc.c (tail_alloc): Create additional memory mapping
	holes before and after the allocated memory.

2016-05-21  Dmitry V. Levin  <ldv@altlinux.org>

	mpers: add support of conditionally compiled printers.
	We used to declare and define all printers marked with
	MPERS_PRINTER_DECL, including ifdef'ed ones.  That approach left us
	no way to conditionally compile mpersified printers, which was not
	a problem until btrfs ioctls appeared on the horizon.

	With this change, those mpersified printers that are not going
	to be compiled are also won't be declared and won't be added to
	struct_printers.

	This is implemented by filtering all source files containing
	MPERS_PRINTER_DECL markers through CPP.  As a nice side effect, this
	also lifts an ugly requirement of writing all MPERS_PRINTER_DECL
	declarations in a single line.

	* README-mpers: Update description of MPERS_PRINTER_DECL syntax.
	* defs.h [IN_MPERS_BOOTSTRAP] (MPERS_PRINTER_DECL): Turn into
	a recursive variadic macro.
	[!IN_MPERS_BOOTSTRAP] (MPERS_PRINTER_DECL): Turn into a variadic macro.
	All callers changed.
	* Makefile.am (mpers_preproc_files, mpers_printer_decl_pattern):
	New variables.
	(CLEANFILES): Add $(mpers_preproc_files).
	(%.c.mpers.i): New rule.
	(printers.h, %_printer_decls.h, %_printer_defs.h): Use
	mpers_preproc_files instead of srcdir_mpers_source_files,
	use mpers_printer_decl_pattern.
	* .gitignore: Add /*.mpers.i.

2016-05-20  Dmitry V. Levin  <ldv@altlinux.org>

	Remove redundant declaration of v4l2_ioctl.
	There is no need to declare mpers printers in defs.h because
	they are already declared in printers.h or native_printer_decls.h.

	This complements commit 1e56814f77594a22a74ddee629639eb0bb7edf3a.

	* defs.h (v4l2_ioctl): Remove.

2016-05-21  Dmitry V. Levin  <ldv@altlinux.org>

	Fix one more code pattern that might break gcc strict aliasing rules.
	* socketutils.c (receive_responses): Turn static buffer into a union
	to avoid breaking of gcc strict aliasing rules.
	* tests/netlink_inet_diag.c (check_responses): Likewise.
	* tests/netlink_netlink_diag.c (check_responses): Likewise.
	* tests/netlink_unix_diag.c (check_responses): Likewise.

2016-05-21  Fabien Siron  <fabien.siron@epita.fr>

	tests: add check for netlink protocol decoding with -yy option.
	* tests/netlink_netlink_diag.c: New file.
	* tests/net-yy-netlink.c: New file.
	* tests/net-yy-netlink.test: New test.
	* tests/.gitignore: Add net-yy-netlink and netlink_netlink_diag
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add net-yy-netlink.test.

2016-05-18  Fabien Siron  <fabien.siron@epita.fr>

	Add netlink domain sockets support to socketutils.
	* linux/netlink_diag.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* socketutils.c: Include it and "xlat/netlink_protocols.h".
	(netlink_send_query, netlink_parse_response, netlink_print): New
	functions.
	(print_sockaddr_by_inode): Hook up netlink_print.

2016-05-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests/pread64-pwrite64.c: robustify against os specific issues.
	Do not assume that pwrite64 syscall fails when only part of the
	specified memory buffer is accessible.  With some kernels, one
	accessible byte at the end of page is enough for pwrite64 syscall
	to return 1.

	* tests/pread64-pwrite64.c (main): Tweak the test that can lead
	to a partial write.

2016-05-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests/read-write.c: robustify against os specific issues.
	Do not assume that write syscall fails when only part of the specified
	memory buffer is accessible.  With some kernels, one accessible byte
	at the end of page is enough for write syscall to return 1.

	* tests/read-write.c (main): Tweak the test that can lead to a partial
	write.

2016-05-18  Dmitry V. Levin  <ldv@altlinux.org>

	umovestr3.test: extend test coverage.
	* tests/umovestr3.c: Include <sys/param.h>.
	(main): Test with each number between PATH_MAX-1 and 0.

	tests/timer_create.c: robustify against os specific issues.
	* tests/timer_create.c (main): Do not assume any specific error code
	returned by timer_create, print whatever it is.

	Fix some compilation warnings on older systems.
	* print_statfs.c (print_statfs_flags): Define only
	for [HAVE_STRUCT_STATFS_F_FLAGS || HAVE_STRUCT_STATFS64_F_FLAGS].
	* tests/inet-cmsg.c (print_origdstaddr): Define only
	for [IP_ORIGDSTADDR].

	Update generic ioctl entries from linux 4.6.
	* linux/64/ioctls_inc.h: Update from linux v4.6 using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* NEWS: Mention this.

	maint: update for linux 4.6.
	* maint/ioctls_sym.sh: Update workarounds for linux/kvm.h.

	Update SOL_* constants.
	* xlat/socketlayers.in: Add SOL_KCM.

	Update MSG_* constants.
	* xlat/msg_flags.in: Add MSG_BATCH.

	Update AF_* constants.
	* xlat/addrfams.in: Add AF_KCM.

2016-05-17  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add brk.test.
	* tests/brk.c: New file.
	* tests/brk.test: New test.
	* tests/.gitignore: Add brk.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add brk.test.

2016-05-17  Dmitry V. Levin  <ldv@altlinux.org>

	Fix printing of invalid arguments of term ioctls.
	* term.c (term_ioctl): Print arguments of TCXONC and TCFLSH ioctls
	using printxval_long.

	mips: fix printing of invalid operations argument of sysmips syscall.
	* sysmips.c (SYS_FUNC(sysmips)): Print 1st argument of syscall using
	printxval_long.

	bfin: fix printing of invalid flags argument of sram_alloc syscall.
	* sram_alloc.c (SYS_FUNC(sram_alloc)): Print 2nd argument using
	printflags_long.

2016-05-16  Dmitry V. Levin  <ldv@altlinux.org>

	Fix printing of invalid arguments of prctl syscall.
	* prctl.c (SYS_FUNC(prctl)): Print 2nd syscall argument
	of PR_CAPBSET_DROP, PR_CAPBSET_READ, PR_CAP_AMBIENT, PR_MCE_KILL,
	and PR_SET_SECCOMP using printxval_long.
	Print 2nd syscall argument of PR_SET_SECUREBITS using printflags_long.
	Print 3rd syscall argument of PR_CAP_AMBIENT and PR_MCE_KILL using
	printxval_long.
	* tests/prctl-seccomp-strict.c (main): Update.

	Fix printing of invalid flags argument of perf_event_open syscall.
	* numa.c (SYS_FUNC(perf_event_open)): Print 5th argument of syscall
	using printflags_long.

	or1k: fix printing of invalid 1st argument of or1k_atomic syscall.
	* or1k_atomic.c (SYS_FUNC(or1k_atomic)): Print 1st argument using
	printxval_long.

	Fix printing of invalid flags argument of get_mempolicy syscall.
	* numa.c (SYS_FUNC(get_mempolicy)): Print 5th argument of syscall
	using printxval_long.

	Fix printing of invalid mode argument of mbind syscall.
	* numa.c (SYS_FUNC(mbind)): Print 3rd argument of syscall
	using printxval_long.
	* tests/mbind.c (main): Update.

	Fix printing of invalid argument of MTDFILEMODE ioctl.
	* mtd.c (mtd_ioctl): Print 3rd argument of MTDFILEMODE ioctl
	using printflags_long.

	Fix printing of invalid flags argument of mount syscall.
	* mount.c (SYS_FUNC(mount)): Print 1st argument using printflags_long.

	Fix printing of invalid arguments of memory mapping related syscalls.
	* mem.c (print_mmap): Print 3rd and 4th arguments of syscall
	using printflags_long.
	(SYS_FUNC(mprotect)): Print 3rd argument of syscall using
	printflags_long.
	(SYS_FUNC(mremap)): Print 4th argument of syscall using printflags_long.
	(SYS_FUNC(remap_file_pages)): Print 3rd and 4th arguments of syscall
	using printflags_long.
	* tests/remap_file_pages.c (main): Update.

	Fix printing of invalid flags argument of kexec_load and kexec_file_load
	* kexec.c (SYS_FUNC(kexec_load), SYS_FUNC(kexec_file_load)): Print
	flags argument using printflags_long.

	Fix printing of invalid 3rd argument of fcntl/fcntl64 syscall.
	* fcntl.c (print_fcntl): Print 3rd argument of F_NOTIFY, F_SETLEASE, and
	F_ADD_SEALS operations using printflags_long.

	Fix printing of invalid flags argument of unshare syscall.
	* clone.c (SYS_FUNC(unshare)): Print 1st argument using printflags_long.

	Introduce printflags_long and printxval_long.
	* defs.h (printflags_long, printxval_long): New static inline functions.

	Fix printing of invalid struct xfs_dqblk.d_flags.
	* quota.c (decode_cmd_data): Explicitly cast struct xfs_dqblk.d_flags
	to uint8_t to avoid potential sign-extension bug when printing
	invalid struct xfs_dqblk.d_flags.

	Fix printing of invalid struct ubi_mkvol_req.vol_type.
	* mtd.c (ubi_ioctl): Explicitly cast struct ubi_mkvol_req.vol_type
	to unsigned short to avoid potential sign-extension bug when printing
	invalid struct ubi_mkvol_req.vol_type.

2016-05-16  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of prctl/arch_prctl operation argument.
	Consistently treat operation argument of prctl/arch_prctl syscalls
	as int to match the kernel behaviour.

	* prctl.c (SYS_FUNC(prctl), SYS_FUNC(arch_prctl)): Assign 1st argument
	of syscalls to a variable of type unsigned int and use it in all
	subsequent checks and lookups.

2016-05-16  Dmitry V. Levin  <ldv@altlinux.org>

	Fix printing of struct sched_attr.sched_flags.
	* sched.c (print_sched_attr): Print sched_flags using printflags64.

	Fix printing of struct statfs.f_flags.
	* print_statfs.c (print_statfs_flags): Print flags using printflags64.

	Fix printing of invalid struct ifreq.ifr_flags.
	* sock.c (print_ifreq): Explicitly cast struct ifreq.ifr_flags
	to unsigned short to avoid potential sign-extension bug when printing
	invalid struct ifreq.ifr_flags.

	Fix printing of invalid struct pollfd.events.
	* poll.c (print_pollfd): Explicitly cast struct pollfd.events
	to unsigned short to avoid potential sign-extension bug when printing
	invalid struct pollfd.events.

	Fix printing of invalid struct sembuf.sem_flg.
	* ipc_sem.c (print_sembuf): Explicitly cast struct sembuf.sem_flg
	to unsigned short to avoid potential sign-extension bug when printing
	invalid struct sembuf.sem_flg.

	Fix printing of invalid l_type and l_whence in fcntl/fcntl64 syscalls.
	* fcntl.c (print_struct_flock64): Explicitly cast l_type and l_whence
	fields to unsigned short to avoid potential sign-extension bug when
	printing invalid l_type or l_whence fields.

	Fix printing of fanotify_mark mask argument.
	* fanotify.c (SYS_FUNC(fanotify_mark)): Print mask using printflags64.

2016-05-16  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of epoll_ctl operation argument.
	Consistently treat operation argument of epoll_ctl syscall as int
	to match the kernel behaviour.

	* epoll.c (SYS_FUNC(epoll_ctl)): Assign 2nd argument of syscall
	to a variable of type unsigned int and use it in all subsequent
	checks and lookups.
	* tests/epoll_ctl.c (invoke_syscall): New function.
	(main): Use it.

2016-05-16  Dmitry V. Levin  <ldv@altlinux.org>

	Fix printing of invalid d_type in getdents syscall.
	* dirent.c (SYS_FUNC(getdents)): Treat d_type as unsigned char to avoid
	potential sign-extension bug when printing invalid d_type.

	bfin: fix decoding of cacheflush syscall.
	* cacheflush.c (SYS_FUNC(cacheflush)): Print 2nd argument
	using %lu format.  Print 3rd argument as flags.

	Fix decoding of BPF_MAP_UPDATE_ELEM flags.
	* bpf.c (bpf_map_update_elem): Print attr.flags using printxval64.

2016-05-16  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of fcntl/fcntl64 operation argument.
	Consistently treat operation argument of fcntl/fcntl64 syscalls as int
	to match the kernel behaviour.

	* fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Assign
	2nd argument of syscall to a variable of type unsigned int
	and use it in all subsequent checks and lookups.
	* tests/struct_flock.c (invoke_test_syscall): New function.
	(test_flock_einval, test_flock): Use it.
	* tests/fcntl.c (test_flock64_einval): Use it.
	* tests/fcntl64.c (test_flock64_einval, test_flock64): Use it.

2016-05-15  Dmitry V. Levin  <ldv@altlinux.org>

	Rename sprintflags64 to sprintflags.
	* defs.h (sprintflags): Remove.
	(sprintflags64): Rename to sprintflags.
	* util.c (sprintflags64): Rename to sprintflags.

	Prepare for transition from sprintflags64 to sprintflags.
	* fcntl.c (print_fcntl): Cast 3rd argument of sprintflags
	to unsigned long.
	* membarrier.c (SYS_FUNC(membarrier)): Likewise.
	* prctl.c (SYS_FUNC(prctl)): Likewise.
	* poll.c (decode_poll_exiting): Cast 3rd argument of sprintflags
	to unsigned short.

2016-05-14  Dmitry V. Levin  <ldv@altlinux.org>

	Rename xlookup64 to xlookup.
	* defs.h (xlookup): Remove.
	(xlookup64): Rename to xlookup.
	* util.c (xlookup64): Rename to xlookup.

	Prepare for transition from xlookup64 to xlookup.
	* fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)):
	Cast 2nd argument of xlookup to unsigned long.
	* prctl.c (SYS_FUNC(prctl)): Likewise.
	* sched.c (SYS_FUNC(sched_getscheduler)): Likewise.
	* time.c (do_adjtimex): Likewise.
	* ioprio.c (sprint_ioprio): Change type of the argument
	and local variables from int to unsigned int.
	* keyctl.c (print_keyring_serial_number): Cast 2nd argument
	of xlookup to unsigned int.
	* net.c (tprint_sock_type): Change type of the argument to unsigned int.
	* printmode.c (sprintmode): Likewise.
	* printsiginfo.c (printsigval):  Change type of si_code argument
	to unsigned int.

2016-05-14  Dmitry V. Levin  <ldv@altlinux.org>

	v4l2: fix build with old kernel headers.
	Prior to v2.6.25-rc3, <linux/videodev2.h> didn't include all
	required headers, resulting to omission of V4L2_* constants.

	This issue doesn't arise in v4l2.c and tests/ioctl_v4l2.c files
	because they already include all necessary headers themselves.

	* configure.ac (AC_CHECK_DECLS): Include <sys/time.h>, <linux/ioctl.h>,
	and <linux/types.h> before <linux/videodev2.h>.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

	configure.ac: do not check for sys/ioctl.h and ioctls.h.
	Since sys/ioctl.h is included unconditionally when needed
	and ioctls.h doesn't exist, these checks are redundant.

	* configure.ac (AC_CHECK_HEADERS): Remove ioctls.h and sys/ioctl.h.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

	sock.c: include <linux/ioctl.h> instead of <sys/ioctl.h> or <ioctls.h>
	Include <linux/ioctl.h> for <linux/sockios.h> on alpha, sh, and sh64
	architectures because their <asm/sockios.h> use _IOR and _IOW macros
	but don't include anything that would define these macros.

	Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings
	no benefits in this case.  <ioctls.h> simply doesn't exist.

	* sock.c [ALPHA || SH || SH64]: Include <linux/ioctl.h>
	instead of <sys/ioctl.h> or <ioctls.h>.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

	v4l2: include <linux/ioctl.h> instead of <sys/ioctl.h>
	Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings
	no benefits for parser of VIDIOC_* ioctls.

	* v4l2.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

	printsiginfo: remove "verbose" argument.
	Remove erroneous use of verbose(tcp) as a printing limit
	for already fetched members of siginfo_t structure.

	* printsiginfo.h (printsiginfo): Remove boolean argument.
	* printsiginfo.c (printsigval): Remove boolean argument, print
	si_int and si_ptr members unconditionally.  All callers changed.
	(print_si_info): Remove boolean argument, print si_utime and si_stime
	members unconditionally.  All callers changed.
	(printsiginfo): Remove boolean argument.  All callers changed.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests/ptrace.c: tweak magic constants to make the test more reliable.
	* tests/ptrace.c (main): Change bad_request and bad_data to make they
	lower 32-bit parts closer to -1U.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests/ioctl_v4l2.c: fix build on older systems.
	Fix build on systems without HAVE_DECL_V4L2_CTRL_TYPE_STRING or
	V4L2_CTRL_CLASS_CAMERA.

	* tests/ioctl_v4l2.c (main) [VIDIOC_S_EXT_CTRLS]: Disable part of the
	test if [!HAVE_DECL_V4L2_CTRL_TYPE_STRING].
	Replace V4L2_CTRL_CLASS_CAMERA with V4L2_CTRL_CLASS_USER.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

	Do not use htole32 function.
	htole32 function is not portable enough.

	* v4l2.c (print_pixelformat): Rewrite initialization of pixel format
	union without using of htole32.
	* tests/ioctl_v4l2.c (main): Likewise.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests/ioctl_v4l2.c: fix typo.
	* tests/ioctl_v4l2.c (main)
	[!HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE]: Fix typo in expected
	output string.

	tests: check decoding of ptrace syscall.
	* tests/ptrace.c: New file.
	* tests/ptrace.test: New test.
	* tests/.gitignore: Add ptrace.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ptrace.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

	ptrace: decode data argument of PTRACE_PEEKSIGINFO request.
	The data argument of PTRACE_PEEKSIGINFO request is a pointer
	to siginfo_t array.

	* printsiginfo.c (print_siginfo_t): New function.
	(print_siginfo_array): New mpers printer.
	* process.c (SYS_FUNC(ptrace)): Print data argument of
	PTRACE_PEEKSIGINFO request using print_siginfo_array.

2016-05-13  Dmitry V. Levin  <ldv@altlinux.org>

	ptrace: decode data argument of PTRACE_SECCOMP_GET_FILTER request.
	* process.c (SYS_FUNC(ptrace)): Print data argument of
	PTRACE_SECCOMP_GET_FILTER request on exiting using print_seccomp_fprog.

	ptrace: decode argument of PTRACE_GETEVENTMSG request.
	* process.c (SYS_FUNC(ptrace)): Print data argument of
	PTRACE_GETEVENTMSG request on exiting using printnum_ulong.

	ptrace: decode arguments of PTRACE_[GS]ETSIGMASK requests.
	* process.c (SYS_FUNC(ptrace)): Print arguments of PTRACE_GETSIGMASK
	and PTRACE_SETSIGMASK requests using print_sigset_addr_len.

	ptrace: return RVAL_DECODED for requests decoded on entering.
	* process.c (SYS_FUNC(ptrace)): Return RVAL_DECODED on entering for all
	ptrace requests except those that are partially decoded in exiting,

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

	ptrace: print PTRACE_O_* flags using printflags64.
	As flags argument has a long integer type, print it using printflags64
	because printflags takes unsigned int argument.

	* process.c (SYS_FUNC(ptrace)): Print PTRACE_O_* flags
	using printflags64.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

	ptrace: print data argument of PTRACE_SEIZE et al requests as flags.
	* process.c (SYS_FUNC(ptrace)): Print data argument of
	PTRACE_SEIZE and PTRACE_OLDSETOPTIONS as PTRACE_O_* flags.

	ptrace: print data argument of PTRACE_SINGLEBLOCK et al requests as signo
	* process.c (SYS_FUNC(ptrace)): Print data argument of
	PTRACE_SINGLEBLOCK, PTRACE_SYSEMU, and PTRACE_SYSEMU_SINGLESTEP requests
	as a signal number.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

	ptrace: decode addr argument of PTRACE_PEEKSIGINFO request.
	The addr argument of PTRACE_PEEKSIGINFO request is a pointer to
	a struct ptrace_peeksiginfo_args.

	* process.c: Include "xlat/ptrace_peeksiginfo_flags.h".
	(SYS_FUNC(ptrace)): Print addr argument of PTRACE_PEEKSIGINFO request
	as a struct ptrace_peeksiginfo_args.
	* xlat/ptrace_peeksiginfo_flags.in: New file.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

	ptrace: fix printing addr argument of PTRACE_GETSIGMASK et al requests.
	For PTRACE_GETSIGMASK and PTRACE_SETSIGMASK requests, addr argument
	contains the size of the buffer pointed to by data argument.
	For PTRACE_SECCOMP_GET_FILTER request, addr argument contains
	an offset counter.

	* process.c (SYS_FUNC(ptrace)): Print addr argument of
	PTRACE_GETSIGMASK, PTRACE_SETSIGMASK, and PTRACE_SECCOMP_GET_FILTER
	requests using %lu format.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

	ptrace: do not print data argument of some requests on sparc.
	On sparc, kernel ignores data argument of PTRACE_GETREGS,
	PTRACE_SETREGS, PTRACE_GETFPREGS, and PTRACE_SETFPREGS requests.

	* process.c (SYS_FUNC(ptrace)) [SPARC || SPARC64]: Return RVAL_DECODED
	right after printing addr argument if request is one of PTRACE_GETREGS,
	PTRACE_SETREGS, PTRACE_GETFPREGS, or PTRACE_SETFPREGS.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

	ptrace: do not print addr and data arguments of PTRACE_ATTACH-like requests
	As kernel ignores addr and data arguments of PTRACE_ATTACH,
	PTRACE_INTERRUPT, PTRACE_KILL, and PTRACE_LISTEN request,
	we do not print them either.

	* process.c (SYS_FUNC(ptrace)): After printing pid argument, return
	RVAL_DECODED if request is one of PTRACE_ATTACH, PTRACE_INTERRUPT,
	PTRACE_KILL, or PTRACE_LISTEN.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

	ptrace: do not print arguments of PTRACE_TRACEME request.
	As kernel ignores arguments of PTRACE_TRACEME request,
	we do not print them either.

	* process.c (SYS_FUNC(ptrace)): If request is PTRACE_TRACEME,
	return early with RVAL_DECODED.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

	ptrace: print request using printxval64.
	As first argument of ptrace syscall has a long integer type, print
	it using printxval64 because printxval takes unsigned int argument.

	* process.c (SYS_FUNC(ptrace)): Change type of "request" variable
	from "long" to "unsigned long", print it using printxval64 instead
	of printxval.

2016-05-12  Dmitry V. Levin  <ldv@altlinux.org>

	Do not sign-extend siginfo_t.si_syscall.
	* printsiginfo.c (print_si_info): Explicitly cast si_syscall member
	of siginfo_t that has type "int" to "unsigned int", to avoid sign
	extension when passed to syscall_name function.

	Export print_seccomp_fprog for further use in parser of ptrace syscall.
	* defs.h (print_seccomp_fprog): New prototype.
	* seccomp.c (print_seccomp_fprog): Remove "static" keyword.
	Move printing of struct seccomp_fprog fields ...
	(print_seccomp_filter): ... here.

2016-05-11  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add munlockall.test.
	* tests/munlockall.c: New file.
	* tests/munlockall.test: New test.
	* tests/.gitignore: Add munlockall.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add munlockall.test.

	tests: add link.test.
	* tests/link.c: New file.
	* tests/link.test: New test.
	* tests/.gitignore: Add link.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add link.test.

2016-05-11  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding and dumping of preadv2 and pwritev2 syscalls.
	* tests/preadv2-pwritev2.c: New file.
	* tests/preadv2-pwritev2.test: New test.
	* tests/.gitignore: Add preadv2-pwritev2.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add preadv2-pwritev2.

	Implement decoding of preadv2 and pwritev2 syscalls.
	* io.c: Include "xlat/rwf_flags.h".
	(do_preadv, do_pwritev, SYS_FUNC(preadv2), SYS_FUNC(pwritev2)):
	New functions.
	(SYS_FUNC(preadv)): Use do_preadv.
	(SYS_FUNC(pwritev)): Use do_pwritev.
	* linux/32/syscallent.h (preadv2, pwritev2): New entries.
	* linux/64/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* syscall.c (dumpio): Handle SEN_preadv2 and SEN_pwritev2.
	* xlat/rwf_flags.in: New file.
	* NEWS: Mention parsers of new syscalls.

2016-05-10  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend test coverage of xattr family syscalls.
	* tests/xattr.c: Check decoding of all xattr family syscalls.
	* tests/xattr.test: Use run_strace_match_diff.
	* tests/xattr.expected: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove it.

	tests: add print_quoted_memory function to libtests.
	* tests/print_quoted_string.c (print_quoted_memory): New function.
	(print_quoted_string): Use it.
	* tests/tests.h (print_quoted_memory): New prototype.

	Fix corner cases of xattr family syscalls decoding.
	* xattr.c (print_xattr_val): Do not take insize into account, print it
	as unsigned long.
	Do not decode xattr values of size larger than XATTR_SIZE_MAX.
	Use static buffer for fetching xattr values.
	(print_xattr_list): Do not decode string when size is zero.

2016-05-10  Dr. David Alan Gilbert  <dgilbert@redhat.com>

	userfaultfd: Add ioctl tests.
	* tests/ioctl_uffdio.c: New file.
	* tests/ioctl_uffdio.test: New test.
	* tests/.gitignore: Add ioctl_uffdio.
	* tests/Makefile.am (check_PROGRAMS):  Likewise.
	(DECODER_TESTS): Add ioctl_uffdio.test.

2016-05-10  Dr. David Alan Gilbert  <dgilbert@redhat.com>

	Decode UFFDIO_* ioctls.
	Decode the ioctls associated with the userfaultfd fd.
	Note that they tend to read from and also return result in it's data
	structure.

	* configure.ac (AC_CHECK_HEADERS): Add linux/userfaultfd.h.
	* userfaultfd.c [HAVE_LINUX_USERFAULTFD_H]: Add ioctl decoder.
	* defs.h (uffdio_ioctl): New prototype.
	* ioctl.c (ioctl_decode) [HAVE_LINUX_USERFAULTFD_H]: Wire in
	uffdio_ioctl.
	* xlat/uffd_*.in: Create flag xlat for all the IOCTLs.

2016-05-10  Dmitry V. Levin  <ldv@altlinux.org>

	Update AX_CODE_COVERAGE.
	* m4/ax_code_coverage.m4: Update to serial 16.
	* Makefile.am (CODE_COVERAGE_LCOV_OPTIONS): Remove.
	(CODE_COVERAGE_GENHTML_OPTIONS): Update, add prefix.
	(CODE_COVERAGE_BRANCH_COVERAGE): Set to 1.

	strace-ff.test: fix race condition.
	* tests/strace-ff.test: Wait for completion of PR_SET_PTRACER command.

	tests/epoll_pwait.c: fix for x32.
	* tests/epoll_pwait.c (main): Explicitly cast last syscall argument
	to kernel_ulong_t.

	strace-S.test: check "-S name"
	* tests/strace-S.test: Add a check for "-c -S name" output.

	Fix NULL dereference in "-S name" when syscall table has holes.
	* count.c (syscall_cmp): Do not pass NULL to strcmp.

	strace-S.test: cleanup.
	* tests/strace-S.test: Rewrite using sed.

2016-05-09  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add strace-S.test.
	* tests/strace-S.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.

2016-05-09  Dmitry V. Levin  <ldv@altlinux.org>

	strace-ff.test: check that -ff does not create unexpected output files.
	* tests/strace-ff.expected: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/strace-ff.test: Use it.  Check that no other output files
	have been created.

2016-05-09  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add strace-ff.test.
	* tests/strace-ff.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.

2016-05-09  Dmitry V. Levin  <ldv@altlinux.org>

	strace-V.test: cleanup.
	* tests/strace-V.test: Move config.h parser to a function.
	Rename $OUT to $EXP, swap arguments passed to match_diff.

2016-05-09  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add strace-V.test.
	* tests/strace-V.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.

2016-05-09  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of epoll_pwait syscall.
	* tests/epoll_pwait.c: New file.
	* tests/epoll_pwait.test: New test.
	* tests/.gitignore: Add epoll_pwait.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add epoll_pwait.test.

2016-05-09  Dmitry V. Levin  <ldv@altlinux.org>

	Assume that sys/epoll.h exists.
	This header file was added in glibc-2.3.2,
	so it's safe to assume its availability.

	* configure.ac (AC_CHECK_HEADERS): Remove sys/epoll.h.
	* epoll.c: Include <sys/epoll.h> unconditionally.
	Compile [HAVE_SYS_EPOLL_H] code unconditionally.
	* tests/epoll_ctl.c: Do not check for HAVE_SYS_EPOLL_H.
	* tests/epoll_wait.c: Likewise.

2016-05-08  Fabien Siron  <fabien.siron@epita.fr>

	Factorize send_query functions.
	* socketutils.c (send_query): New function.
	(inet_send_query, unix_send_query): Use it.

2016-05-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: relax timings.
	Allow nanosleep(2) to spend 10% more time to make the test suite
	more reliable on slow systems.

	* tests/count.test: Treat 1.1 seconds as valid output.
	* tests/strace-T.expected: Likewise.
	* tests/strace-r.expected: Likewise.

2016-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests/attach-f-p.c: increase timeouts.
	Increase timeouts to make the test more reliable on slow systems.

	* tests/attach-f-p.c (its): Increase timeouts to 1, 2, and 3 seconds,
	respectively.

2016-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unused functions.
	* defs.h (umove_ulong_or_printaddr, umove_ulong_array_or_printaddr):
	Remove.
	* util.c (umove_ulong_or_printaddr, umove_ulong_array_or_printaddr):
	Likewise.

	v4l2.c: use print_array function.
	* v4l2.c (print_v4l2_ext_control, umoven_or_printaddr_ignore_syserror):
	New functions.
	(print_v4l2_ext_controls): Use them via print_array.

	uid.c: use print_array function.
	* uid.c (print_gid): New function.
	(print_groups): Use it via print_array.

	seccomp.c: use print_array function.
	* seccomp.c (decode_filter, decode_seccomp_fprog): Remove.
	(print_bpf_filter): New function.
	(print_seccomp_fprog): Use it via print_array.
	* tests/seccomp-filter-v.c (main): Update.

	scsi.c: use print_array function.
	* scsi.c (print_uchar): New function.
	(print_sg_io_buffer): Use it via print_array.

	poll.c: use print_array function.
	* poll.c (print_pollfd): Change for use as print_array callback.
	(decode_poll_entering): Use print_array.
	* tests/poll.c: Update.
	* tests/poll.test: Update.

	numa.c: use print_array function.
	* numa.c (print_node): New function.
	(print_nodemask): Use it via print_array.
	(print_page_array, print_int_array): Remove.
	(print_addr): New function.
	(print_status, print_int): Change for use as print_array callback.
	(SYS_FUNC(move_pages)): Use print_addr, print_int, and print_status
	via print_array.
	* tests/move_pages.c: Update.
	* tests/set_mempolicy.c: Likewise.
	* tests/set_mempolicy.test: Likewise.

	mem.c: use print_array function.
	* mem.c [POWERPC] (print_protmap_entry): New function.
	[POWERPC] (SYS_FUNC(subpage_prot)): Use it via print_array.

	kexec.c: use print_array function.
	* kexec.c (print_seg): Change for use as print_array callback.
	(print_kexec_segments): Use print_array.

	ipc_sem.c: use print_array function.
	* ipc_sem.c (tprint_sembuf): Rename to print_sembuf, change signature
	for use as print_array callback.
	(tprint_sembuf_array): Use print_array.

	io.c: use print_array function.
	* io.c (print_iovec_config): New structure.
	(print_iovec): New function.
	(tprint_iov_upto): Use print_array.
	* tests/preadv.c (main): Update.
	* tests/pwritev.c (print_iovec, main): Likewise.

	epoll.c: use print_array function.
	* epoll.c (print_epoll_event): Change signature for use as print_array
	callback, all users updated.
	(print_epoll_event_array): Remove.
	(epoll_wait_common): Change to use print_array instead
	of print_epoll_event_array.

	aio.c: use print_array function.
	* aio.c (print_iocbp): New function.
	(SYS_FUNC(io_submit)): Use it via print_array.  Use widen_to_long
	to process long int argument.
	(print_io_event): Change to print struct io_event fetched elsewhere.
	(SYS_FUNC(io_cancel)): Update use of print_io_event.
	(SYS_FUNC(io_getevents)): Use print_io_event via print_array.
	Use widen_to_long to print long int arguments.
	* tests/aio.c (main): Check decoding of io_submit with negative "nr".

	Introduce print_array function for consistent decoding of arrays.
	* defs.h (print_array): New prototype.
	* util.c (print_array): New function.

2016-05-06  Dmitry V. Levin  <ldv@altlinux.org>

	Fix corner cases of ICMP_FILTER decoding.
	* net.c (print_icmp_filter): Print icmp_filter for any positive length.
	* tests/net-icmp_filter.c: New file.
	* tests/net-icmp_filter.test: New test.
	* tests/.gitignore: Add net-icmp_filter.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add net-icmp_filter.test.

2016-05-05  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: do not strip "1<<" prefix from xlat strings.
	* xlat/gen.sh (cond_xlat, gen_header): Do not strip "1<<" prefix
	from xlat strings to fix incorrect output.
	* tests/caps.awk: Update.

	Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

2016-05-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests/xstatfsx.c: fix mips o32 support.
	mips o32 differs from all other 32-bit architectures by defining
	__kernel_fsid_t structure as an array of long ints.

	* tests/xstatfsx.c (print_statfs): Explicitly cast elements
	of PRINT_F_FSID array to unsigned int.

2016-05-05  Dmitry V. Levin  <ldv@altlinux.org>

	Mpersify VIDIOC_* ioctl parser.
	* v4l2.c: Mpersify arch-specific structures.
	(v4l2_ioctl): Mpersify.
	* tests/ioctl_v4l2.c: New file.
	* tests/ioctl_v4l2.test: New test.
	* tests/.gitignore: Add ioctl_v4l2.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioctl_v4l2.test.

2016-05-05  Dmitry V. Levin  <ldv@altlinux.org>

	Mpersify ioctl macros.
	As values of some ioctl macros differ between personalities, these
	personality specific ioctl macros should be properly defined for
	mpersified code.  Implement this by redefining personality specific
	ioctl macros from ioctlent*.h for each file that includes MPERS_DEFS.

	* Makefile.am (ioctl_macros_h): New variable.
	(ioctl_macros%.h): New rule.
	(BUILT_SOURCES, CLEANFILES): Add $(ioctl_macros_h).
	(m%_type_defs.h): #include MPERS_$(mpers_PREFIX)IOCTL_MACROS.
	* defs.h [HAVE_M32_MPERS] (MPERS_m32_IOCTL_MACROS): New macro.
	[HAVE_MX32_MPERS] (MPERS_mx32_IOCTL_MACROS): Likewise.

	Acked-by: Elvira Khabirova <lineprinter0@gmail.com>

2016-05-05  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of VIDIOC_* ioctls.
	* v4l2.c: Fix numerous bugs in decoding of VIDIOC_* ioctls.
	* tests/ioctl.c (main): Update.

2016-05-05  Dmitry V. Levin  <ldv@altlinux.org>

	nsyscalls.test: add mips o32 support.
	Out-of-range syscalls looks differently on mips o32.

	* tests/nsyscalls.c (main): Handle LINUX_MIPSO32.
	* tests/nsyscalls.test: Trace syscall called "syscall" on mips.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	Remove initialization of big holes in syscallent.h files.
	There is no need to explicitly initialize big holes after conversion
	of syscallent.h files to use designated initializers.  For architectures
	that have some data at the end of syscallent.h this initialization of
	big holes is no-op, for others it just inflates the table unnecessarily.

	* linux/arc/syscallent.h: Remove initialization of arch specific block
	at the end of table.
	* linux/metag/syscallent.h: Likewise.
	* linux/nios2/syscallent.h: Likewise.
	* linux/or1k/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.
	* linux/tile/syscallent1.h: Likewise.
	* linux/arm/syscallent.h: Remove explicit initialization of a big hole
	before socket subcalls.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/mips/syscallent-compat.h: Remove explicit initialization
	of big holes between different mips ABIs.
	* linux/mips/syscallent-n64.h: Remove explicit initialization
	of big holes before socket subcalls and between different mips ABIs.
	* linux/mips/syscallent-o32.h: Likewise.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: make "1<<val" syntax work with 64-bit values.
	* xlat/gen.sh(cond_xlat, gen_header): Generate 1UUL<<val
	for 1<<val syntax.

	Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	Fix typo in XLAT_TYPE_PAIR.
	* xlat.h (XLAT_TYPE_PAIR): Take "type" parameter.

	Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of move_pages syscall.
	* numa.c (print_page_array, print_status, print_int, print_int_array):
	New functions.
	(SYS_FUNC(move_pages)): Rewrite using these functions.
	* tests/move_pages.c: New file.
	* tests/move_pages.test: New test.
	* tests/.gitignore: Add move_pages.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add move_pages.test.

	tests: check decoding of mbind syscall.
	* tests/mbind.c: New file.
	* tests/mbind.test: New test.
	* tests/.gitignore: Add mbind.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add mbind.test.

2016-04-29  Jeff Mahoney  <jeffm@suse.com>

	Change type of struct xlat.val to uint64_t.
	Some ioctls have flags fields that are 64-bit.  A 32-bit val means
	these flags will never be matched or printed.

	* xlat.h: Include <stdint.h>.
	(struct xlat): Change type of val to uint64_t.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: extend syntax with #val_type directive.
	When #val_type directive is encountered, gen.sh starts using
	XLAT_TYPE/XLAT_TYPE_PAIR macros instead of XLAT/XLAT_PAIR,
	with #val_type's argument as a type.

	For example, "#val_type uint64_t" means values of type uint64_t.

	* xlat/gen.sh (gen_header, print_xlat, print_xlat_pair):
	Add val_type support.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat/gen.sh: prepare for adding #val_type directive support.
	This is essentially a no-op change that makes the following change
	easier to read.

	* xlat/gen.sh (print_xlat, print_xlat_pair): New functions.
	(cond_xlat, gen_header): Use them.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce XLAT_TYPE and XLAT_TYPE_PAIR macros.
	* xlat.h (XLAT_TYPE): New macro, similar to XLAT but casts
	to the specified type instead of unsigned int.
	(XLAT_TYPE_PAIR): New macro, similar to XLAT_PAIR but casts
	to the specified type instead of unsigned int.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: generate xlat pairs using new XLAT_PAIR macro.
	Before this change there were two forms of xlat entries: those that use XLAT
	or XLAT_END macros, and others verbatim entries.  This change converts
	the latter to use new XLAT_PAIR macro.

	This is necessary for the upcoming change of xlat.val type.

	* xlat.h (XLAT_PAIR): New macro.
	* xlat/gen.sh (cond_xlat, gen_header): Use it.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	Explicitly cast argument of XLAT macro to unsigned int.
	This is necessary for the upcoming change of xlat.val type.

	* xlat.h (XLAT): Cast the argument to unsigned int.

2016-04-29  Dmitry V. Levin  <ldv@altlinux.org>

	Change type of {s,t}print_open_modes's argument to unsigned.
	As "flags" argument of sprint_open_modes and tprint_open_modes is
	involved only in bit operations, change its type to unsigned.

	* defs.h.c (sprint_open_modes, tprint_open_modes): Change type
	to unsigned int.
	* open.c (sprint_open_modes, tprint_open_modes): Likewise.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests/remap_file_pages.c: fix for the upcoming change of xlat.val type.
	The "flags" argument of remap_file_page syscall has type "unsigned
	long", so it is not correct to load most significant bits with garbage
	ans assume they are going to be ignored.

	* tests/remap_file_pages.c (main): Remove artificial garbage from flags.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce printflags64 function.
	This is necessary for the upcoming change of xlat.val type.

	* defs.h (printflags): Rename to printflags64, change type of integer
	argument to uint64_t.
	(printflags): New static inline function.
	* util.c (printflags): Rename to printflags64, change type of integer
	argument to uint64_t.  Print it using PRIx64 format.
	Based on patch by Jeff Mahoney <jeffm@suse.com>.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce sprintflags64 function.
	This is necessary for the upcoming change of xlat.val type.

	* defs.h (sprintflags): Rename to sprintflags64, change type of integer
	argument to uint64_t.
	(sprintflags): New static inline function.
	* util.c (sprintflags): Rename to sprintflags64, change type of integer
	argument to uint64_t.  Print it using PRIx64 format.
	Based on patch by Jeff Mahoney <jeffm@suse.com>.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

	printxvals: change type of integer argument to uint64_t.
	This is necessary for the upcoming change of xlat.val type.
	All users of printxvals are already prepared for this change.

	* defs.h (printxvals): Change type of integer argument to uint64_t.
	* util.c (printxvals): Likewise.  Print it using PRIx64 format.
	Patch by Jeff Mahoney <jeffm@suse.com>.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

	xlat_search: change type of integer argument to uint64_t.
	This is necessary for the upcoming change of xlat.val type.
	All users of addflags are already prepared for this change.

	* defs.h (xlat_search): Change type of integer argument to uint64_t.
	* util.c (xlat_search): Likewise.  Pass it by pointer.
	(xlat_bsearch_compare): Treat first argument as a pointer.
	Patch by Jeff Mahoney <jeffm@suse.com>.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce xlookup64 function.
	This is necessary for the upcoming change of xlat.val type.

	* defs.h (xlookup): Rename to xlookup64, change type of integer argument
	to uint64_t.
	(xlookup): New static inline function.
	* util.c (xlookup): Rename to xlookup64, change type of integer
	argument to uint64_t.
	Based on patch by Jeff Mahoney <jeffm@suse.com>.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

	addflags: change type of integer argument to uint64_t.
	This is necessary for the upcoming change of xlat.val type.
	All users of addflags are already prepared for this change.

	* defs.h (addflags): Change type of integer argument to uint64_t.
	* util.c (addflags): Likewise.  Print it using PRIx64 format.
	Based on patch by Jeff Mahoney <jeffm@suse.com>.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce printxval64 wrapper.
	This is necessary for the upcoming change of xlat.val type.

	* defs.h (printxval64): New static inline function.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

	Turn printxval macro into a static inline function.
	This is necessary for the upcoming change of xlat.val type.

	* defs.h (printxval): Change to static inline function.

2016-04-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of migrate_pages syscall.
	* tests/migrate_pages.c: New file.
	* tests/migrate_pages.test: New test.
	* tests/.gitignore: Add migrate_pages.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add migrate_pages.test.

	Fix decoding of migrate_pages syscall.
	* numa.c (SYS_FUNC(migrate_pages)): Print syscall arguments
	in the right order.

	tests: check decoding of set_mempolicy syscall.
	* tests/set_mempolicy.c: New file.
	* tests/set_mempolicy.test: New test.
	* tests/.gitignore: Add set_mempolicy.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add set_mempolicy.test.

	tests: check decoding of get_mempolicy syscall.
	* tests/get_mempolicy.c: New file.
	* tests/get_mempolicy.test: New test.
	* tests/.gitignore: Add get_mempolicy.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add get_mempolicy.test.

	numa: fix decoding of nodemask arrays.
	* numa.c (get_nodes): Rewrite an rename to print_nodemask.
	All callers updated.
	(SYS_FUNC(mbind), SYS_FUNC(set_mempolicy), SYS_FUNC(get_mempolicy)):
	Print a delimiter before nodemask argument.

2016-04-27  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of policy argument of get_mempolicy syscall.
	* numa.c (SYS_FUNC(get_mempolicy)): Print policy argument in square
	brackets to indicate indirect access.

	Fix decoding of pid_t argument of migrate_pages syscall.
	* numa.c (SYS_FUNC(migrate_pages)): Print pid_t syscall
	argument using %d format.

	tests: add printxval function to libtests.
	* tests/tests.h (printxval): New prototype.
	* tests/printxval.c: New file.
	* tests/Makefile.am  (libtests_a_SOURCES): Add it.

	tests: check decoding of remap_file_pages syscall.
	* tests/remap_file_pages.c: New file.
	* tests/remap_file_pages.test: New test.
	* tests/.gitignore: Add remap_file_pages.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add remap_file_pages.test.

2016-04-27  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add pause.test.
	* tests/pause.c: New file.
	* tests/pause.test: New test.
	* tests/.gitignore: Add pause.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add pause.test.

	tests: add kill.test.
	* tests/kill.c: New file.
	* tests/kill.test: New test.
	* tests/.gitignore: Add kill.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add kill.test.

2016-04-27  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of pid_t arguments of kill and tgkill syscalls.
	* signal.c (SYS_FUNC(kill), SYS_FUNC(tgkill)): Print pid_t syscall
	arguments using %d format.

2016-04-27  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add mlock.test.
	* tests/mlock.c: New file.
	* tests/mlock.test: New test.
	* tests/.gitignore: Add mlock.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add mlock.test.

2016-04-27  Dmitry V. Levin  <ldv@altlinux.org>

	Move parsers of NUMA related syscalls to numa.c.
	* mem.c (get_nodes, SYS_FUNC(mbind), SYS_FUNC(set_mempolicy),
	SYS_FUNC(get_mempolicy), SYS_FUNC(migrate_pages), SYS_FUNC(move_pages)):
	Move ...
	* numa.c: ... here.
	* Makefile.am (strace_SOURCES): Add numa.c

	tests/umovestr3.c: robustify against os specific issues.
	* tests/umovestr3.c (main): Create extra gap before unreadable page.

	tests: extend test coverage of umovestr short read condition.
	* tests/umovestr3.c: New file.
	* tests/umovestr3.test: New test.
	* tests/.gitignore: Add umovestr3.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add umovestr3.test.

	tests: check decoding of out-of-range syscalls.
	* tests/nsyscalls.c: New file.
	* tests/nsyscalls.test: New test.
	* tests/.gitignore: Add nsyscalls.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add nsyscalls.test.

2016-04-26  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of 3rd argument of getdents/getdents64 syscalls.
	* dirent.c (SYS_FUNC(getdents)): Always print 3rd syscall argument
	as unsigned int.
	* dirent64.c (SYS_FUNC(getdents64)): Likewise.
	* tests/getdents.c (main): Check it.
	* tests/getdents64.c (main): Likewise.

	Fix decoding of LINUX_REBOOT_CMD_RESTART2 argument.
	* reboot.c (SYS_FUNC(reboot)): Cast numeric arguments to unsigned int.

2016-04-26  Dmitry V. Levin  <ldv@altlinux.org>

	.travis.yml: raise sleep delay.
	Previous sleep delay value seems to be not enough nowadays.

	.travis.yml (SLEEP_A_BIT): Raise sleep delay.

2016-04-26  Dmitry V. Levin  <ldv@altlinux.org>

	Move definitions of MPOL_* constants to xlat files.
	* mem.c (MPOL_DEFAULT, MPOL_PREFERRED, MPOL_BIND, MPOL_INTERLEAVE):
	Move to xlat/policies.in.
	(MPOL_F_NODE, MPOL_F_ADDR): Move to xlat/mempolicyflags.in.
	(MPOL_MF_STRICT, MPOL_MF_MOVE, MPOL_MF_MOVE_ALL): Move
	to xlat/mbindflags.in.

	tests: check decoding of renameat2 syscall.
	* tests/renameat2.c: New file.
	* tests/renameat2.test: New test.
	* tests/.gitignore: Add renameat2.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add renameat2.test.

	Add default values for RENAME_* constants.
	* xlat/rename_flags.in: Add default values.

	tests: check decoding of utimes syscall.
	* tests/utimes.c: New file.
	* tests/utimes.test: New test.
	* tests/.gitignore: Add utimes.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add utimes.test.

	tests: check decoding of futimesat syscall.
	* tests/futimesat.c: New file.
	* tests/futimesat.test: New test.
	* tests/.gitignore: Add futimesat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add futimesat.test.

	tests: extend test coverage of mknod syscall.
	* mknod.c (main): Check more corner cases of mode_t parser.
	* mknod.test: Update.

2016-04-26  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add sched_yield.test.
	* tests/sched_yield.c: New file.
	* tests/sched_yield.test: New test.
	* tests/.gitignore: Add sched_yield.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add sched_yield.test.

	tests: add sync.test.
	* tests/sync.c: New file.
	* tests/sync.test: New test.
	* tests/.gitignore: Add sync.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add sync.test.

	tests: add mknodat.test.
	* tests/mknodat.c: New file.
	* tests/mknodat.test: New test.
	* tests/.gitignore: Add mknodat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add mknodat.test.

	tests: add unlink.test.
	* tests/unlink.c: New file.
	* tests/unlink.test: New test.
	* tests/.gitignore: Add unlink.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add unlink.test.

	tests: add reboot.test.
	* tests/reboot.c: New file.
	* tests/reboot.test: New test.
	* tests/.gitignore: Add reboot.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add reboot.test.

2016-04-26  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of statfs family syscalls.
	Fix decoders of fstatfs, fstatfs64, statfs, and statfs64 syscalls
	by rewriting them using mpers infrastructure.

	* fetch_struct_statfs.c: New file.
	* fstatfs.c: Likewise.
	* fstatfs64.c: Likewise.
	* print_statfs.c: Likewise.
	* statfs.h: Likewise.
	* statfs64.c: Likewise.
	* statfs.c: Remove everything except SYS_FUNC(statfs).
	* configure.ac: Remove the check for struct statfs64 in <sys/vfs.h>.
	Add checks for struct statfs and struct statfs64 in <asm/statfs.h>.
	Add checks for f_frsize and f_flags members of these structures.
	* defs.h (struct strace_statfs): New forward declaration.
	(print_struct_statfs, print_struct_statfs64): New prototypes.
	* Makefile.am (libstrace_a_SOURCES): Add fstatfs.c, fstatfs64.c,
	statfs.c, and statfs64.c.
	(strace_SOURCES): Add fetch_struct_statfs.c, print_statfs.c,
	and statfs.h.
	* NEWS: Mention this fix.
	* tests/fstatfs.c: New file.
	* tests/fstatfs64.c: Likewise.
	* tests/statfs64.c: Likewise.
	* tests/xstatfs.c: Likewise.
	* tests/xstatfs64.c: Likewise.
	* tests/xstatfsx.c: Likewise.
	* tests/fstatfs.test: New test.
	* tests/fstatfs64.test: Likewise.
	* tests/statfs64.test: Likewise.
	* tests/statfs.c: Rewrite using xstatfs.c.
	* tests/statfs.test: Update.
	* tests/.gitignore: Add fstatfs, fstatfs64, and statfs64.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add  fstatfs.test, fstatfs64.test, and statfs64.test.
	(EXTRA_DIST): Add xstatfs.c, xstatfs64.c, and xstatfsx.c.

2016-04-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add printflags function to libtests.
	* tests/printflags.c: New file.
	* tests/tests.h (printflags): New prototype.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.

2016-04-26  Dmitry V. Levin  <ldv@altlinux.org>

	Move definition of struct xlat to a separate header file.
	Define struct xlat in a separate file so that it could be used later by
	tests without inclusion of defs.h header file.

	* defs.h (struct xlat, XLAT, XLAT_END): Move ...
	* xlat.h: ... here.
	* Makefile.am (strace_SOURCES): Add xlat.h.

2016-04-25  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: decode osf_statfs64 and osf_fstatfs64 syscalls.
	* linux/alpha/syscallent.h (osf_statfs64, osf_fstatfs64): Set nargs
	and handler.

2016-04-25  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: fix decoding of osf_statfs and osf_fstatfs syscalls.
	Do not attempt to print struct osf_statfs as if it was the same as
	struct statfs.  Since struct osf_statfs has never been decoded properly,
	it is probably too late to implement a decoder, so let's just print the
	pointer.

	* statfs.c [ALPHA] (SYS_FUNC(osf_statfs), SYS_FUNC(osf_fstatfs)): Move ...
	* alpha.c: ... here.  Replace printstatfs with printaddr.

2016-04-25  Dmitry V. Levin  <ldv@altlinux.org>

	statfs: print f_flags field only when ST_VALID flag is set.
	* statfs.c (print_statfs_flags): New function.
	(printstatfs, printstatfs64, printcompat_statfs64): Use it.
	* xlat/statfs_flags.in (ST_VALID): Move to the head of the list.
	* tests/statfs.expected: Update.

2016-04-25  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add symlink.test.
	* tests/symlink.c: New file.
	* tests/symlink.test: New test.
	* tests/.gitignore: Add symlink.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add symlink.test.

	tests: add rmdir.test.
	* tests/rmdir.c: New file.
	* tests/rmdir.test: New test.
	* tests/.gitignore: Add rmdir.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add rmdir.test.

	tests: add setdomainname.test.
	* tests/setdomainname.c: New file.
	* tests/setdomainname.test: New test.
	* tests/.gitignore: Add setdomainname.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setdomainname.test.

	tests: add sched_rr_get_interval.test.
	* tests/sched_rr_get_interval.c: New file.
	* tests/sched_rr_get_interval.test: New test.
	* tests/.gitignore: Add sched_rr_get_interval.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add sched_rr_get_interval.test.

2016-04-25  Dmitry V. Levin  <ldv@altlinux.org>

	statfs: decode f_flags field of struct statfs.
	* xlat/statfs_flags.in: New file.
	* statfs.c: Include "xlat/statfs_flags.h".
	(printstatfs) [_STATFS_F_FLAGS]: Print statbuf.f_flags as flags.
	(printstatfs64) [_STATFS_F_FLAGS]: Likewise.
	(printcompat_statfs64): Likewise.
	* tests/statfs.expected: Update.

2016-04-25  Zev Weiss  <zev@bewilderbeest.net>

	statfs: don't quote f_type macro names.
	* statfs.c (sprintfstype): Don't add double-quotes to fs magic macros.
	* tests/statfs.expected: Remove double-quotes.

2016-04-25  Dmitry V. Levin  <ldv@altlinux.org>

	tests/shmxt.c: robustify against arch specific issues.
	Do not treat failed shmat(SHM_RND) as a test failure.
	This change partially reverts commit
	bea707377d2ee3e1950bfa43537ef928163a5fa6.

	* tests/shmxt.c (main): Use SHM_RND in the second shmat call,
	do not treat its potential error as a test failure.

2016-04-23  Dmitry V. Levin  <ldv@altlinux.org>

	Rename PRI__s64 to PRI__d64.
	As PRI__*64 macros mirror PRI*64 macros from inttypes.h, follow the
	principle of least astonishment and name these macros the same way.

	* defs.h (PRI__s64): Rename to PRI__d64.

2016-04-23  Dmitry V. Levin  <ldv@altlinux.org>

	Fix old_mmap output when mmap arguments are unfetchable.
	* mem.c (SYS_FUNC(old_mmap)): Use umove_or_printaddr instead of umoven
	to fetch mmap arguments, return RVAL_DECODED when umove_or_printaddr
	fails.
	* tests/old_mmap.c (main): Check it.

2016-04-22  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64: fix old_mmap output for arm personality.
	* mem.c (SYS_FUNC(old_mmap)) [AARCH64]: Fetch mmap arguments
	as 32-bit integers.

	Define old_mmap parser only on architectures that use it.
	* mem.c (SYS_FUNC(old_mmap)): Define only on AARCH64, ARM, I386, X86_64,
	X32, M68K, S390, and S390X.

2016-04-22  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend test coverage of mmap syscall.
	Check decoding of "old mmap" edition of mmap syscall
	on those architectures that define it.

	* tests/old_mmap.c: New file.
	* tests/old_mmap.test: New test.
	* tests/.gitignore: Add old_mmap.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add old_mmap.test.

2016-04-22  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend test coverage of mincore syscall.
	* tests/mincore.c (print_mincore): New function.
	(test_mincore): Use it.  Check mincore with invalid vec address.
	Check mincore with length argument not a multiple of the page size.
	(main): Check with DEFAULT_STRLEN pages.

2016-04-22  Dmitry V. Levin  <ldv@altlinux.org>

	Move parsers of sync_file_range and sync_file_range2 syscalls to libstrace
	For each given architecture only one of these two syscalls has a
	syscallent entry.  When each parser is placed into a separate file,
	moving to libstrace ensures that only one of them that is need
	is linked into strace executable.

	* sync_file_range.c (SYS_FUNC(sync_file_range2)): Move ...
	* sync_file_range2.c: ... here.
	* Makefile.am (strace_SOURCES): Move sync_file_range.c ...
	(libstrace_a_SOURCES): ... here.  Add sync_file_range2.c.
	(strace_SOURCES_c): Add filtered libstrace_a_SOURCES.

2016-04-22  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of clock_adjtime syscall.
	* tests/clock_adjtime.c: New file.
	* tests/clock_adjtime.test: New test.
	* tests/.gitignore: Add clock_adjtime.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add clock_adjtime.test.

2016-04-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: do not include <assert.h> unnecessarily.
	Automatically change tests/*.c files using the following script:

	for f in tests/*.c; do
		grep -q '\<assert(' "$f" ||
			sed -i '/# *include *<assert\.h>/d' "$f"
	done

2016-04-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: do not include <errno.h> unnecessarily.
	Automatically change tests/*.c files using the following script:

	for f in tests/*.c; do
		grep -Fv errno.h "$f" |
		grep -Ewq '(si_)?errno|SOCK_FILTER_DENY_SYSCALL' ||
			sed -i '/# *include *<errno\.h>/d' "$f"
	done

2016-04-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests/xetpriority.c: print syscall() result using %ld format.

	tests/xetpgid.c: print syscall() result using %ld format.

	tests/xchownx.c: use errno2name.

	tests/userfaultfd.c: stop using assert.

	tests/unlinkat.c: print syscall() result using %ld format.

	tests/umount.c: use errno2name.

	tests/truncate64.c: cleanup.
	* tests/truncate64.c (main): Use errno2name, stop using assert.

	tests/truncate.c: cleanup.
	* tests/truncate.c (main): Use errno2name, stop using assert.

	tests/tee.c: stop using assert.

	tests/syslog.c: use errno2name.

	tests/sync_file_range2.c: stop using assert.

	tests/sync_file_range.c: stop using assert.

	tests/symlinkat.c: cleanup.

	tests/swap.c: cleanup.
	* tests/swap.c (error_msg): Remove.
	(main): Use errno2name.

	tests/splice.c: stop using assert.

	tests/setugid.c: cleanup.

	tests/sethostname.c: use errno2name.

	tests/setgroups.c: use errno2name.
	* tests/setgroups.c (errno2str): Remove.
	(main): Use errno2name.

	tests/seccomp-strict.c: cleanup.
	* tests/seccomp-strict.c (main): Use errno2name, stop using assert.

	tests/seccomp-filter.c: cleanup.
	* tests/seccomp-filter.c (main): Use errno2name, stop using assert.

	tests/sched_xetscheduler.c: print syscall() result using %ld format.

	tests/sched_xetparam.c: print syscall() result using %ld format.

	tests/renameat.c: print syscall() result using %ld format.

	tests/rename.c: print syscall() result using %ld format.

	tests/readv.c: cleanup.

	tests/pwritev.c: use errno2name.

	tests/preadv-pwritev.c: cleanup.

	tests/prctl-seccomp-strict.c: cleanup.
	* tests/prctl-seccomp-strict.c (main): Use errno2name,
	stop using assert.

	tests/openat.c: use errno2name.

	tests/open.c: use errno2name.

	tests/mlockall.c: cleanup.

	tests/mlock2.c: stop using assert.

	tests/mknod.c: print syscall() result using %ld format.

	tests/mkdirat.c: print syscall() result using %ld format.

	tests/lseek.c: cleanup.
	* tests/lseek.c (main): Use errno2name, stop using assert.

	tests/llseek.c: cleanup.
	* tests/llseek.c (main): Use errno2name, stop using assert.

	tests/linkat.c: print syscall() result using %ld format.

	tests/iopl.c: use errno2name.

	tests/ioperm.c: use errno2name.

	tests/getgroups.c: use errno2name.
	* tests/getgroups.c (errno2str): Remove.
	(main): Use errno2name.

	tests/ftruncate64.c: cleanup.
	* tests/ftruncate64.c (main): Use errno2name, stop using assert.

	tests/ftruncate.c: cleanup.
	* tests/ftruncate.c (main): Use errno2name, stop using assert.

	tests/fsync.c: print syscall() result using %ld format.

	tests/flock.c: print syscall() result using %ld format.

	tests/file_handle.c: use errno2name.

	tests/fdatasync.c: print syscall() result using %ld format.

	tests/fchownat.c: use errno2name.

	tests/fchmodat.c: use errno2name.

	tests/fchmod.c: use errno2name.

	tests/faccessat.c: print syscall() result using %ld format.

	tests/epoll_wait.c: print syscall() result using %ld format.

	tests/epoll_ctl.c: print syscall() result using %ld format.

	tests/epoll_create1.c: cleanup.
	* tests/epoll_create1.c (main): Use errno2name, stop using assert.

	tests/epoll_create.c: print syscall() result using %ld format.

	tests/dup3.c: print syscall() result using %ld format.

	tests/dup2.c: print syscall() result using %ld format.

	tests/dup.c: cleanup.

	tests/creat.c: stop using sys/stat.h.

	tests/copy_file_range.c: stop using assert.

	tests/chroot.c: use errno2name.

	tests/aio.c: use errno2name.

	tests: cleanup acct.test.
	* tests/acct.c (main): Use errno2name, stop using assert,
	change sample file name.
	* tests/acct.test: Update.

	tests: use errno2name()
	Automatically change tests/*.c files using the following sed regexp:
	sed -i 's/errno == E[[:alnum:]]\+ ? "E[[:alnum:]]\+" : "E[[:alnum:]]\+"/errno2name()/g'

	tests/dup.c: include "tests.h"
	This is going to be necessary for the following commit.

2016-04-21  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add getpgrp.test.
	* tests/getpgrp.c: New file.
	* tests/getpgrp.test: New test.
	* tests/.gitignore: Add getpgrp.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add getpgrp.test.

	tests: add access.test.
	* tests/access.c: New file.
	* tests/access.test: New test.
	* tests/.gitignore: Add access.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add access.test.

	tests: add fchdir.test.
	* tests/fchdir.c: New file.
	* tests/fchdir.test: New test.
	* tests/.gitignore: Add fchdir.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add fchdir.test.

	tests: add mkdir.test.
	* tests/mkdir.c: New file.
	* tests/mkdir.test: New test.
	* tests/.gitignore: Add mkdir.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add mkdir.test.

	tests: add getsid.test.
	* tests/getsid.c: New file.
	* tests/getsid.test: New test.
	* tests/.gitignore: Add getsid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add getsid.test.

2016-04-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add errno2name function to libtests.
	Add a simple translator of errno to its name, so one could
	simply use errno2name() instead of complex expressions like
	errno == EINVAL ? "EINVAL" : "EFAULT".

	* tests.h (errno2name): New prototype.
	* errno2name.c: New file.
	* Makefile.am (libtests_a_SOURCES): Add it.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	hppa: rename ECANCELLED to ECANCELED.
	hppa seems to be the only architecture that defines ECANCELLED synonym
	for ECANCELED constant, other architectures just define ECANCELED.
	Change the way how this constant is printed on hppa to be in line
	with other architectures.

	* linux/hppa/errnoent.h [253]: Rename ECANCELLED to ECANCELED.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	Remove parser of unimplemented timerfd syscall.
	timerfd syscall was introduced in v2.6.22-rc1, but in v2.6.25-rc1
	it was replaced by timerfd_* syscall family.

	* linux/avr32/syscallent.h (timerfd): Fix nargs.
	* linux/dummy.h (sys_timerfd): Add stub alias.
	* time.c (SYS_FUNC(timerfd)): Remove.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: workaround kernel bugs in seccomp-strict.test and prctl-seccomp-strict.test
	If kernel implementation of strict seccomp mode is buggy, test programs
	will be killed by SIGKILL.  This is a known problem at least on
	x32 and mips.  Skip affected tests if this is the case.

	This change partially revert commit 9c1a72cd3f3d52d573876ce474b620a5f141fb1b.

	* tests/seccomp-strict.c (main): Remove workaround for x32.
	* tests/prctl-seccomp-strict.c: Likewise.
	* tests/seccomp-strict.test: Skip the test if the test program
	has been killed by SIGKILL.
	* tests/prctl-seccomp-strict.test: Likewise.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests/shmxt.c: do not use SHM_RND, it is unreliable.
	* tests/shmxt.c (main): Do not set SHM_RND flag.

	tests/rt_sigpending.c: fix for systems where _NSIG > 16 * sizeof(long)
	* tests/rt_sigsuspend.c (iterate): Do not assume that size will be less
	than sizeof(long) on the second iteration.

	prctl-seccomp-strict.test: robustify against unrelated prctl invocations
	* tests/prctl-seccomp-strict.test: Filter out PR_GET_* prctl calls.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: adjust rt_sigpending to older kernels.
	With linux kernels older than v3.9-rc1, compat rt_sigpending syscall
	could fail with EFAULT in cases where on later kernels it succeeds.
	Adjust the test to handle both cases properly.

	* tests/rt_sigpending.c (iterate): Stop iterations if rt_sigpending
	failed with EFAULT.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: adjust readv/writev and preadv/pwritev tests to older kernels.
	With linux kernels older than v3.16-rc1, iovec based compat syscalls may
	return EINVAL in some cases where on later kernels they return EFAULT.
	Adjust tests to handle both cases properly.

	* tests/preadv-pwritev.c: Include <errno.h>.
	(main): Print either "EINVAL" or "EFAULT" depending on errno.
	* tests/pwritev.c: Likewise.
	* tests/readv.c: Likewise.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: remove obsolete non-strict uid tests.
	Recently added strict tests for uid/gid related syscalls
	made old uid tests obsolete.

	* tests/uid.awk: Remove.
	* tests/uid.c: Remove.
	* tests/uid.test: Remove.
	* tests/uid16.c: Remove.
	* tests/uid16.test: Remove.
	* tests/uid32.c: Remove.
	* tests/uid32.test: Remove.
	* tests/.gitignore: Remove uid, uid16, and uid32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Remove uid.test, uid16.test, and uid32.test.
	(EXTRA_DIST): Remove uid.awk.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend test coverage of getuid/getgid family syscalls.
	Add strict tests for getuid, getuid32, getgid, getgid32, geteuid,
	geteuid32, getegid, and getegid32 syscalls.

	* tests/getegid.c: New file.
	* tests/getegid.test: New test.
	* tests/getegid32.c: New file.
	* tests/getegid32.test: New test.
	* tests/geteuid.c: New file.
	* tests/geteuid.test: New test.
	* tests/geteuid32.c: New file.
	* tests/geteuid32.test: New test.
	* tests/getgid.c: New file.
	* tests/getgid.test: New test.
	* tests/getgid32.c: New file.
	* tests/getgid32.test: New test.
	* tests/getuid.c: New file.
	* tests/getuid.test: New test.
	* tests/getuid32.c: New file.
	* tests/getuid32.test: New test.
	* tests/.gitignore: Add getuid, getuid32, getgid, getgid32, geteuid,
	* geteuid32, getegid, and getegid32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add getegid.test, getegid32.test, geteuid.test,
	geteuid32.test, getgid.test, getgid32.test, getuid.test,
	and getuid32.test.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend test coverage of getresgid32 syscall.
	* tests/getresgid32.c: New file.
	* tests/getresgid32.test: New test.
	* tests/.gitignore: Add getresgid32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add getresgid32.test.

	tests: extend test coverage of getresgid syscall.
	* tests/getresgid.c: New file.
	* tests/getresgid.test: New test.
	* tests/.gitignore: Add getresgid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add getresgid.test.

	tests: extend test coverage of getresuid32 syscall.
	* tests/getresuid32.c: New file.
	* tests/getresuid32.test: New test.
	* tests/.gitignore: Add getresuid32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add getresuid32.test.

	tests: extend test coverage of getresuid syscall.
	* tests/getresugid.c: New file.
	* tests/getresuid.c: New file.
	* tests/getresuid.test: New test.
	* tests/.gitignore: Add getresuid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add getresuid.test.
	(EXTRA_DIST): Add getresugid.c.

2016-04-20  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add symlinkat.test.
	* tests/symlinkat.c: New file.
	* tests/symlinkat.test: New test.
	* tests/.gitignore: Add symlinkat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add symlinkat.test.

	tests: add iopl.test.
	* tests/iopl.c: New file.
	* tests/iopl.test: New test.
	* tests/.gitignore: Add iopl.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add iopl.test.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	mips o32, powerpc, powerpc64: fix decoding of iopl syscall.
	* linux/mips/syscallent-o32.h (iopl): Fix nargs.
	* linux/powerpc/syscallent.h (iopl): Fix nargs and sys_func.
	* linux/powerpc64/syscallent.h (iopl): Likewise.

2016-04-20  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add ioperm.test.
	* tests/ioperm.c: New file.
	* tests/ioperm.test: New test.
	* tests/.gitignore: Add ioperm.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add ioperm.test.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	Fix corner cases of getgroups and setgroups syscall decoders.
	* uid.c (print_groups): New function.
	(SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Use it.
	Print first syscall argument using %u format.
	* tests/getgroups.c: New file.
	* tests/getgroups.test: New test.
	* tests/getgroups32.c: New file.
	* tests/getgroups32.test: New test.
	* tests/setgroups.c: New file.
	* tests/setgroups.test: New test.
	* tests/setgroups32.c: New file.
	* tests/setgroups32.test: New test.
	* tests/.gitignore: Add getgroups, getgroups32, setgroups,
	and setgroups32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add getgroups.test, getgroups32.test,
	setgroups.test, and setgroups32.test.

	Cleanup setfsuid syscall decoder.
	* uid.c (SYS_FUNC(setfsuid)): Remove redundant check.

	tests: check decoding of setfsgid32 syscall.
	* tests/setfsgid32.c: New file.
	* tests/setfsgid32.test: New test.
	* tests/.gitignore: Add setfsgid32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setfsgid32.test.

	tests: check decoding of setfsgid syscall.
	* tests/setfsugid.c: New file.
	* tests/setfsgid.c: New file.
	* tests/setfsgid.test: New test.
	* tests/.gitignore: Add setfsgid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setfsgid.test.
	(EXTRA_DIST): Add setfsugid.c.

	tests: check decoding of setfsuid32 syscall.
	* tests/setfsuid32.c: New file.
	* tests/setfsuid32.test: New test.
	* tests/.gitignore: Add setfsuid32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setfsuid32.test.

	tests: check decoding of setfsuid syscall.
	* tests/setfsugid.c: New file.
	* tests/setfsuid.c: New file.
	* tests/setfsuid.test: New test.
	* tests/.gitignore: Add setfsuid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setfsuid.test.
	(EXTRA_DIST): Add setfsugid.c.

	tests: extend test coverage of setresgid32 syscall.
	* tests/setresgid32.c: New file.
	* tests/setresgid32.test: New test.
	* tests/.gitignore: Add setresgid32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setresgid32.test.

	tests: extend test coverage of setresgid syscall.
	* tests/setresgid.c: New file.
	* tests/setresgid.test: New test.
	* tests/.gitignore: Add setresgid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setresgid.test.

	tests: extend test coverage of setresuid32 syscall.
	* tests/setresuid32.c: New file.
	* tests/setresuid32.test: New test.
	* tests/.gitignore: Add setresuid32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setresuid32.test.

	tests: extend test coverage of setresuid syscall.
	* tests/setresugid.c: New file.
	* tests/setresuid.c: New file.
	* tests/setresuid.test: New test.
	* tests/.gitignore: Add setresuid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setresuid.test.
	(EXTRA_DIST): Add setresugid.c.

	tests: extend test coverage of setregid32 syscall.
	* tests/setregid32.c: New file.
	* tests/setregid32.test: New test.
	* tests/.gitignore: Add setregid32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setregid32.test.

	tests: extend test coverage of setregid syscall.
	* tests/setregid.c: New file.
	* tests/setregid.test: New test.
	* tests/.gitignore: Add setregid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setregid.test.

	tests: extend test coverage of setreuid32 syscall.
	* tests/setreuid32.c: New file.
	* tests/setreuid32.test: New test.
	* tests/.gitignore: Add setreuid32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setreuid32.test.

	tests: extend test coverage of setreuid syscall.
	* tests/setreugid.c: New file.
	* tests/setreuid.c: New file.
	* tests/setreuid.test: New test.
	* tests/.gitignore: Add setreuid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setreuid.test.
	(EXTRA_DIST): Add setreugid.c.

	tests: extend test coverage of setgid32 syscall.
	* tests/setgid32.c: New file.
	* tests/setgid32.test: New test.
	* tests/.gitignore: Add setgid32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setgid32.test.

	tests: extend test coverage of setgid syscall.
	* tests/setgid.c: New file.
	* tests/setgid.test: New test.
	* tests/.gitignore: Add setgid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setgid.test.

	tests: extend test coverage of setuid32 syscall.
	* tests/setuid32.c: New file.
	* tests/setuid32.test: New test.
	* tests/.gitignore: Add setuid32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setuid32.test.

	tests: extend test coverage of setuid syscall.
	* tests/setugid.c: New file.
	* tests/setuid.c: New file.
	* tests/setuid.test: New test.
	* tests/.gitignore: Add setuid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add setuid.test.
	(EXTRA_DIST): Add setugid.c.

2016-04-20  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add shmxt.test.
	* tests/shmxt.c: New file.
	* tests/shmxt.test: New test.
	* tests/.gitignore: Add shmxt.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add shmxt.test.

2016-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: fix decoding of shmat syscall.
	On alpha, shmat syscall is known as osf_shmat.

	* linux/alpha/syscallent.h (osf_shmat): Fix sys_flags and sys_func.

2016-04-20  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add semop.test.
	* tests/semop.c: New file.
	* tests/semop.test: New test.
	* tests/.gitignore: Add semop.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add semop.test.

2016-04-18  Dmitry V. Levin  <ldv@altlinux.org>

	prctl-seccomp-filter-v.test: robustify against unrelated prctl invocations
	* tests/prctl-seccomp-filter-v.test: Filter out PR_GET_* prctl calls.

	Reported-by: Steve McIntyre <steve@einval.com>

2016-04-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests/pselect6.c: fix potential output mismatch.
	* tests/pselect6.c (main): In the last case of printing pselect6
	syscall, print the last argument the same way as in other cases.

	Reported-by: Steve McIntyre <steve@einval.com>

2016-04-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of fchown32 syscall.
	* tests/fchown32.c: New file.
	* tests/fchown32.test: New test.
	* tests/.gitignore: Add fchown32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add fchown32.test.

	tests: check decoding of fchown syscall.
	* tests/fchown.c: New file.
	* tests/fchown.test: New test.
	* tests/.gitignore: Add fchown.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add fchown.test.

	tests: check decoding of lchown32 syscall.
	* tests/lchown32.c: New file.
	* tests/lchown32.test: New test.
	* tests/.gitignore: Add lchown32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add lchown32.test.

	tests: check decoding of lchown syscall.
	* tests/lchown.c: New file.
	* tests/lchown.test: New test.
	* tests/.gitignore: Add lchown.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add lchown.test.

	tests: check decoding of chown32 syscall.
	* tests/chown32.c: New file.
	* tests/chown32.test: New test.
	* tests/.gitignore: Add chown32.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add chown32.test.

	tests: check decoding of chown syscall.
	* tests/chown.c: New file.
	* tests/chown.test: New test.
	* tests/xchownx.c: New file.
	* tests/.gitignore: Add chown.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add chown.test.
	(EXTRA_DIST): Add xchownx.c.

	Fix decoding of 16-bit uid_t/git_t.
	* uid.c (printuid): Always cast value to uid_t.

2016-04-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: move kernel uid overflow check to libtests.
	This code used in two different places, so move it to the library.

	* tests/overflowuid.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.
	* tests/tests.h (check_overflowuid, check_overflowgid): New prototypes.
	* tests/uid.c (main): Use check_overflowuid.
	* tests/uid16.c (main): Likewise.

2016-04-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip seccomp-strict.test and prctl-seccomp-strict.test on x32.
	As x86_64 kernel does not support x32 syscall numbers in
	SECCOMP_MODE_STRICT, skip affected tests on x32.

	* tests/seccomp-strict.c (main) [__x86_64__ && __ILP32__]: Bail out
	using error_msg_and_skip.
	* tests/prctl-seccomp-strict.c: Likewise.

2016-04-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add seccomp-filter.test.
	* tests/seccomp-filter.c: New file.
	* tests/seccomp-filter.test: New test.
	* tests/.gitignore: Add seccomp-filter.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add seccomp-filter.test.

2016-04-12  Dmitry V. Levin  <ldv@altlinux.org>

	seccomp: fix decoding of sock_fprog and sock_filter structures.
	Always print struct sock_fprog.len.
	Fix printing of unfetchable elements in sock_filter array.
	Fix printing of large sock_filter arrays.

	* seccomp.c (decode_fprog): Rewrite into decode_seccomp_fprog and
	print_seccomp_fprog.
	(print_seccomp_filter): Replace decode_fprog with print_seccomp_fprog.
	* tests/prctl-seccomp-filter-v.c (main): Update.
	* tests/seccomp-filter-v.c: New file.
	* tests/seccomp-filter-v.test: New test.
	* tests/.gitignore: Add seccomp-filter-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add seccomp-filter-v.test.

2016-04-11  Dmitry V. Levin  <ldv@altlinux.org>

	seccomp: print SECCOMP_* and BPF_* constants in a more compact way.
	* seccomp.c (decode_bpf_code, decode_bpf_stmt): Replace " | " with "|".
	* tests/prctl-seccomp-filter-v.c: Update.

	tests: rename seccomp.test to prctl-seccomp-filter-v.test.
	* tests/.gitignore: Replace seccomp with prctl-seccomp-filter-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Replace seccomp.test with prctl-seccomp-filter-v.test.
	* tests/seccomp.c: Rename to tests/prctl-seccomp-filter-v.c.
	* tests/seccomp.test: Rename to tests/prctl-seccomp-filter-v.test.

	tests: add seccomp-strict.test.
	* tests/seccomp-strict.c: New file.
	* tests/seccomp-strict.test: New test.
	* tests/.gitignore: Add seccomp-strict.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add seccomp-strict.test.

	tests: add prctl-seccomp-strict.test.
	* tests/prctl-seccomp-strict.c: New file.
	* tests/prctl-seccomp-strict.test: New test.
	* tests/.gitignore: Add prctl-seccomp-strict.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add prctl-seccomp-strict.test.

	tests: bring lists back to the sorted order.

2016-04-10  Dmitry V. Levin  <ldv@altlinux.org>

	tests/epoll_create1.c: extend for the case of ENOSYS.
	* epoll_create1.c: Make the test work in case of epoll_create1
	returning ENOSYS.

	tests/epoll_ctl.c: extend epoll_ctl coverage.
	* tests/epoll_ctl.c (main): Check EPOLL_CTL_DEL decoding.  Check
	decoding of long int descriptors and NULL struct epoll_event pointer.

2016-04-09  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add mlockall.test.
	* tests/mlockall.c: New file.
	* tests/mlockall.test: New test.
	* tests/.gitignore: Add mlockall.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add mlockall.test.

2016-04-08  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add epoll_wait.test.
	* tests/epoll_wait.c: New file.
	* tests/epoll_wait.test: New test.
	* tests/.gitignore: Add epoll_wait.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add epoll_wait.test.

	tests: add epoll_ctl.test.
	* tests/epoll_ctl.c: New file.
	* tests/epoll_ctl.test: New test.
	* tests/.gitignore: Add epoll_ctl.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add epoll_ctl.test.

	tests: add epoll_create.test.
	* tests/epoll_create.c: New file.
	* tests/epoll_create.test: New test.
	* tests/.gitignore: Add epoll_create.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add epoll_create.test.

2016-04-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests/pread64-pwrite64.c: minor cleanup.
	* tests/pread64-pwrite64.c: Do not include <sys/uio.h>.

2016-04-07  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of swapon flags.
	* swapon.c (SYS_FUNC(swapon)): Print priority regardless
	of SWAP_FLAG_PREFER flag being set.
	* tests/swap.c (error_msg): Handle EINVAL.
	(main): Check decoding of swapon flags.

	tests/unlinkat.c: check AT_* decoding.
	* tests/unlinkat.c (main): Check decoding of AT_* constants.

	tests/linkat.c: check AT_* decoding.
	* tests/linkat.c (main): Check decoding of AT_* constants.

2016-04-06  Elliott Hughes  <enh@google.com>

	Improve decoding of Android's PR_SET_VMA prctl.
	Before:

	  prctl(0x53564d41 /* PR_??? */, 0, 0x7f8ab53000, 4096,
	        "atexit handlers") = 0

	After:

	  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0x7fa8cbd000, 4096,
	        "atexit handlers") = 0

	* prctl.c (SYS_FUNC(prctl)) [__ANDROID__]: Do not define PR_SET_VMA.
	* Hard-code PR_SET_VMA_ANON_NAME, the only current sub-option.
	* xlat/prctl_options.in: Add PR_SET_VMA.

2016-04-06  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add mkdirat.test.
	* tests/mkdirat.c: New file.
	* tests/mkdirat.test: New test.
	* tests/.gitignore: Add mkdirat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add mkdirat.test.

	tests: add swap.test.
	* tests/swap.c: New file.
	* tests/swap.test: New test.
	* tests/.gitignore: Add swap.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add swap.test.

	tests: add unlinkat.test.
	* tests/unlinkat.c: New file.
	* tests/unlinkat.test: New test.
	* tests/.gitignore: Add unlinkat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add unlinkat.test.

	tests: add linkat.test.
	* tests/linkat.c: New file.
	* tests/linkat.test: New test.
	* tests/.gitignore: Add linkat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add linkat.test.

2016-04-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add sync_file_range.test and sync_file_range2.test.
	* configure.ac (AC_CHECK_FUNCS): Add sync_file_range.
	* tests/sync_file_range.c: New file.
	* tests/sync_file_range2.c: Likewise.
	* tests/sync_file_range.test: New test.
	* tests/sync_file_range2.test: Likewise.
	* tests/.gitignore: Add sync_file_range and sync_file_range2.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add sync_file_range.test and sync_file_range2.test.

2016-04-05  Dmitry V. Levin  <ldv@altlinux.org>

	Add default values for SYNC_FILE_RANGE_* constants.
	* xlat/sync_file_range_flags.in: Add default values.

2016-04-05  Elliott Hughes  <enh@google.com>

	Fix sync_file_range2 output.
	Before:

	  sync_file_range2(3SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE|
	    SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0, )

	After:

	  sync_file_range2(3, SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE|
	    SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0)

	* sync_file_range.c (SYS_FUNC(sync_file_range2)): Output the ", "
	in the right place.

2016-04-04  Dmitry V. Levin  <ldv@altlinux.org>

	Replace PF_* constants with AF_*
	AF_* constants appear to be more standardized, and in practice there's
	always a one to one relationship between AF_* and PF_*, so let's
	use AF_* instead of PF_*.

	* xlat/domains.in: Remove.
	* net.c: Do not define PF_UNSPEC.  Stop including "xlat/domains.h".
	Replace PF_* with AF_*.  Replace domains with addrfams.
	* tests/inet-cmsg.c: Replace PF_INET with AF_INET.
	* tests/net-yy-inet.c: Likewise.
	* tests/netlink_inet_diag.c: Likewise.
	* tests/net-accept-connect.c: Replace PF_LOCAL with AF_LOCAL.
	* tests/net-y-unix.c: Likewise.
	* tests/net-yy-unix.c: Likewise.
	* tests/netlink_unix_diag.c: Likewise.
	* tests/net.expected: Replace PF_ with AF_.

2016-04-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add read-write.test.
	* tests/read-write.c: New file.
	* tests/read-write.test: New test.
	* tests/.gitignore: Add read-write.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add read-write.test.

2016-04-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests/pread64-pwrite64.test: extend dumpio coverage.
	* tests/pread64-pwrite64.c (dump_str, print_hex, test_dump):
	New functions.
	(main): Use them to test dumping of various data.
	* tests/pread64-pwrite64.test: Update.

	tests: add hexdump_memdup function to libtests.
	* tests/hexdump_strdup.c (hexdump_memdup): New function.
	(hexdump_strdup): Use it.
	* tests/tests.h (hexdump_memdup): New prototype.

	tests: add fchownat.test.
	* tests/fchownat.c: New file.
	* tests/fchownat.test: New test.
	* tests/.gitignore: Add fchownat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add fchownat.test.

	tests: add fchmodat.test.
	* tests/fchmodat.c: New file.
	* tests/fchmodat.test: New test.
	* tests/.gitignore: Add fchmodat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add fchmodat.test.

	Fix printing of negative offsets in pread64 and pwrite64 syscalls.
	* io.c (SYS_FUNC(pread), SYS_FUNC(pwrite)): Print offset
	using %lld format string.
	* tests/pread64-pwrite64.c: New file.
	* tests/pread64-pwrite64.test: New test.
	* tests/.gitignore: Add pread64-pwrite64.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(pread64_pwrite64_CPPFLAGS): New variable.
	(DECODER_TESTS): Add pread64-pwrite64.

	tests/hexdump_strdup.c: add support for longer strings.
	* tests/hexdump_strdup.c (hexdump_strdup): Output extra space character
	before hexdumping of the 9th symbol.

	tests/preadv-pwritev.c: fix typo in error diagnostics.
	* tests/preadv-pwritev.c (main): Fix typo in error message.

2016-04-01  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add chroot.test.
	* tests/chroot.c: New file.
	* tests/chroot.test: New test.
	* tests/.gitignore: Add chroot.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add chroot.test.

	tests: add fdatasync.test.
	* tests/fdatasync.c: New file.
	* tests/fdatasync.test: New test.
	* tests/.gitignore: Add fdatasync.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add fdatasync.test.

	tests: add fsync.test.
	* tests/fsync.c: New file.
	* tests/fsync.test: New test.
	* tests/.gitignore: Add fsync.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add fsync.test.

	tests: add sethostname.test.
	* tests/sethostname.c: New file.
	* tests/sethostname.test: New test.
	* tests/.gitignore: Add sethostname.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add sethostname.test.

2016-04-01  Dmitry V. Levin  <ldv@altlinux.org>

	Consistently handle unsigned arguments of mmap* and remap_file_pages.
	Explicitly declare first 4 arguments of mmap* and all remap_file_pages
	arguments as unsigned to avoid potential sign extension issues.

	* mem.c (print_mmap, SYS_FUNC(remap_file_pages)): Assign syscall
	arguments to local variables of appropriate types.

2016-04-01  Dmitry V. Levin  <ldv@altlinux.org>

	Consistently handle 2nd and 3rd arguments of [gs]etsockopt as unsigned.
	The second (level) and third (optname) arguments of getsockopt and
	setsockopt syscalls are enums, so treat them consistently as enums:
	use "unsigned int" type to avoid potential sign extension issues.

	* net.c (print_sockopt_fd_level_name, print_getsockopt,
	print_setsockopt): Change type of "level" and "name" arguments
	from "int" to "unsigned int".

2016-04-01  Dmitry V. Levin  <ldv@altlinux.org>

	Add sentinel attribute to printxvals.
	* gcc_compat.h (ATTRIBUTE_SENTINEL): New macro.
	* defs.h (printxvals): Add ATTRIBUTE_SENTINEL.

	Cleanup parser of ptrace syscall.
	* process.c (print_user_offset_addr): New function for printing offset
	address in the tracee's USER area.
	(SYS_FUNC(ptrace)): Assign syscall arguments to local variables with
	appropriate types.  Print pid argument as int.  Use switch statement
	in the code that handles address argument.  Use print_user_offset_addr
	to print address in PTRACE_PEEKUSER and PTRACE_POKEUSER requests.

2016-03-31  Jeff Mahoney  <jeffm@suse.com>

	Define PRI__[uxs]64 macros to print __s64 and __u64 values.
	Rather than cast every __u64 or __s64 before printing,
	define printing helpers for those types directly.

	* defs.h (PRI__s64, PRI__u64, PRI__x64): New macros.

2016-03-31  Dmitry V. Levin  <ldv@altlinux.org>

	Implement dumping of preadv and pwritev syscalls.
	* syscall.c (dumpio): Add SEN_preadv and SEN_pwritev.
	* NEWS: Mention this.
	* tests/preadv-pwritev.c: New file.
	* tests/preadv-pwritev.test: New test.
	* tests/.gitignore: Add preadv-pwritev.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(preadv_pwritev_CPPFLAGS): New variable.
	(DECODER_TESTS): Add preadv-pwritev.

2016-03-30  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of preadv syscall in case of short read.
	* io.c (SYS_FUNC(preadv)): Call tprint_iov_upto instead
	of tprint_iov and specify syscall return value as a data size limit.
	* NEWS: Mention it.
	* tests/preadv.c (main): Add a test case for preadv short read.

	Fix printing of negative offsets in preadv and pwritev syscalls.
	* io.c (print_llu_from_low_high_val): Rename to
	print_lld_from_low_high_val, all callers changed.
	Print value as a signed integer.
	* tests/preadv.c: New file.
	* tests/preadv.test: New test.
	* tests/pwritev.c: New file.
	* tests/pwritev.test: New test.
	* tests/.gitignore: Add preadv and pwritev.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(preadv_CPPFLAGS, pwritev_CPPFLAGS): New variables.
	(DECODER_TESTS): Add preadv.test and pwritev.test.

	Fix printing of unreadable struct iovec.
	* io.c (tprint_iov_upto): If the first element of iovec array is
	unreadable, print its address without array markup.
	* tests/readv.c (main): Check it.

	tests: factor out a part common to many simply organized test scripts.
	* tests/init.sh (run_strace_match_diff): New function.
	* tests/acct.test: Rewrite using run_strace_match_diff.
	* tests/aio.test: Likewise.
	* tests/alarm.test: Likewise.
	* tests/chmod.test: Likewise.
	* tests/clock_nanosleep.test: Likewise.
	* tests/clock_xettime.test: Likewise.
	* tests/copy_file_range.test: Likewise.
	* tests/creat.test: Likewise.
	* tests/dup.test: Likewise.
	* tests/dup2.test: Likewise.
	* tests/dup3.test: Likewise.
	* tests/epoll_create1.test: Likewise.
	* tests/execveat-v.test: Likewise.
	* tests/execveat.test: Likewise.
	* tests/fchmod.test: Likewise.
	* tests/fcntl.test: Likewise.
	* tests/file_handle.test: Likewise.
	* tests/flock.test: Likewise.
	* tests/fork-f.test: Likewise.
	* tests/ftruncate.test: Likewise.
	* tests/ftruncate64.test: Likewise.
	* tests/getcwd.test: Likewise.
	* tests/getdents.test: Likewise.
	* tests/getdents64.test: Likewise.
	* tests/getrandom.test: Likewise.
	* tests/getrusage.test: Likewise.
	* tests/getxxid.test: Likewise.
	* tests/inet-cmsg.test: Likewise.
	* tests/init.sh: Likewise.
	* tests/membarrier.test: Likewise.
	* tests/mincore.test: Likewise.
	* tests/mknod.test: Likewise.
	* tests/mlock2.test: Likewise.
	* tests/mmsg.test: Likewise.
	* tests/nanosleep.test: Likewise.
	* tests/open.test: Likewise.
	* tests/openat.test: Likewise.
	* tests/pselect6.test: Likewise.
	* tests/readdir.test: Likewise.
	* tests/readlink.test: Likewise.
	* tests/readv.test: Likewise.
	* tests/recvmsg.test: Likewise.
	* tests/rename.test: Likewise.
	* tests/renameat.test: Likewise.
	* tests/rt_sigpending.test: Likewise.
	* tests/rt_sigprocmask.test: Likewise.
	* tests/rt_sigqueueinfo.test: Likewise.
	* tests/rt_sigsuspend.test: Likewise.
	* tests/rt_sigtimedwait.test: Likewise.
	* tests/rt_tgsigqueueinfo.test: Likewise.
	* tests/sched_get_priority_mxx.test: Likewise.
	* tests/sched_xetaffinity.test: Likewise.
	* tests/sched_xetparam.test: Likewise.
	* tests/sched_xetscheduler.test: Likewise.
	* tests/seccomp.test: Likewise.
	* tests/select.test: Likewise.
	* tests/sendfile.test: Likewise.
	* tests/sendfile64.test: Likewise.
	* tests/splice.test: Likewise.
	* tests/statx.sh: Likewise.
	* tests/sysinfo.test: Likewise.
	* tests/syslog.test: Likewise.
	* tests/tee.test: Likewise.
	* tests/time.test: Likewise.
	* tests/timer_create.test: Likewise.
	* tests/timer_xettime.test: Likewise.
	* tests/timerfd_xettime.test: Likewise.
	* tests/times-fail.test: Likewise.
	* tests/times.test: Likewise.
	* tests/truncate.test: Likewise.
	* tests/truncate64.test: Likewise.
	* tests/umask.test: Likewise.
	* tests/umount.test: Likewise.
	* tests/umount2.test: Likewise.
	* tests/userfaultfd.test: Likewise.
	* tests/vmsplice.test: Likewise.
	* tests/xet_robust_list.test: Likewise.
	* tests/xetitimer.test: Likewise.
	* tests/xetpgid.test: Likewise.
	* tests/xetpriority.test: Likewise.
	* tests/xettimeofday.test: Likewise.

	tests: introduce $NAME.
	* tests/init.sh (NAME): New variable, defined to ${ME_%.test}.
	(run_prog, match_awk, match_diff, match_grep): Replace ${ME_%.test}
	with $NAME.
	* tests/fcntl.test: Likewise.
	* tests/fstat.test: Likewise.
	* tests/mmap.test: Likewise.
	* tests/net-y-unix.test: Likewise.
	* tests/net-yy-inet.test: Likewise.
	* tests/net-yy-unix.test: Likewise.
	* tests/open.test: Likewise.
	* tests/openat.test: Likewise.
	* tests/poll.test: Likewise.
	* tests/ppoll.test: Likewise.
	* tests/readlink.test: Likewise.
	* tests/select.test: Likewise.
	* tests/statx.sh: Likewise.
	* tests/uname.test: Likewise.

2016-03-30  Dmitry V. Levin  <ldv@altlinux.org>

	tests: move definitions of $OUT and $ERR to init.sh.
	As virtually every test defines either one or both of OUT and ERR
	variables and these definitions are exactly the same, move definitions
	of these variables from individual tests to init.sh.

	* tests/init.sh (OUT, ERR): New variables.
	* tests/ipc.sh: Remove initialization of OUT variable.
	* tests/statx.sh: Likewise.
	* tests/*.test: Remove initialization of OUT and ERR variables.

2016-03-29  Dmitry V. Levin  <ldv@altlinux.org>

	tests: simplify sendfile.test and sendfile64.test.
	Use the executable itself for input by default.

	* tests/sendfile.c (main): Use av[0] instead of av[1] for input.
	* tests/sendfile64.c (main): Likewise.
	* tests/sendfile.test: Invoke run_prog without arguments.
	* tests/sendfile64.test: Likewise.

2016-03-29  Dmitry V. Levin  <ldv@altlinux.org>

	open.test, openat.test: lift /proc requirement.
	While -P option needs /proc to match descriptors, it does not use
	/proc to match pathnames.  As these tests do not need descriptor
	match, the /proc requirement can be safely lifted.

	* tests/open.test: Lift /proc/self/fd/ requirement.
	* tests/openat.test: Likewise.

2016-03-29  Dmitry V. Levin  <ldv@altlinux.org>

	quotactl: add decoding of Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA.
	* quota.c (if_nextdqblk): New structure.
	(decode_cmd_data): Handle Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA.

	Update Q_* constants.
	* xlat/quotacmds.in: Add Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA introduced
	by linux kernel commits v4.6-rc1~65^2~9^2~5 and v4.6-rc1~65^2~9^2~6.

	Update CLONE_* constants.
	* xlat/clone_flags.in: Rename CLONE_STOPPED to CLONE_NEWCGROUP.
	The former was removed by linux kernel commit v2.6.38-rc1~217.
	The latter was introduced by linux kernel commit v4.6-rc1~67^2~8.

	Update BPF_MAP_TYPE_* constants.
	* xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERCPU_HASH,
	BPF_MAP_TYPE_PERCPU_ARRAY, and BPF_MAP_TYPE_STACK_TRACE introduced by
	linux kernel commits v4.6-rc1~91^2~326^2~5, v4.6-rc1~91^2~326^2~4, and
	v4.6-rc1~91^2~212^2~1, respectively.

	Update SO_* constants.
	* xlat/sockoptions.in: Add SO_CNX_ADVICE introduced by linux kernel
	commit v4.6-rc1~91^2~176.

	Update SEGV_* constants.
	* xlat/sigsegv_codes.in: Add SEGV_PKUERR introduced by linux kernel
	commit v4.6-rc1~68^2~23.

	avr32: wire up copy_file_range syscall.
	* linux/avr32/syscallent.h [325]: Add copy_file_range entry.

2016-03-28  JayRJoshi  <jay.r.joshi100@gmail.com>

	tests/uname.test: check abbreviated output, use print_quoted_string.
	* tests/uname.c (main): Use print_quoted_string to print
	utsname members.  Add abbrev check.
	* tests/uname.test: Add abbrev check.

2016-03-28  Dmitry V. Levin  <ldv@altlinux.org>

	faccessat.test: robustify against libcs invoking faccessat syscall on their own
	* tests/faccessat.c (TMP_FILE): Rename to sample, change its value
	to "faccessat.sample".
	* tests/faccessat.test: Rewrite using openat.test.

	openat.test: robustify against libcs invoking openat syscall on their own
	* tests/openat.c (main): Rename fname to sample, change its value
	to "openat.sample".
	* tests/openat.test: Use -P option to filter out openat syscalls
	made by libc and dynamic linker.

	tests: add open.test.
	* tests/open.c: New file.
	* tests/open.test: New test.
	* tests/.gitignore: Add open.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add open.test.

2016-03-27  Dmitry V. Levin  <ldv@altlinux.org>

	Update generic ioctl entries from linux 4.5.
	* linux/64/ioctls_inc.h: Update from linux v4.5 using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* NEWS: Mention this.

2016-03-26  Dmitry V. Levin  <ldv@altlinux.org>

	maint: update for linux 4.5.
	* maint/ioctls_sym.sh: Update workarounds for drm/*_drm.h files.
	Add workarounds for xen/gntdev.h and net/nfc/nci_core.h files.
	Update path of saa6588.h and exynos-fimc.h files.

2016-03-25  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of device numbers in mknod and mknodat syscalls.
	* mknod.c (decode_mknod): Treat device number argument as unsigned int.
	* tests/mknod.c: Include <sys/sysmacros.h> or <sys/mkdev.h>
	for definition of makedev macro.
	(main): Add a check for a character special file.

2016-03-25  Dmitry V. Levin  <ldv@altlinux.org>

	sparc64: fix decoding of mknod and mknodat syscalls for sparc personality
	Remove remnants of solaris personality support in mknod parser
	that resulted to sparc personality being decoded as old solaris
	personality.  This complements commit v4.10-45-gdf4dd8b and fixes
	commit v4.10-46-g588a90f.

	* mknod.c (decode_mknod) [SPARC || SPARC64]: Remove.

2016-03-25  Katerina Koukiou  <k.koukiou@googlemail.com>

	tests: add openat.test.
	* tests/openat.c: New file.
	* tests/openat.test: New test.
	* tests/.gitignore: Add openat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add openat.test.

2016-03-25  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add renameat.test.
	* tests/renameat.c: New file.
	* tests/renameat.test: New test.
	* tests/.gitignore: Add renameat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add renameat.test.

	tests: add faccessat.test.
	* tests/faccessat.c: New file.
	* tests/faccessat.test: New test.
	* tests/.gitignore: Add faccessat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add faccessat.test.

	tests: add creat.test.
	* tests/creat.c: New file.
	* tests/creat.test: New test.
	* tests/.gitignore: Add creat.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add creat.test.

	tests: add mknod.test.
	* tests/mknod.c: New file.
	* tests/mknod.test: New test.
	* tests/.gitignore: Add mknod.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add mknod.test.

	tests: add syslog.test.
	* tests/syslog.c: New file.
	* tests/syslog.test: New test.
	* tests/.gitignore: Add syslog.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(DECODER_TESTS): Add syslog.test.

2016-03-23  JayRJoshi  <jay.r.joshi100@gmail.com>

	tests/scm_rights-fd.test: fix pathname regex.
	Pathname containing >, }, or non-printable characters was resulting
	in failing of the test.

	* tests/scm_rights-fd.test: Fix pathname regex and simplify things.

2016-03-24  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add strace-r.test.
	* tests/strace-r.expected: New file.
	* tests/strace-r.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.
	(EXTRA_DIST): Add strace-r.expected.

	tests: add strace-ttt.test.
	* tests/strace-ttt.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.

	tests: add strace-tt.test.
	* tests/strace-tt.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.

	tests: add strace-t.test.
	* tests/strace-t.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.

	tests: add strace-T.test.
	* tests/strace-T.expected: New file.
	* tests/strace-T.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add it.
	(EXTRA_DIST): Add strace-T.expected.

2016-03-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: split out tests of specific decoders.
	Split TESTS into three groups: tests of specific decoders, libunwind
	tests, and all other tests.

	* tests/Makefile.am (TESTS): Move attach-f-p.test, attach-p-cmd.test,
	bexecve.test, count-f.test, count.test, detach-running.test,
	detach-sleeping.test, detach-stopped.test, dumpio.test,
	filter-unavailable.test, fork-f.test, ksysent.test, opipe.test,
	pc.test, qual_syscall.test, redirect.test, restart_syscall.test,
	strace-f.test, and vfork-f.test to MISC_TESTS.
	Move remaining tests except $(LIBUNWIND_TESTS) to DECODER_TESTS.
	Add $(DECODER_TESTS) and $(MISC_TESTS).

2016-03-23  JayRJoshi  <jay.r.joshi100@gmail.com>

	tests: add getcwd.test.
	* tests/getcwd.c: New file.
	* tests/getcwd.test: New test.
	* tests/.gitignore: Add getcwd.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add getcwd.test.

	tests: add print_quoted_string function to libtests.
	* tests/tests.h (print_quoted_string): New prototype.
	* tests/print_quoted_string.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.

2016-03-17  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add xetpriority.test.
	* resource.c (SYS_FUNC(getpriority), SYS_FUNC(setpriority)): Print
	the second syscall argument using %d format.
	* tests/xetpriority.c: New file.
	* tests/xetpriority.test: New test.
	* tests/.gitignore: Add xetpriority.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add xetpriority.test.

2016-03-15  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add flock.test.
	* tests/flock.c: New file.
	* tests/flock.test: New test.
	* tests/.gitignore: Add flock.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add flock.test.

	tests: add sched_xetscheduler.test.
	* tests/sched_xetscheduler.c: New file.
	* tests/sched_xetscheduler.test: New test.
	* tests/.gitignore: Add sched_xetscheduler.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add sched_xetscheduler.test.

2016-03-15  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: fix SOCK_DIAG_BY_FAMILY tests.
	This complements commit v4.9-368-g301c65c.

	* tests/netlink_inet_diag.c (check_responses): Align "buf"
	on sizeof(long) boundary.
	* tests/netlink_unix_diag.c (check_responses): Likewise.

2016-03-14  Dmitry V. Levin  <ldv@altlinux.org>

	Update EPOLL* constants.
	* xlat/epollevents.in: Add EPOLLWAKEUP and EPOLLEXCLUSIVE.

2016-03-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add count-f.test.
	* tests/count-f.c: New file.
	* tests/count-f.expected: Likewise.
	* tests/count-f.test: New test.
	* tests/.gitignore: Add count-f.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(count_f_LDADD): New variable.
	(EXTRA_DIST): Add count-f.expected.
	(TESTS): Add count-f.test.

2016-02-21  Dmitry V. Levin  <ldv@altlinux.org>

	hppa: wire up copy_file_range syscall.
	* linux/hppa/syscallent.h [346]: Add copy_file_range entry.

2016-03-11  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: filter strace output in uname test.
	* tests/uname.test: Use uniq to filter strace output.

2016-03-10  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add sched_xetparam.test.
	* tests/sched_xetparam.c: New file.
	* tests/sched_xetparam.test: New test.
	* tests/.gitignore: Add sched_xetparam.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add sched_xetparam.test.

	tests: add sched_get_priority_mxx.test.
	* tests/sched_get_priority_mxx.c: New file.
	* tests/sched_get_priority_mxx.test: New test.
	* tests/.gitignore: Add sched_get_priority_mxx.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add sched_get_priority_mxx.test.

	tests: add dup.test, dup2.test, and dup3.test.
	* tests/dup.c: New file.
	* tests/dup.test: New test.
	* tests/dup2.c: New file.
	* tests/dup2.test: New test.
	* tests/dup3.c: New file.
	* tests/dup3.test: New test.
	* tests/.gitignore: Add dup, dup2, and dup3.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add dup.test, dup2.test, and dup3.test.

2016-03-10  Fabien Siron  <fabien.siron@epita.fr>

	tests: add fchmod.test.
	* tests/fchmod.c: New file.
	* tests/fchmod.test: New test.
	* tests/.gitignore: Add fchmod.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add fchmod.test.

2016-03-09  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add acct.test.
	* tests/acct.c: New file.
	* tests/acct.test: New test.
	* tests/.gitignore: Add acct.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add acct.test.

2016-03-07  Anchit Jain  <anchitjain1234@gmail.com>

	tests: add chmod.test.
	* tests/chmod.c: New file.
	* tests/chmod.test: New test.
	* tests/.gitignore: Add chmod.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add chmod.test.

2016-03-05  Nahim El Atmani  <naam@lse.epita.fr>

	Reduce memory usage while managing tcbs allocation.
	* strace.c (init):  Remove initial memory allocation for tcbtab.
	(expand_tcbtab): Do initial memory allocation when tcbtabsize == 0.

	Reviewed-By: Gabriel Laskar <gabriel@lse.epita.fr>
	Reported-by: haris iqbal <haris.phnx@gmail.com>

2016-03-01  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add umask.test.
	* tests/umask.c: New file.
	* tests/umask.test: New test.
	* tests/.gitignore: Add umask.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add umask.test.

	tests: add rename.test.
	* tests/rename.c: New file.
	* tests/rename.test: New test.
	* tests/.gitignore: Add rename.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add rename.test.

	tests: add uname.test.
	* tests/uname.c: New file.
	* tests/uname.test: New test.
	* tests/.gitignore: Add uname.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add uname.test.

2016-02-20  Dmitry V. Levin  <ldv@altlinux.org>

	mips: wire up copy_file_range syscall.
	* linux/mips/syscallent-n32.h [6324]: Add copy_file_range entry.
	* linux/mips/syscallent-n64.h [5320]: Likewise.
	* linux/mips/syscallent-o32.h [4360]: Likewise.

2016-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add rt_sigsuspend.test.
	* tests/rt_sigsuspend.c: New file.
	* tests/rt_sigsuspend.test: New test.
	* tests/.gitignore: Add rt_sigsuspend.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add rt_sigsuspend.test.

	Print pid_t arguments of rt_sigqueueinfo and rt_tgsigqueueinfo as int.
	* signal.c (SYS_FUNC(rt_sigqueueinfo)): Print first syscall argument
	using %d format.
	(SYS_FUNC(rt_tgsigqueueinfo)): Print first and second syscall arguments
	using %d format.
	* tests/rt_tgsigqueueinfo.c: New file.
	* tests/rt_tgsigqueueinfo.test: New test.
	* tests/.gitignore: Add rt_tgsigqueueinfo.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add rt_tgsigqueueinfo.test.

	getrusage.test: fix build on x32.
	* tests/getrusage.c: Include <stdint.h>
	(main): Print members of struct timeval using %ju format.

2016-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	getrusage.test: check that getrusage parser does not access extra memory
	Place struct rusage at the end of an allocated memory page followed by
	an inaccessible page.

	* tests/getrusage.c (main): Use tail_alloc.

2016-02-19  Fei Jie  <feij.fnst@cn.fujitsu.com>

	tests: add getrusage.test.
	* tests/getrusage.c: New file.
	* tests/getrusage.test: New test.
	* tests/.gitignore: Add getrusage.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add getrusage.test.

2016-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	Print rt_sigtimedwait return value as a signal name.
	* signal.c (SYS_FUNC(rt_sigtimedwait)): Decode return value.
	* tests/rt_sigtimedwait.c: New file.
	* tests/rt_sigtimedwait.test: New test.
	* tests/.gitignore: Add rt_sigtimedwait.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add rt_sigtimedwait.test.

	tests: add rt_sigprocmask.test.
	* tests/rt_sigprocmask.c: New file.
	* tests/rt_sigprocmask.test: New test.
	* tests/.gitignore: Add rt_sigprocmask.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add rt_sigprocmask.test.

	Fix corner cases of rt_sigpending syscall decoder.
	* signal (print_sigset_addr_len_limit): New function, cloned from
	print_sigset_addr_len with added minimal length argument.
	Treat length less than minimal length or greater than NSIG/8 as invalid.
	Do not align length to 4-byte boundary.  Align destination buffer
	to 4-byte boundary and initialize it with zeroes so that subsequent
	call to sprintsigmask_n will not access uninitialized data.
	(print_sigset_addr_len): Turn into a wrapper around
	print_sigset_addr_len_limit with current_wordsize
	as a minimal length argument.
	(SYS_FUNC(rt_sigpending)): Call print_sigset_addr_len_limit
	instead of print_sigset_addr_len with 1 as a minimal length argument.
	* tests/rt_sigpending.c: New file.
	* tests/rt_sigpending.test: New test.
	* tests/.gitignore: Add rt_sigpending.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add rt_sigpending.test.

2016-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	Change unix_diag requests back to use full dump instead of exact match.
	Unfortunately, 64-bit linux kernel has a bug in matching inode numbers
	greater than INT_MAX, so unix_diag exact match is not reliable.

	This partially reverts commit 69bfc89770152033d4aa0bc5673fc46e65d89838.

	* socketutils.c (unix_send_query): Add NLM_F_DUMP to nlmsg_flags,
	remove initialization of udiag_cookie.
	* tests/netlink_unix_diag.c (send_query): Remove "inode" argument,
	add NLM_F_DUMP to nlmsg_flags, remove initialization of udiag_ino
	and udiag_cookie.
	(check_responses): Remove "inode" argument and its use.
	(main): Remove invocation of inode_of_sockfd and passing of listening
	socket inode to send_query and check_responses.

2016-02-19  Michael Shigorin  <mike@altlinux.org>

	tests: avoid using cpp -dD.
	-dD is less portable across some peculiar preprocessors.

	tests/Makefile.am (ksysent.h): Use cpp -dM instead of cpp -dD.

2016-02-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add poll.test.
	* tests/poll.c: New file.
	* tests/poll.test: New test.
	* tests/.gitignore: Add poll.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add poll.test.

	Fix abbreviated output of poll and ppoll decoders.
	* poll.c (decode_poll_entering, decode_poll_exiting): Fix corner cases
	of abbreviated output.
	* tests/ppoll-v.expected: Update.
	* tests/ppoll.expected: Update.
	* tests/ppoll.test: Update.

	Print unfetchable address in poll and ppoll decoders.
	* poll.c (decode_poll_entering): Replace umove call with
	umove_or_printaddr.
	(decode_poll_exiting): Print unfetchable address when umove call fails.

	Print offsets in lseek and _llseek syscalls as signed integers.
	* lseek.c (SYS_FUNC(lseek)): Print offset using %lld format.
	(SYS_FUNC(llseek)): Likewise.  Treat high and low components of offset
	as unsigned long integers.
	* tests/llseek.c (main): Check that negative offset is printed properly.
	* tests/lseek.c (main): Likewise.

2016-02-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add xetpgid.test.
	* tests/xetpgid.c: New file.
	* tests/xetpgid.test: New test.
	* tests/.gitignore: Add xetpgid.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add xetpgid.test.

	tests: add alarm.test.
	* tests/alarm.c: New file.
	* tests/alarm.test: New test.
	* tests/.gitignore: Add alarm.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add alarm.test.

	Replace printargs_lu and printargs_ld with printargs_u and printargs_d.
	* defs.h (printargs_lu): Rename to printargs_u.
	(printargs_ld): Rename to printargs_d.
	* syscall.c (printargs_lu): Rename to printargs_u.  Replace %lu with %u.
	(printargs_ld): Rename to printargs_d.  Replace %ld with %d.
	* linux/dummy.h (sys_getpgrp): Change to printargs.
	(sys_alarm): Change to printargs_u.
	(sys_getpgid, sys_getsid, sys_nice, sys_setpgid, sys_setpgrp,
	sys_timer_delete, sys_timer_getoverrun): Change to printargs_d.

	Change printargs_lu and printargs_ld to return RVAL_DECODED.
	* syscall.c (printargs_lu, printargs_ld): Return RVAL_DECODED.

	redirect.test: fix the way how strace output is discarded.
	* tests/redirect.test: Disable tracing of syscalls, signals,
	and exit status instead of redirecting strace output to /dev/null.

	tests: extend coverage of struct iovec arrays.
	* tests/readv.c (main): Check decoding of empty, inaccessible,
	and partially inaccessible iovec arrays.
	* tests/readv.test: Update.

	Implement dumping of vmsplice syscall.
	* syscall.c (dumpio): Add SEN_vmsplice.
	* NEWS: Mention this.
	* tests/vmsplice.c: New file.
	* tests/vmsplice.test: New test.
	* tests/.gitignore: Add vmsplice.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add vmsplice.test.

	tests: add tee.test.
	* tests/tee.c: New file.
	* tests/tee.test: New test.
	* tests/.gitignore: Add tee.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add tee.test.

	Fix printing of negative offsets in splice syscall.
	* io.c (SYS_FUNC(splice)): Use PRId64 instead of PRIu64 for printing
	offsets.
	* tests/splice.c: New file.
	* tests/splice.test: New test.
	* tests/.gitignore: Add splice.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add splice.test.

	Implement copy_file_range syscall decoding.
	* copy_file_range.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/32/syscallent.h (copy_file_range): New entry.
	* linux/64/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* pathtrace.c (pathtrace_match): Add SEN_copy_file_range.
	* NEWS: Mention new syscall parser.
	* tests/copy_file_range.c: New file.
	* tests/copy_file_range.test: New test.
	* tests/.gitignore: Add copy_file_range.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add copy_file_range.test.

	Update fs *_MAGIC constants.
	* xlat/fsmagic.in: Add CGROUP2_SUPER_MAGIC and OVERLAYFS_SUPER_MAGIC.

	Update IPV6_* constants.
	* xlat/sockipv6options.in: Add IPV6_HDRINCL.

	Update SO_* constants.
	* xlat/sockoptions.in: Add SO_ATTACH_REUSEPORT_CBPF
	and SO_ATTACH_REUSEPORT_EBPF.

	Update MADV_* constants.
	* xlat/madvise_cmds.in: Add MAD_FREE.

2016-02-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify execve and execveat tests.
	* tests/execve.c (main): Use one page gap between two mapped regions
	for an address that is more likely to be not yet mapped.
	* tests/execveat.c (main): Likewise.

	tests: simplify execve test.
	* tests/execve.c (main): Simplify the test assuming that execve syscall
	never returns ENOSYS.

2016-02-13  Dmitry V. Levin  <ldv@altlinux.org>

	Fix numbers of syscall arguments in syscall tables.
	This semi-automatic change brings syscall tables in sync with kernel's
	include/linux/syscalls.h file.

	* linux/aarch64/syscallent.h (recv): Fix nargs.
	* linux/alpha/syscallent.h (sigaltstack, init_module,
	sched_getscheduler, settimeofday): Likewise.
	* linux/arm/syscallent.h (signal, pciconfig_iobase, msgrcv, msgctl,
	shmat, shmdt, shmctl, semtimedop, get_mempolicy, set_mempolicy,
	timerfd_create): Likewise.
	* linux/bfin/syscallent.h (signal, delete_module): Likewise.
	* linux/hppa/syscallent.h (init_module, munlockall, sched_getscheduler,
	io_cancel, set_tid_address, listxattr, llistxattr, flistxattr,
	removexattr, lremovexattr, fremovexattr): Likewise.
	* linux/i386/syscallent.h (signal, mmap): Likewise.
	* linux/ia64/syscallent.h (init_module, readv, writev,
	sched_getscheduler): Likewise.
	* linux/m68k/syscallent.h (signal, request_key): Likewise.
	* linux/microblaze/syscallent.h (signal, clone, fstatfs64, vmsplice):
	Likewise.
	* linux/mips/syscallent-n32.h (getpgid, statfs, fstatfs, init_module,
	delete_module): Likewise.
	* linux/mips/syscallent-n64.h (getpgid, statfs, fstatfs, init_module,
	delete_module): Likewise.
	* linux/mips/syscallent-o32.h (signal, statfs, fstatfs, ioperm,
	fstatfs64): Likewise.
	* linux/powerpc/syscallent.h (signal, spu_run, spu_create): Likewise.
	* linux/powerpc64/syscallent.h (signal, pread64, pwrite64, readahead,
	fadvise64, lookup_dcookie, spu_run, spu_create, sync_file_range2,
	fallocate, preadv, pwritev, fanotify_mark): Likewise.
	* linux/s390/syscallent.h (signal, mmap, lookup_dcookie, ipc): Likewise.
	* linux/s390x/syscallent.h (signal, ipc): Likewise.
	* linux/sh/syscallent.h (signal, ipc, munlockall, fstatfs64, vmsplice):
	Likewise.
	* linux/sh64/syscallent.h (signal, ipc, msgrcv, msgctl, shmat, shmdt,
	shmctl, fstatfs64, vmsplice): Likewise.
	* linux/sparc/syscallent.h (ptrace, dup, signal, ipc): Likewise.
	* linux/sparc64/syscallent.h (ptrace, dup, signal, pread64, pwrite64,
	readahead, lookup_dcookie, fadvise64, fadvise64_64, ipc,
	sync_file_range, fallocate, preadv, pwritev, fanotify_mark): Likewise.
	* linux/x32/syscallent.h (64:recvmsg): Likewise.
	* linux/xtensa/syscallent.h (mremap, futex, reboot, init_module,
	delete_module, request_key, getcpu, ioprio_set, ioprio_get, utimensat,
	futimesat, fchmodat, faccessat): Likewise.
	* NEWS: Mention this fix.

2016-02-13  Dmitry V. Levin  <ldv@altlinux.org>

	s390: decode fadvise64 and fadvise64_64.
	* linux/s390/syscallent.h (fadvise64): Set sys_func.
	(fadvise64_64): Set nargs and sys_func.

	mips n64: use the most optimal parser for fadvise64 syscall.
	* linux/mips/syscallent-n64.h (fadvise64): Replace SEN(fadvise64_64)
	with SEN(fadvise64).

	ia64: decode fstatfs64 and statfs64.
	* linux/ia64/syscallent.h (fstatfs64, statfs64): Set nargs and sys_func.

2016-02-13  Dmitry V. Levin  <ldv@altlinux.org>

	alpha, ia64, mips, sh, sh64: fix the number of pipe syscall arguments.
	On alpha, ia64, mips, sh, sh64, sparc, and sparc64 architectures
	pipe syscall does not take arguments.

	* linux/alpha/syscallent.h (pipe): Change nargs to 0.
	* linux/ia64/syscallent.h (pipe): Likewise.
	* linux/mips/syscallent-n32.h (pipe): Likewise.
	* linux/mips/syscallent-n64.h (pipe): Likewise.
	* linux/mips/syscallent-o32.h (pipe): Likewise.
	* linux/sh/syscallent.h (pipe): Likewise.
	* linux/sh64/syscallent.h (pipe): Likewise.

2016-02-13  Dmitry V. Levin  <ldv@altlinux.org>

	alpha, ia64, mips, sh*, sparc*: fix error path decoding of pipe syscall.
	* net.c (do_pipe) [HAVE_GETRVAL2]: Remove.
	Always call decode_pair_fd on exiting.
	(SYS_FUNC(pipe)) [HAVE_GETRVAL2]: Call printpair_fd instead of do_pipe.

	Fix pathtrace match for pipe2 syscall.
	* pathtrace.c (pathtrace_match): As pipe2 syscall has no descriptors
	or paths to test, move SEN_pipe2 to the appropriate category.

	avr32: wire up missing syscalls.
	* linux/avr32/syscallent.h [322..324]: Add userfaultfd, membarrier,
	and mlock2 entries.

2016-02-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check decoding of madvise, mlockall, mremap, and msync syscalls.
	* tests/mmap.c (main): Change output format from regexp to verbatim.
	Add tests for madvise, mlockall, mremap, and msync syscalls.
	* tests/mmap.test: Convert from match_grep to match_diff.
	Add madvise, mlockall, mremap, and msync syscalls to syscall filter.

2016-02-11  Dmitry V. Levin  <ldv@altlinux.org>

	Simplify decoding of waitpid and wait4 syscalls.
	* wait.c (printwaitn): Replace "n" and "bitness" integer arguments
	with a single print_rusage function pointer.  All callers updated.

	waitid: print pid argument as int.
	* wait.c (SYS_FUNC(waitid)): As the type of second syscall argument
	in the kernel is pid_t, print it as int.

	waitid: always print 5th argument.
	* wait.c (SYS_FUNC(waitid)): Do not check for tcp->s_ent->nargs
	as waitid syscall has 5 arguments.

	socketutils: add const qualifier to variables.
	* socketutils.c (cache_and_print_inode_details): Make "details"
	parameter const.
	(print_sockaddr_by_inode_cached): Make "e" variable const.
	(inet_send_query): Make struct nlmsghdr and struct inet_diag_req_v2
	members const.  Make "msg" variable const.
	(inet_parse_response): Make "data" parameter and diag_msg variable const.
	(receive_responses): Make "h" and "rc" variables const.
	(unix_send_query): Make struct nlmsghdr and struct unix_diag_req
	members const.  Make "msg" variable const.
	(unix_print): Make all parameters const.
	(print_sockaddr_by_inode): Make proto_name parameter const.

	print_sockaddr_by_inode: cleanup protocol lookup.
	* socketutils.c (tcp_v4_print, udp_v4_print, tcp_v6_print,
	udp_v6_print): New functions.
	(print_sockaddr_by_inode): Make "protocols" array static, replace
	"family" and "protocol" members with "print" in its underlying
	structure.  Iterate through protocols array when the protocol name
	is specified.

2016-02-09  Dmitry V. Levin  <ldv@altlinux.org>

	tests: check that -f -p attaches to threads properly.
	Check that -f -p attaches and follows all threads of the given pid.

	* tests/attach-f-p.c: New file.
	* tests/attach-f-p.test: New test.
	* tests/.gitignore: Add attach-f-p.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(attach_f_p_LDADD): New variable.
	(TESTS): Add attach-f-p.test.

2016-02-09  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce libstrace.a for potentially conditional compilation units.
	Some files are used conditionally depending on architecture and
	configuration.  Create a library for the purpose of keeping such
	compilation units.

	* Makefile.am (strace_LDADD, noinst_LIBRARIES): Add libstrace.a.
	(libstrace_a_CPPFLAGS): New variable, set to $(strace_CPPFLAGS).
	(libstrace_a_CFLAGS): New variable, set to $(strace_CFLAGS).
	(libstrace_a_SOURCES): New variable, set to upeek.c.
	* util.c (upeek): Move ...
	* upeek.c: ... here.

2016-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	travis-ci: pass more gcov arguments to codecov.

	tests: extend coverage of struct itimerspec.
	* tests/timer_xettime.c (main): Check decoding of NULL struct itimerspec
	pointer.

	tests: extend coverage of utimensat syscall.
	* tests/utimensat.c (main): Check decoding of NULL struct timespec
	pointer.

	tests: extend coverage of time syscall.
	* tests/time.c (main): Check decoding of NULL time_t pointer.

	tests: extend coverage of struct sigevent.
	* tests/timer_create.c (main): Check decoding of NULL struct sigevent
	pointer.  Check decoding of invalid sigev_notify value.

2016-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend coverage of execve and execveat syscalls.
	Check decoding of inaccessible or partially inaccessible arrays.

	* tests/execve-v.c: New file.
	* tests/execveat-v.c: Likewise.
	* tests/execve-v.test: New test.
	* tests/execveat-v.test: Likewise.
	* tests/execve.c: Rewrite.
	* tests/execveat.c: Likewise.
	* tests/execve.test: Likewise.
	* tests/execveat.test: Likewise.
	* tests/execve.expected: Remove.
	* tests/execve-v.expected: Likewise.
	* tests/execveat.expected: Likewise.
	* tests/execveat-v.expected: Likewise.
	* tests/.gitignore: Add execve-v and execveat-v.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add execve-v.test and execveat-v.test.
	(EXTRA_DIST): Remove execve.expected, execve-v.expected,
	execveat.expected, and execveat-v.expected.

2016-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of execve and execveat syscalls with invalid input.
	* execve.c (printargv): Fix decoding of inaccessible or partially
	inaccessible array.
	(printargc): Diagnose inaccessible or partially inaccessible array.
	(decode_execve, SYS_FUNC(execv)): Update printargv and printargc callers.

	tests: extend coverage of capget syscall.
	* tests/caps.c (main): Check decoding of inaccessible cap_user_header_t
	and/or cap_user_data_t.
	* tests/caps.awk: Update match patterns.
	* tests/caps.test: Update.

	tests: extend coverage of sched_getaffinity syscall.
	* tests/sched_xetaffinity.c (main): Check decoding of pointer
	to inaccessible cpu_set_t.

	tests: extend coverage of utime syscall.
	* tests/utime.c (main): Check decoding of NULL struct utimbuf pointer.
	Check decoding of struct utimbuf located at the end of page boundary.
	* tests/utime.test: Update.

	tests: extend coverage of sysinfo syscall.
	* tests/sysinfo.c (main): Check decoding of NULL struct sysinfo pointer.
	Check decoding of struct sysinfo located at the end of page boundary.
	* tests/sysinfo.test: Update.

	tests: extend coverage of adjtimex syscall.
	* tests/adjtimex.c (main): Check decoding of NULL struct timex pointer.
	Check decoding of struct timex located at the end of page boundary.
	* tests/adjtimex.test: Update.

	tests: check that strace does not retain stdin and stdout descriptors.
	* tests/redirect.test: New test.
	* tests/Makefile.am (TESTS): Add it.

	Create a dummy pipe descriptor instead of opening /dev/null.
	* strace.c (open_dev_null): Rename to open_dummy_desc.  All callers
	changed.  Create a pipe and return its first descriptor instead of
	opening /dev/null.

2016-02-08  Denys Vlasenko  <dvlasenk@redhat.com>

	If stdin/stdout aren't open on startup, open them to /dev/null.
	Otherwise, -oLOGFILE may end up using one of them. This conflicts
	with the previous change, which closes stdin/out in strace.

	* strace.c (init): If fcntl(F_GETFD) fails on stdin or stdout,
	sanitize them: open /dev/null and dup it until fds 0,1,2
	are all used up.

2016-02-08  Denys Vlasenko  <dvlasenk@redhat.com>

	Close stdin/out after child is forked.
	Testcase:

	{ sleep 1; yes | head -n99999; } | strace -o/dev/null sh -c 'exec <&-; sleep 9'

	The writer (head) will be able to perform writes to write end of the pipe.
	With strace call removed, head will immediately get SIGPIPE.

	This change fixes this: now writer immediately gets SIGPIPE with strace too.

	* strace.c (startup_child): Close stdin/out and reopen them to /dev/null.

2016-02-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add opipe.test.
	Check that -o |pipe_command works.  In particular, check that
	strace waits for completion of piped command.

	* tests/opipe.test: New test.
	* tests/Makefile.am (TESTS): Add it.

2016-02-05  Keith Owens  <kaos.ocs@gmail.com>

	strace-graph: print the pid in the graph.
	* strace-graph: Prefix each command with its pid.

	strace-graph: cope with clone immediately followed by exit.
	* strace-graph: A clone() followed by exit() with no intervening fork
	or execve resulted in the new pid having no seq key.  That breaks when
	trying to use seq as an array reference.  Ensure that clone populates
	the new pid with an empty seq entry.

	strace-graph: handle recent strace output.
	* strace-graph: Fix regex for --SIG.  Ignore '+++ exited with <n> +++'
	lines.  Handle exit_group syscall as well as _exit.

	strace-graph: handle strace -T.
	* strace-graph: Ignore extra ' <time.spent>' field added by strace -T.

	strace-graph: use "strict" and "warnings" pragmas.
	* strace-graph: Set "use strict" and "use warnings" options.  Fix errors
	detected by strict/warnings.  $result is really a string, it can be "-1"
	followed by an error text.

2016-02-04  Dmitry V. Levin  <ldv@altlinux.org>

	Add README.md file with links to build status and test coverage.

	travis-ci: prepare and submit test coverage report.

	tests: extend readlink and readlinkat coverage.
	* tests/readlink.c (PREFIX, TARGET, LINKPATH): New macros.
	(main): Allocate memory for string and buffer passed to the syscall
	being tested using tail_alloc mechanism.  Create and cleanup test
	symlink.  Test syscall error path output.  Print hexquoted strings
	using hexquote_strndup.
	* tests/readlinkat.c: Likewise.
	* tests/readlink.test: Remove creation and cleanup of test symlinks.

	tests: add hexquote_strndup function to libtests.
	* tests/tests.h (hexquote_strndup): New prototype.
	* tests/hexquote_strndup.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.

	readlinkat.test: use readlink.test.
	* tests/readlink.test (syscall): Initialize from $0.
	* tests/readlinkat.test: Source readlink.test.

2016-02-04  Gabriel Laskar  <gabriel@lse.epita.fr>

	Add configure --enable-code-coverage option.
	* m4/ax_code_coverage.m4: New file.
	* configure.ac: Use AX_CODE_COVERAGE.
	* Makefile.am: Add @CODE_COVERAGE_RULES@.
	(CODE_COVERAGE_LCOV_OPTIONS, CODE_COVERAGE_GENHTML_OPTIONS,
	CODE_COVERAGE_IGNORE_PATTERN): New variables.
	(strace_CPPFLAGS): Add $(CODE_COVERAGE_CPPFLAGS).
	(strace_CFLAGS): Add $(CODE_COVERAGE_CFLAGS).
	(strace_LDADD): Add $(CODE_COVERAGE_LDFLAGS).
	* .gitignore: Add *.gcda and *.gcno.

2016-02-03  Dmitry V. Levin  <ldv@altlinux.org>

	Makefile.am: introduce strace_CFLAGS and derivatives.
	* Makefile.am (strace_CFLAGS): New variable, set to $(AM_CFLAGS).
	(libmpers_CFLAGS): New variable, set to $(strace_CFLAGS).
	(libmpers_m32_a_CFLAGS, libmpers_mx32_a_CFLAGS): New variables,
	set to $(libmpers_CFLAGS).

	Makefile.am: use strace_CPPFLAGS consistently.
	* Makefile.am (libmpers_CPPFLAGS): Replace $(AM_CPPFLAGS)
	with $(strace_CPPFLAGS).

2016-02-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: replace net-fd.test with net-y-unix.test.
	Unlike the former test that was based on match_grep,
	the new one uses match_diff and does more rigorous testing.

	* tests/net-y-unix.c: New file.
	* tests/net-y-unix.test: New test.
	* tests/net-fd.test: Remove.
	* tests/net-fd.expected: Remove.
	* tests/.gitignore: Add net-y-unix.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Replace net-fd.test with net-y-unix.test.
	(net-fd.log): Remove.
	(EXTRA_DIST): Remove net-fd.expected.

2016-02-03  Dmitry V. Levin  <ldv@altlinux.org>

	Implement caching of print_sockaddr_by_inode.
	As -yy parser, compared to -y, needs to do at least 5 extra syscalls
	(getxattr, socket, sendmsg, recvmsg, close) to print socket details,
	caching results of netlink conversations between strace and kernel
	noticeably reduces amount of system time spent by strace.

	The caching is safe since sockets do not change their addresses after
	successful bind or connect syscall.

	* defs.h (string_quote, print_sockaddr_by_inode_cached): New prototypes.
	* socketutils.c (cache_entry): New type.
	(CACHE_SIZE, CACHE_MASK): New macros.
	(cache): New static array.
	(cache_and_print_inode_details): New static function.
	(print_sockaddr_by_inode_cached): New function.
	(inet_parse_response, unix_parse_response): Use
	cache_and_print_inode_details.
	* util.c (printfd): Use string_quote and print_sockaddr_by_inode_cached.
	(string_quote): Remove static qualifier.
	* NEWS: Mention this improvement.
	* tests/unix-yy.c (main): Update.

2016-02-03  Dmitry V. Levin  <ldv@altlinux.org>

	Change unix_diag requests to use exact match instead of full dump.
	* socketutils.c (unix_send_query): Remove NLM_F_DUMP from nlmsg_flags,
	initialize udiag_cookie.
	* tests/netlink_unix_diag.c (send_query): Remove "family" and "proto"
	arguments, add "inode" argument, remove NLM_F_DUMP from nlmsg_flags,
	initialize udiag_ino and udiag_cookie.
	(check_responses): Add "inode" argument, check inode match.
	(main): Pass listening socket inode to send_query and check_responses.

	Robustify netlink response parsers.
	* socketutils.c (inet_parse_response, unix_parse_response): Change
	return type from bool to int, return -1 on all parse errors except
	inode mismatch.
	(receive_responses): Stop on the first nlmsg_type that is not
	SOCK_DIAG_BY_FAMILY, also stop when the parser returns -1.
	* tests/netlink_inet_diag.c (check_responses): Stop on short messages,
	on first nlmsg_type that is not SOCK_DIAG_BY_FAMILY, print more verbose
	diagnostics for NLMSG_ERROR.
	* tests/netlink_unix_diag.c (check_responses): Likewise.

	inet_parse_response: add a safety check.
	* socketutils.c (inet_parse_response): Check that netlink message
	is large enough to contain a inet_diag_msg structure.

	receive_responses: avoid potential hangup.
	* socketutils.c (receive_responses): Pass MSG_DONTWAIT to recvmsg after
	the first recvmsg call to avoid potential hangup.

2016-02-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: replace net-yy.test with net-yy-inet.test.
	Unlike the former test that was based on match_awk,
	the new one uses match_diff and does more rigorous testing.

	* tests/net-yy-inet.c: New file.
	* tests/net-yy-inet.test: New test.
	* tests/net-yy.test: Remove.
	* tests/net-yy-accept.awk: Remove.
	* tests/net-yy-connect.awk: Remove.
	* tests/inet-accept-connect-send-recv.c: Remove.
	* tests/.gitignore: Replace inet-accept-connect-send-recv
	with net-yy-inet.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Replace net-yy.test with net-yy-inet.test.
	(EXTRA_DIST): Remove net-yy-accept.awk and net-yy-connect.awk.

2016-02-03  Dmitry V. Levin  <ldv@altlinux.org>

	tests: replace unix-yy.test with net-yy-unix.test.
	Unlike the former test that was based on match_awk,
	the new one uses match_diff and does more rigorous testing.

	* tests/net-yy-unix.c: New file.
	* tests/net-yy-unix.test: New test.
	* tests/unix-yy.test: Remove.
	* tests/unix-yy-accept.awk: Remove.
	* tests/unix-yy-connect.awk: Remove.
	* tests/.gitignore: Add net-yy-unix.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Replace unix-yy.test with net-yy-unix.test.
	(EXTRA_DIST): Remove unix-yy-accept.awk and unix-yy-connect.awk.

2016-02-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add inode_of_sockfd function to libtests.
	* tests/tests.h (inode_of_sockfd): New prototype.
	* tests/inode_of_sockfd.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.

	unix_parse_response: add a safety check.
	* socketutils.c (unix_parse_response): Check that netlink message
	is large enough to contain a unix_diag_msg structure.

2016-01-29  Dmitry V. Levin  <ldv@altlinux.org>

	Fixed decoding of mincore syscall's last argument.
	* mem.c (SYS_FUNC(mincore)): Print only those bytes of the vector
	that were written by the kernel.
	* NEWS: Mention this fix.
	* tests/mincore.c: New file.
	* tests/mincore.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add mincore.
	(TESTS): Add mincore.test.
	* tests/.gitignore: Add mincore.

2016-01-23  Dmitry V. Levin  <ldv@altlinux.org>

	Move fallback -yy socket print from printfd to print_sockaddr_by_inode.
	* util.c (printfd): In -yy mode, move fallback print of proto:[inode] ...
	* socketutils.c (to print_sockaddr_by_inode): ... here.

2016-01-22  Dmitry V. Levin  <ldv@altlinux.org>

	Implement simultaneous use of -p option and tracing of a command.
	* strace.c (init): Allow -p option along with a command.
	(startup_child): In -D mode, record the parent of the tracer process
	as strace_child.
	(startup_attach): Save trace_tracer_pid before -D mode fork.
	When tracing a command in -f mode, do not check for the command's
	threads as it has no threads at this moment.
	Never attach to the tracer process.
	In -D mode, never attach to the parent of the tracer process,
	terminate that process only once at the end of startup_attach,
	and reset strace_child.
	* strace.1: Document that -p option can be used along with tracing
	of a command.
	* NEWS: Mention it.
	* tests/attach-p-cmd-cmd.c: New file.
	* tests/attach-p-cmd-p.c: Likewise.
	* tests/attach-p-cmd.test: New test.
	* tests/.gitignore: Add attach-p-cmd-cmd and attach-p-cmd-p.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(TESTS): Add attach-p-cmd.test.

	This fixes Debian bug #549942.

2016-01-22  Dmitry V. Levin  <ldv@altlinux.org>

	strace.1: fix format of -P description.
	* strace.1 (-P): Write trailing using regular font.

2016-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use local nanosleep based sleep utility replacement.
	* tests/sleep.c: New file.
	* tests/.gitignore: Add sleep.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	* tests/count.test: Use it instead of system sleep utility.

	tests: add error_msg_and_fail function to libtests.
	* tests/tests.h (error_msg_and_fail): New prototype.
	* tests/error_msg.c (error_msg_and_fail): New function.

2016-01-20  Dmitry V. Levin  <ldv@altlinux.org>

	Fix dumping of recvmmsg syscall in case of short read.
	* net.c (dumpiov_in_mmsghdr): Call dumpiov_upto instead of dumpiov,
	pass data size limit to dumpiov_upto.
	* NEWS: Mention this fix.
	* tests/mmsg.c (main): Update.

	Fix dumping of recvmsg syscall in case of short read.
	* defs.h (dumpiov_in_msghdr): Add unsigned long argument.
	* net.c (dumpiov_in_msghdr): Add data_size argument.  Call dumpiov_upto
	instead of dumpiov, pass data_size to dumpiov_upto.
	* syscall.c (dumpio): Pass data size limit to dumpiov_in_msghdr.
	* NEWS: Mention this fix.
	* tests/recvmsg.c: New file.
	* tests/recvmsg.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add recvmsg.
	(TESTS): Add recvmsg.test.
	* tests/.gitignore: Add recvmsg.

	Fix decoding and dumping of readv syscall in case of short read.
	* defs.h (dumpiov_upto): New prototype.
	(dumpiov): Change to a wrapper around dumpiov_upto.
	* util.c (dumpiov): Rename to dumpiov_upto, add and check data_size
	argument.
	* io.c (SYS_FUNC(readv)): Call tprint_iov_upto instead
	of tprint_iov and specify syscall return value as a data size limit.
	* syscall.c (dumpio): In case of SEN_readv, call dumpiov_upto instead
	of dumpiov and specify syscall return value as a data size limit.
	* NEWS: Mention this fix.
	* tests/readv.c: New file.
	* tests/readv.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add readv.
	(TESTS): Add readv.test.
	* tests/.gitignore: Add readv.

	tests/tests.h: add ARRAY_SIZE and LENGTH_OF macros.
	* tests/tests.h (ARRAY_SIZE, LENGTH_OF): New macros.
	* tests/aio.c (ARRAY_SIZE): Remove.
	* tests/mmsg.c (LENGTH_OF): Remove.

	tests: add hexdump_strdup function to libtests.
	* tests/tests.h (hexdump_strdup): New prototype.
	* tests/hexdump_strdup.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.

	tests: add tprintf function to libtests.
	* tests/tests.h (tprintf): New prototype.
	* tests/tprintf.c: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add it.
	* tests/mmsg.c: Use tprintf.

2016-01-19  Dmitry V. Levin  <ldv@altlinux.org>

	quotactl: add Q_XGETQSTATV command decoding.
	* quota.c (fs_qfilestatv, fs_quota_statv): New structures.
	(decode_cmd_data): Handle Q_XGETQSTATV case.

	quotactl: add decoding of if_dqinfo.dqi_flags constants.
	* xlat/if_dqinfo_flags.in: New file.
	* quota.c: Include "xlat/if_dqinfo_flags.h".
	(decode_cmd_data): Print struct if_dqinfo.dqi_flags using printflags.

	quotactl: consistenly decode all write and unknown commands on entering.
	* quota.c (decode_cmd_data): Change return type to int.
	Return 0 on entering Q_GETQUOTA, Q_V1_GETQUOTA, Q_V2_GETQUOTA,
	Q_XGETQUOTA, Q_GETFMT, Q_GETINFO, Q_V2_GETINFO, Q_V1_GETSTATS,
	Q_V2_GETSTATS, and Q_XGETQSTAT commands, return RVAL_DECODED
	for any other command.
	(SYS_FUNC(quotactl)): On entering, print third argument of any command.
	For any command except Q_QUOTAON and Q_V1_QUOTAON, call decode_cmd_data
	and forward its return value.

	quotactl: fix Q_QUOTAON command decoding.
	* quota.c (SYS_FUNC(quotactl)): Print Q_QUOTAON 4th argument as a path.

	quotactl: print third argument as unsigned int.
	* quota.c (SYS_FUNC(quotactl)): Consistently print the third
	argument using "%u" format.

	quotactl: fix Q_XQUOTAOFF command decoding.
	* quota.c (decode_cmd_data): Print xfs quota flags argument.

	quotactl: fix Q_GETFMT and Q_XQUOTAON commands decoding.
	* quota.c (decode_cmd_data): As quota format value and xfs quota flags
	are in-memory constants, print it like an array of one element instead
	of a structure.

2016-01-17  Dmitry V. Levin  <ldv@altlinux.org>

	Update quotactl constants.
	* xlat/quota_formats.in: Add QFMT_OCFS2 and QFMT_VFS_V1.
	* xlat/quotacmds.in: Add Q_XGETQSTATV.
	* xlat/quotatypes.in: Add PRJQUOTA.
	* xlat/xfs_quota_flags.in: Add FS_QUOTA_PDQ_ACCT and FS_QUOTA_PDQ_ENFD.

2016-01-19  Dmitry V. Levin  <ldv@altlinux.org>

	Replace u_int{8,16,32,64} with uint{8,16,32,64}
	* util.c: Replace u_int{32,64} with uint{32,64}.
	* quota.c: Replace u_int{8,16,32,64} with uint{8,16,32,64}.

	Move definitions of quotactl constants to xlat files.
	* quota.c (Q_*): Move to xlat/quotacmds.in.
	(USRQUOTA, GRPQUOTA): Move to xlat/quotatypes.in.
	(QFMT_VFS_OLD, QFMT_VFS_V0): Move to xlat/quota_formats.in.
	(XFS_QUOTA_*): Move to xlat/xfs_quota_flags.in.
	(XFS_*_QUOTA): Move to xlat/xfs_dqblk_flags.in.
	(QIF_*): Move to xlat/if_dqblk_valid.in.
	(IIF_*): Move to xlat/if_dqinfo_valid.in.

2016-01-15  Dmitry V. Levin  <ldv@altlinux.org>

	llseek.test: robustify against libcs invoking _llseek syscall on their own
	* tests/llseek.test: Filter out _llseek calls made with non-negative
	descriptor arguments.

	lseek.test: robustify against libcs invoking lseek syscall on their own.
	* tests/lseek.test: Filter out lseek calls made with non-negative
	descriptor arguments.

2016-01-14  Dmitry V. Levin  <ldv@altlinux.org>

	mmsg.test: fix regression introduced by commit v4.11-138-g6e815ce.
	This fixes the test on platforms where both __NR_sendmmsg and
	HAVE_SENDMMSG are defined but the former is not implemented by the
	kernel and the second is implemented as an indirect syscall.

	* tests/mmsg.c (LENGTH_OF): New macro.
	(send_mmsg, recv_mmsg): Print expected output in case of ENOSYS.
	(main): Redirect stdout to a new descriptor.  Use LENGTH_OF.
	Print expected output.
	* tests/mmsg.test: Update.
	* tests/mmsg.expected: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove mmsg.expected.

2016-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	aio.test: check memory access by aio decoders.
	* tests/aio.c (main): Place all objects passed to io_* syscalls
	at the end of memory pages followed by inaccessible pages.

2016-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	s390, s390x: fix printing of syscalls unknown to the kernel.
	On s390/s390x, syscalls with NR up to 255 can be implemented
	directly using "svc NR", for NR >= 256 "svc 0" with %r1=NR is used.
	The latter method is allowed for NR < 256, too.

	When the syscall number specified directly or indirectly is recognized
	by the kernel, i.e. it is less than its NR_syscalls value, it is stored
	in %r2 and is available to arch_get_scno via s390_regset.gprs[2].
	For syscall numbers >= NR_syscalls this register is set to 0,
	but %r1 remains unchanged and could be used by arch_get_scno
	via s390_regset.gprs[1] to decide what the syscall number is.

	* linux/s390/get_scno.c (arch_get_scno): If s390_regset.gprs[2] is zero,
	take syscall number from s390_regset.gprs[1].
	* NEWS: Mention this fix.

	This fixes Debian bug #485979 and Fedora bug #1298294.

2016-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	s390, s390x: print all syscall arguments for syscall number 0.
	* linux/s390/syscallent.h [0]: Set nargs to MA.
	* linux/s390x/syscallent.h: Likewise.

	mips o32: alias sys_syscall to printargs.
	* linux/dummy.h (sys_syscall): Alias to printargs.
	* syscall.c [LINUX_MIPSO32] (SYS_FUNC(syscall)): Remove.

2016-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	travis-ci: update build matrix.
	Add clang-3.6/x86_64, clang-3.6/x86, and musl-gcc/x86_64 to the matrix.

	* .travis.yml (compiler): Add gcc, clang-3.6, and musl-gcc.
	(env): Add matrix, remove global ENABLE_GCC_WERROR.
	(matrix): Add exclude, remove include.
	* travis-ci.sh: Add support for clang and musl-gcc.
	Use --enable-gcc-Werror for gcc build unconditionally.

2016-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.awk: add support for DWARF files generated by clang.
	* mpers.awk: Define default_pointer_size.  Initialize byte_size
	for DW_TAG_pointer_type to default_pointer_size.  Set parent
	for DW_TAG_member only.  Handle DW_AT_count as an alternative
	to DW_AT_upper_bound.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	configure.ac: reorder some statements for better readability.
	* configure.ac: Sort and group together AC_PROG_*, AC_C_*, AC_TYPE_*,
	AC_HEADER_*, AC_CHECK_FUNCS, AC_CHECK_TYPES, AC_CHECK_MEMBERS,
	and AC_CHECK_HEADERS.

	scm_rights-fd.test: rewrite without fork.
	* tests/scm_rights.c (main): Rewrite without fork.
	Place all objects passed to sendmsg and recvmsg at the end
	of memory pages followed by inaccessible pages.
	* tests/scm_rights-fd.test: Update.

	tests: fix clang "duplicate 'const' declaration specifier" warnings.
	* tests/ksysent.c (pstr_t): Remove second const specifier.
	* tests/mmsg.c (main): Remove second const specifier from one[], two[],
	and three[].

	tests/times.c: fix clang compilation warning.
	* tests/times.c (main): Initialize dummy variable.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests/mmsg.c: fix build on rhel6/ppc.
	There are weird platforms that define __NR_sendmmsg but at the same time
	do not define __NR_recvmmsg.  Add a workaround for them.

	* configure.ac (AC_CHECK_FUNCS): Add recvmmsg.
	* tests/mmsg.c: Check for __NR_recvmmsg || HAVE_RECVMMSG.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	s390: fix sigreturn decoding on recent kernels.
	Linux kernel commit v4.3-rc1-50-g8d4bd0e corrected uc_sigmask
	of the compat signal frame, so remove the old workaround.

	* linux/s390/arch_sigreturn.c (arch_sigreturn) [S390]: Remove.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	Update PTRACE_* constants.
	* ptrace.h (PTRACE_SECCOMP_GET_FILTER): Define.
	* xlat/ptrace_cmds.in: Add PTRACE_SECCOMP_GET_FILTER.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	Fix struct sigevent decoding for musl.
	Do not rely on "struct sigevent.__pad" being located at the same address
	as "struct sigevent.sigev_notify_thread_id", it's not the case with musl
	libc.  Do not rely on struct sigevent definition at all to access
	sigev_notify_thread_id.

	* configure.ac (AC_CHECK_MEMBERS): Remove struct sigevent._sigev_un._pad
	and struct sigevent.__pad.
	* sigevent.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* print_sigevent.c: Include it.
	* print_sigevent.c (struct_sigevent): Remove.
	(print_sigevent): Update all struct_sigevent users.
	* tests/timer_create.c: Include "sigevent.h".
	(main): Use struct_sigevent instead of struct sigevent,
	all struct sigevent clients changed.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	syscall.c: include <signal.h>
	All users of NSIG macro must include <signal.h>.
	This complements commit v4.10-184-g0e946ab.

	* syscall.c: Include <signal.h>.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	signal.c: fix musl libc compilation warning.
	musl libc defines SIGRTMAX to a function that returns signed int,
	which obviously makes gcc -Wsign-compare unhappy.

	* signal.c (signame): Cast ASM_SIGRTMAX to unsigned int.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix TEST_SYSCALL_{NR,STR} and STRUCT_STAT_STR macros for musl.
	The contents of TEST_SYSCALL_NAME and STRUCT_STAT macros was subject
	to macro expansion when used in definitions of TEST_SYSCALL_NR,
	TEST_SYSCALL_STR, and STRUCT_STAT_STR macros.

	As some libcs, e.g. musl libc, define lfs64 names as macros
	(stat64 as stat, lstat64 as lstat, etc.), this might result to incorrect
	expansion of TEST_SYSCALL_NR, TEST_SYSCALL_STR, and STRUCT_STAT_STR
	macros.  To avoid this problem, define these macros directly and remove
	TEST_SYSCALL_NAME macro.

	* tests/_newselect.c (TEST_SYSCALL_NAME): Remove.
	(TEST_SYSCALL_NR, TEST_SYSCALL_STR): New macros.
	* tests/fcntl.c: Likewise.
	* tests/fcntl64.c: Likewise.
	* tests/fstat.c: Likewise.
	* tests/fstatat64.c: Likewise.
	* tests/lstat.c: Likewise.
	* tests/newfstatat.c: Likewise.
	* tests/select.c: Likewise.
	* tests/stat.c: Likewise.
	* tests/fstat64.c (TEST_SYSCALL_NAME): Remove.
	(TEST_SYSCALL_NR, TEST_SYSCALL_STR, STRUCT_STAT_STR): New macros.
	* tests/lstat64.c: Likewise.
	* tests/stat64.c: Likewise.
	* tests/fstatx.c (TEST_SYSCALL_NR, nrify, nrify_): Remove.
	* tests/lstatx.c: Likewise.
	* tests/struct_flock.c (TEST_SYSCALL_NR, TEST_SYSCALL_STR, nrify,
	nrify_, stringify, stringify_): Remove.
	* tests/xselect.c: Likewise.
	* tests/xstatx.c: Check TEST_SYSCALL_STR instead of TEST_SYSCALL_NAME.
	(STRUCT_STAT_STR, TEST_SYSCALL_STR, stringify, stringify_): Remove.
	[!STRUCT_STAT] (STRUCT_STAT_STR): New macro.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests/struct_flock.c: fix musl libc compilation warnings.
	The size of off_t is not something one can rely upon.  For example,
	musl libc unconditionally defines it as an int64_t type on x86.
	A cast to the target type helps to avoid these libc differences.

	* configure.ac: Call AC_C_TYPEOF.
	* tests/struct_flock.c (TYPEOF_FLOCK_OFF_T): New macro.
	(test_flock_einval): Use it instead of off_t.

2016-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests/inet-cmsg.c: fix musl libc compilation warnings.
	The types that are used to define msg_namelen member of struct msghdr
	and cmsg_len member of struct cmsghdr differ between libcs.
	For example, glibc defines them as size_t, while musl libc - as type
	socklen_t.  Print these fields using %lu format to avoid issues caused
	by libc differences.

	* tests/inet-cmsg.c (main): Cast mh.msg_controllen and c->cmsg_len
	to unsigned long and print them using %lu format.

2016-01-11  Dmitry V. Levin  <ldv@altlinux.org>

	aio.test: include <fcntl.h> instead of <sys/fcntl.h>
	* tests/aio.c: Include <fcntl.h> instead of <sys/fcntl.h>.

	mmsg.test: check memory access by sendmmsg and recvmmsg decoders.
	* tests/tests.h (tail_memdup): New prototype.
	* tests/tail_alloc.c (tail_memdup): New function.
	* tests/mmsg.c (main): Place all objects passed to sendmmsg and recvmmsg
	at the end of memory pages followed by inaccessible pages.

	mmsg.test: check decoding of flags passed to sendmmsg and recvmmsg.
	* tests/mmsg.c (main): Pass MSG_DONTROUTE|MSG_NOSIGNAL to sendmmsg.
	Pass MSG_DONTWAIT to recvmmsg.
	* tests/mmsg.expected: Update.

2016-01-11  Dmitry V. Levin  <ldv@altlinux.org>

	mmsg.test: prefer direct sendmmsg/recvmmsg syscalls to libc wrappers.
	* tests/mmsg.c: Include <sys/syscall.h>.
	Check for __NR_sendmmsg as an alternative to HAVE_SENDMMSG.
	[!HAVE_STRUCT_MMSGHDR] (struct mmsghdr): Define.
	(send_mmsg, recv_mmsg): New functions.
	(main): Use them instead of sendmmsg and recvmmsg.

	Reported-by: Szabolcs Nagy <nsz@port70.net>

2016-01-10  Dmitry V. Levin  <ldv@altlinux.org>

	sigreturn.test: use RT_5 signal number instead of RT_2.
	Make the test compatible with musl libc that uses RT_2 internally.

	* tests/sigreturn.c (main): Replace RT_2 with RT_5.
	* tests/sigreturn.test: Likewise.

	Reported-by: Szabolcs Nagy <nsz@port70.net>

2016-01-10  Dmitry V. Levin  <ldv@altlinux.org>

	avr32: wire up accept4 syscall.
	* linux/avr32/syscallent.h [321]: Add accept4 entry.

2016-01-09  Dmitry V. Levin  <ldv@altlinux.org>

	sparc64: fix names of {s,g}etres{u,g}id syscalls.
	* linux/sparc64/syscallent.h [108 ... 111]: Use sparc64 syscall names.

	sparc64: remove sparc32 syscall entries.
	* linux/sparc64/syscallent.h [31, 32, 35, 44, 53, 56, 69, 70, 72, 77,
	82, 84, 87, 89, 91, 94, 112, 115, 155, 231]: Unassign.

	sparc: remove sparc64 syscall entries.
	* linux/sparc/syscallent.h [52, 163]: Unassign.

	sparc64: clone syscallent.h from sparc.
	* linux/sparc64/syscallent.h: Clone from linux/sparc/syscallent.h.

	sparc: fix mlock2 sysentry, wire up bind, listen, and setsockopt syscalls
	* linux/sparc/syscallent.h [353]: Move mlock2 entry to 356.
	[353, 354, 355]: Add bind, listen, and setsockopt entries.
	* NEWS: Mention this.

2016-01-09  Dmitry V. Levin  <ldv@altlinux.org>

	tests: do not use settimeofday wrapper provided by libc.
	Workaround limitations of settimeofday wrapper provided by musl libc.

	* tests/xettimeofday.c (main): Call settimeofday using syscall().

	Reported-by: Szabolcs Nagy <nsz@port70.net>

2016-01-09  Dmitry V. Levin  <ldv@altlinux.org>

	ioctl.test: robustify against libcs invoking ioctl syscall on their own.
	* tests/ioctl.test: Filter out from the log ioctl calls with standard
	descriptor arguments.

	Reported-by: Szabolcs Nagy <nsz@port70.net>

2016-01-09  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: enhance decoding of getxpid, getxuid, and getxgid syscalls.
	Print the second return value of getxpid, getxuid, and getxgid syscalls
	that return a pair of values using the same mechanism as pipe syscall.

	* alpha.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/alpha/syscallent.h [20]: Change SEN(getpid) to SEN(getxpid).
	[24]: Change SEN(getuid) to SEN(getxuid).
	[47]: Change SEN(getgid) to SEN(getxgid).
	* NEWS: Mention this enhancement.
	* tests/uid.awk: Update for getxgid output change.
	* tests/uid.test: Cleanup.
	* tests/getxxid.c: New file.
	* tests/getxxid.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add getxxid.
	(TESTS): Add getxxid.test.
	* tests/.gitignore: Add getxxid.

2016-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	Cleanup parser of getpagesize syscall.
	* mem.c (SYS_FUNC(getpagesize)): Decode on entering syscall.

	alpha: alias getdtablesize to printargs.
	* linux/dummy.h [ALPHA] (sys_getdtablesize): Alias to printargs.
	* desc.c [ALPHA] (SYS_FUNC(getdtablesize)): Remove.

2016-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change text marker in fork-f and vfork-f tests.
	Use chdir syscalls instead of pwrite64 syscalls as a method of inserting
	text markers into strace output because the former are more portable.

	* tests/fork-f.c (logit): Rename to logit_. Use chdir instead of pwrite.
	(logit): New macro wrapper around logit_.
	(main): Update expected output.
	* tests/vfork-f.c: Likewise.
	* tests/fork-f.test: Update.

2016-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	Fix printing of 32-bit times syscall return value on 64-bit architectures
	This change complements commit v4.9-359-gd93d9f8 by fixing
	RVAL_UDECIMAL case.
	The only syscall that appears to be affected is the times syscall.

	* syscall.c (trace_syscall_exiting): In case of RVAL_UDECIMAL,
	when current personality is 32-bit, print 32-bit return code.
	* NEWS: Mention this fix.

	Reported-by: Steve McIntyre <steve@einval.com>

2016-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests/vfork-f.c: support platforms without vfork.
	On some platforms, e.g. hppa glibc, vfork() is implemented using fork
	syscall, so the test cannot rely on the parent process remaining blocked
	until the child process either terminates or calls execve.

	* tests/vfork-f.c (main): Explicitly block the parent until the child
	either terminates or calls execve.

2016-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	Fix and enhance decoding of sched_[gs]etaffinity syscalls.
	Print cpu_set_t as a set of integers, similar to the way
	fd_set is printed as a set of descriptors.

	* affinity.c: Include <sched.h>.
	(get_cpuset_size): New function.
	(print_affinitylist): Rewrite using get_cpuset_size and next_set_bit.
	(sched_getaffinity, sched_setaffinity): Print first two args as ints.
	* NEWS: Mention this enhancement.
	* tests/sched_xetaffinity.c: New file.
	* tests/sched_xetaffinity.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add sched_xetaffinity.
	(TESTS): Add sched_xetaffinity.test.
	* tests/.gitignore: Add sched_xetaffinity.

	Reported-by: Joe Korty <joe.korty@ccur.com>

2016-01-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: convert epoll_create1.test from match_grep to match_diff.
	* tests/epoll_create1.c (main): Print expected output.
	* tests/epoll_create1.test: Use match_diff instead of match_grep.
	* tests/epoll_create1.expected: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove epoll_create1.expected.

	tests/struct_flock.c: use libtests.
	* tests/struct_flock.c (create_sample): Return void,
	all callers changed.  Use perror_msg_and_fail.
	* tests/fcntl.c: Use SKIP_MAIN_UNDEFINED.
	* tests/fcntl64.c: Likewise.

	tests/file_handle.c: use libtests.
	* tests/file_handle.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert and perror_msg_and_skip.

	tests/uid32.c: use libtests.
	* tests/uid32.c: Use SKIP_MAIN_UNDEFINED.

	tests/uid16.c: use libtests.
	* tests/uid16.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/uid.c: use libtests.
	* tests/uid.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/netlink_unix_diag.c: use libtests.
	* tests/netlink_unix_diag.c (send_query, check_responses, main):
	Use perror_msg_and_skip.

	tests/netlink_inet_diag.c: use libtests.
	* tests/netlink_inet_diag.c (send_query, check_responses, main):
	Use perror_msg_and_skip.

	tests/readdir.c: use libtests.
	* tests/readdir.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/getdents64.c: use libtests.
	* tests/getdents64.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/getdents.c: use libtests.
	* tests/getdents.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/ipc_shm.c: use libtests.
	* tests/ipc_shm.c (cleanup): New function.
	(main): Use it and perror_msg_and_skip.

	tests/ipc_sem.c: use libtests.
	* tests/ipc_sem.c (cleanup): New function.
	(main): Use it and perror_msg_and_skip.

	tests/ipc_msg.c: use libtests.
	* tests/ipc_msg.c (cleanup): New function.
	(main): Use it and perror_msg_and_skip.

	tests/ipc_msgbuf.c: use libtests.
	* tests/ipc_msgbuf.c (cleanup): New function.
	(main): Use it and perror_msg_and_skip.

	tests/mq.c: use libtests.
	* tests/mq.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/utimensat.c: use libtests.
	* tests/utimensat.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert and perror_msg_and_skip.

	tests/ppoll.c: use libtests.
	* tests/ppoll.c (main): Use assert, perror_msg_and_skip,
	and perror_msg_and_fail.

	tests/mmsg.c: use libtests.
	* tests/mmsg.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/ip_mreq.c: use libtests.
	* tests/ip_mreq.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/ioctl.c: use libtests.
	* tests/ioctl.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use %m printf format specifier.

	tests/pipe.c: use libtests.
	* tests/pipe.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_fail and perror_msg_and_skip.

	tests/getrandom.c: use libtests.
	* tests/getrandom.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/signalfd.c: use libtests.
	* tests/signalfd.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/pc.c: use libtests.
	* tests/pc.c (main): Use assert, get_page_size, perror_msg_and_fail,
	and perror_msg_and_skip.

	tests/uio.c: use libtests.
	* tests/uio.c: Use SKIP_MAIN_UNDEFINED.

	tests/bpf.c: use libtests.
	* tests/bpf.c: Use SKIP_MAIN_UNDEFINED.
	(main) Use perror_msg_and_skip.

	tests/aio.c: use libtests.
	* tests/aio.c: Use SKIP_MAIN_UNDEFINED.
	(main) Use perror_msg_and_skip.

	tests/sched_xetattr.c: use libtests.
	* tests/sched_xetattr.c: Use SKIP_MAIN_UNDEFINED.
	(main) Use perror_msg_and_skip.

	tests/wait.c: use libtests.
	* tests/wait.c (main): Use perror_msg_and_fail.

	tests/vfork-f.c: use libtests.
	* tests/vfork-f.c (main): Use assert and perror_msg_and_fail.

	tests/fork-f.c: use libtests.
	* tests/fork-f.c (main): Use assert and perror_msg_and_fail.

	tests/userfaultfd.c: use libtests.
	* tests/userfaultfd.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert.

	tests/mlock2.c: use libtests.
	* tests/mlock2.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert.

	tests/membarrier.c: use libtests.
	* tests/membarrier.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert.

	tests/nanosleep.c: use libtests.
	* tests/nanosleep.c (main): Use assert, perror_msg_and_fail,
	and perror_msg_and_skip.

	tests/timerfd_xettime.c: use libtests.
	* tests/timerfd_xettime.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/timer_xettime.c: use libtests.
	* tests/timer_xettime.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/timer_create.c: use libtests.
	* tests/timer_create.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/clock_xettime.c: use libtests.
	* tests/clock_xettime.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/clock_nanosleep.c: use libtests.
	* tests/clock_nanosleep.c (main): Use assert and perror_msg_and_skip.

	tests/truncate64.c: use libtests.
	* tests/truncate64.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert and perror_msg_and_skip.

	tests/truncate.c: use libtests.
	* tests/truncate.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert and perror_msg_and_skip.

	tests/ftruncate64.c: use libtests.
	* tests/ftruncate64.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert and perror_msg_and_skip.

	tests/ftruncate.c: use libtests.
	* tests/ftruncate.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert and perror_msg_and_skip.

2016-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests/llseek.c: use libtests.
	* tests/llseek.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert and perror_msg_and_skip.

	tests/lseek.c: use libtests.
	* tests/lseek.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert and perror_msg_and_skip.

	tests/readlinkat.c: use libtests.
	* tests/readlinkat.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/readlink.c: use libtests.
	* tests/readlink.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/xattr.c: use libtests.
	* tests/xattr.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/seccomp.c: use libtests.
	* tests/seccomp.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_fail and perror_msg_and_skip.

	tests/restart_syscall.c: use libtests.
	* tests/restart_syscall.c (main): Use assert, perror_msg_and_fail,
	and perror_msg_and_skip.

	tests/inet-cmsg.c: use libtests.
	* tests/inet-cmsg.c (main): Use perror_msg_and_skip.

	tests/eventfd.c: use libtests.
	* tests/eventfd.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip.

	tests/epoll_create1.c: use libtests.
	* tests/epoll_create1.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert and perror_msg_and_skip.

	tests/mmap.c: use libtests.
	* tests/mmap.c (main): Use get_page_size and perror_msg_and_fail.

	tests/fanotify_mark.c: use libtests.
	* tests/fanotify_mark.c: Use SKIP_MAIN_UNDEFINED.

	tests/inet-accept-connect-send-recv.c: use libtests.
	* tests/inet-accept-connect-send-recv.c (main): Use perror_msg_and_skip
	and perror_msg_and_fail.

	tests/net-accept-connect.c: use libtests.
	* tests/net-accept-connect.c (main): Use perror_msg_and_skip
	and perror_msg_and_fail.

	tests/unix-pair-send-recv.c: use libtests.
	* tests/unix-pair-send-recv.c (main): Use perror_msg_and_skip
	and perror_msg_and_fail.

2016-01-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests/xselect.c: use libtests.
	* tests/xselect.c (main): Use assert, perror_msg_and_fail,
	and perror_msg_and_skip.

	tests/pselect6.c: use libtests.
	* tests/pselect6.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert, perror_msg_and_fail, and perror_msg_and_skip.

2016-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests/oldselect.c: use libtests.
	* tests/oldselect.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_fail and perror_msg_and_skip.

	tests/select.c: use libtests.
	* tests/select.c: Use SKIP_MAIN_UNDEFINED.

	tests/_newselect.c: use libtests.
	* tests/_newselect.c: Use SKIP_MAIN_UNDEFINED.

	tests/fstatat.c: use libtests.
	* tests/fstatat.c: Use SKIP_MAIN_UNDEFINED.

	tests/newfstatat.c: use libtests.
	* tests/newfstatat.c: Use SKIP_MAIN_UNDEFINED.

	tests/fstatat64.c: use libtests.
	* tests/fstatat64.c: Use SKIP_MAIN_UNDEFINED.

	tests/xstatx.c: use libtests.
	* tests/xstatx.c: Use SKIP_MAIN_UNDEFINED.

	tests/stat64.c: use libtests.
	* tests/stat64.c: Use SKIP_MAIN_UNDEFINED.

	tests/stat.c: use libtests.
	* tests/stat.c: Use SKIP_MAIN_UNDEFINED.

	tests/lstat64.c: use libtests.
	* tests/lstat64.c: Use SKIP_MAIN_UNDEFINED.

	tests/lstat.c: use libtests.
	* tests/lstat.c: Use SKIP_MAIN_UNDEFINED.

	tests/fstat64.c: use libtests.
	* tests/fstat64.c: Use SKIP_MAIN_UNDEFINED.

	tests/fstat.c: use libtests.
	* tests/fstat.c: Use SKIP_MAIN_UNDEFINED.

	tests/statfs.c: use libtests.
	* tests/statfs.c (main): Use perror_msg_and_fail.

2016-01-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests/xettimeofday.c: use libtests.
	* tests/xettimeofday.c (main): Use assert and perror_msg_and_skip.

	tests/utime.c: use libtests.
	* tests/utime.c (main): Use assert and perror_msg_and_skip.

	tests/filter-unavailable.c: use libtests.
	* tests/filter-unavailable.c (main): Use perror_msg_and_fail.

	tests/scm_rights.c: use libtests.
	* tests/scm_rights.c (main): Use perror_msg_and_fail and perror_msg_and_skip.

	tests/caps.c: use libtests.
	* tests/caps.c (main): Use perror_msg_and_skip.

	tests/rt_sigqueueinfo.c: use libtests.
	* tests/rt_sigqueueinfo.c (main): Use assert and perror_msg_and_skip.

	tests/umount.c: use libtests.
	* tests/umount.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_fail.

	tests/umount2.c: use libtests.
	* tests/umount2.c (main): Use perror_msg_and_fail.

2016-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests/times.c: use libtests.
	* tests/times.c (main): Use perror_msg_and_fail and perror_msg_and_skip.

2016-01-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests/times-fail.c: use assert.
	* tests/times-fail.c (main): Use assert.

	tests/memfd_create.c: use libtests.
	* tests/memfd_create.c: Use SKIP_MAIN_UNDEFINED.

	tests/execveat.c: use libtests.
	* tests/execveat.c: Use SKIP_MAIN_UNDEFINED.

	tests/xetitimer.c: use libtests.
	* tests/xetitimer.c (main): Use perror_msg_and_skip.

2016-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests/sysinfo.c: use libtests.
	* tests/sysinfo.c (main): Use perror_msg_and_skip.

	tests/sigaltstack.c: use libtests.
	* tests/sigaltstack.c (main): Use perror_msg_and_skip.

	tests/adjtimex.c: use libtests.
	* tests/adjtimex.c (main): Use perror_msg_and_skip.

	tests/xet_robust_list.c: use libtests.
	* tests/xet_robust_list.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip and tail_alloc.

	tests/umovestr2.c: use libtests.
	* tests/umovestr2.c (main): Use get_page_size and tail_alloc.

	tests/umovestr.c: use libtests.
	* tests/umovestr.c (main): Use perror_msg_and_skip and tail_alloc.

	tests/time.c: use libtests.
	* tests/time.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use perror_msg_and_skip and tail_alloc.

	tests/sendfile64.c: use libtests.
	* tests/sendfile64.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert, perror_msg_and_fail, perror_msg_and_skip,
	and tail_alloc.

	tests/sendfile.c: use libtests.
	* tests/sendfile.c: Use SKIP_MAIN_UNDEFINED.
	(main): Use assert, perror_msg_and_fail, perror_msg_and_skip,
	and tail_alloc.

2016-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: include tests.h instead of config.h.
	Automatically edit tests/*.c files using the following perl one-liner:

	perl -0777 -pi -e \
	's/#ifdef HAVE_CONFIG_H\n# include "config\.h"\n#endif\n*/#include "tests.h"\n/' \
	tests/*.c

2016-01-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: introduce libtests.
	Introduce tests/libtests.a with common functions for use in tests.

	* tests/tests.h: New file.
	* tests/error_msg.c: Likewise.
	* tests/tail_alloc.c: Likewise.
	* tests/get_page_size.c: Likewise.
	* tests/Makefile.am (libtests_a_SOURCES, libtests_a_CPPFLAGS,
	check_LIBRARIES, LDADD): New variables.
	(clock_xettime_LDADD, filter_unavailable_LDADD, mq_LDADD,
	pc_LDADD, times_LDADD): Add $(LDADD).
	* tests/.gitignore: Add libtests.a.

2016-01-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enable strace-k.test only for --with-libunwind configurations.
	Also, since -k option does not support multiple personalities,
	add strace-k.test to XFAIL_TESTS when running mpers tests.

	* tests/Makefile.am (MPERS_NAME, LIBUNWIND_TESTS, XFAIL_TESTS_,
	XFAIL_TESTS_m32, XFAIL_TESTS_mx32, XFAIL_TESTS): New variables.
	[USE_LIBUNWIND] (LIBUNWIND_TESTS): Add strace-k.test.
	(TESTS): Replace strace-k.test with $(LIBUNWIND_TESTS).
	* bootstrap: Substitute MPERS_NAME variable in tests-*/Makefile.am.
	* tests/strace-k.test: Do not check for -k option availability.

2016-01-02  Dmitry V. Levin  <ldv@altlinux.org>

	Move gcc compat macros to gcc_compat.h.
	* defs.h: Include "gcc_compat.h".
	(GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT,
	ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC,
	ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): Move ...
	* gcc_compat.h: ... here.
	* Makefile.am (strace_SOURCES): Add gcc_compat.h.

2015-12-31  Dmitry V. Levin  <ldv@altlinux.org>

	Move defs.h from noinst_HEADERS to strace_SOURCES.
	* Makefile.am (noinst_HEADERS): Move defs.h ...
	(strace_SOURCES): ... here.

2015-12-30  Dmitry V. Levin  <ldv@altlinux.org>

	test: remove fork.c and vfork.c.
	These manual tests are obsoleted by fork-f.test and vfork-f.test.

	* test/fork.c: Remove.
	* test/vfork.c: Remove.
	* test/Makefile (PROGS): Remove fork and vfork.
	* test/.gitignore: Remove fork and vfork.

2015-12-30  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add fork-f.test and vfork-f.test.
	Check how strace -f follows fork and vfork syscalls.

	* tests/fork-f.c: New file.
	* tests/fork-f.test: New test.
	* tests/vfork-f.c: New file.
	* tests/vfork-f.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add fork-f and vfork-f.
	(TESTS): Add fork-f.test and vfork-f.test.
	* tests/.gitignore: Add fork-f and vfork-f.

2015-12-29  Dmitry V. Levin  <ldv@altlinux.org>

	Set SYSCALL_NEVER_FAILS flag for getpid, getppid and gettid syscall.
	* linux/*/syscallent*.h (getpid, getppid, gettid): Set NF flag.

2015-12-29  Dmitry V. Levin  <ldv@altlinux.org>

	Set SYSCALL_NEVER_FAILS flag for umask syscall.
	Linux kernel always ANDs umask argument with 0700 and therefore
	this syscall never fails.

	* linux/*/syscallent*.h (umask): Set NF flag.

2015-12-27  Dmitry V. Levin  <ldv@altlinux.org>

	alpha, ia64, mips, nios2, powerpc, sparc: always check for syscall error
	On architectures that use dedicated registers to report syscall errors,
	check for syscall error condition regardless of SYSCALL_NEVER_FAILS flag
	in the syscall entry.  On architectures that use negated errno
	semantics, there is no way to distinguish a syscall error from a valid
	return code that looks like a syscall error, and the check for
	SYSCALL_NEVER_FAILS flag remains the only way to tell one case
	from another.

	* linux/alpha/get_error.c (get_error): Ignore check_errno.
	* linux/ia64/get_error.c: Likewise.
	* linux/mips/get_error.c: Likewise.
	* linux/nios2/get_error.c: Likewise.
	* linux/powerpc/get_error.c: Likewise.
	* linux/sparc/get_error.c: Likewise.
	* linux/sparc64/get_error.c: Likewise.

2015-12-27  Dmitry V. Levin  <ldv@altlinux.org>

	Handle unlikely errors from personality syscall.
	Despite being marked as SYSCALL_NEVER_FAILS, personality syscall still
	might report a failure on some architectures due to obscure kernel
	bugs.  Check for this unlikely case and let users know that their
	kernel has gone bananas.

	* personality.c (SYS_FUNC(personality)): Do not parse syscall return
	value in case of syserror.

2015-12-27  Dmitry V. Levin  <ldv@altlinux.org>

	Do not truncate return value of get{,e}[ug]id and setfs[ug]id syscalls.
	This should not be a user visible change unless the kernel does
	something completely unexpected.  In the latter case, let user see
	what is going on.

	* uid.c (SYS_FUNC(getuid), SYS_FUNC(setfsuid)): Do not truncate
	tcp->u_rval to uid_t on exiting syscall, return RVAL_DECODED.

2015-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance personality syscall decoding.
	* xlat/personality_options.in: Split into ...
	* xlat/personality_types.in: ... personality types and ...
	* xlat/personality_flags.in: ... personality flags.
	* personality.c: Include "xlat/personality_types.h"
	and "xlat/personality_flags.h" instead of "xlat/personality_options.h".
	(SYS_FUNC(personality)): Print PER_MASK part of personality as
	a symbolic value, and the rest of personality as a set of flags.
	* tests/personality.c (main): Add more test cases.
	* tests/personality.test: Update.

2015-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	sh, sh64: fix syscall flags in several syscall entries.
	* linux/sh/syscallent.h (geteuid32, getegid32, setfsuid32, setfsgid32):
	Set SYSCALL_NEVER_FAILS flag.
	(fchown32): Set TRACE_DESC flag.
	* linux/sh64/syscallent.h: Likewise.

2015-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	Print personality value 0xffffffff properly.
	Value 0xffffffff of personality syscall first argument has a special
	meaning, it is not a set of personality flags.

	* personality.c (SYS_FUNC(personality)): If personality equals
	to 0xffffffff, print it verbatim.
	* tests/personality.c (main): Test it.

2015-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add personality.test.
	* tests/personality.c: New file.
	* tests/personality.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add personality.
	(TESTS): Add personality.test.
	* tests/.gitignore: Add personality.

	Enhance personality syscall decoding.
	* personality.c (SYS_FUNC(personality)): On entering syscall,
	print first argument not as a hex value but as a set of flags.
	On exiting syscall, print return code as a set of flags.
	* NEWS: Mention this enhancement.

2015-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	Set SYSCALL_NEVER_FAILS flag for personality syscall.
	Starting with commit
	v2.6.29-6609-g11d06b2a1e5658f448a308aa3beb97bacd64a940, personality
	syscall never fails to set the personality, but before commit
	v2.6.35-rc1-372-g485d527 it still could return an error.
	Starting with that commit, personality syscall never returns an error.

	* linux/*/syscallent.h: Set SYSCALL_NEVER_FAILS flag in personality
	syscall entries.

2015-12-24  Dmitry V. Levin  <ldv@altlinux.org>

	Add personality emulation flags.
	* xlat/personality_options.in: Add UNAME26, ADDR_NO_RANDOMIZE,
	FDPIC_FUNCPTRS, MMAP_PAGE_ZERO, ADDR_COMPAT_LAYOUT, READ_IMPLIES_EXEC,
	ADDR_LIMIT_32BIT, SHORT_INODE, WHOLE_SECONDS, STICKY_TIMEOUTS,
	and ADDR_LIMIT_3GB.

2015-12-24  Dmitry V. Levin  <ldv@altlinux.org>

	arc, metag, nios2, or1k, tile: fix build.
	Fix build regression introduced by commit
	34683e3926d8c2daa368afb805da422ee7043396.

	* linux/32/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap.
	* linux/arc/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap_pgoff.
	* linux/nios2/syscallent.h: Likewise.
	* linux/or1k/syscallent.h: Likewise.
	* linux/tile/syscallent1.h: Add sys_ prefix to ARCH_mmap and sys_mmap_4koff.
	* pathtrace.c (pathtrace_match): Handle SEN_ARCH_mmap.
	* NEWS: Mention this build fix.

	Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>

2015-12-24  Dmitry V. Levin  <ldv@altlinux.org>

	packages: remove acl development library from build dependencies.
	Starting with commit v4.9-46-g681452b that removed all references
	to acl.h, we no longer use acl development library.

	* .travis.yml (addons.apt.packages): Remove libacl1-dev.
	* strace.spec (BuildRequires): Remove libacl-devel.

2015-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	packages/x86_64: enable experimental -k option.
	* debian/control (Build-Depends) [amd64]: Add libunwind-dev.
	* strace.spec (BuildRequires) [x86_64]: Add libunwind-devel.

	maint: post-release administrivia.
	* NEWS: Add header line for the next release.

2015-12-21  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.11 release.
	* NEWS: Update for 4.11 release.
	* debian/changelog: 4.11-1.
	* strace.spec: 4.11-1.

2015-12-20  Dmitry V. Levin  <ldv@altlinux.org>

	Sync strace.spec and debian/ with packages.
	* debian/changelog: Sync with 4.10-3.
	* debian/control: Likewise.
	* debian/rules: Likewise.
	* strace.spec: Sync with 4.10-3.

	.mailmap: add addresses of Kirill A. Shutemov.
	* .mailmap: Add both addresses of Kirill A. Shutemov here
	to avoid duplications in CREDITS file.

2015-12-19  Dmitry V. Levin  <ldv@altlinux.org>

	NEWS: Prepare for 4.11 release.

2015-12-18  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: wire up mlock2 syscall.
	* linux/ia64/syscallent.h [1346]: Add mlock2 entry.

2015-12-17  Dmitry V. Levin  <ldv@altlinux.org>

	Add copyright headers to some files which lack them.
	Before this change, all files that exist since 20th century had
	copyright headers, while most files that appeared later didn't.  This
	change fixes the inconsistency by adding missing copyright headers.

	It doesn't mean that copyright headers became maintained.  In my view,
	git history provides much better information on this subject and is much
	more accurate than copyright headers.

2015-12-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests/aio.c: include <time.h>
	* tests/aio.c: Include <time.h> for struct timespec.

	Reported-by: Szabolcs Nagy <nsz@port70.net>

2015-12-16  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.sh: switch to DWARF version 2 format for better portability.
	* mpers.sh (CFLAGS): Replace -gdwarf-4 with -gdwarf-2.

	mpers.awk: add support for DWARF version 2 format.
	* mpers.awk: Handle DW_AT_data_member_location in DWARF v2 format.

2015-12-16  Dmitry V. Levin  <ldv@altlinux.org>

	Replace %Ld/%Lu printf format specifiers with %lld/%llu.
	As %Ld and %Lu printf format specifiers are not quite portable,
	replace them with %lld and %llu, respectively.

	* desc.c (SYS_FUNC(pselect6)): Replace %Lu with %llu.
	* dirent.c (print_old_dirent, SYS_FUNC(getdents)): Likewise.
	* times.c (SYS_FUNC(times)): Likewise.
	* fcntl.c (print_struct_flock64): Replace %Ld with %lld.
	* tests/ftruncate.c (main): Replace %Lu with %llu.
	* tests/ftruncate64.c (main): Likewise.
	* tests/getdents.c (print_dirent): Likewise.
	* tests/llseek.c (main): Likewise.
	* tests/lseek.c (main): Likewise.
	* tests/truncate.c (main): Likewise.
	* tests/truncate64.c (main): Likewise.
	* tests/xstatx.c (main): Likewise.
	* tests/pselect6.c (main): Replace %Ld with %lld.
	* tests/xselect.c(main): Likewise.

	Reported-by: Szabolcs Nagy <nsz@port70.net>

2015-12-16  Szabolcs Nagy  <nsz@port70.net>

	Fix SYS_FUNC and SEN macros for musl.
	The syscall_name argument was subject to macro expansion because
	it was passed down to other macros before it was prefixed.

	musl libc defines lfs64 names as macros (e.g. fstat64 as fstat)
	so SYS_FUNC(fstat64) was expanded to sys_fstat.

	This change adds the prefix before the name is passed to other macros,
	i.e. the argument of SYS_FUNC_NAME is already prefixed with sys_.

	* defs.h (SYS_FUNC): Add sys_ prefix to SYS_FUNC_NAME's argument.
	(SYS_FUNC_NAME): Do not add sys_ prefix to MPERS_FUNC_NAME's argument.
	* linux/ia64/syscallent.h (SYS_FUNC_NAME): Do not add sys_ prefix
	to MPERS_FUNC_NAME's argument.
	* syscall.c (SEN_NAME): Remove.
	(SEN): Replace SEN_NAME call with its definition.  Add sys_ prefix
	to SYS_FUNC_NAME's argument.

2015-12-15  Dmitry V. Levin  <ldv@altlinux.org>

	tests/times.test: workaround libc bug on x32.
	As glibc times wrapper on x32 is known to wrongly truncate and then sign
	extend the syscall return value, invoke the syscall directly on x32.

	* tests/times.c (main) [__NR_times && __x86_64__ && __ILP32__]:
	Invoke times syscall using inline asm.

2015-12-15  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.awk: make fillers added to the output structure more predictable.
	* mpers.awk (array_seq): New function.
	(what_is): Use it for printing filler names.  Tweak return types.
	* mpers_test.sh: Use a more complicated sample type to test mpers
	machinery.

2015-12-15  Dmitry V. Levin  <ldv@altlinux.org>

	Robustify mpers.awk against input containing index loops.
	Make mpers.awk check for potential index loops.  Such loops should not
	normally happen, but mpers.awk will not go into infinite recursion if
	they do.

	* mpers.awk (enter, leave): New functions.
	(what_is): Use them.

2015-12-15  Dmitry V. Levin  <ldv@altlinux.org>

	Robustify mpers.awk against invalid input.
	Make mpers.awk check that accessed elements of the main array that
	are expected to have non-empty values really meet this requirement.

	* mpers.awk (array_get): New function.
	(what_is, END): Use it.
	* mpers_test.sh: Use a more complicated type to test mpers machinery.

	Reported-by: Mike Frysinger <vapier@gentoo.org>

2015-12-14  Dmitry V. Levin  <ldv@altlinux.org>

	Replace HAVE_LITTLE_ENDIAN_LONG_LONG with WORDS_BIGENDIAN.
	* defs.h: Use WORDS_BIGENDIAN instead of HAVE_LITTLE_ENDIAN_LONG_LONG.
	* configure.ac (AC_LITTLE_ENDIAN_LONG_LONG): Remove.
	* m4/long_long.m4: Remove.

2015-12-14  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unused parser of xmknod syscall.
	The last reference to this parser was removed by commit
	v4.10-45-gdf4dd8b.

	* mknod.c [SPARC || SPARC64] (SYS_FUNC(xmknod)): Remove.

2015-12-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests/restart_syscall: add a workaround for old arm kernels.
	As arm kernels used to overwrite ARM_r0 with -EINTR after
	ERESTART_RESTARTBLOCK, update regexp to workaround this.

	* tests/restart_syscall.c (main) [__arm__]: Add 0xfffffffc as a valid
	alternative value for the first argument of restarted nanosleep syscall.

2015-12-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests/.gitignore: add ksysent.h.
	tests/ksysent.h is a generated file listed in CLEANFILES.
	This change complements commit v4.10-566-gbab4ef4.

	* tests/.gitignore: Add ksysent.h.

2015-12-11  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64: make arm registers unsigned.
	Follow the x86_64 example and define registers in arm_pt_regs
	as unsigned, to avoid potential sign extension bugs.

	This also fixes --enable-gcc-Werror build.

	* linux/aarch64/arch_regs.c (arm_pt_regs): Change uregs's type
	from int to uint32_t.

	Reported-by: Sergey Bolshakov <sbolshakov@altlinux.org>

2015-12-10  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add ksysent.test.
	Check that syscall names and numbers defined in syscallent files
	match kernel __NR_* constants defined by <asm/unistd.h>.

	Tested on various platforms, including the following combinations
	of architectures and kernel headers:

	x86_64: 4.4-rc, 4.3, 4.2, 4.1, 3.19, 3.17, 3.16, 3.12, 3.11,
	3.10-rhel, 2.6.32-rhel, 2.6.27-sle, 2.6.18-rhel
	i386: 4.4-rc, 4.3, 4.2, 4.1, 3.19, 3.17, 3.16, 3.11,
	3.10-rhel, 2.6.32-rhel, 2.6.27-sle, 2.6.18-rhel
	aarch64: 4.4-rc
	alpha: 4.3
	arm eabi: 4.4-rc, 4.2, 4.1
	hppa: 3.18
	ia64: 3.18
	mips o32: 4.1
	ppc: 3.18
	ppc64: 3.10-rhel, 2.6.32-rhel
	s390: 3.18
	s390x: 3.18
	sparc: 4.1
	sparc: 3.18
	x32: 3.19

	The only platform which is known at this moment to fail the test
	is CentOS-5 provided by OBS.  On x86_64 instance it fails with
	error: "prlimit64" syscall #300 is "fanotify_init" in syscallent.h
	and on i586 it similarly fails with
	error: "prlimit64" syscall #338 is "fanotify_init" in syscallent.h
	So this is a real platform bug that is not likely to be worked around
	on the strace side.

	* tests/ksysent.c: New file.
	* tests/ksysent.sed: Likewise.
	* tests/ksysent.test: New test.
	* tests/Makefile.am (AM_CPPFLAGS): Add -I$(builddir).
	(check_PROGRAMS): Add ksysent.
	(TESTS): Add ksysent.test.
	(EXTRA_DIST): Add ksysent.sed.
	(ksysent.h): New rule.
	(BUILT_SOURCES, CLEANFILES): Add ksysent.h.
	* tests/.gitignore: Add ksysent.

2015-12-09  Dmitry V. Levin  <ldv@altlinux.org>

	Document that syscall names match kernel __NR_* constants.
	* strace.1: Note syscall naming difference between architectures
	and the rule of choosing the right syscall name in each case.

2015-12-09  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: print all ia32 syscalls using printargs.
	Printing of ia32 syscalls on ia64 must have been broken for a long time.
	Do not pretend that it works, print ia32 syscalls using printargs
	instead.

	* linux/ia64/syscallent.h: Remove all redefinitions of sys_* macros.
	Stop including"../dummy.h".  Include "../i386/syscallent.h" with
	SYS_FUNC_NAME macro temporarily redirected to printargs.

2015-12-09  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build on architectures for which arch_sigreturn is not implemented.
	This complements commit 527b42ff8da3f52fa7c48eb766b2b57fb0f0b977.

	* linux/arch_sigreturn.c (arch_sigreturn): Define.

2015-12-09  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64: swap 64-bit and 32-bit personalities.
	Let native 64-bit personality be personality 0, and 32-bit personality
	be personality 1, to follow the traditional layout used for other
	architectures.

	* defs.h [AARCH64]: Swap PERSONALITY0_WORDSIZE and
	PERSONALITY1_WORDSIZE, remove DEFAULT_PERSONALITY.
	[AARCH64 && HAVE_M32_MPERS]: Rename PERSONALITY1_* to PERSONALITY0_*.
	* file.c [AARCH64 || defined X86_64 || defined X32]: Define
	STAT32_PERSONALITY for AARCH64 as well.
	* syscall.c (update_personality) [AARCH64]: Adjust PERSONALITY_NAMES.
	* linux/aarch64/errnoent1.h: Adjust comment.
	* linux/aarch64/get_error.c (get_error): Adjust tcp->currpers check.
	* linux/aarch64/get_syscall_args.c (get_syscall_args): Likewise.
	* linux/arm/arch_sigreturn.c (arch_sigreturn) [AARCH64]: Likewise.
	* linux/aarch64/get_scno.c (arch_get_scno): Adjust update_personality
	invocations.
	* linux/aarch64/ioctls_arch0.h: Swap with ...
	* linux/aarch64/ioctls_arch1.h: ... this file.
	* linux/aarch64/ioctls_inc0.h: Swap with ...
	* linux/aarch64/ioctls_inc1.h: ... this file.
	* linux/aarch64/syscallent.h: Swap with ...
	* linux/aarch64/syscallent1.h: ... this file.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

	mips: fix fadvise64 syscall entries.
	* linux/mips/syscallent-n32.h [6216]: Change syscall handler
	from fadvise64 to fadvise64_64.
	* linux/mips/syscallent-n64.h [5215]: Rename from "fadvise64_64"
	to "fadvise64"
	* linux/mips/syscallent-o32.h [4254]: Likewise.

	xtensa: wire up syncfs syscall.
	* linux/xtensa/syscallent.h [179]: Add syncfs entry.

	sh, sh64: fix syscall entries.
	* linux/sh/syscallent.h [322]: Fix timerfd_create entry.
	* linux/sh64/syscallent.h [350]: Likewise.
	[0]: Fix restart_syscall entry.

	powerpc, powerpc64: wire up mlock2 syscall.
	* linux/powerpc/syscallent.h [378]: Add mlock2 entry.
	* linux/powerpc64/syscallent.h: Likewise.

	hppa: fix syscall entries.
	* linux/hppa/syscallent.h: Swap [343] and [344] entries.

	avr32: update syscall entries.
	* linux/avr32/syscallent.h [0]: Rename from setup to restart_syscall.
	[284 ... 320]: New entries.

	m68k: fix syscall names.
	* linux/m68k/syscallent.h [335]: Rename "atomic_comxchg_32"
	to "atomic_cmpxchg_32".

	sparc: update syscall names.
	* linux/sparc/syscallent.h [160]: Rename "sched_setaffinity"
	to "sched_set_affinity".
	[161]: Rename "sched_getaffinity" to "sched_get_affinity".

	powerpc, powerpc64: update syscall names.
	* linux/powerpc/syscallent.h [201]: Rename "MOL" to "multiplexer".
	[225]: Rename "tux" to "tuxcall".
	[256]: Rename "debug_setcontext" to "sys_debug_setcontext".
	* linux/powerpc64/syscallent.h: Likewise.

	alpha: update syscall entries.
	* linux/alpha/syscallent.h [224 ... 228]: Add stub entries.
	[100]: Rename "osf_getpriority" to "getpriority".
	[255]: Rename "osf_subsysinfo" to "osf_subsys_info".
	[303]: Rename "adjtimex32" to "old_adjtimex".
	[319]: Rename "sysctl" to "_sysctl".
	[320]: Remove.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

	Fix mmap syscall entries.
	Change syscall names to match kernel __NR_* constants.

	* linux/avr32/syscallent.h [90]: Rename "mmap" to "mmap2".
	* linux/bfin/syscallent.h [90]: Rename "old_mmap" to "mmap".
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* tests/mmap.c (main): Remove old_mmap from expected output.
	* tests/mmap.test: Remove old_mmap from the list of mmap syscalls.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

	Fix select and _newselect syscall entries.
	Change syscall names to match kernel __NR_* constants.
	This reverts commit ddcf54969d253582ab2cfdcab8ede9cdae3fb171.

	* linux/arm/syscallent.h [82]: Rename "oldselect" to "select".
	[142]: Rename "select" to "_newselect".
	* linux/bfin/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h [82]: Likewise.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/hppa/syscallent.h [142]: Rename "select" to "_newselect".
	* linux/mips/syscallent-n32.h [6022]: Rename "select" to "_newselect".
	* linux/mips/syscallent-n64.h [5022]: Likewise.
	* linux/mips/syscallent-o32.h [4142]: Likewise.
	* linux/s390/syscallent.h [142]: Rename "select" to "_newselect".
	* linux/sparc/syscallent.h [230]: Rename "select" to "_newselect".
	* tests/oldselect.test: Rename oldselect to select.  Convert
	from match_grep to match_diff.
	* tests/oldselect.expected: Likewise.
	* xselect.c: New file, based on select.c.
	* tests/_newselect.c: New file.
	* tests/select.c: Replace with a wrapper around xselect.c.
	* tests/select.test: Parametrize.
	* tests/_newselect.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add _newselect.
	(TESTS): Add _newselect.test.
	(EXTRA_DIST): Add xselect.c.
	* tests/.gitignore: Add _newselect.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

	Fix exit syscall entries.
	Change syscall names to match kernel __NR_* constants.

	* linux/avr32/syscallent.h [1]: Rename "_exit" to "exit".
	* linux/bfin/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/x32/syscallent.h [60]: Rename "_exit" to "exit".
	* linux/x86_64/syscallent.h: Likewise.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

	Fix pread64 and pwrite64 syscall entries.
	Change syscall names to match kernel __NR_* constants.

	* linux/alpha/syscallent.h [349]: Rename "pread" to "pread64".
	[350]: Rename "pwrite" to "pwrite64".
	* linux/ia64/syscallent.h [1148]: Rename "pread" to "pread64".
	[1149]: Rename "pwrite" to "pwrite64".
	* linux/sh/syscallent.h [180]: Rename "pread" to "pread64".
	[181]: Rename "pwrite" to "pwrite64".
	* linux/sh64/syscallent.h: Likewise.
	* linux/x32/syscallent.h [17]: Rename "pread" to "pread64".
	[18]: Rename "pwrite" to "pwrite64".
	* linux/x86_64/syscallent.h: Likewise.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: sort the list of tests.
	* tests/Makefile.am (TESTS): Sort the list of regular tests.
	* tests/.gitignore: Sort.

	ia64: fix remap_file_pages syscall entry.
	* linux/ia64/syscallent.h (1125): Set to remap_file_pages.

	bfin, i386: remove sysentry for nonexistent security syscall.
	* linux/bfin/syscallent.h (223): Remove.
	* linux/i386/syscallent.h: Likewise.

	build: add -D_FILE_OFFSET_BITS=64 to _CPPFLAGS instead of _CFLAGS.
	* tests/Makefile.am (fstat64_CFLAGS): Rename to fstat64_CPPFLAGS,
	replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
	(fstatat64_CFLAGS): Rename to fstatat64_CPPFLAGS,
	replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
	(ftruncate64_CFLAGS): Rename to ftruncate64_CPPFLAGS,
	replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
	(lstat64_CFLAGS): Rename to lstat64_CPPFLAGS,
	replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
	(mmap64_CFLAGS): Rename to mmap64_CPPFLAGS,
	replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
	(newfstatat_CFLAGS): Rename to newfstatat_CPPFLAGS,
	replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
	(stat64_CFLAGS): Rename to stat64_CPPFLAGS,
	replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
	(statfs_CFLAGS): Rename to statfs_CPPFLAGS,
	replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
	(truncate64_CFLAGS): Rename to truncate64_CPPFLAGS,
	replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
	(uio_CFLAGS): Rename to uio_CPPFLAGS,
	replace $(AM_CFLAGS) with $(AM_CPPFLAGS).

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

	Move x32 <asm/stat.h> replacement to x32 specific directory.
	As tests-m*32/Makefile.am files now refer to proper arch specific
	directories, it's possible to relocate x32 <asm/stat.h> replacement
	to its arch specific directory.

	* linux/x86_64/asm_stat.h: Move ...
	* linux/x32/asm_stat.h: ... here, remove x32 guard.
	* Makefile.am (strace_SOURCES): Remove linux/x86_64/asm_stat.h.

2015-12-08  Dmitry V. Levin  <ldv@altlinux.org>

	build: set arch specific -m switches in tests-m*32/Makefile.am files properly
	* tests/Makefile.am (ARCH_MFLAGS, AM_LDFLAGS): New variables.
	(AM_CPPFLAGS): Use ARCH_MFLAGS.
	* bootstrap: In tests-m32/Makefile.am and tests-mx32/Makefile.am,
	add -m32 and -mx32, respectively, to ARCH_MFLAGS instead of AM_CFLAGS.

	build: initialize ARCH variable in tests-m*32/Makefile.am files properly
	* configure.ac (arch_m32): Set to sparc on sparc64, powerpc on
	powerpc64, arm on aarch64, i386 on x86_64 and x32, $arch in other cases.
	(arch_mx32): Set to x32 on x86_64, $arch in other cases.
	(AC_SUBST): Add arch_m32 and arch_mx32.
	* bootstrap: Substitute @arch@ with @arch_m32@ in tests-m32/Makefile.am.
	Substitute @arch@ with @arch_mx32@ in tests-mx32/Makefile.am.

2015-12-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add umount.test and umount2.test.
	* tests/umount.c: New file.
	* tests/umount2.c: Likewise.
	* tests/umount.test: New test.
	* tests/umount2.test: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add umount and umount2.
	(TESTS): Add umount.test and umount2.test.
	* tests/.gitignore: Add umount and umount2.

	avr32: fix umount2 syscall entry.
	* linux/avr32/syscallent.h: Rename umount to umount2.

	Update umount2 flags.
	* umount.c (MNT_FORCE, MNT_DETACH, MNT_EXPIRE): Move definitions ...
	* xlat/umount_flags.in: ... here.  Add UMOUNT_NOFOLLOW.

2015-12-07  Dmitry V. Levin  <ldv@altlinux.org>

	Print the first argument of umount2 syscall as a path.
	* umount.c (SYS_FUNC(umount2)): Use printpath instead of printstr.

	This fixes Debian bug #785050.

2015-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	prctl: add PR_CAP_AMBIENT parser.
	* xlat/pr_cap_ambient.in: New file.
	* prctl.c: Include "xlat/pr_cap_ambient.h".
	(SYS_FUNC(prctl)): Handle PR_CAP_AMBIENT.

	prctl: finish decoding of several commands on entering syscall.
	* prctl.c (SYS_FUNC(prctl)): Return RVAL_DECODED after decoding of
	PR_GET_DUMPABLE, PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK,
	PR_GET_TIMING, and PR_CAPBSET_READ commands.

	Fix build on systems that lack EM_FRV definition.
	* xlat/audit_arch.in: Guard AUDIT_ARCH_FRV with EM_FRV check.

	times.test: workaround buggy libc.
	* tests/times.c: Include <sys/syscall.h>.
	(main): On systems where user's and kernel's long types are the same,
	prefer direct times syscall over libc's times function because
	the latter is more prone to return value truncation.

	times.test: reduce cpu time consumption, increase struct tms diversity.
	* tests/times.c (main): Reduce cpu time consumption fourfold,
	make the parent process consume less cpu time than the child process
	so that members of the structure returned by times syscall would be
	more likely to contain different values.

2015-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	mips n32, x32: fix printing of times syscall return value.
	As times syscall returns kernel's long value, it has to be printed as
	RVAL_LUDECIMAL on systems where long type is less than kernel's long.

	* times.c (SYS_FUNC(times)) [RVAL_LUDECIMAL && !IN_MPERS]:
	Return RVAL_LUDECIMAL instead of RVAL_UDECIMAL.

2015-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	unix-yy.test: fix portability issue.
	* tests/unix-yy-connect.awk (r_close_listen): Quote square brackets
	that are not part of a bracket expression.

	inet-cmsg.test: skip the test when the network is not functional.
	* tests/inet-cmsg.c (main): Return 77 if inet datagram socket
	cannot be bound to INADDR_LOOPBACK.

2015-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	fcntl: skip F_GETLK64, F_SETLK64, and F_SETLKW64 in fcntl syscall parser
	As the kernel recognizes F_GETLK64, F_SETLK64, and F_SETLKW64 commands
	in fcntl64 syscall only, do not parse their structures in fcntl parser.

	* xlat/fcntlcmds.in: Move F_GETLK64, F_SETLK64, and F_SETLKW64 ...
	* xlat/fcntl64cmds.in: ... here.
	* fcntl.c: Include "xlat/fcntl64cmds.h".
	(print_fcntl): Move printing of first two syscall arguments
	and handling of F_GETLK64, F_SETLK64, and F_SETLKW64 commands ...
	(SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): ... here.
	* tests/fcntl.c: New file, based on struct_flock.c.
	* tests/fcntl64.c: Likewise.
	* tests/struct_flock.c (test_flock_einval, create_sample): New functions.
	(test_flock): Use test_flock_einval.
	(test_flock64, main): Remove.
	* tests/fcntl.test: New test.
	* tests/fcntl64.test: Likewise.
	* tests/struct_flock.test: Remove.
	* tests/Makefile.am (check_PROGRAMS): Add fcntl and fcntl64,
	remove struct_flock.
	(TESTS): Add fcntl.test and fcntl64.test, remove struct_flock.test.
	(EXTRA_DIST) Add struct_flock.c.
	* tests/.gitignore: Add fcntl and fcntl64, remove struct_flock.

2015-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	print_fcntl: finish with unrecognized commands on entering syscall.
	* fcntl.c (print_fcntl): Merge two switch statements.

2015-12-04  Elvira Khabirova  <lineprinter0@gmail.com>

	fcntl: create a separate parser for fcntl64 syscall.
	* fcntl.c(print_fcntl): New function, made from SYS_FUNC(fcntl).
	(SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Use it.
	* linux/32/syscallent.h: Change parser of fcntl64 to SEN(fcntl64).
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

2015-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	travis-ci: add build matrix.

	tests: replace old stat tests with stat.test and stat64.test.
	* tests/stat.c: Replace with a wrapper around lstatx.c
	* tests/stat.test: Replace with a wrapper around statx.sh.
	* tests/stat32-v.test: Remove.
	* tests/stat32.c: Remove.
	* tests/stat64-v.test: Remove.
	* tests/stat64.c: New file.
	* tests/stat64.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Replace stat32 with stat64.
	(stat_CFLAGS): Rename to stat64_CFLAGS.
	(TESTS): Replace stat32-v.test and stat64-v.test with stat64.test.
	* tests/.gitignore: Replace stat32 with stat64.

	tests: add lstat.test and lstat64.test.
	* tests/lstat.c: New file.
	* tests/lstat64.c: Likewise.
	* tests/lstatx.c: Likewise.
	* tests/lstat.test: New test.
	* tests/lstat64.test: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add lstat and lstat64.
	(lstat64_CFLAGS): Define.
	(TESTS): Add lstat.test and lstat64.test.
	(EXTRA_DIST): Add lstatx.c.
	* tests/.gitignore: Add lstat and lstat64.

	tests: add fstat.test and fstat64.test.
	* tests/fstat.c: New file.
	* tests/fstat64.c: Likewise.
	* tests/fstatx.c: Likewise.
	* tests/fstat.test: New test.
	* tests/fstat64.test: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add fstat and fstat64.
	(fstat64_CFLAGS): Define.
	(TESTS): Add fstat.test and fstat64.test.
	(EXTRA_DIST): Add fstatx.c.
	* tests/.gitignore: Add fstat and fstat64.

2015-12-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: prepare for detailed testing of stat family syscalls.
	Parametrize code from fstatat.c to support <asm/stat.h>
	as an alternative to <sys/stat.h> and move it to a separate file.

	* tests/statx.sh: New file, based on fstatat64.test.
	* tests/fstatat64.test: Use it.
	* tests/newfstatat.test: Likewise.
	* tests/xstatx.c: New file, based on fstatat.c.
	* tests/fstatat.c: Use it.
	* tests/Makefile.am (EXTRA_DIST): Add statx.sh and xstatx.c.
	* tests/fstatat64.c (FSTATAT_NAME): Change to TEST_SYSCALL_NAME.
	* tests/newfstatat.c: Likewise.

2015-12-04  Gabriel Laskar  <gabriel@lse.epita.fr>

	ioctl: allow to stop decoding number.
	For some ioctls, like from drm, the identification of the correct ioctl
	is done by custom code.  Specifying IOCTL_NUMBER_STOP_LOOKUP on
	return of ioctl_decode_command_number() disables further calls to
	ioctl_lookup().

	* defs.h (IOCTL_NUMBER_UNKNOWN, IOCTL_NUMBER_HANDLED,
	IOCTL_NUMBER_STOP_LOOKUP): Add macros representing ioctl number state
	decoding.
	* ioctl.c (SYS_FUNC(ioctl)): Skip ioctl_lookup() when
	ioctl_decode_command_number() returns a value with
	IOCTL_NUMBER_STOP_LOOKUP flag is set.

	Suggested-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>

2015-12-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip restart_syscall.test on x32.
	The syscall number of restart_syscall returned by the kernel in case
	of ERESTART_RESTARTBLOCK is broken on x32 from the beginning, see
	https://lkml.org/lkml/2015/11/30/790

	Until that improves, skip the test on x32.

	* tests/restart_syscall.c (main) [__x86_64__ && __ILP32__]: Return 77.

2015-12-04  Dmitry V. Levin  <ldv@altlinux.org>

	x32: fix decoding of i386 personality lseek syscall.
	On x32, tcp->ext_arg is not initialized for i386 personality,
	so tcp->u_arg has to be used instead.

	* lseek.c (SYS_FUNC(lseek)) [X32]: Handle "current_personality == 1" case.

2015-12-04  Dmitry V. Levin  <ldv@altlinux.org>

	x86_64, x32: add a replacement for <asm/stat.h>
	Some old kernel headers, Ubuntu 14.04 in particular, provide
	<asm/stat.h> editions that are completely wrong for x32.
	Workaround this issue by providing a replacement.

	* linux/x86_64/asm_stat.h: New file.
	* linux/x32/asm_stat.h: Likewise.
	* Makefile.am (strace_SOURCES): Add them.

2015-12-04  Dmitry V. Levin  <ldv@altlinux.org>

	Add a wrapper around <asm/stat.h>
	* linux/asm_stat.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c: Use it.

	kernel_types.h: protect from double inclusion.
	* kernel_types.h: Add #include guard.

2015-12-03  Dmitry V. Levin  <ldv@altlinux.org>

	fstatat64.test: lift /proc requirement.
	While -P option needs /proc to match descriptors, it does not use
	/proc to match pathnames.  As this test does not need descriptor
	match, the /proc requirement can be safely lifted.

	* tests/fstatat64.test: Lift /proc/self/fd/ requirement.

2015-12-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add fstatat64.test and newfstatat.test.
	* configure.ac (AC_CHECK_FUNCS): Add fstatat, ftruncate, and futimens.
	* tests/fstatat.c: New file.
	* tests/fstatat64.c: Likewise.
	* tests/newfstatat.c: Likewise.
	* tests/fstatat64.test: New test.
	* tests/newfstatat.test: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add fstatat64 and newfstatat.
	(fstatat64_CFLAGS, newstatat_CFLAGS): Define.
	(TESTS): Add fstatat64.test and newfstatat.test.
	(EXTRA_DIST): Add fstatat.c.
	* tests/.gitignore: Add fstatat64 and newfstatat.

2015-12-01  Dmitry V. Levin  <ldv@altlinux.org>

	alpha, ppc, sh, sh64: fix fstatat64 syscall entries.
	* linux/alpha/syscallent.h (newfstatat): Change sys_name to fstatat64.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.

	ppc64: clone syscallent.h from ppc.
	* linux/powerpc64/syscallent.h: Clone from linux/powerpc/syscallent.h
	with entries for numbers 192..197, 204, 226, and 254 unassigned.

	tests: add lseek.test and llseek.test.
	* tests/llseek.c: New file.
	* tests/lseek.c: Likewise.
	* tests/llseek.test: New test.
	* tests/lseek.test: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add llseek and lseek.
	(TESTS): Add llseek.test and lseek.test.
	* tests/.gitignore: Add llseek and lseek.

	tests: add ftruncate64.test and truncate64.test.
	* tests/ftruncate64.c: New file.
	* tests/truncate64.c: Likewise.
	* tests/ftruncate64.test: New test.
	* tests/truncate64.test: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add ftruncate64 and truncate64.
	(ftruncate64_CFLAGS, truncate64_CFLAGS): Define.
	(TESTS): Add ftruncate64.test and truncate64.test.
	* tests/.gitignore: Add ftruncate64 and truncate64.

	tests: add ftruncate.test and truncate.test.
	* tests/ftruncate.c: New file.
	* tests/truncate.c: Likewise.
	* tests/ftruncate.test: New test.
	* tests/truncate.test: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add ftruncate and truncate.
	(TESTS): Add ftruncate.test and truncate.test.
	* tests/.gitignore: Add ftruncate and truncate.

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

	build: robustify linux/fcntl.h check.
	* configure.ac (AC_CHECK_TYPES): Support older linux kernel headers
	by including <sys/types.h> before <linux/fcntl.h>.

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

	syscall.c: move inclusion of arch specific files to the end of file.
	Move inclusion of arch specific files that define static functions to
	the end of syscall.c.

	* syscall.c (get_syscall_result_regs, get_error, getregs_old):
	New forward declarations.
	(arch_get_scno): Move forward.
	Move inclusion of "get_scno.c", "get_syscall_args.c",
	"get_syscall_result.c", "get_error.c", and "getregs_old.c"
	to the end of file.

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

	x86_64: change getregs_old to forward ptrace return code.
	* linux/x86_64/getregs_old.c (getregs_old): Change to return ptrace
	return code.
	* syscall.c (get_regs) [ARCH_REGS_FOR_GETREGSET && X86_64]: Use
	getregs_old return code.

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

	Cleanup print_pc.
	Apparently, there are only two types of instruction pointer printers
	depending on the architecture: those that print a register that was
	fetched earlier, and those that fetch a register themselves using upeek.
	With this change, architectures of the first type have ARCH_PC_REG
	defined in their arch_regs.c file, architectures of the first type
	have ARCH_PC_PEEK_ADDR defined there, and the common code in syscall.c
	uses these macros to print the instruction pointer.

	* Makefile.am (EXTRA_DIST): Remove linux/*/print_pc.c.
	* linux/*/print_pc.c: Remove.
	* linux/aarch64/arch_regs.c(ARCH_PC_REG): Define macro.
	* linux/arc/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/arm/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/avr32/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/i386/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/ia64/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/metag/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/mips/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/nios2/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/or1k/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/powerpc64/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/powerpc/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/s390/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/s390x/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/sparc64/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/sparc/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/tile/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/x32/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/x86_64/arch_regs.c(ARCH_PC_REG): Likewise.
	* linux/alpha/arch_regs.c(ARCH_PC_PEEK_ADDR): Define macro.
	* linux/bfin/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
	* linux/crisv10/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
	* linux/crisv32/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
	* linux/hppa/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
	* linux/m68k/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
	* linux/microblaze/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
	* linux/sh64/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
	* linux/sh/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
	* linux/xtensa/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise.
	* syscall.c (print_pc): Stop including "print_pc.c".
	Use ARCH_PC_REG or ARCH_PC_PEEK_ADDR.

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

	cleanup: make get_scno.c files more readable.
	Make get_scno.c files more self-contained.  While they are still
	being included by syscall.c, the latter no longer provides
	a function framework for them.

	* linux/aarch64/get_scno.c (arch_get_scno): Define.
	* linux/alpha/get_scno.c: Likewise.
	* linux/arc/get_scno.c: Likewise.
	* linux/arm/get_scno.c: Likewise.
	* linux/avr32/get_scno.c: Likewise.
	* linux/bfin/get_scno.c: Likewise.
	* linux/crisv10/get_scno.c: Likewise.
	* linux/hppa/get_scno.c: Likewise.
	* linux/i386/get_scno.c: Likewise.
	* linux/ia64/get_scno.c: Likewise.
	* linux/m68k/get_scno.c: Likewise.
	* linux/metag/get_scno.c: Likewise.
	* linux/microblaze/get_scno.c: Likewise.
	* linux/mips/get_scno.c: Likewise.
	* linux/nios2/get_scno.c: Likewise.
	* linux/or1k/get_scno.c: Likewise.
	* linux/powerpc/get_scno.c: Likewise.
	* linux/powerpc64/get_scno.c: Likewise.
	* linux/s390/get_scno.c: Likewise.
	* linux/sh/get_scno.c: Likewise.
	* linux/sh64/get_scno.c: Likewise.
	* linux/sparc/get_scno.c: Likewise.
	* linux/sparc64/get_scno.c: Likewise.
	* linux/tile/get_scno.c: Likewise.
	* linux/x86_64/get_scno.c: Likewise.
	* linux/xtensa/get_scno.c: Likewise.
	* syscall.c (arch_get_scno): New declaration.
	Include "get_scno.c" in file scope.
	(get_scno): Use arch_get_scno.

	Requested-by: Denys Vlasenko <dvlasenk@redhat.com>

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

	cleanup: make get_syscall_args.c files more readable.
	Make get_syscall_args.c files more self-contained.  While they are
	still being included by syscall.c, the latter no longer defines
	get_syscall_args function.

	* linux/aarch64/get_syscall_args.c: Include "arm/get_syscall_args.c"
	with get_syscall_args temporarily defined to arm_get_syscall_args.
	(get_syscall_args): Define.
	* linux/alpha/get_syscall_args.c (get_syscall_args): Define.
	* linux/arc/get_syscall_args.c: Likewise.
	* linux/arm/get_syscall_args.c: Likewise.
	* linux/avr32/get_syscall_args.c: Likewise.
	* linux/bfin/get_syscall_args.c: Likewise.
	* linux/crisv10/get_syscall_args.c: Likewise.
	* linux/hppa/get_syscall_args.c: Likewise.
	* linux/i386/get_syscall_args.c: Likewise.
	* linux/ia64/get_syscall_args.c: Likewise.
	* linux/m68k/get_syscall_args.c: Likewise.
	* linux/metag/get_syscall_args.c: Likewise.
	* linux/microblaze/get_syscall_args.c: Likewise.
	* linux/mips/get_syscall_args.c: Likewise.
	* linux/nios2/get_syscall_args.c: Likewise.
	* linux/or1k/get_syscall_args.c: Likewise.
	* linux/powerpc/get_syscall_args.c: Likewise.
	* linux/s390/get_syscall_args.c: Likewise.
	* linux/sh/get_syscall_args.c: Likewise.
	* linux/sh64/get_syscall_args.c: Likewise.
	* linux/sparc/get_syscall_args.c: Likewise.
	* linux/tile/get_syscall_args.c: Likewise.
	* linux/x86_64/get_syscall_args.c: Likewise.
	* linux/xtensa/get_syscall_args.c: Likewise.
	* syscall.c (get_syscall_args): Remove.
	Include "get_syscall_args.c" in file scope.

	Requested-by: Denys Vlasenko <dvlasenk@redhat.com>

2015-11-30  Dmitry V. Levin  <ldv@altlinux.org>

	cleanup: make get_syscall_result.c files more readable.
	Make get_syscall_result.c files more self-contained.  While they are
	still being included by syscall.c, the latter no longer provides
	a function framework for them.

	* linux/alpha/get_syscall_result.c (get_syscall_result_regs): Define.
	* linux/bfin/get_syscall_result.c: Likewise.
	* linux/crisv10/get_syscall_result.c: Likewise.
	* linux/hppa/get_syscall_result.c: Likewise.
	* linux/m68k/get_syscall_result.c: Likewise.
	* linux/microblaze/get_syscall_result.c: Likewise.
	* linux/sh/get_syscall_result.c: Likewise.
	* linux/sh64/get_syscall_result.c: Likewise.
	* linux/xtensa/get_syscall_result.c: Likewise.
	* syscall.c [!ARCH_REGS_FOR_GETREGSET && !ARCH_REGS_FOR_GETREGS]:
	Define USE_GET_SYSCALL_RESULT_REGS macro.
	[USE_GET_SYSCALL_RESULT_REGS]: Include "get_syscall_result.c".
	(get_syscall_result) [USE_GET_SYSCALL_RESULT_REGS]: Stop including
	"get_syscall_result.c".  Call get_syscall_result_regs.

	Requested-by: Denys Vlasenko <dvlasenk@redhat.com>

2015-11-29  Dmitry V. Levin  <ldv@altlinux.org>

	cleanup: make get_error.c files more readable.
	Make get_error.c files more self-sustained.  While they are still being
	included by syscall.c, the latter no longer defines get_error function.

	* linux/aarch64/get_error.c: Include "arm/get_error.c" with get_error
	temporarily defined to arm_get_error.
	(get_error): Define.
	* linux/alpha/get_error.c (get_error): Define.
	* linux/arc/get_error.c: Likewise.
	* linux/arm/get_error.c: Likewise.
	* linux/avr32/get_error.c: Likewise.
	* linux/bfin/get_error.c: Likewise.
	* linux/crisv10/get_error.c: Likewise.
	* linux/hppa/get_error.c: Likewise.
	* linux/i386/get_error.c: Likewise.
	* linux/ia64/get_error.c: Likewise.
	* linux/m68k/get_error.c: Likewise.
	* linux/metag/get_error.c: Likewise.
	* linux/microblaze/get_error.c: Likewise.
	* linux/mips/get_error.c: Likewise.
	* linux/nios2/get_error.c: Likewise.
	* linux/or1k/get_error.c: Likewise.
	* linux/powerpc/get_error.c: Likewise.
	* linux/s390/get_error.c: Likewise.
	* linux/sh/get_error.c: Likewise.
	* linux/sh64/get_error.c: Likewise.
	* linux/sparc/get_error.c: Likewise.
	* linux/sparc64/get_error.c: Likewise.
	* linux/tile/get_error.c: Likewise.
	* linux/x86_64/get_error.c: Likewise.
	* linux/xtensa/get_error.c: Likewise.
	* syscall.c: Include "get_error.c" in file scope.
	(get_error): Remove.  Move arch independent code ...
	(get_syscall_result): ... here.  Update get_error invocation.

	Requested-by: Denys Vlasenko <dvlasenk@redhat.com>

2015-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	cleanup: make arch_sigreturn.c files more readable.
	Make arch_sigreturn.c files more self-sustained.  While they are
	still being included by sigreturn.c, the latter no longer defines
	arch_sigreturn function.

	* linux/alpha/arch_sigreturn.c (arch_sigreturn): Define.
	* linux/arm/arch_sigreturn.c: Likewise.
	* linux/crisv10/arch_sigreturn.c: Likewise.
	* linux/i386/arch_sigreturn.c: Likewise.
	* linux/ia64/arch_sigreturn.c: Likewise.
	* linux/m68k/arch_sigreturn.c: Likewise.
	* linux/microblaze/arch_sigreturn.c: Likewise.
	* linux/mips/arch_sigreturn.c: Likewise.
	* linux/powerpc/arch_sigreturn.c: Likewise.
	* linux/s390/arch_sigreturn.c: Likewise.
	* linux/sparc/arch_sigreturn.c: Likewise.
	* linux/tile/arch_sigreturn.c: Likewise.
	* linux/x32/arch_sigreturn.c: Remove code.
	Include "x86_64/arch_sigreturn.c".
	* linux/x86_64/arch_sigreturn.c: Stop including "x32/arch_sigreturn.c".
	Include "i386/arch_sigreturn.c" with arch_sigreturn temporarily defined
	to i386_arch_sigreturn.
	(arch_sigreturn): Define.  Add x32 personality support there.
	* sigreturn.c: Remove arch_sigreturn header and footer.

	Requested-by: Denys Vlasenko <dvlasenk@redhat.com>

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	Add initial Travis CI support.
	* .travis.yml: New file.
	* travis-ci.sh: Likewise.

2015-11-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: remove temporary files left after two tests.
	* tests/net-yy.test: Remove "$LOG"-connect and "$LOG"-accept.
	* tests/unix-yy.test: Likewise.

2015-11-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip stat32-v.test on x32.
	Explicitly skip 32-bit stat test on x32 even if libc pretends
	to support it.

	* tests/stat.c (main) [__x86_64__ && __ILP32__]: Skip.

2015-11-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix ipc_msgbuf.test on x32.
	* tests/ipc_msgbuf.c: Include "config.h" and "kernel_types.h".
	(main): Replace "long" with "kernel_long_t" in struct msgbuf.

	x32: fix pselect6 decoding.
	* desc.c: Include "kernel_types.h".
	(umove_kulong_array_or_printaddr): New function.
	(SYS_FUNC(pselect6)): Use it.

	x32: fix sigreturn decoding.
	* linux/x32/arch_sigreturn.c: Implement x32_rt_sigreturn decoding.
	* linux/x86_64/arch_sigreturn.c: Handle (current_personality == 0)
	case only.
	Include "x32/arch_sigreturn.c" instead of "i386/arch_sigreturn.c".

	x32: fix struct dirent decoding.
	* kernel_types.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* configure.ac (AC_CHECK_TYPES): Check for __kernel_long_t
	and __kernel_ulong_t in <asm/posix_types.h>.
	* dirent.c: Stop including <dirent.h>.
	(kernel_dirent): Remove.
	Include "kernel_types.h".
	(print_old_dirent, SYS_FUNC(getdents)): Print variables
	of kernel_ulong_t type using %Lu format.
	* syscall.c (kernel_long_t, kernel_ulong_t): Remove.
	Include "kernel_types.h".
	* tests/getdents.c (kernel_dirent): Remove.
	Include "kernel_types.h".
	(print_dirent): Print variables of kernel_ulong_t type using %Lu format.

2015-11-26  Elvira Khabirova  <lineprinter0@gmail.com>

	Refer to -h on incorrect usage.
	* defs.h (error_msg_and_help): New prototype.
	* strace.c (error_msg_and_help): New function.
	(error_opt_arg, init): Use it.
	(usage): Remove unnecessary arguments.
	* count.c: Use the new function.

	Rearrange flags descriptions in the usage text.
	* strace.c (usage): Rearrange descriptions.
	* tests/strace-k.test: Change the option detecting regexp accordingly.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: run in "set -x" mode if VERBOSE variable is non-null.
	* tests/init.sh: Enter "set -x" mode if $VERBOSE is non-null.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix match_diff usage.
	Fix argument order in match_diff invocations:
	the first argument has to be actual output,
	the second argument has to be expected output.

	* tests/aio.test: Swap match_diff arguments.
	* tests/clock_nanosleep.test: Likewise.
	* tests/clock_xettime.test: Likewise.
	* tests/file_handle.test: Likewise.
	* tests/getdents.test: Likewise.
	* tests/getdents64.test: Likewise.
	* tests/getrandom.test: Likewise.
	* tests/inet-cmsg.test: Likewise.
	* tests/ioctl.test: Likewise.
	* tests/membarrier.test: Likewise.
	* tests/mlock2.test: Likewise.
	* tests/nanosleep.test: Likewise.
	* tests/pselect6.test: Likewise.
	* tests/readdir.test: Likewise.
	* tests/readlink.test: Likewise.
	* tests/readlinkat.test: Likewise.
	* tests/rt_sigqueueinfo.test: Likewise.
	* tests/seccomp.test: Likewise.
	* tests/select.test: Likewise.
	* tests/sendfile.test: Likewise.
	* tests/sendfile64.test: Likewise.
	* tests/struct_flock.test: Likewise.
	* tests/sysinfo.test: Likewise.
	* tests/time.test: Likewise.
	* tests/timer_create.test: Likewise.
	* tests/timer_xettime.test: Likewise.
	* tests/timerfd_xettime.test: Likewise.
	* tests/times-fail.test: Likewise.
	* tests/times.test: Likewise.
	* tests/umovestr2.test: Likewise.
	* tests/userfaultfd.test: Likewise.
	* tests/utime.test: Likewise.
	* tests/utimensat.test: Likewise.
	* tests/xet_robust_list.test: Likewise.
	* tests/xetitimer.test: Likewise.
	* tests/xettimeofday.test: Likewise.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	x86_64: fix x32 personality support in print_llu_from_low_high_val.
	x86 is the only personality supported on x86_64
	that has 32-bit syscall arguments.

	* io.c (print_llu_from_low_high_val) [X86_64]: Fix
	current_personality == 2 case.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	x86_64: fix x32 personality support in getllval.
	x86 is the only personality supported on x86_64
	that has 32-bit syscall arguments.

	* util.c (getllval) [X86_64]: Fix current_personality == 2 case.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests/file_handle: fix expected output.
	* tests/file_handle.c (main): Parametrize handle_type
	in open_by_handle_at parser output.

	startup_attach: fix compilation warning.
	* strace.c (startup_attach): Split single error_msg statement with
	variable number of arguments to silence a compilation warning.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	.gitignore: add mpers_xlat.h.
	Ignore mpers_xlat.h generated since commit v4.10-454-g5cb45b2.

	* .gitignore: Add /mpers_xlat.h.

	Reported-by: Elvira Khabirova <lineprinter0@gmail.com>

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add struct_flock.test.
	* tests/struct_flock.c: New file.
	* tests/struct_flock.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add struct_flock.
	(TESTS): Add struct_flock.test.
	* tests/.gitignore: Add struct_flock.

	Convert parsers of flock structures to new mpers infrastructure.
	* fetch_struct_flock.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* fcntl.c (print_struct_flock64): New function.
	(printflock64): Use fetch_struct_flock64 and print_struct_flock64.
	(printflock): Use fetch_struct_flock and print_struct_flock64.

	fcntl.c: implement decoding for all known operations.
	* xlat/f_owner_types.in: New file.
	* xlat/f_seals.in: Likewise.
	* fcntl.c: Include "xlat/f_owner_types.h" and "xlat/f_seals.h".
	(print_f_owner_ex): New function.
	(SYS_FUNC(fcntl)): Use it.
	Handle F_SETPIPE_SZ, F_GETPIPE_SZ, F_OFD_SETLKW,
	F_OFD_SETLK, F_SETOWN_EX, F_ADD_SEALS, F_SETSIG,
	F_OFD_GETLK, F_GETOWN_EX, F_GET_SEALS, F_GETSIG.

	fcntl.c: mark F_DUPFD and F_DUPFD_CLOEXEC return code with RVAL_FD flag.
	* fcntl.c (SYS_FUNC(fcntl)): Set RVAL_FD flag in the return code
	for F_DUPFD and F_DUPFD_CLOEXEC operations.

	fcntl.c: remove redundant ifdefs.
	* fcntl.c (USE_PRINTFLOCK64): Remove macro.
	(printflock64): Define unconditionally.
	(SYS_FUNC(fcntl)): Do not check for USE_PRINTFLOCK64,
	F_DUPFD_CLOEXEC, F_NOTIFY, F_SETLEASE, and F_GETLEASE macros.

	Update F_* constants.
	* xlat/fcntlcmds.in: Add F_SETOWN_EX, F_GETOWN_EX, F_GETOWNER_UIDS,
	F_OFD_GETLK, F_OFD_SETLK, F_OFD_SETLKW, and F_CANCELLK.
	Remove F_ALLOCSP, F_BLKSIZE, F_BLOCKS, F_CHKFL, F_CNVT, F_DUP2FD,
	F_ISSTREAM, F_NPRIV, F_PRIV, F_QUOTACL, F_REVOKE, F_RGETLK, F_RSETLK,
	F_RSETLKW, F_SHARE, and F_UNSHARE.
	Add default values.

	Update LOCK_* constants.
	* xlat/flockcmds.in: Add LOCK_MAND, LOCK_READ, LOCK_WRITE, and LOCK_RW.
	Add default values.

2015-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	fcntl.c: use <linux/fcntl.h> instead of <fcntl.h>
	Include <linux/fcntl.h> for proper definitions of F_* constants
	and flock structures.

	* configure.ac (AC_CHECK_TYPES): Check for struct flock, struct flock64,
	struct __kernel_flock, and struct __kernel_flock64 in <linux/fcntl.h>.
	* flock.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* fcntl.c: Include it instead of <fcntl.h>.
	(struct flock64): Remove.
	(printflock): Use struct_kernel_flock instead of struct flock.
	(printflock64): Use struct_kernel_flock64 instead of struct flock64.

2015-11-26  Elvira Khabirova  <lineprinter0@gmail.com>

	mpers: fix compound types with arbitrary member alignments.
	* mpers.sh: Compound types are now represented as packed
	with character arrays as explicit fillers inbetween members
	and at the end.

2015-11-26  Mike Frysinger  <vapier@gentoo.org>

	Support C libraries without System V shared memory/ipc.
	Some systems (like Bionic) omit support for SysV related code.  That
	means no C library headers for strace to include.  Add configure tests
	to probe the headers from the kernel and use them when they are
	available.

	It might make more sense to never rely on the C library's headers as
	there is no guarantee or requirement that the structure layout between
	apps and the C library match that what is passed to the kernel.

	* configure.ac (AC_CHECK_HEADERS): Check for linux/ipc.h,
	linux/mqueue.h, linux/msg.h, linux/sem.h, linux/shm.h,
	sys/ipc.h, sys/msg.h, sys/sem.h, and sys/shm.h.
	* ipc_defs.h: Include <sys/ipc.h> or <linux/ipc.h> depending
	on what is available.
	* ipc_msg.c: Replace <sys/ipc.h> with "ipc_defs.h".
	Fallback to <linux/msg.h> when available.
	* ipc_msgctl.c: Include <sys/msg.h>, <asm/msgbuf.h>, or <linux/msg.h>
	based on what is available.  Note missing support for old ipc structs.
	* ipc_sem.c: Include <sys/sem.h> or <linux/sem.h> depending
	on what is available.  Only decode sembuf when available.
	* ipc_shm.c: Fallback to <linux/shm.h> when available.
	* ipc_shmctl.c: Include <sys/shm.h>, <asm/shmbuf.h>, or <linux/shm.h>
	based on what is available.  Note missing support for old ipc structs.
	* print_mq_attr.c: Fallback to <linux/mqueue.h> when available.

2015-11-25  Dmitry V. Levin  <ldv@altlinux.org>

	CREDITS.in: add Jian Zhen.
	Thanks to Jian Zhen for donation of https://github.com/strace/ and
	strace.io.

	* CREDITS.in: Add Jian Zhen.

2015-11-24  Dmitry V. Levin  <ldv@altlinux.org>

	Fix syscall entries of unimplemented getpmsg and putpmsg syscalls.
	* linux/ia64/syscallent.h (getpmsg): Change SEN(printargs)
	to SEN(getpmsg).
	(putpmsg): Change SEN(printargs) to SEN(putpmsg).
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/arm/syscallent.h (getpmsg, putpmsg): Set sys_flags to TN.
	* linux/bfin/syscallent.h (getpmsg, putpmsg): Likewise.
	* linux/hppa/syscallent.h (getpmsg, putpmsg): Likewise.
	* linux/i386/syscallent.h (getpmsg, putpmsg): Likewise.
	* linux/m68k/syscallent.h (getpmsg, putpmsg): Likewise.
	* linux/microblaze/syscallent.h (getpmsg, putpmsg): Likewise.
	* linux/powerpc/syscallent.h (getpmsg, putpmsg): Likewise.
	* linux/s390/syscallent.h (getpmsg, putpmsg): Likewise.
	* linux/s390x/syscallent.h (getpmsg, putpmsg): Likewise.
	* linux/x32/syscallent.h (getpmsg, putpmsg): Likewise.
	* linux/x86_64/syscallent.h (getpmsg, putpmsg): Likewise.

2015-11-24  Dmitry V. Levin  <ldv@altlinux.org>

	Remove parsers of getpmsg and putpmsg syscalls.
	These system calls are not implemented in the Linux kernel.

	* linux/dummy.h(getpmsg, putpmsg): Move to the list of deprecated
	syscalls.
	* Makefile.am (strace_SOURCES): Remove stream.c.
	* stream.c: Remove.
	* xlat/pmsgflags.in: Remove.

2015-11-24  Dmitry V. Levin  <ldv@altlinux.org>

	Remove parser of query_module syscall.
	Since query_module syscall is present only in kernels before Linux 2.6
	and strace does not support those kernels, there is no use to keep this
	parser any longer.

	* bjm.c: Do not include <sys/*>, "xlat/qm_which.h",
	and "xlat/modflags.h".
	(MOD_*, QM_*, module_symbol, module_info, SYS_FUNC(query_module)):
	Remove.
	* linux/dummy.h (sys_query_module): Add stub alias.
	* xlat/modflags.in: Remove.
	* xlat/qm_which.in: Remove.

2015-11-24  Dmitry V. Levin  <ldv@altlinux.org>

	Fix syscall entries of deprecated sysfs syscall.
	* linux/alpha/syscallent.h (sysfs): Change nargs from 5 to 3.
	* linux/hppa/syscallent.h (sysfs): Likewise.
	* linux/mips/syscallent-n32.h (sysfs): Likewise.
	* linux/mips/syscallent-n64.h (sysfs): Likewise.

	Move sysfs syscall to deprecated category.
	* linux/dummy.h (sys_sysfs): Move to the list of deprecated syscalls.

	Fix syscall entries of deprecated bdflush syscall.
	* linux/alpha/syscallent.h (bdflush): Change nargs from 0 to 2.
	* linux/arm/syscallent.h (bdflush): Likewise.
	* linux/avr32/syscallent.h (bdflush): Likewise.
	* linux/bfin/syscallent.h (bdflush): Likewise.
	* linux/hppa/syscallent.h (bdflush): Likewise.
	* linux/i386/syscallent.h (bdflush): Likewise.
	* linux/ia64/syscallent.h (bdflush): Likewise.
	* linux/m68k/syscallent.h (bdflush): Likewise.
	* linux/microblaze/syscallent.h (bdflush): Likewise.
	* linux/powerpc/syscallent.h (bdflush): Likewise.
	* linux/s390/syscallent.h (bdflush): Likewise.
	* linux/s390x/syscallent.h (bdflush): Likewise.
	* linux/sh/syscallent.h (bdflush): Likewise.
	* linux/sh64/syscallent.h (bdflush): Likewise.
	* linux/sparc/syscallent.h (bdflush): Likewise.

2015-11-22  Dmitry V. Levin  <ldv@altlinux.org>

	Implement name_to_handle_at and open_by_handle_at syscalls decoding.
	* file_handle.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/dummy.h (sys_name_to_handle_at, sys_open_by_handle_at):
	Remove stub aliases.
	* pathtrace.c (pathtrace_match): Add SEN_name_to_handle_at.
	* tests/file_handle.c: New file.
	* tests/file_handle.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add file_handle.
	(TESTS): Add file_handle.test.
	* tests/.gitignore: Add file_handle.

	Implement lookup_dcookie syscall decoding.
	* lookup_dcookie.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/dummy.h (sys_lookup_dcookie): Remove stub alias.

	Implement kexec_file_load syscall decoding.
	* xlat/kexec_file_load_flags.in: New file.
	* kexec.c: Include "xlat/kexec_file_load_flags.h".
	(SYS_FUNC(kexec_file_load)): New function.
	* linux/dummy.h (sys_kexec_file_load): Remove stub alias.
	* pathtrace.c (pathtrace_match): Add SEN_kexec_file_load.

	Implement kcmp syscall decoding.
	* kcmp.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/dummy.h (sys_kcmp): Remove stub alias.
	* xlat/kcmp_types.in: New file.

	Implement iopl syscall decoding.
	* iopl.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/dummy.h (sys_iopl): Remove stub alias.

	Implement ioperm syscall decoding.
	* ioperm.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/dummy.h (sys_ioperm): Remove stub alias.

	net: fix printing of IP_RECVOPTS/IP_RETOPTS cmsg options.
	* net.c (print_cmsg_ip_opts): Print each byte as unsigned char.

	userfaultfd: fix pathtrace support.
	* pathtrace.c (pathtrace_match): Add SEN_userfaultfd.

2015-11-22  Dmitry V. Levin  <ldv@altlinux.org>

	Implement IPPROTO_IP control messages decoding.
	* net.c: Include "xlat/ip_cmsg_types.h".
	(print_cmsg_ip_pktinfo, print_cmsg_ip_ttl, print_cmsg_ip_tos,
	print_cmsg_ip_opts, print_cmsg_ip_recverr, print_cmsg_ip_checksum,
	print_cmsg_ip_origdstaddr): New functions.
	(print_cmsg_type_data): Add generic SOL_IP level decoding.
	Use these functions for decoding of IP_PKTINFO, IP_TTL, IP_TOS,
	IP_RECVOPTS, IP_RETOPTS, IP_RECVERR, IP_ORIGDSTADDR, IP_CHECKSUM,
	and SCM_SECURITY type messages.
	* xlat/ip_cmsg_types.in: New file.
	* xlat/sockipoptions.in: Move IP_RETOPTS before IP_RECVRETOPTS.
	* tests/inet-cmsg.c: New file.
	* tests/inet-cmsg.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add inet-cmsg.
	(TESTS): Add inet-cmsg.test.
	* tests/.gitignore: Add inet-cmsg.

	Suggested-by: Orion Poplawski <orion@cora.nwra.com>

2015-11-22  Dmitry V. Levin  <ldv@altlinux.org>

	Simplify control messages printers.
	Do not pass sizeof(struct cmsghdr) to every cmsg printer.

	* net.c (printcmsghdr): Pass pointer to cmsg_data and length
	of cmsg_data to print_cmsg_type_data.
	(print_cmsg_type_data): Update prototype.  Pass pointer to cmsg_data
	and length of cmsg_data to cmsg printers.
	(print_scm_rights, print_scm_creds, print_scm_security): Update.

2015-11-21  Dmitry V. Levin  <ldv@altlinux.org>

	net: factor out address printing code to a separate function.
	* net.c (sockaddr_buf_t): New type.
	(print_sockaddr): New function.
	(printsock, print_group_req): Use it.

2015-11-20  Dmitry V. Levin  <ldv@altlinux.org>

	mpers: skip xlat struct definitions in mpers mode.
	Avoid duplicate definitions of xlat structures in files
	compiled in mpers mode.

	Each xlat file defines the corresponding xlat struct with
	either global or local visibility using the following rules:

	- if xlat struct declaration is available in defs.h,
	  a global definition is provided in regular mode,
	  and nothing is provided in mpers mode;
	- otherwise, if xlat file is included by a mpers source file,
	  a global definition is provided in regular mode
	  (unless no mpers mode is supported on this architecture,
	  in that case, a local definition is provided instead),
	  and a declaration is provided in mpers mode;
	- otherwise, a local definition is provided in regular mode,
	  and an error message is printed in mpers mode.

	Fallback definitions of constants provided by xlat files
	remain available in all modes.

	* bootstrap: Invoke generate_mpers_am.sh before xlat/gen.sh.
	* defs.h (adjtimex_modes, adjtimex_status, sigev_value): Remove.
	* generate_mpers_am.sh: Generate mpers_xlat.h.
	* Makefile.am (EXTRA_DIST): Add mpers_xlat.h.
	* print_sigevent.c: Include "xlat/sigev_value.h" unconditionally.
	* print_timex.c: Include "xlat/adjtimex_modes.h" and
	"xlat/adjtimex_status.h" unconditionally.
	* xlat/gen.sh (cond_xlat): Move printing of fallback definitions ...
	(cond_def): ... here.
	(gen_header): Check also mpers_xlat.h for global declarations
	of xlat structures.
	Process input file twice, first time print directives
	only, second time print everything.
	Wrap struct xlat into #ifdef IN_MPERS ... #else ... #endif.
	* xlat/getrandom_flags.in: Cleanup.

2015-11-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite getdents test in C for better coverage.
	* tests/getdents.awk: Remove.
	* tests/getdents.out: Remove.
	* tests/getdents.c: New file.
	* tests/getdents.test: Rewrite.
	* tests/getdents64.c: New file.
	* tests/getdents64.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add getdents and getdents64.
	(TESTS): Add getdents64.test.
	(EXTRA_DIST): Remove getdents.awk and getdents.out.
	* tests/.gitignore: Add getdents and getdents64.

2015-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add readdir.test.
	* tests/readdir.c: New file.
	* tests/readdir.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add readdir.
	(TESTS): Add readdir.test.
	* tests/.gitignore: Add readdir.

	Mpersify parsers of readdir and getdents syscalls.
	* defs.h (dirent_types): New xlat prototype.
	* dirent.c: Stop including "xlat/direnttypes.h".
	(kernel_dirent): New typedef.  Mpersify it.
	(print_old_dirent): Use it instead of old_dirent_t.
	(SYS_FUNC(getdents)): Use it instead of struct kernel_dirent.
	Rename direnttypes to dirent_types.
	(SYS_FUNC(getdents64)): Move ...
	* dirent64.c: ... here.  Rename direnttypes to dirent_types.
	Include "xlat/dirent_types.h".
	* Makefile.am (strace_SOURCES): Add dirent64.c.
	* xlat/direnttypes.in: Rename to xlat/dirent_types.in.

2015-11-19  Gabriel Laskar  <gabriel@lse.epita.fr>

	getdents: fix typos in array output.
	Array should be enclosed by square brakets, and elements should be
	separated by commas.

	* dirent.c (SYS_FUNC(getdents), SYS_FUNC(getdents64)): Fix typos
	in array output.
	* tests/getdents.awk: Update regexps to match fixed output.
	* tests/getdents.out: Update output.

2015-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	printcmsghdr: move type and data decoders to a separate function.
	* net.c (print_scm_rights, print_scm_creds, print_scm_security): Change
	to return void.  Move printing of struct cmsghdr closing '}' ...
	(printcmsghdr): ... here.  Move type and data decoders to ...
	(print_cmsg_type_data): ... new function.

2015-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	Assume that libc provides sendmsg.
	Starting with commit v4.6-281-g7af9f35, we implicitly assume that
	HAVE_SENDMSG is always defined.  Therefore, the check for sendmsg
	availability is redundant and could be safely removed.

	* configure.ac (AC_CHECK_FUNCS): Remove sendmsg.
	* linux/dummy.h [!HAVE_SENDMSG] (sys_recvmsg, sys_sendmsg): Remove
	stub aliases.
	* net.c [HAVE_SENDMSG]: Define unconditionally.
	* syscall.c (dumpio) [HAVE_SENDMSG]: Likewise.

2015-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: move fallback definition of SCM_SECURITY to xlat/
	* net.c: Move fallback definition of SCM_SECURITY ...
	* xlat/scmvals.in: ... here.

2015-11-17  Dmitry V. Levin  <ldv@altlinux.org>

	Implement mlock2 syscall decoding.
	* mem.c: Include "xlat/mlock_flags.h".
	(SYS_FUNC(mlock2)): New function.
	* xlat/mlock_flags.in: New file.
	* xlat/mlockall_flags.in: Add MCL_ONFAULT, add default values.
	* linux/dummy.h (mlock2): Remove.
	* tests/mlock2.c: New file.
	* tests/mlock2.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add mlock2.
	(TESTS): Add mlock2.test.
	* tests/.gitignore Add mlock2.

	Implement membarrier syscall decoding.
	* membarrier.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* xlat/membarrier_cmds.in: New file.
	* linux/dummy.h (membarrier): Remove.
	* tests/membarrier.c: New file.
	* tests/membarrier.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add membarrier.
	(TESTS): Add membarrier.test.
	* tests/.gitignore: Add membarrier.

	Implement userfaultfd syscall decoding.
	* userfaultfd.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* xlat/uffd_flags.in: New file.
	* linux/dummy.h (userfaultfd): Remove.
	* tests/userfaultfd.c: New file.
	* tests/userfaultfd.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add userfaultfd.
	(TESTS): Add userfaultfd.test.
	* tests/.gitignore: Add userfaultfd.

2015-11-17  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: wire up kcmp syscall.
	ia64 has kcmp syscall starting with linux kernel commit
	v4.3-rc7-1-gd305c47.

	* linux/ia64/syscallent.h (kcmp): New entry.

2015-11-17  Dmitry V. Levin  <ldv@altlinux.org>

	powerpc: wire up direct sysv ipc syscalls.
	Starting with linux commit v4.3-rc3-33-ga342361, powerpc has
	direct sysv ipc syscalls in addition to traditional ipc syscall.

	* linux/powerpc/syscallent.h (semop, semget, semctl, semtimedop, msgsnd,
	msgrcv, msgget, msgctl, shmat, shmdt, shmget, shmctl): New entries.

2015-11-17  Dmitry V. Levin  <ldv@altlinux.org>

	Wire up userfaultfd, membarrier, and mlock2 syscalls.
	* linux/dummy.h (membarrier, mlock2, userfaultfd): New stub aliases.
	* linux/32/syscallent.h (userfaultfd, membarrier, mlock2): New entries.
	* linux/64/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
	* linux/arm/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
	* linux/hppa/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
	* linux/i386/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
	* linux/ia64/syscallent.h (userfaultfd, membarrier): Likewise.
	* linux/m68k/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
	* linux/microblaze/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
	* linux/mips/syscallent-n32.h (userfaultfd, membarrier, mlock2): Likewise.
	* linux/mips/syscallent-n64.h (userfaultfd, membarrier, mlock2): Likewise.
	* linux/mips/syscallent-o32.h (userfaultfd, membarrier, mlock2): Likewise.
	* linux/powerpc/syscallent.h (userfaultfd, membarrier): Likewise.
	* linux/s390/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
	* linux/s390x/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
	* linux/sparc/syscallent.h (membarrier, userfaultfd, mlock2): Likewise.
	* linux/x32/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.
	* linux/x86_64/syscallent.h (userfaultfd, membarrier, mlock2): Likewise.

2015-11-16  Dmitry V. Levin  <ldv@altlinux.org>

	sprintflags: skip zero flags.
	Tweak sprintflags behaviour to match printflags.

	* util.c (sprintflags): Skip zero flags unless the value passed
	to sprintflags is also zero.

2015-11-16  Mike Frysinger  <vapier@gentoo.org>

	printflags: handle empty xlats.
	If the set of headers are unable to produce a valid list, printflags
	will try to pass NULL to tprints which crashes.  Add a sanity check
	for this edge case.

	* util.c (printflags): Check xlat->str is not NULL.

2015-11-16  Dmitry V. Levin  <ldv@altlinux.org>

	mpers: forward mpers_DEFS to mpers.sh.
	mpers_DEFS has to be forwarded to mpers.sh so that config.h would be
	properly included by defs.h at preprocessor stage.

	* Makefile.am (mpers-m%.stamp): Add the whole $(mpers_sh_opts) set of
	options to mpers.sh's CPPFLAGS.

2015-11-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests/ioctl: workaround glibc ioctl wrapper on powerpc.
	* tests/ioctl.c (main) [POWERPC] Disable TCGETS test.

2015-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	powerpc: wire up switch_endian syscall.
	powerpc has switch_endian syscall starting with linux commit
	v4.0-rc4-67-g529d235.

	* linux/powerpc/syscallent.h (switch_endian): New entry.

2015-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	sparc: reserve more space for new syscalls.
	Move socket subcalls further down the table to make room
	for new syscalls.

	* linux/sparc/syscallent.h (SYS_socket_subcall): Raise from 353 to 400.

2015-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	m68k: wire up direct socket syscalls.
	Starting with linux commit v4.3-rc3-1-g5b3f33e, m68k has direct
	socket syscalls in addition to traditional socketcall syscall.

	* linux/m68k/syscallent.h (socket, socketpair, bind, connect, listen,
	accept4, getsockopt, setsockopt, getsockname, getpeername, sendto,
	sendmsg, recvfrom, recvmsg, shutdown, recvmmsg, sendmmsg): New entries.

2015-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	i386: wire up direct socket syscalls.
	Starting with linux commit v4.2-rc1-64-g9dea5dc, x86 has direct
	socket syscalls in addition to traditional socketcall syscall.

	* linux/i386/syscallent.h (socket, socketpair, bind, connect, listen,
	accept4, getsockopt, setsockopt, getsockname, getpeername, sendto,
	sendmsg, recvfrom, recvmsg, shutdown): New entries.

2015-11-11  Heiko Carstens  <heiko.carstens@de.ibm.com>

	s390, s390x: update syscall tables.
	* linux/s390/syscallent.h: Add new syscalls available with kernel 4.3.0.
	* linux/s390x/syscallent.h: Likewise.

2015-11-07  Dmitry V. Levin  <ldv@altlinux.org>

	Fix *_printer_defs.h rules ambiguousness.
	There is an ambiguousness in *_printer_defs.h rules definition:

	$ grep '^[^ ]*_defs\.h: ' Makefile.am
	m%_defs.h: $(srcdir_mpers_source_files)
	%_printer_defs.h: $(srcdir_mpers_source_files)

	While it appears to work with GNU make, it has to be fixed nevertheless.

	* Makefile.am (m%_defs.h): Rename to m%_type_defs.h.
	(mpers_m32_targets): Rename m32_defs.h to m32_type_defs.h.
	(mpers_mx32_targets): Rename mx32_defs.h to mx32_type_defs.h.
	* mpers_type.h: Rename m32_defs.h to m32_type_defs.h,
	mx32_defs.h to mx32_type_defs.h.
	* .gitignore: Likewise.

	Reported-by: Elliott Hughes <enh@google.com>

2015-10-09  Dmitry V. Levin  <ldv@altlinux.org>

	fcntl.c: make use of RVAL_DECODED.
	* fcntl.c (SYS_FUNC(fcntl)): Return RVAL_DECODED for write-only operations.

2015-10-08  Dmitry V. Levin  <ldv@altlinux.org>

	desc.c: move parser of fcntl syscall to a separate file.
	* fcntl.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* desc.c (printflock64, printflock, SYS_FUNC(fcntl)): Move to fcntl.c.

	desc.c: move parser of flock syscall to a separate file.
	* flock.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* desc.c (SYS_FUNC(flock)): Move to flock.c.

2015-10-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix false uio.test failures.
	* tests/uio.c (main): Use descriptor number 0 in pread/pwrite
	and preadv/pwritev syscalls.
	* tests/uio.expected: Update regexps.

	Reported-by: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>

2015-10-01  Gabriel Laskar  <gabriel@lse.epita.fr>

	Fix make -j builds.
	In files generated by mpers scripts, includes directives are taken from
	original files where the type definition was done.  This causes to
	include defs.h in multiple files.  defs.h includes printers.h header,
	which is a generated header.

	This patch add an explicit dependency to printers.h for the mpers
	scripts.

	* Makefile.am (mpers-m%.stamp): Add printers.h to order-only
	prerequisites.

2015-09-29  Mike Frysinger  <vapier@gentoo.org>

	mpers: fix shell code to conform better to POSIX.
	The `echo -n` behavior is non-portable, so use printf instead.

	* generate_mpers_am.sh: Change `echo -n` to `printf`.

2015-09-23  Gabriel Laskar  <gabriel@lse.epita.fr>

	ioctl: fix ioctl command number decoding in case of conflicts.
	When a command number was decoded through ioctl_decode_command_number(),
	there was no check for conflicts with other potential ioctls numbers.

	For example:
		ioctl(fd, MCE_GET_RECORD_LEN, &i);
	output:
		ioctl(3, MIXER_READ(1), 0x7ffddce74a58) = 0
	instead of:
		ioctl(3, MIXER_READ(1) or MCE_GET_RECORD_LEN, 0x7ffee435ce08) = 0

	* ioctl.c (SYS_FUNC(ioctl)): Fix ioctl command number decoding
	in case of conflicts.
	* tests/ioctl.c (main): Add a case for command number conflicts.

2015-09-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: convert ioctl.test from match_grep to match_diff.
	* tests/ioctl.c (main): Print expected output.
	* tests/ioctl.test: Use match_diff instead of match_grep.
	* tests/ioctl.expected: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove ioctl.expected.

2015-09-20  Dmitry V. Levin  <ldv@altlinux.org>

	Convert parser of seccomp filter program to new mpers infrastructure.
	* seccomp_fprog.h: New file.
	* fetch_seccomp_fprog.c: New file.
	* Makefile.am (strace_SOURCES): Add them.
	* seccomp.c: Include "seccomp_fprog.h".
	(print_seccomp_filter): Use fetch_seccomp_fprog.

2015-09-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests/init.sh: enhance match_grep error diagnostics.
	* tests/init.sh (match_grep): Check patterns one by one,
	output only those patterns that didn't match.

	tests/init.sh: fix comment.
	* tests/init.sh (match_awk): Fix usage description.

	tests: add one more case to select.test.
	* tests/select.c (main): Check how timeout is printed
	on exiting syscall.

	tests: uncouple pselect6 from select.test.
	* tests/select.c Do not include <string.h>.
	Include <sys/syscall.h>.
	[!__NR_select]: Skip the test.
	(main): Remove pselect6 support, test just select syscall.
	* tests/select.test: Remove all pselect6 checks, test just
	select syscall.

	tests: robustify select test.
	* tests/select.c: Do not include <assert.h>.
	(main): Skip the test instead of assertions.
	Add some padding to the timeval structure.

	tests: add one more case to pselect6.test.
	* tests/pselect6.c (main): Check how timeout is printed
	on exiting syscall.

	tests: robustify pselect6 test.
	* tests/pselect6.c: Do not include <assert.h> and <string.h>.
	Include <sys/syscall.h>.
	[!__NR_pselect6]: Skip the test.
	(main): Skip the test instead of assertions.
	Add some padding to the timespec structure.

	Convert another parser of struct timeval to new mpers infrastructure.
	* print_time.c (sprint_timeval): New mpers printer.
	[ALPHA] (sprint_timeval32): New function.
	* defs.h [ALPHA] (sprint_timeval32): New prototype.
	(bitness_t, TIMEVAL_TEXT_BUFSIZE, printtv_bitness, sprinttv): Remove.
	* desc.c (decode_select): Replace bitness parameter with two printers.
	Use them instead of printtv_bitness and sprinttv.
	(sys_oldselect, sys_select): Pass print_timeval and sprint_timeval
	to decode_select.
	[ALPHA] (sys_osf_select): Pass print_timeval32 and sprint_timeval32
	to decode_select.
	(pselect6): Pass print_timespec and sprint_timespec to decode_select.
	* time.c (UTIME_NOW, UTIME_OMIT, current_time_t_is_compat,
	struct timeval32, printtv_bitness, do_sprinttv, sprinttv): Remove.

	Convert another parser of struct timespec to new mpers infrastructure.
	* print_time.c (sprint_timespec): New mpers printer.
	* defs.h (TIMESPEC_TEXT_BUFSIZE): Update.
	(sprint_timespec): Remove.
	* time.c (sprint_timespec): Remove.
	* net.c (sys_recvmmsg): Update callers.
	* poll.c (decode_poll_exiting): Likewise.

	tests: add another case to pselect6 test.
	* tests/pselect6.c: Include <sys/time.h>.
	(handler): New function.
	(main): Install an interval timer.
	Use it to check how ERESTARTNOHAND is printed.

	Fix decoding of gettimeofday and settimeofday.
	* time.c (print_timezone): new function.
	(sys_gettimeofday, sys_settimeofday): Use it instead of print_timeval
	to print struct timezone.
	[ALPHA] (sys_osf_gettimeofday, sys_osf_settimeofday): Use it
	instead of print_timeval32 to print struct timezone.
	* tests/xettimeofday.c: New file.
	* tests/xettimeofday.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add xettimeofday.
	(TESTS): Add xettimeofday.
	* tests/.gitignore: Add xettimeofday.

	Convert parser of struct timeval to new mpers infrastructure.
	* defs.h (printtv, printtv_special): Remove.
	[ALPHA] (print_timeval32, print_timeval32_pair): New prototypes.
	* print_time.c (print_timeval): New mpers printer.
	[ALPHA] (print_timeval32, print_timeval32_pair): New functions.
	* time.c (sys_gettimeofday, sys_settimeofday): Use print_timeval
	instead of printtv.
	[ALPHA] (sys_osf_gettimeofday, sys_osf_settimeofday):
	Use print_timeval32 instead of printtv_bitness.
	* utimes.c [ALPHA] (sys_osf_utimes): Use print_timeval32_pair
	instead of printtv_bitness.

	Convert parser of struct timespec to new mpers infrastructure.
	* defs.h (print_timespec): Remove.
	* print_time.c (print_timespec): New mpers printer.
	* futex.c (sys_futex): Use print_timespec instead of printtv.
	* ipc_sem.c (sys_semtimedop): Likewise.
	* mq.c (sys_mq_timedsend, sys_mq_timedreceive): Likewise.
	* time.c (clock_settime, clock_gettime, clock_nanosleep): Likewise.
	(print_timespec): Remove.

	Remove unused parser of adjtime syscall.
	* time.c (sys_adjtime): Remove.

	Fix decoding of clock_nanosleep.
	* time.c (sys_clock_nanosleep): Use is_erestart,
	temporarily_clear_syserror, and restore_cleared_syserror.
	* tests/clock_nanosleep.c: New file.
	* tests/clock_nanosleep.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add clock_nanosleep.
	(TESTS): Add clock_nanosleep.test.
	* tests/.gitignore: Add clock_nanosleep.

	Add is_erestart helper function.
	* defs.h (is_erestart): New prototype.
	* syscall.c (is_erestart): New function.
	* time.c (sys_nanosleep): Use is_erestart,
	temporarily_clear_syserror, and restore_cleared_syserror.

	Add helper functions to clear/restore syserror.
	* defs.h (temporarily_clear_syserror, restore_cleared_syserror):
	New prototypes.
	* syscall.c (saved_u_error): New variable.
	(temporarily_clear_syserror, restore_cleared_syserror): New functions.
	* aio.c (sys_io_getevents): Use temporarily_clear_syserror
	and restore_cleared_syserror.
	* mq.c (sys_mq_timedreceive): Likewise.
	* signal.c (sys_rt_sigtimedwait): Likewise.

	tests: add nanosleep.test.
	* tests/nanosleep.c: New file.
	* tests/nanosleep.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add nanosleep.
	(TESTS): Add nanosleep.test.
	* tests/.gitignore: Add nanosleep.

	tests: rewrite restart_syscall in C.
	* tests/restart_syscall.c: New file.
	* tests/restart_syscall.expected: Remove.
	* tests/restart_syscall_unknown.expected: Remove.
	* tests/restart_syscall.test: Update to use restart_syscall.
	* tests/Makefile.am (check_PROGRAMS): Add restart_syscall.
	(EXTRA_DIST): Remove restart_syscall.expected
	and restart_syscall_unknown.expected.
	* tests/.gitignore: Add restart_syscall.

	Properly initialize siginfo_t object passed to print_stopped function.
	* strace.c (trace): Clear the whole siginfo_t variable before passing it
	to ptrace(PTRACE_GETSIGINFO) because the latter may initialize only a
	part of the structure.

	tests: add clock_xettime.test.
	* tests/clock_xettime.c: New file.
	* tests/clock_xettime.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add clock_xettime.
	(TESTS): Add clock_xettime.test.
	* tests/.gitignore: Add clock_xettime.

	Convert parser of struct itimerval to new mpers infrastructure.
	* defs.h [ALPHA] (print_itimerval32): New prototype.
	* print_time.c (print_itimerval): New mpers printer.
	[ALPHA] (timeval32_t): New typedef.
	[ALPHA] (print_timeval32_t, print_itimerval32): New functions.
	* time.c (sys_getitimer, sys_setitimer): Use print_itimerval instead
	of printitv.
	[ALPHA] (sys_osf_getitimer, sys_osf_setitimer): Use print_itimerval32
	instead of printitv_bitness.
	(tprint_timeval32, tprint_timeval, printitv_bitness, printitv): Remove.

	tests: add xetitimer.test.
	* tests/xetitimer.c: New file.
	* tests/xetitimer.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add xetitimer.
	(TESTS): Add xetitimer.test.
	* tests/.gitignore: Add xetitimer.

	Convert parser of struct itimerspec to new mpers infrastructure.
	* print_time.c (print_itimerspec): New mpers printer.
	* time.c (sys_timer_settime, sys_timer_gettime, sys_timerfd,
	sys_timerfd_settime, sys_timerfd_gettime): Use it instead of printitv.

2015-09-17  Dmitry V. Levin  <ldv@altlinux.org>

	print_time.c: introduce print_timespec_t helper.
	* print_time.c (time_fmt): New constant string.
	(print_timeval_t): Use it.
	(print_timespec_t): New function.
	(print_timespec_t_utime): Use it.

	tests: add timerfd_xettime.test.
	* tests/timerfd_xettime.c: New file.
	* tests/timerfd_xettime.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add timerfd_xettime.
	(TESTS): Add timerfd_xettime.test.
	* tests/.gitignore: Add timerfd_xettime.

	tests: add timer_xettime.test.
	* tests/timer_xettime.c: New file.
	* tests/timer_xettime.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add timer_xettime.
	(TESTS): Add timer_xettime.test.
	* tests/.gitignore: Add timer_xettime.

	time.c: move parser of time syscall to print_time.c.
	* time.c (current_time_t_is_int32): Remove.
	(sys_time): Move ...
	* print_time.c: ... here.  Mpersify time_t.

	print_time.c: remove unused function parameters.
	* print_time.c (print_timespec_t_utime, print_timeval_t): Remove
	"struct tcb *" parameter.
	(print_timespec_utime_pair, print_timeval_pair): Update callers.

	Add struct timex.tai support.
	* configure.ac (AC_CHECK_MEMBERS): Add struct timex.tai.
	* print_timex.c (print_timex) [HAVE_STRUCT_TIMEX_TAI]: Print tai field.
	* tests/adjtimex.c (main) [HAVE_STRUCT_TIMEX_TAI]: Likewise.

	Convert parser of struct timex to new mpers infrastructure.
	* defs.h (adjtimex_modes, adjtimex_status): New xlat prototypes.
	* print_timex.c (struct_timex): New typedef.  Mpersify it.
	[IN_MPERS]: Do not include "xlat/adjtimex_modes.h"
	and "xlat/adjtimex_status.h".
	[SUPPORTED_PERSONALITIES > 1]: Remove.
	(tprint_timeval): Remove.
	(tprint_timex): Rename to print_timex.  Mpersify it.
	* time.c (do_adjtimex): Rename tprint_timex to print_timex.
	* tests/adjtimex.c: New file.
	* tests/adjtimex.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add adjtimex.
	(TESTS): Add adjtimex.test.
	* tests/.gitignore: Add adjtimex.

	Move parser of struct timex to a separate file.
	* print_timex.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* time.c (tprint_timex32, tprint_timex): Move to print_timex.c.

	Enhance parser of struct sigevent.
	* print_sigevent.c (print_sigevent): Always print names
	of struct_sigevent fields along with their values.
	Print signal name of sigev_signo for those sigev_notify values
	that require valid signal numbers.
	* tests/timer_create.c: New file.
	* tests/timer_create.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add timer_create.
	(TESTS): Add timer_create.test.
	* tests/.gitignore: Add timer_create.

2015-09-16  Dmitry V. Levin  <ldv@altlinux.org>

	Convert parser of struct sigevent to new mpers infrastructure.
	* defs.h (sigev_value): New prototype.
	(printsigevent): Remove.
	* print_sigevent.c (struct_sigevent): New typedef.  Mpersify it.
	[IN_MPERS]: Do not include "xlat/sigev_value.h".
	(printsigevent32): Remove.
	(printsigevent): Rename to print_sigevent.  Mpersify it.
	* mq.c (sys_mq_notify): Rename printsigevent to print_sigevent.
	* time.c (sys_timer_create): Likewise.

	Move parser of struct sigevent to a separate file.
	* print_sigevent.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* time.c (printsigevent32, printsigevent): Move to print_sigevent.c.

	time.c: move fallback definitions of SIGEV_* values to xlat/
	* time.c: Move fallback definitions of SIGEV_* values ...
	* xlat/sigev_value.in: ... here.

	Simplify use of mpers printers.
	* native_defs.h: New file.
	* syscall.c: Include it.
	* mpers_type.h [!IN_MPERS] (MPERS_DEFS): Change to "native_defs.h".
	* defs.h (MPERS_PRINTER_NAME): Remove.
	[SUPPORTED_PERSONALITIES > 1] (MPERS_PRINTER_NAME, printers): Move ...
	* Makefile.am (printers.h): ... here.
	Add macro definitions for mpers printers.
	(m%_defs.h): Add redefinition of MPERS_PRINTER_NAME and inclusion
	of "$(mpers_PREFIX)printer_decls.h".
	(strace_SOURCES): Add native_defs.h.
	* README-mpers: Update instructions for using mpers printers.
	* ipc_msg.c (tprint_msgsnd, tprint_msgrcv): Call tprint_msgbuf directly.
	* mq.c (sys_mq_open, mq_getsetattr): Call printmqattr directly.
	* process.c (sys_ptrace): Call printsiginfo_at directly.
	* signal.c (print_sigqueueinfo, sys_rt_sigtimedwait): Likewise.
	* resource.c (sys_getrusage): Call printrusage directly.
	* utimes.c (sys_utimensat): Call print_timespec_utime_pair directly.
	(sys_utimes, sys_futimesat): Call print_timeval_pair directly.
	* wait.c (printwaitn): Call printrusage directly.
	(sys_waitid): Call printrusage and printsiginfo_at directly.

2015-09-15  Dmitry V. Levin  <ldv@altlinux.org>

	Add a new helper function umove_ulong_array_or_printaddr.
	* defs.h (umove_ulong_array_or_printaddr): New prototype.
	* util.c (umove_ulong_array_or_printaddr): New function.
	* desc.c (sys_pselect6): Use it instead of open-coding
	a proxy struct parser for different personalities.
	* io.c (tprint_iov_upto): Use it instead of open-coding
	a struct iovec parser for different personalities.
	* kexec.c (print_kexec_segments): Use it instead of open-coding
	a struct kexec_segment parser for different personalities.
	(print_seg): Pass arguments using an array.

	tests: add pselect6.test.
	* tests/pselect6.c: New file.
	* tests/pselect6.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add pselect6.
	(TESTS): Add pselect6.test.
	* tests/.gitignore: Add pselect6.

2015-09-14  Dmitry V. Levin  <ldv@altlinux.org>

	Rename umove_long_or_printaddr to umove_ulong_or_printaddr.
	Rename the recently added function to reflect what kind of data type
	it actually deals with: unsigned long int, without sign extension.

	* defs.h (umove_long_or_printaddr): Rename to umove_ulong_or_printaddr,
	chage 3rd argument to unsigned long *.
	* util.c (umove_long_or_printaddr): Likewise.
	* aio.c (sys_io_submit): Update callers.

2015-09-14  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64, ppc64, sparc64, tile: hook up mpers printers.
	* defs.h [AARCH64 && HAVE_M32_MPERS]: Define PERSONALITY0_INCLUDE_FUNCS,
	PERSONALITY0_INCLUDE_PRINTERS_DECLS,
	and PERSONALITY0_INCLUDE_PRINTERS_DEFS.
	[POWERPC64 && HAVE_M32_MPERS]: Define PERSONALITY1_INCLUDE_FUNCS,
	PERSONALITY1_INCLUDE_PRINTERS_DECLS,
	and PERSONALITY1_INCLUDE_PRINTERS_DEFS.
	[SPARC64 && HAVE_M32_MPERS]: Likewise.
	[TILE && HAVE_M32_MPERS]: Likewise.

2015-09-14  Anton Blanchard  <anton@samba.org>

	Add PowerPC specific ptrace constants.
	* xlat/ptrace_cmds.in: Add PowerPC specific ptrace constants.

2015-09-14  Dmitry V. Levin  <ldv@altlinux.org>

	Update SCTP_* constants.
	* xlat/socksctpoptions.in: Add SCTP_GET_ASSOC_ID_LIST, SCTP_AUTO_ASCONF,
	SCTP_PEER_ADDR_THLDS, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO,
	SCTP_DEFAULT_SNDINFO, SCTP_SOCKOPT_CONNECTX, SCTP_SOCKOPT_CONNECTX3,
	and SCTP_GET_ASSOC_STATS.

	Update F_* constants.
	* xlat/fcntlcmds.in: Add F_SETPIPE_SZ, F_GETPIPE_SZ, F_ADD_SEALS,
	and F_GET_SEALS.

	Update RENAME_* constants.
	* xlat/rename_flags.in: Add RENAME_WHITEOUT.

	Update SO_* constants.
	* xlat/sockoptions.in: Add SO_ATTACH_BPF, SO_BPF_EXTENSIONS,
	SO_BUSY_POLL, SO_DETACH_BPF, SO_GET_FILTER, SO_INCOMING_CPU,
	SO_LOCK_FILTER, SO_MAX_PACING_RATE, SO_PEEK_OFF, SO_RXQ_OVFL,
	SO_SELECT_ERR_QUEUE, and SO_WIFI_STATUS.

	Update INPUT_PROP_* constants.
	* xlat/evdev_prop.in: Add INPUT_PROP_ACCELEROMETER.

	Update KEY_* constants.
	* xlat/evdev_keycode.in: Add KEY_ROTATE_DISPLAY, KEY_NUMERIC_A,
	KEY_NUMERIC_B, KEY_NUMERIC_C, and KEY_NUMERIC_D.

	Update FALLOC_FL_* constants.
	* xlat/falloc_flags.in: Add FALLOC_FL_INSERT_RANGE.

	Update AF_* and PF_* constants.
	* xlat/addrfams.in: Add AF_IB and AF_MPLS.
	* xlat/domains.in: Add PF_IB and PF_MPLS.

	Update TCP_* constants.
	* xlat/socktcpoptions.in: Add TCP_NOTSENT_LOWAT, TCP_CC_INFO,
	TCP_SAVE_SYN, and TCP_SAVED_SYN.

	Update PACKET_* constants.
	* xlat/sockpacketoptions.in: Add PACKET_VNET_HDR, PACKET_TX_TIMESTAMP,
	PACKET_TIMESTAMP, PACKET_FANOUT, PACKET_TX_HAS_OFF, PACKET_QDISC_BYPASS,
	PACKET_ROLLOVER_STATS, and PACKET_FANOUT_DATA.

	Update BPF_MAP_TYPE_* constants.
	* xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERF_EVENT_ARRAY.

	Update IPPROTO_* constants.
	* xlat/inet_protocols.in: Add IPPROTO_MPLS.

	Update IP_* constants.
	* xlat/sockipoptions.in: Add IP_CHECKSUM and IP_BIND_ADDRESS_NO_PORT.

	Update PTRACE_O_* constants.
	* ptrace.h: Define PTRACE_O_SUSPEND_SECCOMP.
	* xlat/ptrace_setoptions_flags.in: Add it.

	Update PR_* constants.
	* xlat/prctl_options.in: Add PR_SET_FP_MODE, PR_GET_FP_MODE,
	and PR_CAP_AMBIENT.

	Update SECBIT_* constants.
	* xlat/secbits.in: Add SECBIT_NO_CAP_AMBIENT_RAISE
	and SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED.

2015-08-28  Dmitry V. Levin  <ldv@altlinux.org>

	mpers.m4: workaround missing gnu/stubs-*.h files.
	On some systems missing gnu/stubs-*.h files make -m32/-mx32 compilation
	checks fail.  As we want to support multiple personalities despite of
	this limitation, workaround the check by creating empty gnu stub files
	if necessary.

	* m4/mpers.m4 (st_MPERS): Check for the gnu stub file.  Create an empty
	gnu stub file if the system one is missing.
	* Makefile.am (DISTCLEANFILES): Add gnu/stubs-32.h and gnu/stubs-x32.h.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	tests: add times-fail.test.
	* tests/times-fail.c: New file.
	* tests/times-fail.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add times-fail.
	(TESTS): Add times-fail.test.
	* tests/.gitignore: Add times-fail.

2015-08-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: add times.test.
	* tests/times.c: New file.
	* tests/times.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add times.
	(TESTS): Add times.test.
	(times_LDADD): Define.
	* tests/.gitignore: Add times.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	Mpersify parser of times syscall.
	Fix multiple personalities support in parser of times syscall by
	mpersifying struct tms.

	* times.c (tms_t): New typedef.  Mpersify it.
	(sys_times): Use it instead of struct tms.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	tests: add sysinfo.test.
	* tests/sysinfo.c: New file.
	* tests/sysinfo.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add sysinfo.
	(TESTS): Add sysinfo.test.
	* tests/.gitignore: Add sysinfo.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	Mpersify parser of sysinfo syscall.
	Fix multiple personalities support in parser of sysinfo syscall by
	mpersifying struct sysinfo.

	* sysinfo.c (sysinfo_t): New typedef.  Mpersify it.
	(sys_sysinfo): Use it instead of struct sysinfo.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	Enhance msgctl syscall decoding.
	Make parser of msgctl syscall print struct msqid_ds.

	* ipc_msgctl.c (msqid_ds_t): New typedef.  Mpersify it.
	(print_msqid_ds): New function.  Use msqid_ds_t.
	(sys_msgctl): Use print_msqid_ds.
	* tests/ipc_msg.c: Update for struct msqid_ds support.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	Enhance shmctl syscall decoding.
	Make parser of shmctl syscall print struct shmid_ds.

	* ipc_shmctl.c (shmid_ds_t): New typedef.  Mpersify it.
	(print_shmid_ds): New function.  Use shmid_ds_t.
	(sys_shmctl): Use print_shmid_ds.
	* tests/ipc_shm.c: Update for struct shmid_ds support.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	tests: add ipc_msgbuf.test.
	* tests/ipc_msgbuf.c: New file.
	* tests/ipc_msgbuf.expected: Likewise.
	* tests/ipc_msgbuf.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add ipc_msgbuf.
	(TESTS): Add ipc_msgbuf.test.
	(EXTRA_DIST): Add ipc_msgbuf.expected.
	* tests/.gitignore: Add ipc_msgbuf.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	Mpersify tprint_msgsnd and tprint_msgrcv.
	Fix multiple personalities support in tprint_msgsnd and tprint_msgrcv
	by converting tprint_msgbuf into a mpersified printer.

	* print_msgbuf.c (msgbuf_t): New typedef.  Mpersify it.
	(tprint_msgbuf): Use it instead of long.
	Wrap function name into MPERS_PRINTER_DECL.
	* ipc_msg.c (tprint_msgsnd, tprint_msgrcv): Use mpersified
	tprint_msgbuf.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	tests: add mq.test.
	* tests/mq.c: New file.
	* tests/mq.expected: Likewise.
	* tests/mq.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add mq.
	(TESTS): Add mq.test.
	(EXTRA_DIST): Add mq.expected.
	(mq_LDADD): Add -lrt.
	* tests/.gitignore: Add mq.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	Mpersify parsers of mq_open and mq_getsetattr syscalls.
	Fix multiple personalities support in parsers of mq_open and
	mq_getsetattr by converting printmqattr into a mpersified printer.

	* print_mq_attr.c (mq_attr_t): New typedef.  Mpersify it.
	(printmqattr): Use it instead of struct mq_attr.  Wrap function name
	into MPERS_PRINTER_DECL.
	* mq.c (mq_open, mq_getsetattr): Use mpersified printmqattr.

2015-08-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add wait.test.
	* tests/wait.c: New file.
	* tests/wait.expected: Likewise.
	* tests/wait.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add wait.
	(TESTS): Add wait.test.
	(EXTRA_DIST): Add wait.expected.
	* tests/.gitignore: Add wait.

2015-08-28  Dmitry V. Levin  <ldv@altlinux.org>

	Mpersify parsers of getrusage, waitpid, wait4, and waitid syscalls.
	Fix multiple personalities support in parsers of getrusage, waitpid,
	wait4, and waitid syscalls by converting printrusage into a mpersified
	printer.

	* defs.h (printrusage): Remove.
	* printrusage.c (rusage_t): New typedef.  Mpersify it.
	(printrusage): Use it instead of struct rusage.
	Wrap function name into MPERS_PRINTER_DECL.
	* resource.c (sys_getrusage): Use mpersified printrusage.
	* wait.c (printwaitn, sys_waitid): Likewise.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	tests: add rt_sigqueueinfo.test.
	* tests/rt_sigqueueinfo.c: New file.
	* tests/rt_sigqueueinfo.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add rt_sigqueueinfo.
	(TESTS): Add rt_sigqueueinfo.test.
	* tests/.gitignore: Add rt_sigqueueinfo.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	Mpersify printsiginfo_at printer.
	Fix multiple personalities support in parsers of ptrace,
	rt_sigqueueinfo, rt_tgsigqueueinfo, rt_sigtimedwait and waitid syscalls
	by converting printsiginfo_at into a mpersified printer.

	* printsiginfo.c (siginfo_t): Mpersify.
	(printsiginfo_at): Wrap function name into MPERS_PRINTER_DECL.
	* defs.h (printsiginfo_at): Remove.
	* signal.c (print_sigqueueinfo, sys_rt_sigtimedwait): Use mpersified
	printsiginfo_at.
	* process.c (sys_ptrace): Likewise.
	* wait.c (sys_waitid): Likewise.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	Mpersify parser of sigaltstack syscall.
	Fix multiple personalities support in parser of sigaltstack syscall by
	mpersifying stack_t typedef.

	* sigaltstack.c (stack_t): Mpersify.
	(print_stack_t): Use it.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	Mpersify parser of utime syscall.
	Fix multiple personalities support in parser of utime syscall by using
	mpersified utimbuf_t typedef.

	* utime.c (utimbuf_t): New typedef.  Mpersify it.
	(sys_utime): Use it instead of a locally defined union.

2015-08-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add utimensat.test.
	* tests/utimensat.c: New file.
	* tests/utimensat.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add utimensat.
	(TESTS): Add utimensat.test.
	* configure.ac (AC_CHECK_FUNCS): Add utimensat.
	* tests/.gitignore: Add utimensat.

2015-08-28  Dmitry V. Levin  <ldv@altlinux.org>

	Mpersify parsers of utimes, futimesat, and utimensat syscalls.
	Fix multiple personalities support in parsers of utimes, futimesat,
	and utimensat syscalls by introducing two mpersified printers:
	print_timeval_pair and print_timespec_utime_pair.

	* print_time.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* utimes.c (decode_utimes): Remove.
	(sys_utimes, sys_futimesat): Use print_timeval_pair instead
	of decode_utimes.
	(sys_utimensat): Use print_timespec_utime_pair instead of decode_utimes.

2015-08-28  Elvira Khabirova  <lineprinter0@gmail.com>

	Add mpers support.
	Add a subsystem for semi-automatical definition of how parsers should
	work with personality-dependent (mpers) types of tracee's data.  Create
	auxiliary libraries containing mpers syscall parsers and printer
	functions, one library for each possible nonnative target personality.

	Currently some parsers do not handle differences in definitions of data
	types between personalities, namely LP64 and ILP32.  When
	this is the case, long integers, pointers, and all compound
	types containing long and pointer members may be printed incorrectly,
	because of differences in sizes, offsets and alignments.

	Since in most cases these are the only differences in desired behaviour
	of parsers and printers for different personalities, a correct way
	would be to compile one source code into multiple parsers, differing
	only in definitions of mpers types.

	To get a definition of a given type for nonnative personality
	a very basic .c file containing a declaration of a variable of this type
	is being compiled for this personality (using -m32 or -mx32 compiler
	flag).  Information about the type is then being extracted from
	this binary's DWARF debug info with an awk script and put
	into a corresponding header file.  Resulting headers are being used to
	compile mpers variations of syscall parsers and printer functions.

	In addition to syscall parsers, there can occur a need to create mpers
	printing functions, which then can be called from many places
	in the code (for example, printsiginfo_at).  Such functions (printers)
	are marked in a special manner.

	For each possible nonnative target personality a library is being
	created, containing mpers variations of syscall parsers and printers.
	Only syscall parsers from files marked in a special manner and specially
	marked functions from such files are being recompiled and included
	in these libraries.

	generate_mpers_am.sh is called by bootstrap to find the files
	from strace_SOURCES which include MPERS_DEFS.  During compilation,
	these files are being inspected for inclusions of DEF_MPERS_TYPE,
	and nonnative variations of each included type are being generated
	by an awk script.

	Mpers parser names are being modified during inclusions of syscallent
	headers for nonnative personalities.  Pointers to printers are
	being stored in structs struct_printers, and a master
	pointer printers is being updated on every set_personality.

	* README-mpers: New README explaining how to use mpers support.
	* empty.h: New empty file.
	* generate_mpers_am.sh: New file.
	* mpers.awk: Likewise.
	* mpers.sh: Likewise.
	* mpers_test.sh: Likewise.
	* mpers_type.h: Likewise.
	* Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h.
	(strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning
	of the file.
	(strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a.
	(EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh.
	(BUILT_SOURCES, CLEANFILES): Add new generated files:
	native_printer_decls.h, native_printer_defs.h, printers.h,
	[HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS]
	$(mpers_mx32_targets).
	(mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS,
	mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES,
	libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables.
	(mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h,
	%_printer_decls.h, %_printer_defs.h, clean-local,
	native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets):
	New targets.
	* bootstrap: Add generate_mpers_am.sh.
	* configure.ac: Add AC_PROG_RANLIB.
	* m4/mpers.m4: Add HAVE_MPERS variable.  Add $st_cv_mpers checks.
	* defs.h: Include mpers_type.h.
	Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME.
	Redefine SYS_FUNC_NAME.  Define MPERS_PRINTER_DECL.
	[HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS,
	PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS
	for X86_64, X32.
	[HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS,
	PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS
	for X86_64.
	Add fallback definitions of
	PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS,
	PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS,
	PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS,
	PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS.
	* syscall.c: Include PERSONALITY1_INCLUDE_FUNCS,
	PERSONALITY2_INCLUDE_FUNCS,
	PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS,
	PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS,
	PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS.
	(printers): New struct.  Update it when needed.
	* .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h,
	m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32,
	mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h,
	mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h,
	native_printer_decls.h, native_printer_defs.h, and printers.h.

2015-08-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: convert readlink.test and readlinkat.test from match_awk to match_diff
	* tests/readlink.c (main): Print expected output.
	* tests/readlinkat.c (main): Likewise.
	* tests/readlink.test: Use match_diff instead of match_awk.
	* tests/readlinkat.test: Likewise.
	* tests/readlink.awk: Remove.
	* tests/readlinkat.awk: Likewise.
	* tests/Makefile.am (EXTRA_DIST): Remove readlink.awk and readlinkat.awk.

	tests: convert getrandom.test from match_awk to match_diff.
	* tests/getrandom.c (main): Print expected output.
	* tests/getrandom.test: Use match_diff instead of match_awk.
	* tests/getrandom.awk: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove getrandom.awk.

2015-08-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: convert select.test from match_awk to match_diff.
	* tests/select.c (main): Print expected output.
	* tests/select.test: Use match_diff instead of match_awk.
	* tests/select.awk: Remove.
	* tests/Makefile.am (EXTRA_DIST): Remove select.awk.

	tests: convert several tests from match_grep to match_diff.
	* tests/sendfile.test: Use match_diff instead of match_grep.
	* tests/sendfile64.test: Likewise.
	* tests/time.test: Likewise.
	* tests/utime.test: Likewise.
	* tests/xet_robust_list.test: Likewise.
	* tests/sendfile.c (main): Update match patterns for match_diff.
	* tests/sendfile64.c (main): Likewise.
	* tests/time.c (main): Likewise.
	* tests/utime.c (main): Likewise.
	* tests/xet_robust_list.c (main): Likewise.

2015-08-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix match_diff usage.
	The first argument of match_diff should be the file with expected
	output, the second argument - the file with actual output.

	* tests/aio.test: Swap match_diff arguments.
	* tests/restart_syscall.test: Likewise.
	* tests/seccomp.test: Likewise.
	* tests/umovestr2.test: Likewise.

2015-08-27  Dmitry V. Levin  <ldv@altlinux.org>

	build: fix -I options.
	* configure.ac (AM_INIT_AUTOMAKE): Add nostdinc.
	* Makefile.am (AM_CPPFLAGS): Append -I$(builddir) and -I$(srcdir).
	* tests/Makefile.am (AM_CPPFLAGS): Likewise.

2015-08-26  Dmitry V. Levin  <ldv@altlinux.org>

	aio: rewrite from libaio.h to linux/aio_abi.h.
	* configure.ac (AC_CHECK_HEADERS): Remove libaio.h.
	* aio.c: Assume that <linux/aio_abi.h> is available,
	include it instead of <libaio.h>.
	[!IOCB_RESFD]: Remove.
	(enum iocb_sub): Remove SUB_POLL.
	(tprint_lio_opcode): Update.
	(print_common_flags): Use IOCB_FLAG_RESFD instead of IOCB_RESFD,
	rename fields of struct iocb.
	(iocb_is_valid, print_iocb_header, print_iocb): New functions.
	(sys_io_submit): Use print_iocb.
	(print_io_event): Fix struct io_event decoding.
	(sys_io_cancel): Use print_iocb_header.
	* strace.spec (BuildRequires): Remove libaio-devel.
	* tests/aio.c (main): Test IOCB_CMD_PREADV, io_cancel,
	and struct io_event decoding.
	* tests/aio.test (syscalls): Add io_cancel.

2015-08-26  Dmitry V. Levin  <ldv@altlinux.org>

	Fix multiple personalities support in parser of io_submit syscall.
	Introduce a new helper function to fetch tracee's long integers
	and use it to fix multiple personalities support in io_submit parser.

	* defs.h (umove_long_or_printaddr): New prototype.
	* util.c (umove_long_or_printaddr): New function.
	* aio.c (sys_io_submit): Use it to fetch tracee's pointers.
	* tests/aio.c: New file.
	* tests/aio.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add aio.
	(TESTS): Add aio.test.
	* tests/.gitignore: Add aio.

2015-08-26  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix build on systems that lack O_CLOEXEC definition.
	* tests/epoll_create1.c (main): Check that O_CLOEXEC is defined.
	* tests/eventfd.c (main): Likewise.
	* tests/signalfd.c (main): Likewise.

	tests: fix build on systems that lack AT_FDCWD definition.
	* tests/readlinkat.c: Stop including <fcntl.h>.
	(main): Replace AT_FDCWD with -100.

	Fix printing of io_getevents first argument.
	* aio.c (sys_io_getevents): Print first argument using "%lu" format.

2015-08-26  Mike Frysinger  <vapier@gentoo.org>

	decode extend getsockopt/setsockopt options.
	Currently the code assumes the set of valid options between getsockopt
	and setsockopt are exactly the same and thus maintains one list.  The
	kernel unfortunately does not do this -- it allows for different opts
	between the get and set functions.  See the {g,s}et_opt{min,max} fields
	in the various netfilter subcores.

	To support this, extend the printxval function to take multiple sets of
	xlats as varargs.  Then we add the new get/set lists, and pass them down
	in the net code when decoding things.

	A simple example is iptables; before:
		getsockopt(4, SOL_IP, 0x40 /* IP_??? */, ...) = 0
		getsockopt(4, SOL_IP, 0x41 /* IP_??? */, ...) = 0
	after:
		getsockopt(4, SOL_IP, IPT_SO_GET_INFO, ...) = 0
		getsockopt(4, SOL_IP, IPT_SO_GET_ENTRIES, ...) = 0

	If these were setsockopt calls, then 0x40 & 0x41 would be
	IPT_SO_SET_REPLACE & IPT_SO_SET_ADD_COUNTERS.

	* configure.ac: Check for netfilter headers.
	* defs.h (printxvals): New prototype.
	(printxval): Change to a define.
	* net.c: Include netfilter headers and new sockopts headers.
	(print_sockopt_fd_level_name): Add a is_getsockopt argument.  Change SOL_IP
	and SOL_IPV6 decoding to use printxvals, and use is_getsockopt to pass more
	xlats down.
	(getsockopt): Call print_sockopt_fd_level_name with is_getsockopt as true.
	(setsockopt): Call print_sockopt_fd_level_name with is_getsockopt as false.
	* util.c (printxval): Rename to ...
	(printxvals): ... this.  Rewrite to be varargs based.
	* xlat/getsockipoptions.in: New xlat list.
	* xlat/getsockipv6options.in, xlat/setsockipoptions.in,
	xlat/setsockipv6options.in: Likewise.

2015-08-26  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build on systems that lack VIDIOC_CREATE_BUFS definition.
	* v4l2.c (v4l2_ioctl): Check that v4l2_ioctl is defined.

	Fix build on systems that lack EM_ARM/EM_OPENRISC definitions.
	* xlat/audit_arch.in: Guard AUDIT_ARCH_ARM and AUDIT_ARCH_ARMEB
	with EM_ARM check.  Guard AUDIT_ARCH_OPENRISC with EM_OPENRISC check.

2015-08-25  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build on systems that lack UBI_IOCVOLCRBLK/UBI_IOCVOLRMBLK definitions
	* mtd.c (ubi_ioctl): Check that UBI_IOCVOLCRBLK and UBI_IOCVOLRMBLK
	are defined.

	Fix build on systems that lack O_CLOEXEC definition.
	* xlat/efd_flags.in: Check that O_CLOEXEC is defined.
	* xlat/epollflags.in: Likewise.
	* xlat/sfd_flags.in: Likewise.
	* xlat/timerfdflags.in: Fix O_CLOEXEC check.

2015-08-21  Elvira Khabirova  <lineprinter0@gmail.com>

	printsiginfo.c: fix integer conversions.
	* printsiginfo.c (printsigsource): Print si_pid and si_uid as unsigned
	integers.
	(printsigval): Print si_int as signed int.

2015-08-20  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of times syscall return value.
	Always print return value of successful times syscall
	as unsigned long integer.

	* times.c (sys_times): Return RVAL_UDECIMAL unless syserror.

2015-08-20  Elvira Khabirova  <lineprinter0@gmail.com>

	mq.c: remove repeated code.
	* mq.c (sys_mq_open): Use printmqattr instead of implementing it again.
	[HAVE_MQUEUE_H]: Remove.

2015-08-20  Elvira Khabirova  <lineprinter0@gmail.com>

	ipc_msg.c: fix multiple personalities support in msgrcv ipc subcall.
	When msgrcv syscall is an ipc subcall, msgp (pointer to struct msgbuf)
	and msgtyp (message type) syscall arguments are passed via proxy
	structure which definition significantly depends on tracee's
	wordsize.

	* ipc_msg.c (fetch_msgrcv_args): New function.
	(sys_msgrcv): Use it.

2015-08-20  Elvira Khabirova  <lineprinter0@gmail.com>

	ipc.c: split into separate files.
	In preparation for upcoming mpers-related changes,
	split ipc.c into independent groups of parsers.

	* ipc_defs.h: New file.
	* ipc_msg.c: Likewise.
	* ipc_msgctl.c: Likewise.
	* ipc_sem.c: Likewise.
	* ipc_shm.c: Likewise.
	* ipc_shmctl.c: Likewise.
	* mq.c: Likewise.
	* print_mq_attr.c: Likewise.
	* print_msgbuf.c: Likewise.
	* ipc.c: Remove.
	(sys_mq_open, sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify,
	sys_mq_getsetattr): Move to mq.c.
	(sys_msgget, tprint_msgsnd, sys_msgsnd, tprint_msgrcv, sys_msgrcv): Move
	to ipc_msg.c.
	(sys_msgctl): Move to ipc_msgctl.c.
	(tprint_sembuf, tprint_sembuf_array, sys_semop, sys_semtimedop,
	sys_semget, syssemctl): Move to ipc_sem.c.
	(sys_shmget, sys_shmat, sys_shmdt): Move to ipc_shm.c.
	(sys_shmctl): Move to ipc_shmctl.c.
	(printmqattr): Move to print_mq_attr.c.
	(tprint_msgbuf): Move to print_msgbuf.c.
	(IPC_64, PRINTCTL): Move to ipc_defs.h.
	* defs.h (struct xlat resource_flags): New prototype.
	* Makefile.am (strace_SOURCES): Remove ipc.c.  Add ipc_defs.h, mq.c,
	ipc_msg.c, ipc_msgctl.c, ipc_sem.c, ipc_shm.c, ipc_shmctl.c,
	print_mq_attr.c, and print_msgbuf.c.

2015-08-20  Elvira Khabirova  <lineprinter0@gmail.com>

	.gitignore: add sen.h and sys_func.h.

2015-08-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add sendfile.test and sendfile64.test.
	* tests/sendfile.c: New file.
	* tests/sendfile64.c: New file.
	* tests/sendfile.test: New test.
	* tests/sendfile64.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add sendfile and sendfile64.
	(TESTS): Add sendfile.test and sendfile64.test.
	* tests/.gitignore: Add sendfile and sendfile64.

2015-08-19  Dmitry V. Levin  <ldv@altlinux.org>

	sendfile: decode file offset both on entering and exiting syscall.
	When sendfile is called with a valid pointer to a file offset variable,
	kernel updates this variable on successfull exit from syscall.

	* sendfile.c (sys_sendfile, sys_sendfile64): Print tcp->u_arg[2]
	on exiting syscall as well as on entering.

2015-08-19  Dmitry V. Levin  <ldv@altlinux.org>

	io.c: move sendfile parsers to a separate file.
	* sendfile.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* io.c (sys_sendfile, sys_sendfile64): Move to sendfile.c

2015-08-19  Dmitry V. Levin  <ldv@altlinux.org>

	Make printnum_* functions return boolean status.
	With this change, printnum_* functions return true iff they
	successfully fetched necessary data from tracee's memory.

	* defs.h (printnum_short, printnum_int, printnum_int64,
	printnum_long_int, printpair_int, printpair_int64): Return bool.
	* util.c (DEF_PRINTNUM, DEF_PRINTPAIR, printnum_long_int): Likewise.

2015-08-19  Dmitry V. Levin  <ldv@altlinux.org>

	mips: print _MIPS_SIM in configure.ac for debug purposes.
	* configure.ac [MIPS]: Print _MIPS_SIM.

	xtensa: fix several syscall entries.
	* linux/xtensa/syscallent.h: Fix nargs in splice, tee, vmsplice,
	pselect6, ppoll, epoll_pwait, and set_robust_list syscall entries.

	ia64: fix syscall numbers for set_robust_list, get_robust_list, and splice syscalls
	* linux/ia64/syscallent.h: Place syscall entries for set_robust_list,
	get_robust_list, and splice in correct order.

2015-08-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a test for get_robust_list and set_robust_list decoding.
	* tests/xet_robust_list.c: New file.
	* tests/xet_robust_list.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add xet_robust_list.
	(TESTS): Add xet_robust_list.test.
	* tests/.gitignore: Add xet_robust_list.

	Simplify printing of get_robust_list first argument.
	* get_robust_list.c (sys_get_robust_list): Print first argument
	using "%d" format.

2015-08-18  Elvira Khabirova  <lineprinter0@gmail.com>

	Fix io_setup first argument printing.
	* aio.c (sys_io_setup): Print first argument using "%u" format.

2015-08-18  Dmitry V. Levin  <ldv@altlinux.org>

	Fix printing tracee's long integers.
	Replace ambiguous printnum_long that used to fetch native long integers
	from tracee's memory with printnum_ptr, printnum_slong, and printnum_ulong
	that fetch tracee's pointer, signed long, and unsigned long integers.

	* defs.h (printnum_long, printpair_long): Remove prototypes.
	(printnum_int64, printpair_int64): Remove macros, declare functions
	unconditionally.
	[SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (printnum_long_int):
	New prototype.
	(printnum_ptr, printnum_slong, printnum_ulong): New macros.
	* aio.c (sys_io_setup): Use printnum_ulong.
	* block.c (block_ioctl): Use printnum_slong and printnum_ulong.
	* get_robust_list.c (sys_get_robust_list): Use printnum_ptr
	and printnum_ulong.
	* io.c (print_off_t): Remove.
	(sys_sendfile): Use printnum_ulong.
	* ipc.c (sys_semctl): Use printnum_ptr.
	* prctl.c (sys_prctl): Likewise.
	* process.c (sys_ptrace): Likewise.
	* rtc.c (rtc_ioctl): Use printnum_ulong.
	* util.c (printnum_long, printpair_long): Remove.
	(printnum_int64, printpair_int64): Define unconditionally.
	[SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (printnum_long_int):
	New function.

2015-08-18  Dmitry V. Levin  <ldv@altlinux.org>

	Fix time syscall decoding for some personalities.
	* time.c (current_time_t_is_int32): Define.
	(sys_time): Use it, printnum_int, and printnum_int64 instead
	of printnum_long.
	* tests/time.c: New file.
	* tests/time.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add time.
	(TESTS): Add time.test.
	* tests/.gitignore: Add time.

2015-08-18  Mike Frysinger  <vapier@gentoo.org>

	signal: SIGSYS: decode si_syscall & si_arch fields.
	When receiving SIGSYS, the si_syscall & si_arch fields are set to known
	values, so make sure we decode their values into the symbol settings.
	This makes stracing seccomp failures much easier.

	* defs.h (syscall_name): New prototype.
	* printsiginfo.c: Include linux/audit.h and xlat/audit_arch.h.
	(print_si_info): Decode si_syscall & si_arch for SIGSYS.
	* syscall.c (undefined_scno_name): Delete.
	(syscall_name): New function.
	(trace_syscall_entering): Change undefined_scno_name to syscall_name.
	(trace_syscall_exiting): Likewise.
	* xlat/audit_arch.in: New file.

2015-08-18  Elvira Khabirova  <lineprinter0@gmail.com>

	ipc.c: remove unnecesarry #ifdef IPC_64.
	* ipc.c (PRINTCTL): Remove #ifdef IPC_64 check as IPC_64 is always
	defined at this point.

2015-08-16  Elvira Khabirova  <lineprinter0@gmail.com>

	resource.c: move times parser to a separate file.
	* times.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* resource.c (sys_times): Move to times.c.

2015-08-16  Elvira Khabirova  <lineprinter0@gmail.com>

	sysctl.c: remove KERN_JAVA_* defines handling.
	This has been obsoleted by binfmt_misc since Linux 2.1.43.

	* sysctl.c (sys_sysctl): Remove KERN_JAVA_INTERPRETER
	and KERN_JAVA_APPLETVIEWER.

2015-08-16  Elvira Khabirova  <lineprinter0@gmail.com>

	sysinfo.c: remove obsolete code.
	struct sysinfo members totalhigh, freehigh and mem_unit are present
	since Linux 2.3.48.

	* configure.ac (AC_CHECK_MEMBERS): Remove struct sysinfo checks.
	* sysinfo.c (sys_sysinfo): Remove HAVE_STRUCT_SYSINFO_* checks.

2015-08-15  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	tests: add readlink.test and readlinkat.test.
	* tests/readlink.c: New file.
	* tests/readlink.awk: Likewise.
	* tests/readlinkat.c: Likewise.
	* tests/readlinkat.awk: Likewise.
	* tests/readlink.test: New test.
	* tests/readlinkat.test: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add readlink and readlinkat.
	(TESTS): Add readlink.test and readlinkat.test.
	(EXTRA_DIST): Add readlink.awk and readlinkat.awk.
	* tests/.gitignore: Add readlink and readlinkat.

2015-08-09  Dmitry V. Levin  <ldv@altlinux.org>

	Print nanoseconds along with seconds in stat family syscalls.
	* configure.ac (AC_CHECK_MEMBERS): Add stat.st_atim.tv_nsec,
	stat.st_ctim.tv_nsec, stat.st_mtim.tv_nsec, stat.st_atime_nsec,
	stat.st_atime_csec, and stat.st_mtime_nsec.
	* file.c: Explicitly define HAVE_STRUCT_STAT_ST_ATIME_NSEC,
	HAVE_STRUCT_STAT_ST_CTIME_NSEC and HAVE_STRUCT_STAT_ST_MTIME_NSEC
	for locally defined types.
	* printstat.h (DO_PRINTSTAT): Print st_atime_nsec, st_ctime_nsec,
	and st_mtime_nsec members.
	* tests/stat.c [_FILE_OFFSET_BITS == 64]: Use st_atime_nsec,
	st_ctime_nsec, and st_mtime_nsec via st_atim.tv_nsec, st_ctim.tv_nsec,
	and st_mtim.tv_nsec.
	(main): Print st_atime_nsec, st_ctime_nsec, and st_mtime_nsec members.

	This fixes Fedora bug #1251176.

2015-08-03  Dmitry V. Levin  <ldv@altlinux.org>

	signalfd4: fix flags decoding.
	* configure.ac (AC_CHECK_FUNCS): Add eventfd.
	(AC_CHECK_HEADERS): Add sys/signalfd.h.
	* signalfd.c: Include <fcntl.h>.
	[HAVE_SYS_SIGNALFD_H] Include <sys/signalfd.h>.
	Include "xlat/sfd_flags.h".
	(do_signalfd): Use sfd_flags for flags decoding.
	* xlat/sfd_flags.in: New file.
	* tests/signalfd.c: Likewise.
	* tests/signalfd.expected: Likewise.
	* tests/signalfd.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add signalfd.
	(TESTS): Add signalfd.test.
	(EXTRA_DIST): Add signalfd.expected.
	* tests/.gitignore: Add signalfd.

	signalfd, signalfd4: mark return code with RVAL_FD flag.
	* signalfd.c (do_signalfd): Set RVAL_FD flag in the return code.

	signal.c: move signalfd parsers to a separate file.
	* signalfd.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* signal.c (do_signalfd, sys_signalfd, sys_signalfd4): Move to signalfd.c

	perf_event_open: mark return code with RVAL_FD flag.
	* perf.c (sys_perf_event_open): Set RVAL_FD flag in the return code.

	pipe, pipe2, socketpair: print returned descriptors using printfd.
	* net.c (printpair_fd, decode_pair_fd): New functions.
	(do_pipe, sys_socketpair): Use them.

	socket: mark return code with RVAL_FD flag.
	* net.c (sys_socket): Set RVAL_FD flag in the return code.
	* tests/net-yy-accept.awk: Update socket and bind regexps.
	* tests/unix-yy-accept.awk: Likewise.
	* tests/net-yy-connect.awk: Update socket and connect regexps.
	* tests/unix-yy-connect.awk: Likewise.

	timerfd, timerfd_create: mark return code with RVAL_FD flag.
	* time.c (sys_timerfd, sys_timerfd_create): Set RVAL_FD flag
	in the return code.

2015-08-02  Dmitry V. Levin  <ldv@altlinux.org>

	inotify_init1: mark return code with RVAL_FD flag.
	* inotify.c (sys_inotify_init1): Set RVAL_FD flag in the return code.

	fanotify_init: mark return code with RVAL_FD flag.
	* fanotify.c (sys_fanotify_init): Set RVAL_FD flag in the return code.

	Fix epoll_create syscall decoding.
	* epoll.c (sys_epoll_create): New function.
	* linux/dummy.h (sys_epoll_create): Remove.

	epoll_create1: mark return code with RVAL_FD flag.
	* epoll.c (sys_epoll_create1): Set RVAL_FD flag in the return code.

	epoll_create1: fix pathtrace support.
	* pathtrace.c (pathtrace_match): Add SEN_epoll_create1.

	epoll_create1: fix flags decoding.
	* xlat/epollflags.in: Remove EPOLL_NONBLOCK, provide fallback definition
	for EPOLL_CLOEXEC.
	* tests/epoll_create1.c: New file.
	* tests/epoll_create1.expected: Likewise.
	* tests/epoll_create1.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add epoll_create1.
	(TESTS): Add epoll_create1.test.
	(EXTRA_DIST): Add epoll_create1.expected.
	* tests/.gitignore: Add epoll_create1.

2015-08-01  Dmitry V. Levin  <ldv@altlinux.org>

	desc.c: move epoll parsers to a separate file.
	* epoll.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* desc.c (sys_epoll_create1, print_epoll_event, sys_epoll_ctl,
	print_epoll_event_array, epoll_wait_common, epoll_wait, epoll_pwait):
	Move to epoll.c.

	eventfd2: fix flags decoding.
	* configure.ac (AC_CHECK_HEADERS): Add sys/eventfd.h.
	* eventfd.c: Include <fcntl.h>.
	[HAVE_SYS_EVENTFD_H] Include <sys/eventfd.h>.
	Include "xlat/efd_flags.h".
	(do_eventfd): Use efd_flags for flags decoding.
	* xlat/efd_flags.in: New file.
	* tests/eventfd.c: New file.
	* tests/eventfd.expected: Likewise.
	* tests/eventfd.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add eventfd.
	(TESTS): Add eventfd.test.
	(EXTRA_DIST): Add eventfd.expected.
	* tests/.gitignore: Add eventfd.

	eventfd: print first argument as unsigned int.
	* eventfd.c (do_eventfd): Explicitly cast initial value to unsigned int.

	Mark eventfd return code with RVAL_FD flag.
	* eventfd.c (do_eventfd): Set RVAL_FD flag in the return code.

	desc.c: move eventfd parsers to a separate file.
	* eventfd.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* desc.c (do_eventfd, sys_eventfd, sys_eventfd2): Move to eventfd.c.

	Update PERF_FLAG_* constants.
	* xlat/perf_event_open_flags.in: Add PERF_FLAG_FD_CLOEXEC,
	provide fallback definitions.

	desc.c: move perf_event_open parser to a separate file.
	* perf.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* desc.c (sys_perf_event_open): Move to perf.c.

2015-08-01  Elvira Khabirova  <lineprinter0@gmail.com>

	time.c: remove obsolete code from adjtimex parser.
	Linux versions 1.3.28 and below are not supported.

	* time.c (tprint_timex) [LINUX_VERSION_CODE < 66332]: Remove.

2015-08-01  Elvira Khabirova  <lineprinter0@gmail.com>

	ipc.c: move fallback definitions of msg, sem, and shm constants to xlat/
	* ipc.c: Move MSG_STAT and MSG_INFO definitions to xlat/msgctl_flags.in.
	Move SHM_STAT and SHM_INFO definitions to xlat/shmctl_flags.in.
	Move SEM_STAT and SEM_INFO definitions to xlat/semctl_flags.in.

2015-08-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests/ppoll: replace SIGABRT with SIGHUP.
	Use SIGHUP instead of SIGABRT, the number of the former
	is more portable across architectures.

	* tests/ppoll.c (test2): Replace SIGABRT with SIGHUP.
	* tests/ppoll.expected: Update regexp.
	* tests/ppoll-v.expected: Likewise.

2015-08-01  Dmitry V. Levin  <ldv@altlinux.org>

	decode_poll_exiting: reserve more space in output buffer.
	* poll.c (decode_poll_exiting): Reserve more space in output buffer.

2015-07-30  Dmitry V. Levin  <ldv@altlinux.org>

	Cleanup poll/ppoll decoders.
	* poll.c (decode_poll): Split into print_pollfd, decode_poll_entering,
	and decode_poll_exiting.
	(sys_poll, sys_ppoll): Update callers.
	* tests/ppoll.c: New file.
	* tests/ppoll.expected: Likewise.
	* tests/ppoll-v.expected: Likewise.
	* tests/ppoll.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add ppoll.
	(TESTS): Add ppoll.test.
	(EXTRA_DIST): Add ppoll.expected and ppoll-v.expected.
	* tests/.gitignore: Add ppoll.

	poll: print timeout argument as int.
	* poll.c (sys_poll): Explicitly cast timeout argument to int.

	stream.c: move poll and ppoll parsers to a separate file.
	* poll.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* stream.c (decode_poll, sys_poll, sys_ppoll): Move to poll.c.

	Assume that <poll.h> is available.
	* configure.ac (AC_CHECK_HEADERS): Remove poll.h and sys/poll.h.
	* pathtrace.c: Include <poll.h> unconditionally.
	* stream.c: Likewise.
	[HAVE_SYS_POLL_H]: Compile unconditionally.
	[!HAVE_SYS_POLL_H]: Remove.

	tests: add oldselect.test.
	* tests/oldselect.c: New file.
	* tests/oldselect.expected: Likewise.
	* tests/oldselect.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add oldselect.
	(TESTS): Add oldselect.test.
	(EXTRA_DIST): Add oldselect.expected.
	* tests/.gitignore: Add oldselect.

2015-07-30  Elvira Khabirova  <lineprinter0@gmail.com>

	Fix oldselect decoding on 64-bit architectures.
	As struct sel_arg_struct is an array of 32-bit values,
	fetch it using an intermediate array on 64-bit architectures.

	* desc.c (sys_oldselect): Rename args to long_args.
	[SIZEOF_LONG == 4] Alias oldselect_args to long_args.
	[SIZEOF_LONG != 4] Introduce oldselect_args to fetch oldselect args.
	* linux/sh64/syscallent.h (oldselect): Remove.

2015-07-30  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: use printaddr.
	* net.c (printsock, sys_recvfrom): Use printaddr.

2015-07-30  Denys Vlasenko  <dvlasenk@redhat.com>

	net.c: recvfrom fixes.
	This change fixes these three problems (before/after is shown):

	On interrupted syscall, flags are not decoded:

	    -recvfrom(3, 0x7fff0a41e306, 10, 2, 0, 0) = ? ERESTARTSYS
	    +recvfrom(3, 0x7fff0a41e306, 10, MSG_PEEK, 0, 0) = ? ERESTARTSYS

	If peer address is unavalable (example: anon sockets from socketpair()),
	kernel returns socklen of 0, but we ignore that and show bogus sockaddr data:

	    -recvfrom(3, "123456789\0", 10, MSG_PEEK, {sa_family=0x7777 /* AF_??? */, sa_data="wwwwwwwwwwwwww"}, [0]) = 10
	    +recvfrom(3, "123456789\0", 10, MSG_PEEK, 0x7ffde6edf760, [0]) = 10

	SYS_FUNC(recvfrom) passes address of fromlen, not fromlen, to printsock():

	    -               printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]);
	    +               printsock(tcp, tcp->u_arg[4], fromlen);

2015-07-29  Elliott Hughes  <enh@google.com>

	prctl: decode Android-specific PR_SET_VMA.
	Android kernels have a prctl to name VMAs.

	* prctl.c (sys_prctl) [__ANDROID__]: Decode PR_SET_VMA.

2015-07-29  Dmitry V. Levin  <ldv@altlinux.org>

	mips: fix stub files.
	This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc.

	* linux/mips/genstub.sh: Output SEN(printargs) instead of printargs.

	Reported-by: Elliott Hughes <enh@google.com>

2015-07-29  Dmitry V. Levin  <ldv@altlinux.org>

	tests/bpf: fix build with incompatibly old linux/bpf.h and/or gcc.
	* configure.ac: Check how union bpf_attr.log_buf initialization works.
	* tests/bpf.c: Check for HAVE_UNION_BPF_ATTR_LOG_BUF.

	Implement sched_getattr and sched_setattr syscalls decoding.
	* xlat/sched_flags.in: New file.
	* sched.c: Include "xlat/sched_flags.h".
	(print_sched_attr, sys_sched_setattr, sys_sched_getattr): New functions.
	* linux/dummy.h (sys_sched_getattr, sys_sched_setattr): Remove.
	* tests/sched_xetattr.c: New file.
	* tests/sched_xetattr.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add sched_xetattr.
	(TESTS): Add sched_xetattr.test.
	* tests/.gitignore: Add sched_xetattr.

	Implement memfd_create syscall decoding.
	* memfd_create.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/dummy.h (sys_memfd_create): Remove.
	* pathtrace.c (pathtrace_match): Add SEN_memfd_create.
	* xlat/memfd_create_flags.in: New file.
	* tests/memfd_create.c: New file.
	* tests/memfd_create.expected: Likewise.
	* tests/memfd_create.test: New test.
	* tests/Makefile.am: (check_PROGRAMS): Add memfd_create.
	(TESTS): Add memfd_create.test.
	(EXTRA_DIST): Add memfd_create.expected.
	* tests/.gitignore: Add memfd_create.

2015-07-28  Elliott Hughes  <enh@google.com>

	Fix builds where HAVE_MQUEUE_H isn't defined.
	Android doesn't have <mqueue.h>.

	* ipc.c (sys_mq_open) [!HAVE_MQUEUE_H]: Fix printaddr invocation.

2015-07-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests/restart_syscall: skip if nanosleep looks uninterrupted.
	* tests/restart_syscall.test: Skip if restart_syscall is not detected
	and nanosleep syscall looks uninterrupted.

	Implement execveat syscall decoding.
	* execve.c (decode_execve): New function.
	(sys_execve): Use it.
	(sys_execveat): New function.
	* linux/dummy.h (sys_execveat): Remove.
	* tests/execveat.c: New file.
	* tests/execveat.expected: Likewise.
	* tests/execveat-v.expected: Likewise.
	* tests/execveat.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add execveat.
	(TESTS): Add execveat.test.
	(EXTRA_DIST): Add execveat.expected and execveat-v.expected.
	* tests/.gitignore: Add execveat.

	execve: fix support of personalities with different word size.
	* execve.c (printargc): Do not assume that host and target pointers have
	the same size.
	* tests/execve.c: New file.
	* tests/execve.expected: Likewise.
	* tests/execve-v.expected: Likewise.
	* tests/execve.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add execve.
	(TESTS): Add execve.test.
	(EXTRA_DIST): Add execve.expected and execve-v.expected.
	* tests/.gitignore: Add execve.

	Implement bpf syscall decoding.
	* bpf.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* configure.ac (AC_CHECK_HEADERS): Add linux/bpf.h.
	* linux/dummy.h (sys_bpf): Remove.
	* pathtrace.c (pathtrace_match): Add SEN_bpf.
	* xlat/bpf_commands.in: New file.
	* xlat/bpf_map_types.in: New file.
	* xlat/bpf_map_update_elem_flags.in: New file.
	* xlat/bpf_prog_types.in: New file.
	* tests/bpf.c: New file.
	* tests/bpf.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add bpf.
	(TESTS): Add bpf.test.
	* tests/.gitignore: Add bpf.

2015-07-25  Dmitry V. Levin  <ldv@altlinux.org>

	prctl: fix decoding of unrecognized commands.
	The use of printargs introduced by commit v4.10-179-g210a6b6 is wrong:
	when the first argument is already printed, printargs cannot be called.

	* prctl.c (print_prctl_args): New function.
	(sys_prctl): Use it.

2015-07-23  Dmitry V. Levin  <ldv@altlinux.org>

	Macroize -m32/-mx32 configure checks.
	Prepare for additional configure checks that would be needed
	for new multiple personalities support.

	* m4/mpers.m4: New file.
	* configure.ac: Use it.

2015-07-22  Dmitry V. Levin  <ldv@altlinux.org>

	tests/uid: import uid overflow check from tests/uid16.
	* tests/uid.c (main): Skip if the uid returned by getuid matches
	/proc/sys/kernel/overflowuid.

2015-07-21  Dmitry V. Levin  <ldv@altlinux.org>

	sh64: fix inotify_{add,rm}_watch syscall entries.
	* linux/sh64/syscallent.h (inotify_add_watch, inotify_rm_watch):
	Set sys_func.

	microblaze: fix several syscall entries.
	* linux/microblaze/syscallent.h (signalfd4, eventfd2, epoll_create1,
	dup3, pipe2, inotify_init1, recvmmsg): Set sys_func.

	hppa: fix several syscall entries.
	* linux/hppa/syscallent.h (remap_file_pages, mq_open, mq_unlink,
	mq_timedsend, mq_timedreceive, mq_notify, mq_getsetattr,
	clock_nanosleep, signalfd, timerfd): Set sys_func.

	ia64: fix getpagesize syscall entry.
	* linux/ia64/syscallent.h (getpagesize): Fux nargs.

	avr32: fix fstatat64 syscall entry.
	* linux/avr32/syscallent.h (fstatat64): Set sys_func.

	alpha: fix 2 dummy osf syscall entries.
	* linux/alpha/syscallent.h (osf_set_program_attributes): Fix nargs.
	(osf_sigstack): Fix nargs and sys_name.

	alpha, arm, ia64, mips, sh64: fix semop syscall entries.
	* linux/alpha/syscallent.h (semop): Fix nargs, set sys_func.
	* linux/ia64/syscallent.h (semop): Set sys_func.
	* linux/mips/syscallent-n32.h (semop): Likewise.
	* linux/mips/syscallent-n64.h (semop): Likewise.
	* linux/arm/syscallent.h (semop): Fix nargs.
	* linux/sh64/syscallent.h (semop): Likewise.

	m68k: fix getpagesize decoding.
	* linux/m68k/syscallent.h (getpagesize): Set sys_func.
	* mem.c [M68K] (sys_getpagesize): Define.

	tests/ip_mreq: skip if basic setsockopt operations fail.
	* tests/ip_mreq.c (main): Return 77 if basic
	IP_ADD_MEMBERSHIP/IP_DROP_MEMBERSHIP options cannot be set.

2015-07-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: use -lpthread instead of -pthread.
	On some obscure systems, -lpthread is more likely to work than -pthread.

	* tests/Makefile.am (filter_unavailable_LDFLAGS): Rename to
	filter_unavailable_LDADD and change to -lpthread.

2015-07-21  Dmitry V. Levin  <ldv@altlinux.org>

	mips o32: fix utimensat syscall entry.
	* linux/mips/syscallent-o32.h (utimensat): set sys_flags and sys_func.

2015-07-21  Dmitry V. Levin  <ldv@altlinux.org>

	linux/mips/syscallent-compat.h: use designated initializers.
	Change linux/mips/syscallent-compat.h to use designated initializers
	like normal syscallent.h files.

	* linux/mips/syscallent-compat.h: Use designated initializers.

2015-07-21  Dmitry V. Levin  <ldv@altlinux.org>

	linux/mips/syscallent-compat.h: fix initalization of empty entries.
	This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc.

	* linux/mips/syscallent-compat.h: Fix initalization of empty entries.

2015-07-20  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unused parsers of getmsg and putmsg.
	* stream.c [SPARC || SPARC64] (sys_putmsg, sys_getmsg): Remove.
	Stop including "xlat/msgflags.h".
	* xlat/msgflags.in: Remove.

	sigreturn: make use of RVAL_DECODED.
	* sigreturn.c (arch_sigreturn): New function.
	(sys_sigreturn): Use it.  Return RVAL_DECODED.
	* linux/alpha/arch_sigreturn.c: Update.
	* linux/crisv10/arch_sigreturn.c: Likewise.
	* linux/m68k/arch_sigreturn.c: Likewise.
	* linux/microblaze/arch_sigreturn.c: Likewise.
	* linux/x86_64/arch_sigreturn.c: Likewise.

	or1k_atomic.c: make use of RVAL_DECODED.
	* or1k_atomic.c (sys_or1k_atomic): Update for RVAL_DECODED.

	Update openat parser for the RVAL_DECODED change.
	* open.c (sys_openat): Update for RVAL_DECODED.

	bjm.c: make use of RVAL_DECODED.
	* bjm.c (sys_create_module, sys_delete_module, sys_init_module,
	sys_finit_module): Update for RVAL_DECODED.

	access.c: make use of RVAL_DECODED.
	* access.c (decode_access, sys_faccessat): Update for RVAL_DECODED.

	affinity.c: make use of RVAL_DECODED.
	* affinity.c (sys_sched_setaffinity): Update for RVAL_DECODED.

	affinity.c: use printaddr and umove_or_printaddr.
	* affinity.c (print_affinitylist): Use printaddr and umove_or_printaddr.
	(sys_sched_getaffinity): Remove redundant u_rval check.

	aio.c: enhance io_* syscalls decoding.
	* aio.c (sys_io_setup): Use printnum_int64 and printnum_long.
	(sys_io_destroy, sys_io_submit): Update for RVAL_DECODED.
	(sys_io_submit): Use umove_or_printaddr and printaddr.
	Enclose iocb array in square brackets.
	Change to traditional structure output format.
	(print_io_event): New function.
	(sys_io_cancel, sys_io_getevents): Use it.
	(sys_io_cancel): Use umove_or_printaddr and printaddr.
	(sys_io_getevents): Use printaddr.

	cacheflush.c: make use of RVAL_DECODED.
	* cacheflush.c (sys_cacheflush): Update for RVAL_DECODED.

	cacheflush.c: use printaddr.
	* cacheflush.c (sys_cacheflush): Use printaddr.

	capability.c: make use of RVAL_DECODED.
	* capability.c (sys_capset): Update for RVAL_DECODED.

	capability.c: use printaddr and umove_or_printaddr.
	* capability.c (get_cap_header): Use printaddr.
	(print_cap_data): Use printaddr and umove_or_printaddr.

	chdir.c: make use of RVAL_DECODED.
	* chdir.c (sys_chdir): Update for RVAL_DECODED.

	chmod.c: make use of RVAL_DECODED.
	* chmod.c (decode_chmod): Change to return void.
	(sys_chmod, sys_fchmodat): Update callers.  Update for RVAL_DECODED.
	(sys_fchmod): Update for RVAL_DECODED.

	clone.c: make use of RVAL_DECODED.
	* clone.c (sys_setns, sys_unshare, sys_fork): Update for RVAL_DECODED.

	Alias sys_epoll_create to printargs_ld.
	* desc.c (sys_epoll_create): Remove.
	* linux/dummy.h (sys_epoll_create): Alias to printargs_ld.

	desc.c: make use of RVAL_DECODED.
	* desc.c (sys_flock, sys_close, sys_dup, do_dup2, sys_epoll_create1,
	sys_epoll_ctl, do_eventfd, sys_perf_event_open): Update
	for RVAL_DECODED.

	desc.c: do not use xmalloc, use umove_or_printaddr and printaddr.
	* desc.c (printflock64, printflock): Use umove_or_printaddr.
	(decode_select): Do not use xmalloc.  Use umoven_or_printaddr
	and printaddr.
	(sys_oldselect): Use printaddr.
	(sys_epoll_ctl): Use umoven_or_printaddr and printaddr.
	(print_epoll_event_array): New function.
	(sys_epoll_wait_common): Use it.
	(sys_pselect6): Use umove_or_printaddr.
	(sys_eventfd2): Use printaddr.

	xlat/epollctls.in: add default values.
	* xlat/epollctls.in (EPOLL_CTL_ADD, EPOLL_CTL_DEL, EPOLL_CTL_MOD): Add
	default values.

	dirent.c: do not use xmalloc.
	* dirent.c (print_old_dirent): Use umove_or_printaddr.
	(sys_readdir): Use printaddr.
	(sys_getdents, sys_getdents64): Do not use xmalloc for dirents,
	treat malloc failure the same way as umoven failure.  Use printaddr.

	execve.c: make use of RVAL_DECODED.
	* execve.c (sys_execve, sys_execv): Update for RVAL_DECODED.

	execve.c: use printaddr and umove_or_printaddr.
	* execve.c (printargv): Use umoven_or_printaddr.
	(sys_execve, sys_execv): Use printaddr.

	fadvise.c: make use of RVAL_DECODED.
	* fadvise.c (sys_fadvise64, sys_fadvise64_64): Update for RVAL_DECODED.

	fallocate.c: make use of RVAL_DECODED.
	* fallocate.c (sys_fallocate): Update for RVAL_DECODED.

	fanotify.c: make use of RVAL_DECODED.
	* fanotify.c (sys_fanotify_init, sys_fanotify_mark): Update
	for RVAL_DECODED.

	fchownat.c: make use of RVAL_DECODED.
	* fchownat.c (sys_fchownat): Update for RVAL_DECODED.

	file.c: use umove_or_printaddr.
	* file.c (printstat32, printstatsol): Remove.
	(printstat, printstat64, printoldstat): Use umove_or_printaddr.

	futex.c: enhance futex syscall decoding.
	* futex.c (sys_futex): Use switch statement.  Use printaddr.
	Print uint32_t syscall arguments using %u format.
	Update for RVAL_DECODED.

	get_robust_list.c: use printnum_long.
	* get_robust_list.c (sys_get_robust_list): Use printnum_long.

	getcpu.c: use printnum_int and printaddr.
	* getcpu.c (sys_getcpu): Use printnum_int and printaddr.

	getcwd.c: use printaddr.
	* getcwd.c (sys_getcwd): Use printaddr.

	getrandom.c: use printaddr.
	* getrandom.c (sys_getrandom): Use printaddr.

	hostname.c: make use of RVAL_DECODED.
	* hostname.c (sys_sethostname): Update for RVAL_DECODED.

	hostname.c: use printaddr.
	* hostname.c (sys_gethostname): Use printaddr.

	inotify.c: make use of RVAL_DECODED.
	* inotify.c (sys_inotify_add_watch, sys_inotify_rm_watch,
	sys_inotify_init1): Update for RVAL_DECODED.

	io.c: make use of RVAL_DECODED.
	* io.c (sys_write, sys_writev, sys_pwrite, sys_pwritev, sys_sendfile,
	sys_sendfile64, sys_tee, sys_splice, sys_vmsplice): Update
	for RVAL_DECODED.

	Use printnum_int64 instead of print_loff_t.
	* defs.h (print_loff_t): Remove.
	* io.c (print_loff_t): Remove.
	(sys_sendfile64, sys_splice): Use printnum_int64 instead of print_loff_t.
	* mtd.c (mtd_ioctl): Likewise.

	io.c: use printaddr and umove_or_printaddr.
	* io.c (sys_read, sys_pread): Use printaddr.
	(tprint_iov_upto): Do not fetch data in case of syserror.
	Use printaddr.
	(sys_readv, sys_preadv): Remove redundant check for syserror.
	(print_off_t): Use printnum_int and printnum_long.
	(print_loff_t): Use umove_or_printaddr.

	ioprio.c: make use of RVAL_DECODED.
	* ioprio.c (sys_ioprio_set): Update for RVAL_DECODED.

	ipc.c: use printaddr and umove_or_printaddr.
	* ipc.c (sys_msgctl): Use printaddr.
	(tprint_msgbuf): New function.
	(tprint_msgsnd, tprint_msgrcv): Use it.
	(sys_msgrcv): Use umove_or_printaddr.
	(tprint_sembuf): Rename to tprint_sembuf_array.
	(tprint_sembuf): New function.
	(tprint_sembuf_array): Use it.
	(sys_semop, sys_semtimedop): Update callers.
	(sys_shmctl, sys_shmat, sys_shmdt): Use printaddr.
	(sys_mq_open, printmqattr): Use printaddr and umove_or_printaddr.
	* tests/ipc_msg.c (main): Update msgctl IPC_RMID regexp.
	* tests/ipc_shm.c (main): Update shmctl IPC_RMID regexp.

	kexec.c: use printaddr and umove_or_printaddr.
	* kexec.c (print_seg): New function.
	(print_kexec_segments): Use it.  Use printaddr and umove_or_printaddr.
	(kexec_load): Use printaddr.  Update for RVAL_DECODED.

	keyctl.c: make use of RVAL_DECODED.
	* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
	(keyctl_join_session_keyring, keyctl_handle_key,
	keyctl_set_reqkey_keyring): Remove.
	(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
	keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
	keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
	keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
	keyctl_setperm_key): Change to return void.
	Update for RVAL_DECODED.
	(sys_keyctl): Update callers.  Update for RVAL_DECODED.

	keyctl.c: use printaddr.
	* keyctl.c (keyctl_read_key): Use printaddr.

	ldt.c: make use of RVAL_DECODED.
	* ldt.c (sys_modify_ldt, sys_set_thread_area, sys_get_thread_area):
	Update for RVAL_DECODED.

	ldt.c: use printaddr and umove_or_printaddr.
	* ldt.c [I386 || X86_64 || X32] (print_user_desc):
	Use umove_or_printaddr.
	[I386 || X86_64 || X32] (sys_modify_ldt): Use printaddr.
	[(M68K || MIPS] (set_thread_area): Likewise.
	[I386 || X86_64 || X32] (set_thread_area): Do not fetch data
	if !verbose.
	[I386 || X86_64 || X32] (get_thread_area): Remove redundant check
	for syserror.

	link.c: make use of RVAL_DECODED.
	* link.c (sys_link, sys_linkat, sys_unlinkat, sys_symlinkat): Update
	for RVAL_DECODED.

	lseek.c: make use of RVAL_DECODED.
	* lseek.c (sys_lseek): Update for RVAL_DECODED.

	lseek.c: use printnum_int64.
	* lseek.c (sys_llseek): Use printnum_int64.

	mem.c: make use of RVAL_DECODED.
	* mem.c (print_mmap): Change to return void.
	Update for RVAL_DECODED.
	(sys_old_mmap, sys_old_mmap_pgoff, sys_mmap, sys_mmap_pgoff,
	sys_mmap_4koff): Update callers.  Update for RVAL_DECODED.
	(sys_brk, sys_munmap, sys_mprotect, sys_mremap, sys_madvise,
	sys_mlockall, sys_msync, sys_remap_file_pages, sys_mbind,
	sys_set_mempolicy, sys_migrate_pages, [POWERPC] subpage_prot):
	Update for RVAL_DECODED.

	mem.c: use printaddr and umove_or_printaddr.
	* mem.c (sys_brk, print_mmap, sys_munmap, sys_mprotect, sys_mremap,
	sys_madvise, sys_msync, sys_mincore, sys_remap_file_pages, get_nodes,
	sys_mbind, [POWERPC] sys_subpage_prot): Use printaddr.
	(sys_get_mempolicy): Use printaddr and umove_or_printaddr.

	mknod.c: make use of RVAL_DECODED.
	* mknod.c (decode_mknod): Change to return void.
	Update for RVAL_DECODED.
	(sys_mknod, sys_mknodat): Update callers.  Update for RVAL_DECODED.
	[SPARC || SPARC64] (xmknod): Update for RVAL_DECODED.

	mount.c: make use of RVAL_DECODED.
	* mount.c (sys_mount): Update for RVAL_DECODED.

	mount.c: use printaddr.
	* mount.c (sys_mount): Use printaddr.

	Alias sys_connect to sys_bind.
	* linux/dummy.h (sys_connect): Alias to sys_bind.
	* net.c (sys_connect): Remove.

	net.c: make use of RVAL_DECODED.
	* net.c (sys_socket, sys_bind, sys_listen, sys_send, sys_sendto,
	sys_sendmsg, sys_shutdown, sys_setsockopt): Update for RVAL_DECODED.

	net.c: use printaddr and umove_or_printaddr.
	* net.c (printsock): Use printaddr and umove_or_printaddr.
	(printcmsghdr, printmsghdr, printmmsghdr, decode_mmsg, do_sockname,
	sys_recv, sys_recvfrom, sys_recvmsg, do_pipe, print_linger, print_ucred,
	print_tpacket_stats, print_icmp_filter, print_getsockopt,
	print_group_req, print_tpacket_req, print_packet_mreq,
	print_setsockopt): Use printaddr.
	(print_mreq, print_mreq6): Use umove_or_printaddr.

2015-07-18  Elvira Khabirova  <lineprinter0@gmail.com>

	tests: add sigaltstack.test.
	* tests/sigaltstack.c: New file.
	* tests/sigaltstack.expected: Likewise.
	* tests/sigaltstack.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add sigaltstack.
	(TESTS): Add sigaltstack.test.
	(EXTRA_DIST): sigaltstack.expected.
	* tests/.gitignore: Add sigaltstack.

	bootstrap: delete personality test directories beforehand.
	* bootstrap: Delete tests-m32 and tests-mx32 directories
	before creating them.

2015-07-18  Dmitry V. Levin  <ldv@altlinux.org>

	defs.h: do not include <signal.h>
	* printsiginfo.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h: Do not include <signal.h>.
	(printsiginfo): Remove.
	* printsiginfo.c: Include <signal.h> and "printsiginfo.h".
	* strace.c: Likewise.
	* sigaltstack.c: Include <signal.h>.
	* signal.c: Likewise.
	* sigreturn.c: Likewise.
	* time.c: Likewise.

	resource.c: move printrusage and printrusage32 to a separate file.
	* printrusage.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* resource.c (printrusage, [ALPHA] printrusage32): Move
	to printrusage.c.

	open.c: make use of RVAL_DECODED.
	* open.c (decode_open, sys_creat): Update for RVAL_DECODED.

	personality.c: make use of RVAL_DECODED.
	* personality.c (sys_personality): Update for RVAL_DECODED.

	printsiginfo.c: use umove_or_printaddr.
	* printsiginfo.c (printsiginfo_at): Use umove_or_printaddr.

	prctl.c: make use of RVAL_DECODED.
	* prctl.c (prctl_enter, prctl_exit): Merge into sys_prctl.
	(sys_prctl, sys_arch_prctl): Update for RVAL_DECODED.

	prctl.c: use printaddr and umove_or_printaddr.
	* prctl.c (prctl_exit): Use printaddr and umove_or_printaddr.

	process.c: use printaddr.
	* process.c (sys_ptrace): Use printaddr.

	process_vm.c: make use of RVAL_DECODED.
	* process_vm.c (sys_process_vm_writev): Update for RVAL_DECODED.

	process_vm.c: use printaddr.
	* process_vm.c (sys_process_vm_readv): Use printaddr.

	reboot.c: make use of RVAL_DECODED.
	* reboot.c (sys_reboot): Update for RVAL_DECODED.

	Enhance quotactl decoding.
	* quota.c (decode_cmd_data): Use umove_or_printaddr.
	(sys_quotactl): Do not disable the parser in verbose mode.
	Decode all "set" commands on entering syscall.

	readahead.c: make use of RVAL_DECODED.
	* readahead.c (sys_readahead.c): Update for RVAL_DECODED.

	readlink.c: use printaddr.
	* readlink.c (decode_readlink): Use printaddr.

	renameat.c: make use of RVAL_DECODED.
	* renameat.c (sys_renameat, sys_renameat2): Update for RVAL_DECODED.

	resource.c: make use of RVAL_DECODED.
	* resource.c (sys_setrlimit, sys_getpriority, sys_setpriority):
	Update for RVAL_DECODED.

	resource.c: use umove_or_printaddr.
	* resource.c (print_rlimit64, print_rlimit32, printrusage32,
	printrusage, sys_times): Use umove_or_printaddr.
	(decode_rlimit64): Remove.
	(decode_rlimit): Remove redundant checks.
	[defined(current_wordsize) && current_wordsize != 4] (decode_rlimit):
	Define to print_rlimit64.
	(sys_prlimit64): Replace decode_rlimit64 with print_rlimit64.

	sched.c: make use of RVAL_DECODED.
	* sched.c (sys_sched_setscheduler, sys_sched_setparam,
	sys_sched_get_priority_min): Update for RVAL_DECODED.

	sched.c: use printnum_int and printaddr.
	* sched.c (sys_sched_setscheduler, sys_sched_getparam,
	sys_sched_setparam): Use printnum_int for sched_param decoding.
	(sched_rr_get_interval): Use printaddr.

	scsi.c: use printaddr.
	* scsi.c (print_sg_io_buffer): Use printaddr.

2015-07-17  Dmitry V. Levin  <ldv@altlinux.org>

	seccomp.c: make use of RVAL_DECODED.
	* seccomp.c (sys_seccomp): Update for RVAL_DECODED.

	seccomp.c: use printaddr and umove_or_printaddr.
	* seccomp.c (decode_fprog, decode_seccomp_set_mode_strict):
	Use printaddr.
	(print_seccomp_filter): Use umove_or_printaddr.

	sigaltstack.c: use printaddr and umove_or_printaddr.
	* sigaltstack.c (print_stack_t): Use umove_or_printaddr and printaddr.

	signal.c: make use of RVAL_DECODED.
	* signal.c (sys_sigsuspend, sys_kill, sys_tgkill, sys_rt_sigsuspend,
	sys_rt_sigqueueinfo, sys_rt_tgsigqueueinfo, sys_restart_syscall,
	do_signalfd): Update for RVAL_DECODED.

	signal.c: use printaddr and umove_or_printaddr.
	* signal.c (print_sigset_addr_len, decode_old_sigaction):
	Use printaddr and umove_or_printaddr.
	(sys_signal): Use printaddr.
	(sys_sigprocmask, sys_sigpending, sys_rt_sigprocmask,
	sys_rt_sigpending): Remove redundant checks for syserror.
	(decode_new_sigaction): Use umove_or_printaddr.

2015-07-16  Dmitry V. Levin  <ldv@altlinux.org>

	sram_alloc.c: make use of RVAL_DECODED.
	* sram_alloc.c [BFIN] (sys_sram_alloc): Update for RVAL_DECODED.

	statfs.c: use umove_or_printaddr.
	* statfs.c (printstatfs, printstatfs64, printcompat_statfs64):
	Use umove_or_printaddr.

	swapon.c: make use of RVAL_DECODED.
	* swapon.c (sys_swapon): Update for RVAL_DECODED.

	swapon.c: move fallback definitions of swap options to xlat/
	* swapon.c: Move definitions of SWAP_FLAG_* flags ...
	* xlat/swap_flags.in: ... here.

	sync_file_range2: fix typo in flags decoding.
	* sync_file_range.c (sys_sync_file_range2): Fix typo in flags decoding.

	sync_file_range.c: make use of RVAL_DECODED.
	* sync_file_range.c (sys_sync_file_range, sys_sync_file_range2): Update
	for RVAL_DECODED.

	syslog.c: use umove_or_printaddr and RVAL_DECODED.
	* sysctl.c (sys_sysctl): Use umove_or_printaddr and RVAL_DECODED.

	sysinfo.c: use umove_or_printaddr.
	* sysinfo.c (sys_sysinfo): Use umove_or_printaddr.

	syslog.c: make use of RVAL_DECODED.
	* syslog.c (sys_syslog): Update for RVAL_DECODED.

	syslog.c: use printaddr.
	* syslog.c (sys_syslog): Use printaddr.

	sysmips.c: cleanup.
	* sysmips.c [MIPS] (sys_sysmips): Use switch statement.  Use printaddr.
	Fix misprinted ", " delimiter.

	sysmips.c: make use of RVAL_DECODED.
	* sysmips.c [MIPS] (sys_sysmips): Update for RVAL_DECODED.

	time.c: make use of RVAL_DECODED.
	* time.c (sys_settimeofday, sys_osf_settimeofday, sys_clock_settime,
	sys_timerfd, sys_timerfd_create, sys_timerfd_settime): Update
	for RVAL_DECODED.
	(timerfd_gettime): Decode struct itimerspec argument on exiting syscall.

	time.c: use printaddr, printnum_int, and umoven_or_printaddr.
	* time.c (sys_nanosleep): Use printaddr.
	(printitv_bitness, tprint_timex32, tprint_timex, printsigevent32,
	printsigevent): Use umoven_or_printaddr.
	(sys_timer_create): Use printnum_int.
	(sys_getitimer, sys_osf_getitimer, sys_setitimer, sys_osf_setitimer,
	do_adjtimex, sys_timer_settime, sys_timer_gettime): Remove
	redundant checks for syserror.

	sprinttv: do not fetch data in case of syserror.
	* time.c (sprinttv): Do not fetch data in case syserror.
	Print address instead of {...} in case of umove failure.
	(sys_gettimeofday, sys_osf_gettimeofday, sys_adjtime, sys_clock_gettime,
	clock_nanosleep): Remove now redundant checks for syserror.

	truncate.c: make use of RVAL_DECODED.
	* truncate.c (sys_truncate, sys_truncate64, sys_ftruncate,
	sys_ftruncate64): Update for RVAL_DECODED.

	umask.c: make use of RVAL_DECODED.
	* umask.c (sys_umask): Update for RVAL_DECODED.

	umount.c: make use of RVAL_DECODED.
	* umount.c (sys_umount2): Update for RVAL_DECODED.

	utimes.c: make use of RVAL_DECODED.
	* utimes.c (decode_utimes): Change to return void.
	Update for RVAL_DECODED.
	(sys_utimes, sys_futimesat, sys_utimensat, sys_osf_utimes):
	Update callers.  Update for RVAL_DECODED.

2015-07-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests/uid.test: adopt for alpha.
	Make the test work on alpha that has getxuid syscall instead of getuid.

	* tests/uid.awk (BEGIN): Update getuid regexp to match both getuid
	and getxuid syscalls.
	* tests/uid.c (main): Allow __NR_getxuid as an alternative
	to __NR_getuid.
	* tests/uid.test: If getuid syscall is not available, probe for
	getxuid syscall.

2015-07-16  Dmitry V. Levin  <ldv@altlinux.org>

	uid.c: make use of RVAL_DECODED.
	* uid.c (sys_setuid, sys_setreuid, sys_setresuid, sys_chown, sys_fchown,
	sys_setgroups): Update for RVAL_DECODED.

	uid.c: use printaddr and umoven_or_printaddr.
	* uid.c (get_print_uid): Use umoven_or_printaddr.
	(sys_getresuid): Do not check for syserror, get_print_uid now does
	the right thing.
	(sys_setgroups, sys_getgroups): Add const qualifier to local variables
	that are assigned once.  Use printaddr.

	ia64: wire up utimensat syscall.
	* linux/ia64/syscallent.h (utimensat): New entry.

	decode_utimes: enclose timespec array in square brackets.
	* utimes.c (decode_utimes): enclose timespec array in square brackets
	instead of curly brackets.

	uname.c: use umove_or_printaddr.
	* uname.c (sys_uname): Use umove_or_printaddr.

	tests: add utime.test.
	* tests/utime.c: New file.
	* tests/utime.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add utime.
	(TESTS): Add utime.test.
	* tests/.gitignore: Add utime.

	utime.c: make use of RVAL_DECODED.
	* utime.c (sys_utime): Update for RVAL_DECODED.

	utime.c: use umoven_or_printaddr.
	* utime.c (sys_utime): Use umoven_or_printaddr.

2015-07-15  Dmitry V. Levin  <ldv@altlinux.org>

	wait.c: use printaddr and umove_or_printaddr.
	* wait.c (waitid): Do not check for NULL the address passed
	to printrusage.
	(printwaitn): Likewise.
	Use printaddr and umove_or_printaddr for fetching wait status.

	wait: move fallback definitions of wait options to xlat/
	* wait.c: Move definitions of __W* flags ...
	* xlat/wait4_options.in: ... here.

	tests: add xattr.test.
	* tests/xattr.c: New file.
	* tests/xattr.expected: Likewise.
	* tests/xattr.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add xattr.
	(TESTS): Add xattr.test.
	(EXTRA_DIST): Add xattr.expected.
	* tests/.gitignore: Add xattr.

2015-07-14  Dmitry V. Levin  <ldv@altlinux.org>

	xattr.c: make use of RVAL_DECODED.
	* xattr.c (sys_setxattr, sys_fsetxattr, sys_removexattr,
	sys_fremovexattr): Update for RVAL_DECODED.

	print_xattr_val: do not fetch data in case of !verbose || syserror.
	* xattr.c (print_xattr_val): Do not fetch data in case
	of !verbose || syserror.   Use printaddr.

	print_xattr_list: use printaddr.
	* xattr.c (print_xattr_list): Use printaddr.

	print_xattr_val: remove unused argument.
	* xattr.c (print_xattr_val): Remove unused "failed" argument.
	(sys_setxattr, sys_fsetxattr, sys_getxattr, sys_fgetxattr): Update
	all callers.

	print_xattr_list: remove redundant address check.
	* xattr.c (print_xattr_list): Do not check for NULL the address passed
	to printstr.

	ipc.c: make use of RVAL_DECODED.
	* ipc.c (sys_mq_notify, sys_mq_open, sys_mq_timedreceive,
	sys_mq_timedsend, sys_msgctl, sys_msgget, sys_msgsnd, sys_semctl,
	sys_semget, sys_semop, sys_semtimedop, sys_shmctl, sys_shmdt,
	sys_shmget): Update for RVAL_DECODED.
	(sys_shmat): Decode all arguments on entering syscall.

2015-07-14  Dmitry V. Levin  <ldv@altlinux.org>

	umoven_or_printaddr: do not fetch data if not in verbose mode.
	After this change, umoven_or_printaddr and its callers, including
	printnum_* and printpair_*, will not fetch data in !verbose mode.

	* util.c (umoven_or_printaddr): Do not call umoven if !verbose.

2015-07-14  Dmitry V. Levin  <ldv@altlinux.org>

	Change printnum_* printers to honor syserror.
	With this change, printnum_* printers will not attempt to fetch data
	in case of exiting(tcp) && syserror(tcp).
	All "at exiting" decoders that call these printers have been made
	ready for this change in previous commits.

	* util.c (DEF_PRINTNUM, DEF_PRINTPAIR): Use umove_or_printaddr.
	* prctl.c (prctl_exit): Use printnum_int and printnum_long.
	(sys_arch_prctl): Do not check for syserror.

2015-07-13  Dmitry V. Levin  <ldv@altlinux.org>

	term.c: enhance tty ioctl parser.
	Decode as much data on entering syscall as possible.

	* term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize,
	decode_modem_flags): New functions.
	(term_ioctl): Use them.  Update for RVAL_DECODED.

2015-07-12  Elvira Khabirova  <lineprinter0@gmail.com>

	Change comparisons with function pointers to comparisons with SENs.
	* pathtrace.c (pathtrace_match): Change all comparisons with function
	pointers to a single SEN based switch.
	* syscall.c (dumpio, trace_syscall_entering): Change all comparisons
	with function pointers to comparisons with SENs.
	* ipc.c (sys_ipc): Remove.
	* sock.c (sys_socketcall): Likewise.
	* linux/dummy.h (sys_ipc, sys_socketcall): New aliases.

	Add unique syscall entry numbers (SENs)
	* Makefile.am (BUILT_SOURCES, CLEANFILES): Add sen.h.
	(syscallent_names, syscallent_patterns, syscallent_files): New variables.
	(sen.h): New rule.
	* defs.h (struct sysent): Add sen field.
	* generate_sen.sh: New file.
	* linux/syscall.h: Include "sen.h".
	* syscall.c (SEN_NAME): New temporary macro.
	(SEN): Use it to prepend syscall entry number.

	Introduce SEN macro.
	* syscall.c (SEN): New temporary macro.
	* linux/dummy.h (sys_printargs): New macro.
	* linux/subcall.h: Wrap all sys_func entries using SEN.
	* linux/*/syscallent*.h: Likewise.

2015-07-10  Dmitry V. Levin  <ldv@altlinux.org>

	scsi.c: enhance SG_IO ioctl parser.
	Fix SG_IO ioctl output in case of failed umove

	* scsi.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>.
	Update for RVAL_DECODED.
	(print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req,
	print_sg_io_v4_res): Do not print address in case of failed umove.
	(scsi_ioctl): Use printaddr.

2015-07-10  Dmitry V. Levin  <ldv@altlinux.org>

	ptp.c: enhance ptp ioctl parser.
	* ptp.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>.
	Update for RVAL_DECODED.
	(ptp_ioctl): Use umove_or_printaddr.

2015-07-10  Dmitry V. Levin  <ldv@altlinux.org>

	mtd.c: enhance mtd and ubi ioctl parsers.
	Decode as much data on entering syscall as possible.

	* xlat/mtd_file_mode_options.in: New file.
	* mtd.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>.
	Include "xlat/mtd_file_mode_options.h".
	Update for RVAL_DECODED.
	(mtd_ioctl, ubi_ioctl): Use printnum_int and umove_or_printaddr.

2015-07-10  Dmitry V. Levin  <ldv@altlinux.org>

	sock.c: enhance socket ioctl parser.
	Decode as much data on entering syscall as possible.

	* sock.c: Update for RVAL_DECODED.
	(print_addr): Remove.
	(print_ifreq_addr, print_ifreq, print_ifc_len, decode_ifconf): New
	functions.
	(sock_ioctl) Use them.  Use umove_or_printaddr.

2015-07-10  Dmitry V. Levin  <ldv@altlinux.org>

	block.c: enhance block ioctl parser.
	* block.c: Update for RVAL_DECODED.
	Define BLKROTATIONAL and BLKZEROOUT.
	(block_ioctl): Decode them.  Use printnum_short, printnum_int,
	printnum_long, printpair_int64, and umove_or_printaddr.
	(print_blkpg_req, block_ioctl): Use umove_or_printaddr.

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	blkpg_ops: add BLKPG_RESIZE_PARTITION constant.
	* xlat/blkpg_ops.in: Add BLKPG_RESIZE_PARTITION.

	Reported-by: Christian Neukirchen <chneukirchen@gmail.com>

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	loop.c: enhance loop ioctl parser.
	Decode as much data on entering syscall as possible.

	* loop.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>.
	Update for RVAL_DECODED.
	(decode_loop_info, decode_loop_info64): New functions.
	(loop_ioctl): Use them.  Decode LOOP_SET_STATUS, LOOP_SET_STATUS64,
	LOOP_SET_FD, LOOP_CHANGE_FD, LOOP_CTL_ADD and LOOP_CTL_REMOVE on
	entering syscall.
	Print LOOP_SET_FD and LOOP_CHANGE_FD arguments using printfd.

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	rtc.c: enhance rtc ioctl parser.
	* rtc.c: Update for RVAL_DECODED.
	(print_rtc): Rename to print_rtc_time.
	(decode_rtc_time, decode_rtc_wkalrm): New functions.
	(rtc_ioctl): Use them.
	[RTC_VL_READ]: Decode RTC_VL_READ.
	Use printnum_long for RTC_IRQP_READ and RTC_EPOCH_READ decoding.

	Use printpair_int.
	* evdev.c (repeat_ioctl): Use printpair_int.
	* net.c (do_pipe, sys_socketpair): Likewise.

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	Add several generic integer pairs printing functions.
	Add functions to fetch and print pairs of integer types.
	Note that these printers do not attempt to fetch data
	in case of exiting(tcp) && syserror(tcp).

	printnum_* printers will follow as soon as all callers are made ready
	for this change.

	* defs.h (printpair_int, printpair_long, printpair_int64): New
	prototypes.
	* util.c (DEF_PRINTPAIR): New macro.
	(printpair_int, printpair_long, printpair_int64): New functions.

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	Add two generic integer printing functions.
	Add printnum_short and printnum_int64 in addition to already existing
	printnum_int and printnum_long.

	* defs.h (printnum_short, printnum_int64): New prototypes.
	* util.c (DEF_PRINTNUM): New macro.
	(printnum_int, printnum_long): Use DEF_PRINTNUM.
	(printnum_short, printnum_int64): New functions.

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	Add address printing functions.
	printaddr is a simple function implementing "print NULL or address"
	idiom.
	umoven_or_printaddr is a wrapper around umoven that has the same return
	value semantics as umoven but also prints the address when the data
	is not going to be fetched (in case of exiting(tcp) && syserror(tcp))
	or cannot be fetched (umoven fails).
	umove_or_printaddr is a macro wrapper around umoven_or_printaddr that
	mirrors umove wrapper around umoven.

	* defs.h (printaddr, umoven_or_printaddr): New prototypes.
	(umove_or_printaddr): New macro.
	* util.c (printaddr, umoven_or_printaddr): New functions.

2015-07-09  Dmitry V. Levin  <ldv@altlinux.org>

	Implement RVAL_DECODED flag.
	Implement a method for "on entering" parsers to return
	"done with decoding" information to their callers.

	If a syscall parser called from trace_syscall_entering returns a value
	with RVAL_DECODED bit set, record this value in tcp->sys_func_rval
	and use it in trace_syscall_exiting instead of calling the parser on
	exiting syscall.

	If an ioctl parser returned RVAL_DECODED, this would tell
	SYS_FUNC(ioctl) that the decoding is finished but fallback printing of
	the ioctl command argument is needed, while e.g. RVAL_DONE+1 would mean
	that the decoding is finished and no fallback decoding is needed.

	* defs.h (struct tcb): Add sys_func_rval.
	(RVAL_DECODED): New macro.
	* syscall.c (trace_syscall_entering): Initialize tcp->sys_func_rval
	along with setting TCB_INSYSCALL flag.
	(trace_syscall_exiting): Use tcp->sys_func_rval instead of calling
	tcp->s_ent->sys_func when the former has RVAL_DECODED flag set.
	Reset tcp->sys_func_rval along with clearing TCB_INSYSCALL flag.
	* ioctl.c (sys_ioctl): Set RVAL_DECODED flag on exiting.
	Print ioctl argument iff RVAL_DECODED is set and fallback decoding
	is requested.

2015-07-05  Dmitry V. Levin  <ldv@altlinux.org>

	time.c: move rtc ioctl parser to a separate file.
	* rtc.c: new file
	* Makefile.am (strace_SOURCES): Add it.
	* time.c (print_rtc, rtc_ioctl): Move to rtc.c.

	term.c: fix typo.
	* term.c: Rename TCLFLSH to TCFLSH.

	Do not include sys/filio.h.
	* configure.ac (AC_CHECK_HEADERS): Remove sys/filio.h.
	* term.c: Do not include <sys/filio.h>.

2015-07-02  Dmitry V. Levin  <ldv@altlinux.org>

	ioctl: prepare ioctl_decode_command_number for future changes.
	* ioctl.c (ioctl_decode_command_number): Change 1st arg to struct tcb*.
	(sys_ioctl): Update callers.

	ioctl: simplify ioctl_decode signature.
	* ioctl.c (ioctl_decode): Remove 2nd and 3rd parameters.
	(sys_ioctl): Update callers.

	ioctl: consistently use name "code" for ioctl request code.
	* ioctl.c (evdev_decode_number, hiddev_decode_number,
	ioctl_decode_command_number): Rename "arg" to "code".

	Move ioctl syscall parser to ioctl.c.
	* io.c (sys_ioctl): Move ...
	* ioctl.c: ... here.
	(ioctl_lookup, ioctl_next_match, ioctl_print_code, ioctl_decode,
	ioctl_decode_command_number): Declare as static.
	* defs.h (ioctl_lookup, ioctl_next_match, ioctl_print_code,
	ioctl_decode, ioctl_decode_command_number): Remove.

	ioctl: remove obsolete registry of ioctl characters.
	* ioctl.c: Remove registry of ioctl characters.

2015-06-30  Dmitry V. Levin  <ldv@altlinux.org>

	Fix filtering of <unavailable> syscalls.
	* syscall.c (trace_syscall_exiting): Skip filtered syscalls also in case
	of get_regs or get_syscall_result failure.
	* tests/filter-unavailable.c: New file.
	* tests/filter-unavailable.expected: Likewise.
	* tests/filter-unavailable.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add filter-unavailable.
	(filter_unavailable_LDFLAGS): Add -pthread.
	(TESTS): Add filter-unavailable.test.
	(EXTRA_DIST): Add filter-unavailable.expected.
	* tests/.gitignore: Add filter-unavailable.

	Reported-by: Bryan Matsuo <bryan.matsuo@gmail.com>

2015-06-30  Dmitry V. Levin  <ldv@altlinux.org>

	Fix -qq option in conjunction with -o option.
	This change makes -qq option work in conjunction with -o option,
	thus complementing commit v4.7-222-g01997cf.

	* strace.c (init): Do not reset qflag.

2015-06-30  Dmitry V. Levin  <ldv@altlinux.org>

	xtensa: wire up new syscalls.
	* linux/xtensa/syscallent.h (bpf, execveat): New entries.

	bfin: wire up new syscalls.
	* linux/bfin/syscallent.h (kcmp, finit_module, sched_setattr,
	sched_getattr, renameat2, seccomp, getrandom, memfd_create,
	bpf, execveat): New entries.

	alpha: wire up new syscalls.
	* linux/alpha/syscallent.h (getrandom, memfd_create, execveat):
	New entries.

2015-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip stat32 test if struct stat is defined incorrectly.
	If stat.st_mode returned by syscall is 0, it means that the definition
	of struct stat in <asm/stat.h> is incorrect.  This is the case e.g. on
	mips n32 where the only available stat syscall is 64-bit but at the same
	time struct stat defined by <asm/stat.h> is 32-bit.

	* tests/stat.c (main) [NR_stat]: Return 77 if st_mode is 0.

2015-06-17  Dmitry V. Levin  <ldv@altlinux.org>

	Consistenly use #ifdef to check for AC_DEFINE'd macros.
	* aio.c (print_common_flags): Use #ifdef in the check for
	HAVE_STRUCT_IOCB_U_C_FLAGS.
	* defs.h: Use #ifdef in the check for HAVE_LITTLE_ENDIAN_LONG_LONG.
	* net.c: Use #ifdef in the check for HAVE_SENDMSG.
	* syscall.c (dumpio): Likewise.
	* printstat.h (DO_PRINTSTAT): Use #ifdef in checks for
	HAVE_STRUCT_STAT_ST_* macros.
	* util.c: Use #ifdef in checks for HAVE_SYS_XATTR_H.

	xattr: move fallback definitions of xattr flags to xlat/
	* xattr.c: Include <sys/xattr.h> insread of <linux/xattr.h>.
	Move definitions of XATTR_* flags ...
	* xlat/xattrflags.in: ... here.

	link: move fallback definitions of AT_* constants to xlat/
	* link.c: Move definitions of AT_* constants ...
	* xlat/at_flags.in: ... here.

	net: move fallback definitions of SOL_* constants to xlat/
	* net.c: Move definitions of SOL_* constants ...
	* xlat/socketlayers.in: ... here.

	futex: move fallback definitions of futex constants to xlat/
	* futex.c: Move definitions of FUTEX_OP_CMP_* constants ...
	* xlat/futexwakecmps.in: ... here.
	* futex.c: Move definitions of other FUTEX_OP_* constants ...
	* xlat/futexwakeops.in: ... here.
	* futex.c: Move definitions of remaining FUTEX_* constants except
	FUTEX_PRIVATE_FLAG and FUTEX_CLOCK_REALTIME flags ...
	* xlat/futexops.in: ... here.

	clone: move definitions of cloning flags to xlat/
	* clone.c: Include <sched.h>.  Move definitions of CLONE_* flags ...
	* xlat/clone_flags.in: ... here.

2015-06-16  Dmitry V. Levin  <ldv@altlinux.org>

	Update mount flags constants.
	* mount.c: Remove definitions of mount flags constants.
	* xlat/mount_flags.in: Update from linux v4.0, add default values.

	mount: update parser to match kernel behaviour.
	* mount.c (sys_mount): Do not decode type and data strings for
	MS_SHARED, MS_PRIVATE, MS_SLAVE, and MS_UNBINDABLE mount flags
	that do not imply valid strings.

	mount: robustify MS_MGC_VAL decoding.
	* mount.c (sys_mount): When printing mount flags, do not assume that
	(flags & MS_MGC_MSK) == MS_MGC_VAL.

2015-06-08  Dmitry V. Levin  <ldv@altlinux.org>

	net: decode setsockopt() multicast arguments.
	* configure.ac (AC_CHECK_FUNCS): Add inet_pton.
	* net.c (print_mreq, print_mreq6): New functions.
	(print_setsockopt): Use them to decode IP_ADD_MEMBERSHIP,
	IP_DROP_MEMBERSHIP, IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP,
	IPV6_JOIN_ANYCAST, and IPV6_LEAVE_ANYCAST.
	* tests/ip_mreq.c: New file.
	* tests/ip_mreq.expected: Likewise.
	* tests/ip_mreq.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add ip_mreq.
	(TESTS): Add ip_mreq.test.
	(EXTRA_DIST): ip_mreq.expected.
	* tests/.gitignore: Add ip_mreq.

	Based on patch by Ben Noordhuis <info@bnoordhuis.nl>.

2015-06-08  Dmitry V. Levin  <ldv@altlinux.org>

	Update IPV6 socket options constants.
	* xlat/sockipv6options.in: Update from linux v4.0.

2015-06-05  Dmitry V. Levin  <ldv@altlinux.org>

	net: factor out interface index printing code.
	* net.c (print_ifindex): New function.
	(printsock) [HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID]: Use it.

2015-05-25  Dmitry V. Levin  <ldv@altlinux.org>

	Consistently use error_msg instead of fprintf(stderr)
	* linux/alpha/get_scno.c: Use error_msg.
	* linux/arm/get_scno.c: Likewise.
	* linux/mips/get_scno.c: Likewise.
	* linux/sh/get_scno.c: Likewise.
	* linux/x86_64/get_scno.c: Likewise.
	* exit.c (sys_exit): Likewise.
	* pathtrace.c (pathtrace_select, pathtrace_match): Likewise.
	* strace.c (alloctcb, droptcb, detach, startup_attach,
	test_ptrace_seize, init, cleanup, print_debug_info,
	maybe_allocate_tcb, startup_tcb, trace): Likewise.
	* syscall.c (update_personality, trace_syscall_exiting,
	get_scno): Likewise.
	* unwind.c (DPRINTF): Likewise.
	* tests/bexecve.test: Update patterns.
	* tests/detach-stopped.test: Likewise.

	Consistently print OOM diagnostic messages.
	* bjm.c (sys_query_module): Use error_msg to print OOM diagnostics.
	* util.c (dumpiov, dumpstr): Likewise.

2015-05-25  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce memory allocation wrappers.
	Introduce wrappers to the following functions that do memory allocation:
	malloc, calloc, realloc, strdup.

	This commit is a follow-up to the related discussions in strace-devel ML:
	http://sourceforge.net/p/strace/mailman/message/33618180/
	http://sourceforge.net/p/strace/mailman/message/33733470/

	* defs.h (xmalloc, xcalloc, xreallocarray, xstrdup): New prototypes.
	* xmalloc.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* count.c (count_syscall, call_summary_pers): Use xcalloc.
	* desc.c (decode_select): Use xmalloc.
	* dirent.c (sys_getdents, sys_getdents64): Likewise.
	* net.c (sys_recvmmsg): Use xstrdup.
	* pathtrace.c (storepath): Use xreallocarray.
	(pathtrace_match): Use xmalloc.
	* strace.c (die_out_of_memory): Move to xmalloc.c.
	(expand_tcbtab): Use xcalloc and xreallocarray.
	(startup_child): Use xstrdup.
	(init): Use xmalloc, xcalloc, and xstrdup.
	* syscall.c (reallocate_qual): Use xreallocarray.
	(qualify): Use xstrdup.
	* unwind.c (unwind_tcb_init): Use xmalloc.
	(build_mmap_cache): Use xcalloc, xreallocarray, and xstrdup.
	(get_symbol_name): Use xreallocarray.
	(stacktrace_walk, queue_put): Use xmalloc.
	* util.c (printstr): Use xmalloc.
	* vsprintf.c (strace_vfprintf): Likewise.

2015-05-21  Dmitry V. Levin  <ldv@altlinux.org>

	Fix ioctl entries on 32-bit architectures with 64-bit aligned structures
	Some ioctl constants are defined to different values on those 32-bit
	architectures where structures containing a 64-bit field are aligned on
	a 8-byte boundary and have a size multiple of 8 bytes, and on other
	32-bit architectures.

	* configure.ac: Check the size of a structure containing a 64-bit field.
	* linux/32/ioctls_inc.h: Rename to ...
	* linux/32/ioctls_inc_align32.h: ... this.
	* linux/32/ioctls_inc_align64.h: New file.
	* linux/32/ioctls_inc.h: Include either 32/ioctls_inc_align32.h
	or ioctls_inc_align64.h depending on SIZEOF_STRUCT_I64_I32.
	* Makefile.am (EXTRA_DIST): Add linux/32/ioctls_inc_align32.h and
	* linux/32/ioctls_inc_align64.h.
	* tests/ioctl.c (main): Test for VIDIOC_ENUMINPUT.
	* tests/ioctl.expected: Check VIDIOC_ENUMINPUT decoding.

	Reported-by: Philippe De Muyter <phdm@macqel.be>

2015-05-21  Dmitry V. Levin  <ldv@altlinux.org>

	maint: make linux/kvm.h parseable on arm.
	* maint/ioctls_sym.sh [AARCH64 || ARM]: Add missing definitions for
	structures referenced from linux/kvm.h.

2015-05-21  Philippe De Muyter  <phdm@macqel.be>

	v4l2: add decoding for VIDIOC_S_CROP's arg.
	* v4l2.c (v4l2_ioctl): Add decoding for VIDIOC_S_CROP's arg.

2015-05-19  Ezequiel Garcia  <ezequiel@vanguardiasur.com.ar>

	Add support for Altera's Nios-II softcore architecture.
	This commit adds strace support for Altera's Nios-II.  The architecture
	is supported by Linux since v3.19, and it implements the generic syscall
	ABI.

	* configure.ac: Add nios2 support.
	* cacheflush.c [NIOS2] (sys_cacheflush): New function.
	* linux/nios2/*: New Nios-II specific files.
	* Makefile.am (EXTRA_DIST): Add them.

2015-05-19  Philippe De Muyter  <phdm@macqel.be>

	v4l2: VIDIOC_CROPCAP: add missing braces around arg printout.
	* v4l2.c (v4l2_ioctl): case VIDIOC_CROPCAP: add missing braces around arg
	printout.

2015-05-19  Dmitry V. Levin  <ldv@altlinux.org>

	maint: avoid effects of locale when sorting files.
	* maint/ioctls_gen.sh: Invoke sort with LC_COLLATE=C.
	* maint/ioctls_hex.sh: Likewise.
	* maint/ioctls_sym.sh: Likewise.

	Reported-by: Philippe De Muyter <phdm@macqel.be>

2015-04-18  Philippe De Muyter  <phdm@macqel.be>

	v4l2: add decoding for VIDIOC_CREATE_BUFS's arg.
	* v4l2.c (v4l2_ioctl): Add decoding for VIDIOC_CREATE_BUFS's arg.

2015-04-17  Dmitry V. Levin  <ldv@altlinux.org>

	mips o32: decode indirect syscall.
	Implement decoding of MIPS O32 specific indirect syscall.

	* syscall.c [LINUX_MIPSO32] (decode_mips_subcall, sys_syscall):
	New functions.
	(trace_syscall_entering) [LINUX_MIPSO32]: Use decode_mips_subcall.
	* linux/mips/syscallent-o32.h (4000): Change sys_func to sys_syscall.

	Reported-and-tested-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>

2015-04-14  Dmitry V. Levin  <ldv@altlinux.org>

	debian: add gawk to Build-Depends.
	* debian/control (Build-Depends): Add gawk.
	Patch by Reiner Herrmann <reiner@reiner-h.de>.

	This fixes Debian bug #780992.

2015-04-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix bexecve.test for the case of mixed personalities.
	Fix bexecve.test when the executable being run does not match the
	native architecture.

	* tests/bexecve.test: Use "set_ptracer_any" instead of "sh".
	Allow for a personality switch notification in the strace output.

2015-04-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a test for "resuming interrupted nanosleep"
	* tests/restart_syscall.test: New test.
	* tests/restart_syscall.expected: New file.
	* tests/restart_syscall_unknown.expected: Likewise.
	* tests/Makefile.am (TESTS): Add restart_syscall.test.
	(EXTRA_DIST): Add restart_syscall.expected
	(TEST_LOG_COMPILER): Change to "env".
	(OS, ARCH, AM_TEST_LOG_FLAGS): Define.
	and restart_syscall_unknown.expected.

	tests: strip executable bit from *.expected files.

2015-04-07  Dmitry V. Levin  <ldv@altlinux.org>

	Declare syscall parsers using SYS_FUNC macro.
	Introduce SYS_FUNC macro to declare and define all syscall parsers.

	* Makefile.am (BUILT_SOURCES, CLEANFILES): Add sys_func.h.
	(sys_func.h): New rule.
	* defs.h (SYS_FUNC_NAME, SYS_FUNC): New macros.
	* linux/syscall.h: Include "sys_func.h".
	[NEED_UID16_PARSERS]: Use SYS_FUNC to declare uid16 syscall parsers.
	Remove other declarations.
	* linux/alpha/syscallent.h (160, 161): Add sys_ prefix to osf_statfs
	and osf_fstatfs syscall parsers.
	* *.c: Use SYS_FUNC to define syscall parsers.

2015-04-07  Denys Vlasenko  <dvlasenk@redhat.com>

	Fix confusing "resuming interrupted unknown" message.
	Dmitry reported seeing the following:

	    $ sleep 2 & sleep 1; ./strace -erestart_syscall -p $!
	    [1] 12345
	    Process 12345 attached
	    restart_syscall(<... resuming interrupted unknown ...>) = 0

	Fixing it by replacing "unknown" with "system call".

2015-04-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: workaround old gawk versions that do not provide @include support
	Some of our tests use GNU awk @include extension, but not all currently
	used versions of GNU awk support it.  Skip these tests if gawk does not
	provide @include support.

	* tests/init.sh (check_gawk): New function.
	(match_awk): Use it.

2015-04-06  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite umovestr2.test without using grep.
	The regular expression generated by umovestr2.c on systems with large
	page size is too big for GNU grep.  Rewrite the test to use diff
	instead of grep.

	* tests/umovestr2.test: Use match_diff instead of match_grep.
	* tests/umovestr2.c (main): Convert output from regexp to plain text.

2015-03-31  Dmitry V. Levin  <ldv@altlinux.org>

	Cleanup process_vm_writev syscall decoding.
	* process_vm.c (sys_process_vm_writev): Do not check for syserror,
	it is not applicable on entering syscall.

	umovestr: read chunks of memory up to pagesize at a time.
	* defs.h (get_pagesize): New prototype.
	* mem.c (get_pagesize) Make global.
	* util.c (PAGMASK): Remove.
	(vm_read_mem): New process_vm_readv proxy function.
	(umoven, umovestr): Use it.
	(umovestr): Read chunks up to pagesize at a time.

2015-03-31  Dmitry V. Levin  <ldv@altlinux.org>

	umovestr: fix short read bug.
	* util.c (umovestr): Check the right address.
	* tests/umovestr.c: New file.
	* tests/umovestr2.c: Likewise.
	* tests/umovestr.expected: Likewise.
	* tests/umovestr.test: New test.
	* tests/umovestr2.test: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add umovestr and umovestr2.
	(TESTS): Add umovestr.test and umovestr2.test.
	(EXTRA_DIST): Add umovestr.expected.
	* tests/.gitignore: Add umovestr and umovestr2.

	Reported-by: Josef T. Burger <bolo@cs.wisc.edu>

2015-03-31  Dmitry V. Levin  <ldv@altlinux.org>

	When process_vm_readv fails with EPERM, try PTRACE_PEEKDATA.
	process_vm_readv() and ptrace(PTRACE_PEEKDATA) have inconsistent access
	control rules wrt traced processes: process_vm_readv() is more likely to
	fail with EPERM than ptrace(PTRACE_PEEKDATA) when tracing a process that
	has execve'd a privileged executable.

	* util.c (umoven, umovestr): If process_vm_readv returned EPERM,
	fall back to ptrace(PTRACE_PEEKDATA).

	Reported-by: Andrew Guertin <lists@dolphinling.net>

2015-03-30  Dmitry V. Levin  <ldv@altlinux.org>

	Use macros for gcc attributes.
	* defs.h (error_msg, perror_msg, error_msg_and_die, perror_msg_and_die,
	die_out_of_memory, printllval, printnum_int, printnum_long, tprintf):
	Use ATTRIBUTE_* macros for gcc attributes.
	* file.c (struct stat64): Likewise.
	* statfs.c (struct compat_statfs64): Likewise.
	* strace.c (die, exec_or_die, init): Likewise.
	* linux/sparc/arch_sigreturn.c: Likewise.
	* linux/ubi-user.h: Likewise.

2015-03-30  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce macros for gcc attributes.
	Define macros for gcc attributes that are already in use
	or going to be used soon.

	* defs.h (GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT,
	ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC,
	ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): New macros.

2015-03-28  Felix Janda  <felix.janda@posteo.de>

	Include <linux/ioctl.h> for _IOC_* macros.
	Fix a compilation failure with musl libc.

	* evdev.c: Include <linux/ioctl.h>.
	* ioctl.c: Include <linux/ioctl.h> instead of <asm/ioctl.h>.
	* ioctlsort.c: Likewise.

	Reported-by: Dima Krasner <dima@dimakrasner.com>
	Acked-by: Mike Frysinger <vapier@gentoo.org>

2015-03-28  Felix Janda  <felix.janda@posteo.de>

	Include <sys/stat.h> for S_I* macros.
	Fix a compilation failure with musl libc.

	* mknod.c: Include <sys/stat.h>.
	* printmode.c: Likewise.

	Reported-by: Dima Krasner <dima@dimakrasner.com>
	Acked-by: Mike Frysinger <vapier@gentoo.org>

2015-03-27  Dmitry V. Levin  <ldv@altlinux.org>

	signal.c: move siginfo_t parsers to a separate file.
	* printsiginfo.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (printsiginfo): Change second argument's type from int to bool.
	* signal.c: Stop defining siginfo_t related constants.
	Move inclusion of xlat/sig*_codes.h files to printsiginfo.c
	(printsigsource, printsigval, printsiginfo_at): Move to printsiginfo.c.
	(printsiginfo): Change second argument's type from int to bool,
	split, and move to printsiginfo.c.

	Update siginfo_t constants.
	* xlat/sigbus_codes.in: Add BUS_MCEERR_AR and BUS_MCEERR_AO,
	add default values.
	* xlat/sigtrap_codes.in: Add TRAP_BRANCH and TRAP_HWBKPT,
	add default values.
	* xlat/sigsegv_codes.in: Add SEGV_BNDERR, add default values.
	* xlat/sigchld_codes.in: Add default values.
	* xlat/sigemt_codes.in: Likewise.
	* xlat/sigfpe_codes.in: Likewise.
	* xlat/sigill_codes.in: Likewise.
	* xlat/siginfo_codes.in: Likewise.
	* xlat/sigpoll_codes.in: Likewise.
	* xlat/sigsys_codes.in: Likewise.

2015-03-26  Dmitry V. Levin  <ldv@altlinux.org>

	signal.c: move sigaltstack parser to a separate file.
	* sigaltstack.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* signal.c (print_stack_t, sys_sigaltstack): Move to sigaltstack.c.
	* xlat/sigaltstack_flags.in: Add default values.

2015-03-25  Denys Vlasenko  <dvlasenk@redhat.com>

	Move sparc64 get_scno() code where it belongs.

	sparc: rename personality 2 files to personality 1.
	Run-tested in qemu 32-bit sparc.

2015-03-25  Denys Vlasenko  <dvlasenk@redhat.com>

	sparc: delete personality 1.
	Personality 1 for sparc and sparc64 appears to be an old attempt
	to support stracing Solaris binaries.

	It stalled after the only syscall, solaris_open, was covered:
	all other solaris_foo's are printargs.

	This change deletes personality 1. Now sparc is an one-personality
	arch, and sparc64 is a two-personality one.

	For clarity, pure renaming of personality 2 files to personality 1 for sparc64
	is performed in the next commit - this prevents a state where syscallent1.h
	seems to indergo a lot of changes, where in fact in is deleted, and then
	replaced by syscallent2.h

	Therefore, tree at this commit will not build.

2015-03-24  Denys Vlasenko  <dvlasenk@redhat.com>

	qemu_multiarch_testing/*: make it easier to do debug in sandboxes.

2015-03-24  Denys Vlasenko  <dvlasenk@redhat.com>

	sparc: fix v4.10-25-g8497b62 fallout.
	Before:

	$ sleep 3 & ./strace -p $!
	Process 8703 attached
	syscall: unknown syscall trap 1a800003 00025d58
	syscall_516(0, 0x40080000, 0, 0xfc000f00, 0x28, 0xefc03b18) = 0
	exit_group(0)                           = ?
	+++ exited with 0 +++

	After:

	$ sleep 3 & ./strace -p $!
	Process 8725 attached
	restart_syscall(<... resuming interrupted nanosleep ...>) = 0
	exit_group(0)                           = ?
	+++ exited with 0 +++

2015-03-24  Dmitry V. Levin  <ldv@altlinux.org>

	get_scno: add diagnostics for invalid syscall numbers.
	* syscall.c (get_scno): Print a debug level message
	for !SCNO_IS_VALID syscall numbers.

2015-03-24  Dmitry V. Levin  <ldv@altlinux.org>

	arm: fix v4.10-25-g8497b62 fallout.
	Starting with commit v4.10-25-g8497b62,

	arm$ ./strace true
	pid 1234 stray syscall exit
	Segmentation fault

	Fix this by updating ARM syscall sanity check.
	In particular, get_scno() should not set TCB_INSYSCALL flag because
	other code assumes that s_ent is properly initialized when this flag
	is set.

	* linux/arm/get_scno.c: Check syscall number after fetching.
	Do not apply the check to SCNO_IN_RANGE syscalls.
	Do not set TCB_INSYSCALL flag.
	Extend diagnostics and move it to debug level.

2015-03-24  Dmitry V. Levin  <ldv@altlinux.org>

	mips: fix pipe syscall decoding.
	* linux/mips/arch_getrval2.c: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* defs.h [MIPS] (HAVE_GETRVAL2): Define.

2015-03-23  Dmitry V. Levin  <ldv@altlinux.org>

	sigreturn.c: split arch specific code into separate arch files.
	Split code that use arch-specific registers to separate arch files.

	* sigreturn.c (sys_sigreturn): Move arch-specific code
	to linux/*/arch_sigreturn.c, include "arch_sigreturn.c".
	* linux/arch_sigreturn.c: New file.
	* Makefile.am (EXTRA_DIST): Add linux/arch_sigreturn.c
	and linux/*/arch_sigreturn.c files.

2015-03-23  Dmitry V. Levin  <ldv@altlinux.org>

	syscall.c: split arch specific code into separate arch files.
	Split code that use arch-specific registers to separate arch files.

	* syscall.c: Move definitions of variables containing fetched registers
	to linux/*/arch_regs.c files.
	[HAVE_GETRVAL2] (getrval2): Move arch-specific code
	to linux/*/arch_getrval2.c, include "arch_getrval2.c".
	(print_pc): Move arch-specific code to linux/*/print_pc.c files,
	include "print_pc.c".
	[X86_64] (x86_64_getregs_old): Rename to getregs_old, move to
	linux/x86_64/getregs_old.c, include "getregs_old.c".
	[POWERPC] (powerpc_getregs_old): Rename to getregs_old, move to
	linux/powerpc/getregs_old.c, include "getregs_old.c".
	(get_regs) [X86_64, POWERPC]: Update callers.
	(get_scno): Move arch-specific code to linux/*/get_scno.c,
	include "get_scno.c".
	(get_syscall_args): Move arch-specific code
	to linux/*/get_syscall_args.c, include "get_syscall_args.c".
	(get_error): Move arch-specific code to linux/*/get_error.c,
	include "get_error.c".
	(get_syscall_result): Move arch-specific code
	to linux/*/get_syscall_result.c, include "get_syscall_result.c".
	* Makefile.am (EXTRA_DIST): Add new linux/*/*.c files.

2015-03-23  Dmitry V. Levin  <ldv@altlinux.org>

	syscall.c: prepare for the split.
	Move functions that use arch-specific registers to the end of file.

2015-03-23  Dmitry V. Levin  <ldv@altlinux.org>

	Move get_regs error check from trace_syscall_entering to get_scno.
	Starting with commit v4.10-25-g8497b62, get_scno() can be called outside
	trace_syscall_entering(), so move the get_regs_error check from
	trace_syscall_entering() to get_scno().

	* syscall.c (trace_syscall_entering): Move get_regs_error check ...
	(get_scno): ... here.

2015-03-23  Dmitry V. Levin  <ldv@altlinux.org>

	alpha, ia64, sh, sparc, sparc64: fix pipe and pipe2 syscalls decoding.
	Fix pipe syscall decoding on alpha.
	Fix pipe2 syscall decoding on ia64, sh, sparc, and sparc64.

	* configure.ac (AC_CHECK_FUNCS): Add pipe2.
	* defs.h [ALPHA || IA64 || SH || SPARC || SPARC64] (HAVE_GETRVAL2):
	Define.
	* net.c (do_pipe): Check HAVE_GETRVAL2 instead of architecture macros.
	Do not use getrval2 for pipe2 decoding.
	Print address if umove call fails.
	* syscall.c (getrval2): Check HAVE_GETRVAL2 instead of architecture
	macros.  Implement for [ALPHA].
	* tests/pipe.c: New file.
	* tests/pipe.expected: New file.
	* tests/pipe.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add pipe.
	(TESTS): Add pipe.test.
	(EXTRA_DIST): Add pipe.expected.
	* tests/.gitignore: Add pipe.

2015-03-22  Dmitry V. Levin  <ldv@altlinux.org>

	decode_socket_subcall: fetch all arguments with a single umoven call.
	* syscall.c (decode_socket_subcall): Replace umoven fetch loop
	with a single umoven call.

2015-03-21  Denys Vlasenko  <dvlasenk@redhat.com>

	New test: test/many_looping_threads.c.

	test/.gitignore: add missing test targets.

	Trivial optimization in sys_sigreturn()

	Change last parameter of umoven() from char* to void*
	Saves tons of casts.

	Remove unused struct tcb::inst field.
	It is unused since we dropped support for kernels without PTRACE_SETOPTIONS.

	test/Makefile: add missing test targets.

	Move the comment about termination logic where it belongs.

	startup_tcb() never fails, remove code which checks for failures.

2015-03-21  Denys Vlasenko  <dvlasenk@redhat.com>

	Show the syscall name in "resuming interrupted call" message.
	When signal is received, or if we have attached to a process,
	current syscall (if process is in one) gets restarted.

	Some syscalls are restarted via "restart_syscall()" mechanism.
	On such sycalls, we don't show _which_ syscall gets restarted.

	IOW: users want to see "resuming interrupted nanosleep"
	instead of "resuming interrupted call" when they attach to "sleep 999".

	Kernel does expose this information. The only thing we need is
	to fetch syscall# on attach, and save it.

	This patch does this. It adds tcp->s_prev_ent, which is
	a pointer to struct_sysent of the previous syscall of this tracee.
	It can be NULL.

	sys_restart_syscall() is made to use it when the message is generated.

	To similarly handle restart_syscall() *after signals*, not just
	on attach, on each syscall exit patch saves exited syscall's data
	in the same member (tcp->s_prev_ent).

	Example:

	    $ sleep 3 & strace -p $!
	    Process 8728 attached
	    restart_syscall(<... resuming interrupted nanosleep ...>) = 0
	    _exit(0)                                = ?
	    +++ exited with 0 +++

2015-03-20  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a test for mmap/mprotect/munmap decoding.
	* tests/mmap.c: New file.
	* tests/mmap64.c: New file.
	* tests/mmap.test: New test.
	* tests/mmap64.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add mmap and mmap64.
	(mmap64_CFLAGS): Define.
	(TESTS): Add mmap.test and mmap64.test.
	* tests/.gitignore: Add mmap and mmap64.

	sparc, sparc64: fix decoding of mmap2.
	* linux/sparc/syscallent.h (mmap2): Decode with sys_mmap_4koff,
	not sys_mmap.
	* linux/sparc64/syscallent2.h (mmap2): Decode with sys_mmap_pgoff,
	not sys_mmap.

2015-03-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a test for SECCOMP_MODE_FILTER decoding.
	* tests/seccomp.c: New file.
	* tests/seccomp.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add seccomp.
	(TESTS): Add seccomp.test.
	* tests/.gitignore: Add seccomp.

2015-03-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: factor out common awk code.
	Factor out awk code used in several tests to match.awk.

	* tests/match.awk: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/caps.awk: Use it.
	* tests/getdents.awk: Likewise.
	* tests/getrandom.awk: Likewise.
	* tests/select.awk: Likewise.
	* tests/sigaction.awk: Likewise.
	* tests/init.sh (match_awk): Use gawk not awk.  Define AWKPATH.
	* tests/getdents.test: Likewise.

2015-03-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip netlink based tests when resources are not available.
	* tests/netlink_inet_diag.c (main): Return 77 if socket, bind,
	or listen syscall fail.
	* tests/netlink_unix_diag.c (main): Likewise.

2015-03-18  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64, arm: decode extra padded compat struct statfs64.
	According to arch/arm/kernel/sys_oabi-compat.c,
	struct statfs64 has extra padding with EABI.

	* statfs.c [AARCH64 || defined ARM] (COMPAT_STATFS64_PADDED_SIZE):
	Define.
	(do_statfs64_fstatfs64): New function, factored out from sys_statfs64.
	[COMPAT_STATFS64_PADDED_SIZE]: Check it in addition to
	sizeof(struct compat_statfs64).
	(sys_statfs64, sys_fstatfs64): Use do_statfs64_fstatfs64.

	Reported-and-tested-by: Elliott Hughes <enh@google.com>

2015-03-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: factor out common shell code to functions.
	Factor out shell code used in several tests to common functions.

	* tests/fanotify_mark.expected: New file.
	* tests/ioctl.expected: New file.
	* tests/net-fd.expected: New file.
	* tests/net.expected: New file.
	* tests/statfs.expected: New file.
	* tests/sun_path.expected: New file.
	* tests/uio.expected: New file.
	* tests/ipc.sh: New file.
	* tests/Makefile.am (EXTRA_DIST): Add them.
	* tests/init.sh (dump_log_and_fail_with, run_prog,
	run_prog_skip_if_failed, run_strace, run_strace_merge,
	match_awk, match_diff, match_grep): New functions.
	* tests/*.test: Use them.

2015-03-18  Elliott Hughes  <enh@google.com>

	Show f_flags field in printstatfs.
	printstatfs64 was right, but printstatfs was missing f_flags.
	Noticed on aarch64.

	* statfs.c (printstatfs) [_STATFS_F_FLAGS]: Print statfs.f_flags.

2015-03-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests/uid*: use fchown* instead of chown*
	Newer architectures have no chown syscall, so use fchown* syscalls
	for testing printuid.

	* tests/uid.test: Use fchown instead of chown.
	* tests/uid.c: Test __NR_fchown instead of __NR_chown.
	(main): Use __NR_fchown instead of __NR_chown.
	* tests/uid32.c: Test __NR_fchown32 instead of __NR_chown32.
	(main): Use __NR_fchown32 instead of __NR_chown32.
	* tests/uid16.c: Test __NR_fchown and __NR_fchown32 instead
	of __NR_chown and __NR_chown32.
	(main): Use __NR_fchown instead of __NR_chown.
	* tests/uid.awk: Update regexp.

2015-03-16  Dmitry V. Levin  <ldv@altlinux.org>

	stat64-v.test: add newfstatat syscall support.
	Newer architectures have no stat syscall, so stat() is implemented there
	using newfstatat syscall.

	* tests/stat.c (STAT_FNAME): Rename to STAT_PREFIX.  Update callers.
	[_FILE_OFFSET_BITS == 64] (STAT_PREFIX): Add newfstatat support.
	(main) [!NR_stat]: Add newfstatat support.

	Reported-by: Andreas Schwab <schwab@suse.de>

2015-03-16  Andreas Schwab  <schwab@suse.de>

	aarch64: properly decode generic syscalls.
	* linux/aarch64/syscallent1.h: Don't override entries 277 to 1023.

	tests: verify that all patterns match.
	* tests/ipc_msg.test: Count matches to verify that all patterns match.
	* tests/ipc_sem.test: Likewise.
	* tests/ipc_shm.test: Likewise.
	* tests/stat32-v.test: Likewise.
	* tests/stat64-v.test: Likewise.

2015-03-16  Dmitry V. Levin  <ldv@altlinux.org>

	Fix stat64 st_[acm]time decoding for personalities with 32-bit time_t.
	STRUCT_STAT.st_[acm]time are declared as unsigned int for some
	personalities, while time_t is signed.

	* printstat.h (DO_PRINTSTAT): If st_[acm]time have the same size as int,
	explicitly cast them to int.
	* tests/stat64-v.test: Test that negative time_t is decoded properly.

	Reported-by: Andreas Schwab <schwab@suse.de>

2015-03-16  Dmitry V. Levin  <ldv@altlinux.org>

	semctl: fix indirect syscall decoding.
	On architectures where the semctl call is implemented by the ipc syscall
	the 4th argument is passed by reference.

	* ipc.c (sys_semctl): Handle the indirect ipc subcall case.
	* tests/ipc_sem.c (main): Optionally match indirection
	in the 4th argument of semctl calls.

	Reported-by: Andreas Schwab <schwab@suse.de>

2015-03-16  Andreas Schwab  <schwab@suse.de>

	tests/ipc_*: match IPC_64 flag.
	* tests/ipc_msg.c (main): Optionally match "IPC_64|" in the third
	argument of the ipc call.
	* tests/ipc_sem.c (main): Likewise.
	* tests/ipc_shm.c (main): Likewise.

2015-03-16  Andreas Schwab  <schwab@suse.de>

	Fix crash in ipc_sem test.
	Properly use union semun as argument of semctl.

	* tests/ipc_sem.c (main): Properly use union semun as argument of
	semctl.  Don't handle EFAULT specially.
	* tests/ipc_sem.test: Revert last change.

2015-03-16  Andreas Schwab  <schwab@suse.de>

	m68k: fix sigreturn decoding.
	* sigreturn.c (sys_sigreturn) [M68K]: Fetch the words of the
	signal mask from the proper place.

	aarch64: fix ioctl decoding.
	* linux/aarch64/ioctls_inc0.h: Rename from ioctls_inc1.h.
	* linux/aarch64/ioctls_inc1.h: Rename from ioctls_inc0.h.
	* linux/aarch64/ioctls_arch0.h: Rename from ioctls_arch1.h.
	* linux/aarch64/ioctls_arch1.h: Rename from ioctls_arch0.h.

2015-03-12  Andreas Schwab  <schwab@suse.de>

	tests/select.test: handle architectures using pselect6 syscall.
	* tests/select.awk (BEGIN): Update regexps to match both select
	and pselect6 syscalls.
	* tests/select.test: Probe for both select and pselect6 syscall.

	Distribute linux/aarch64/arch_regs.h.
	* Makefile.am (EXTRA_DIST): Add linux/aarch64/arch_regs.h.

	Fix decoding of mmap2 for arm.
	* syscallent.h (mmap2): Decode with sys_mmap_4koff, not
	sys_mmap_pgoff.

2015-03-12  Andreas Schwab  <schwab@suse.de>

	m68k: define HAVE_SA_RESTORER.
	On m68k the kernel sigaction structure has the sa_restorer member for
	historical reasons.

	* signal.c (HAVE_SA_RESTORER): Define for M68K.

2015-03-11  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64: fix rt_sigreturn decoding.
	* sigreturn.c (sys_sigreturn) [AARCH64]: Fix personality check.

2015-03-09  Dmitry V. Levin  <ldv@altlinux.org>

	maint: post-release administrivia.
	* NEWS: Add header line for next release.

2015-03-06  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.10 release.
	* NEWS: Update for 4.10 release.
	* debian/changelog: 4.10-1.
	* strace.spec: 4.10-1.

	Move sigreturn/rt_sigreturn parser to a separate file.
	* sigreturn.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (sprintsigmask_n): New prototype.
	(tprintsigmask_addr): New macro.
	* signal.c (sprintsigmask_n): Make global.
	(tprintsigmask_addr): Remove.
	(sys_sigreturn): Move to sigreturn.c.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: use PTRACE_GETREGS to fetch registers.
	* linux/ia64/arch_regs.h: Stop including <asm/rse.h>.
	(ia64_frame_ptr): New declaration.
	* signal.c (sys_sigreturn) [IA64]: Use ia64_frame_ptr.
	* syscall.c [IA64]: Include <asm/rse.h>.
	[IA64] (ia64_regs, ia64_frame_ptr): New variable.
	[IA64] (ARCH_REGS_FOR_GETREGS): New macro.
	[IA64] (ia64_ia32mode): Convert to macro.
	[IA64] (ia64_r8, ia64_r10): Remove.
	(getrval2, print_pc, get_scno, get_syscall_args, get_error) [IA64]:
	Use ia64_regs.
	(get_syscall_result) [IA64]: Remove.

	s390, s390x: use PTRACE_GETREGSET to fetch registers.
	* linux/s390/arch_regs.h: New file.
	* linux/s390x/arch_regs.h: New file.
	* Makefile.am (EXTRA_DIST): Add them.
	* signal.c (sys_sigreturn) [S390 || S390X]: Use s390_frame_ptr.
	* syscall.c [S390 || S390X] (s390_regset, s390_frame_ptr): New variable.
	[S390 || S390X] (ARCH_REGS_FOR_GETREGSET): New macro.
	(print_pc) [S390 || S390X]: Use s390_regset.
	(get_scno) [S390 || S390X]: Likewise.
	(get_syscall_args) [S390 || S390X]: Likewise.
	(get_error) [S390 || S390X]: Likewise.
	(get_syscall_result) [S390 || S390X]: Remove.

	qemu_multiarch_testing: update.
	* qemu_multiarch_testing/README: Update statistics.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify unix-yy.test.
	Implement additional synchronization between parent and child processes
	to guarantee that the child starts closing connected socket only after
	exiting of the parent's accept() syscall.
	This guarantee seems to be necessary to reliably receive UNIX_DIAG_PEER
	messages from NETLINK_SOCK_DIAG interface.

	* tests/net-accept-connect.c: Implement additional synchronization
	between parent and child processes.
	* tests/unix-yy-connect.awk: Update.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	Use SIGRTMIN from kernel headers.
	* configure.ac (ASM_SIGRTMIN): Define to SIGRTMIN from <asm/signal.h>.
	* signal.c: Use ASM_SIGRTMIN instead of constants provided by libc.
	* tests/sigreturn.c: Use ASM_SIGRTMIN instead of hardcoded value.
	Use lower RT_* numbers to support pre-3.18 hppa kernels.
	* tests/sigreturn.test: Update regexp.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	ppc64: fix compilation warning.
	Fix compilation warning introduced by commit
	577be2593d4895ef941e1c4e5e1608f7dd13610d

	* signal.c (sys_sigreturn) [POWERPC64]: Fix initialization of signal
	mask on 32bit personality.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64: fix compilation warnings.
	Fix compilation warnings introduced by commit
	5b9b7e1d347eb4556084cdccad75e8247c535ed5:

	signal.c:702:45: warning: signed and unsigned type in conditional expression [-Wsign-compare]
	syscall.c:746:34: warning: initialization from incompatible pointer type [enabled by default]

	* syscall.c [AARCH64] (aarch64_sp_ptr): Add explicit cast.
	[AARCH64] (arm_sp_ptr): Change pointer type to unsigned.
	* linux/aarch64/arch_regs.h (arm_sp_ptr): Update.

	Reported-by: Mike Frysinger <vapier@gentoo.org>

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	i386: simplify sigreturn decoding.
	* signal.c (sys_sigreturn) [X86_64 || X32 || I386]: Do not define
	i386_sigcontext_struct and i386_fpstate structures.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a test for sigreturn/rt_sigreturn decoding.
	Convert test/sigreturn.c into a regular test.

	* test/Makefile (PROGS): Remove sigreturn.
	* test/.gitignore: Likewise.
	* test/sigreturn.c: Rewrite to ...
	* tests/sigreturn.c: ... new file.
	* tests/sigreturn.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add sigreturn.
	(TESTS): Add sigreturn.test.
	* tests/.gitignore: Add sigreturn.

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

	sigreturn: print signal mask as a syscall argument.
	Although sigreturn takes signal mask via frame pointer,
	it's more convenient to display signal mask as a syscall argument
	rather than an outstanding object of unknown nature:

	Before this change:
	    sigreturn() (mask [USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]) = 0

	After this change:
	    sigreturn({mask=[USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]}) = 0

	* signal.c (sys_sigreturn): Display signal mask as a syscall argument.

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64: implement rt_sigreturn decoding.
	* linux/64/syscallent.h (139): Use sys_sigreturn for rt_sigreturn
	decoding.
	* syscall.c [ARM] (arm_regs): Make static.
	[ARM] (arm_sp_ptr): New variable.
	[AARCH64] (aarch64_sp_ptr, arm_sp_ptr): New variables.
	* linux/aarch64/arch_regs.h: New file.
	* linux/arm/arch_regs.h (arm_regs): Remove.
	(arm_sp_ptr): New declaration.
	* signal.c (sys_sigreturn) [ARM]: Use arm_sp_ptr.
	[AARCH64]: Print signal mask.

	arm: simplify sigreturn decoding.
	* signal.c (sys_sigreturn) [ARM]: Do not define sigcontext and ucontext
	structures, fetch signal mask only, use print_sigset_addr_len.

	s390: fix sigreturn decoding.
	* signal.c (sys_sigreturn) [S390]: Fix signal mask decoding.

	mips o32: fix sigreturn decoding.
	* signal.c (sys_sigreturn) [LINUX_MIPSO32]: Fix the address of signal mask.
	[MIPS] Use print_sigset_addr_len to print signal mask.

	x86_64, x32: implement rt_sigreturn decoding.
	* syscall.c [X86_64 || X32] (x86_64_rsp_ptr): New variable.
	* linux/x86_64/arch_regs.h (x86_64_rsp_ptr): New declaration.
	* linux/x86_64/syscallent.h (15): Use sys_sigreturn for rt_sigreturn
	decoding.
	* linux/x32/syscallent.h (513): Likewise.
	* signal.c (sys_sigreturn) [X86_64 || X32]: Print signal mask
	for non-i386 personalities.

	sparc, sparc64: fix sigreturn decoding.
	* linux/sparc/arch_regs.h (U_REG_FP): New macro.
	* signal.c (sys_sigreturn) [SPARC || SPARC64]: Fix decoding
	of upper 32 bits of the sigmask.

	ppc, ppc64: fix sigreturn decoding.
	* signal.c (sys_sigreturn) [POWERPC]: Fix decoding of upper 32 bits
	of the sigmask.

	sigreturn: issue a less innocuous warning.
	* signal.c (sys_sigreturn): Issue a less innocuous warning on
	architectures for which signal mask decoding is not implemented yet.

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

	bootstrap: do not link Makefile* files.
	* bootstrap: Do not symlink any Makefile* files, not just Makefile.am
	and Makefile.in.

	Reported-by: Christopher Covington <cov@codeaurora.org>

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: fix sigreturn decoding.
	* signal.c (sys_sigreturn) [IA64]: Fix the address of signal mask.
	Use print_sigset_addr_len to print signal mask.

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: use generic signalent.
	This complements commit v4.9-321-gfcf7f8d.

	* linux/ia64/signalent.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.

2015-03-04  Giedrius Statkevičius  <giedrius.statkevicius@gmail.com>

	Document that -k is available only with libunwind.
	Without this users might get confused why `man strace` describes
	an option that doesn't work.

	* strace.1: Note that -k is available only if strace is built
	with libunwind.

2015-03-03  Dmitry V. Levin  <ldv@altlinux.org>

	debian: update control file.
	* debian/control (strace, strace-udeb): Add mips64 and mips64el
	to architecture list.
	Patch by James Cowgill <james410@cowgill.org.uk>

	This fixes Debian bug #773375.

2015-03-03  Dmitry V. Levin  <ldv@altlinux.org>

	debian: sync with 4.9-2 package.
	* debian/changelog: Sync with 4.9-2.
	* debian/control: Likewise.

2015-03-03  Dmitry V. Levin  <ldv@altlinux.org>

	Add arch-specific PTRACE_* constants.
	* xlat/ptrace_cmds.in: Add arch-specific ptrace commands.
	* xlat/ptrace_events.in: Add PTRACE_EVENT_MIGRATE for tile.
	* xlat/ptrace_setoptions_flags.in: Add PTRACE_O_TRACEMIGRATE for tile.

	This fixes Debian bug #734554.

2015-03-03  Mike Frysinger  <vapier@gentoo.org>

	Clarify bootstrap-vs-autoreconf usage.
	* README-hacking: Tell people to run ./bootstrap.

2015-03-03  Dmitry V. Levin  <ldv@altlinux.org>

	mips n32: fix preadv/pwritev offset decoding.
	In mips n32 abi, like in most of 32-bit architectures, offset
	is passed to preadv/pwritev syscalls using two syscall arguments.

	* io.c (print_llu_from_low_high_val) [LINUX_MIPSN32]: Remove.

2015-03-03  Mike Frysinger  <vapier@gentoo.org>

	tests: skip ipc_sem.test on broken kernels.
	Rather than trigger an ERROR which fails `make check`, go with SKIP
	instead.  We don't want the testsuite failing due to kernel bugs.

	* tests/ipc_sem.c (main): Change 99 to 77.

2015-03-03  Mike Frysinger  <vapier@gentoo.org>

	tests: skip pc.test on s390.
	The s390 hardware can't support an exact si_addr, and the current kernels
	don't handle text addresses correctly at all.  Until that improves, skip
	the test on s390.

	* tests/pc.c (main): Return 77 on s390 systems.

2015-03-03  Mike Frysinger  <vapier@gentoo.org>

	tests: note the kernel configs for -yy options.
	* tests/net-yy.test: Note CONFIG_INET_TCP_DIAG.
	* tests/unix-yy.test: Note CONFIG_UNIX_DIAG.

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: fix -yy decoding.
	* socketutils.c (receive_responses): Align buffer on a sizeof(long) boundary.

	Reported-and-tested-by: Mike Frysinger <vapier@gentoo.org>

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64, x32: fix decoding of compat personality statfs64/fstatfs64.
	* statfs.c (struct compat_statfs64) [AARCH64 || X32]: Apply the same
	attributes as on X86_64.

	mips: fix compilation warning.
	* syscall.c (get_scno) [MIPS]: Fix harmless compilation warning
	about comparison between signed and unsigned integer expressions.

	x32: fix compilation warnings.
	* sysinfo.c (sys_sysinfo): Use ll length format modifier
	instead of l and cast kernel ulong types to unsigned long long.

	aarch64: add -i option support.
	* syscall.c (print_pc): Add aarch64 support.

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

	ioctl: use x32 specific ioctl entries on x32 personality.
	As ioctls_inc.h generated natively on x32 differs both from 32/ioctls_inc.h
	(by 45 entries) and from linux/64/ioctls_inc.h (by 322 entries), use x32
	specific ioctl entries on x32 personality.

	* linux/x32/ioctls_inc0.h: Generate from linux v3.19 using ioctls_gen.sh.
	* linux/x86_64/ioctlent2.h: Remove.
	* linux/x86_64/ioctls_arch2.h: New file.
	* linux/x86_64/ioctls_inc2.h: New file.
	* Makefile.am (EXTRA_DIST): Remove linux/x86_64/ioctlent2.h, add
	linux/x86_64/ioctls_arch2.h and linux/x86_64/ioctls_inc2.h.

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests/uid16: skip if real uid is larger than 16bit.
	* tests/uid16.c (main): Skip if the uid returned by getuid matches
	/proc/sys/kernel/overflowuid.

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix uid tests on big endian architectures.
	* tests/uid.c (main): Ignore uids returned by getresuid to avoid
	16bit vs 32bit issues on big endian architectures.
	Change real UID instead of effective UID in setresuid test.
	* tests/uid16.c (main): Likewise.
	* tests/uid32.c (main): Change real UID instead of effective UID
	in setresuid test to match uid.c
	* tests/uid.awk: Update setresuid regexp.

	Reported-by: Mike Frysinger <vapier@gentoo.org>

2015-03-01  Mike Frysinger  <vapier@gentoo.org>

	tests/getdents: handle older getdents calls.
	If the tools we use call older getdents syscalls where d_type isn't
	passed back, or the arch is old (like Alpha) and can't pass back in
	either version, make sure we don't fail.

	* tests/getdents.awk (d_type_dir, d_type_reg): Accept DT_UNKNOWN.

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

	Fix multiple personalities support in decoding syscall return values.
	* syscall.c (trace_syscall_exiting): When current personality is 32bit,
	print 32bit return code.

	Update generic 64-bit ioctlent from linux v3.19.
	* linux/64/ioctls_inc.h: Update from linux v3.19 using ioctls_gen.sh.

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

	sparc, sparc64: fix rt_sigaction decoding.
	Fix regression introduced by commit v4.9-9-gc3a5c01.

	* signal.c (HAVE_SA_RESTORER): New macro.
	[HPPA || IA64]: Do not undefine SA_RESTORER.
	(old_sigaction, old_sigaction32, new_sigaction): Use HAVE_SA_RESTORER
	instead of SA_RESTORER to check whether to define sa_restorer.
	(decode_old_sigaction, decode_new_sigaction): Use HAVE_SA_RESTORER in
	addition to SA_RESTORER to check whether to use sa_restorer.

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

	Fix stack buffer overflow when specified command is too long.
	* strace.c (startup_child): Check that the length of the command strace
	is going to execute does not exceed PATH_MAX limit.

	Reported-by: Cheolung Lee <chpie@grayhash.com>

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

	build: include ptrace.h after regs.h.
	Restore the order of including <sys/reg.h> and <linux/ptrace.h>
	headers that was inadvertently changed by commit v4.9-280-g5503dd2.

	This should fix build on platforms like m68k where some constants
	are defined simultaneously as enums by <sys/reg.h> and as macros
	by <asm/ptrace.h>.

	* process.c: Include "ptrace.h" after "regs.h".
	* signal.c: Likewise.
	* syscall.c: Likewise.
	* util.c: Likewise.

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

	x32: fix decoding of timeval, timespec, and timex structures.
	As time_t is a 64-bit type in x32 personality, it is not correct to
	treat it as a long int type.

	* time.c (current_time_t_is_compat): New macro.
	(sprinttv, sprint_timespec, printitv_bitness, tprint_timex): Use it.
	(tprint_timeval, do_sprinttv, sprint_timespec): Use j and uintmax_t
	when printing tv_sec/tv_usec.
	(tprint_timex): Use j and intmax_t/uintmax_t when printing struct timex
	members of type kernel_long_t.

2015-02-28  Mike Frysinger  <vapier@gentoo.org>

	tests/ipc_sem: detect broken kernels.
	When running 32bit ipc tests on ppc/sparc with a 64bit kernel, the ipc
	logic wrongly returns errors.  Detect that and throw an error.

	* tests/ipc_sem.c: Return 99 when errno is EFAULT.
	* tests/ipc_sem.test: Save output to $OUT and show it when failing.
	Handle exit status 99 to throw an ERROR.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	build: do not link strace with -ldl.
	* configure.ac: Fix dladdr check.

2015-02-27  Mike Frysinger  <vapier@gentoo.org>

	Handle broken PTRACE_EVENT_STOP values.
	For a few linux releases (3.1 through 3.3), this define in the exported
	headers were broken.  Redefine if that's the case.

	* ptrace.h [PTRACE_EVENT_STOP]: Redefine if PTRACE_EVENT_STOP is 7.

2015-02-27  Mike Frysinger  <vapier@gentoo.org>

	bootstrap: always set up test dirs.
	When files get updated, the bootstrap script should make sure the
	parallel dirs are kept in sync.

	* bootstrap: Always generate the test$m.  Clean up symlinks first.
	Don't link in Makefile.in files.

2015-02-27  Mike Frysinger  <vapier@gentoo.org>

	Fix cross-compiling of ioctlsort.
	Use the AX_PROG_CC_FOR_BUILD helper to set up build settings when cross
	compiling.  This way ioctlsort uses the build tools all the time.

	* configure.ac: Call AX_PROG_CC_FOR_BUILD.
	* Makefile.am (ioctlsort_CC): Set to CC_FOR_BUILD.
	(ioctlsort_CPPFLAGS): Change CPPFLAGS to CPPFLAGS_FOR_BUILD.
	(ioctlsort_CFLAGS): Change CFLAGS to CFLAGS_FOR_BUILD.
	(ioctlsort_LDFLAGS): Change LDFLAGS to LDFLAGS_FOR_BUILD.
	(ioctlsort_LD): Delete.
	(ioctlsort%): Change to ioctlsort%$(BUILD_EXEEXT).  Use ioctlsort_CFLAGS.
	* m4/ax_prog_cc_for_build.m4: Import from the autoconf-archive package.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify pc.test.
	* configure.ac: Check for dladdr in -ldl.
	* tests/Makefile.am (pc_LDADD): Adde $(dl_LIBS).
	* tests/pc.c: Include "config.h" and <dlfcn.h>.
	(main): Use dladdr to find the address to unmap.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: drop support for alternative names of select syscall.
	This mostly reverts commit 4a00fc4867bde7a4c333f238851e5cb03f02c824.

	* tests/select.awk: Drop _newselect support.
	* tests/select.test: Skip if select syscall is not supported.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	Rename _newselect to select.
	As an exception to the general rules that syscall names should match
	__NR_* constants defined in kernel headers, show select as "select"
	and old select as "oldselect".

	* linux/arm/syscallent.h (82): Change name to oldselect.
	* linux/hppa/syscallent.h (142): Change name to select.
	* linux/mips/syscallent-n32.h (6022): Likewise.
	* linux/mips/syscallent-n64.h (5022): Likewise.
	* linux/mips/syscallent-o32.h (4142): Likewise.
	* linux/sparc/syscallent.h (230): Likewise.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	sparc: sync syscall entries with kernel headers.
	* linux/sparc/syscallent.h: Fix syscall entries for vmsplice,
	inotify_init, inotify_add_watch, inotify_rm_watch, inotify_rm_watch,
	ioprio_set, ioprio_get, splice, sync_file_range, sched_getaffinity, and
	sched_setaffinity.
	(67, 68, 202, 230): Change syscall names to match __NR_* constants
	defined in arch/sparc/include/uapi/asm/unistd.h.

2015-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	s390, s390x: sync syscall entry names with kernel headers.
	* linux/s390/syscallent.h (1, 180, 181): Change syscall names to match
	__NR_* constants defined in arch/s390/include/uapi/asm/unistd.h.
	* linux/s390x/syscallent.h: Likewise.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

	xlat: avoid fork bombing the build system.
	When there were fewer xlat headers, this didn't matter as much.
	But now with >200, trying to run them all in parallel can easily
	fork bomb smaller systems.

	* xlat/gen.sh (main): Do not more jobs than # of cpus.

2015-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	arm: sync syscall entry names with kernel.
	* linux/arm/syscallent.h (82, 90, 180, 181, 327):
	Change syscall names to match __NR_* constants defined
	in arch/arm/include/uapi/asm/unistd.h.

	arm: fix get_mempolicy, set_mempolicy, and timerfd_create syscall entries
	* linux/arm/syscallent.h (320, 321, 350): Fix names and handlers.

	hppa: sync syscall entry names with kernel.
	* linux/hppa/syscallent.h (18, 28, 59, 84, 108, 109, 280):
	Change syscall names to match __NR_* constants defined in
	arch/parisc/include/uapi/asm/unistd.h.

	subcall.h: add sendmmsg entry.
	* linux/subcall.h: Add sys_sendmmsg entry.
	(SYS_socket_nsubcalls): Update.

	arm: simplify ARM_FIRST_SHUFFLED_SYSCALL definition.
	* linux/arm/syscallent.h (ARM_FIRST_SHUFFLED_SYSCALL): Use SYS_ipc_subcall.

	ia64: parametrize i386 syscallent size check.
	* linux/ia64/syscallent.h: Use (SYS_ipc_subcall + SYS_ipc_nsubcalls)
	instead of numeric constant.

	Cleanup linux/subcall.h.
	* linux/subcall.h: Use SYS_ipc_subcall.

	alpha: fix statfs decoding.
	* statfs.c (printstatfs) [ALPHA]: Remove faulty code.

	x32: fix build regression.
	* linux/x32/arch_regs.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

	hppa: fix fanotify_mark decoding.
	The parisc kernel has some legacy baggage here and decodes the 64bit
	field in the reverse order.  Handle it in strace too.

	* fanotify.c [HPPA] (sys_fanotify_mark): Reverse the mask bits.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

	ia64: fix decoding of getresuid/getresgid/setresgid.
	Looks like the similarity of these names caused confusion when generating
	the syscall table.  getresgid was wired to the wrong output while the other
	two were wired up to printargs instead of the real printer.

	* linux/ia64/syscallent.h: Connect getresuid to sys_getresuid, getresgid to
	sys_getresgid, and setresgid to sys_setresgid.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

	ia64: fix up builds after 16bit uid support.
	The ia64 port pulls in the i386 syscall table so it can decode
	32bit apps, so we need to enable the 16bit uid parsers for it.

	* defs.h (NEED_UID16_PARSERS): Define to 1 for IA64.
	* linux/ia64/syscallent.h: Undefine sys_stime to avoid redefine warnings.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

	v4l2: use uintmax_t for times.
	There is no guarantee that the backing value for the various time fields
	are ints or longs which makes printfs annoying.  Lets cast them to the
	uintmax_t type so we can use the j flag and not worry about truncation.

	* v4l2.c (v4l2_ioctl): Use j and uintmax_t when printing tv_sec/tv_usec.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

	ignore core/compile files.
	Newer autotools includes a compile helper script.

	* .gitignore: Add /compile and core.

2015-02-24  Dmitry V. Levin  <ldv@altlinux.org>

	NEWS: Prepare for 4.10 release.

2015-02-24  Dmitry V. Levin  <ldv@altlinux.org>

	Remove support for systems without PTRACE_SETOPTIONS.
	Assume that the kernel is v2.5.46 or newer, i.e. PTRACE_SETOPTIONS
	and PTRACE_O_TRACESYSGOOD|PTRACE_O_TRACEEXEC|PTRACE_O_TRACECLONE
	are universally available.

	This change removes all code that implemented post-execve SIGTRAP
	handling and fork/vfork/clone->CLONE_PTRACE substitution.

	* defs.h (TCB_BPTSET, TCB_WAITEXECVE): Remove macros.
	(need_fork_exec_workarounds, setbpt, clearbpt): Remove declarations.
	* strace.c (need_fork_exec_workarounds,
	test_ptrace_setoptions_followfork, test_ptrace_setoptions_for_all):
	Remove.
	(syscall_trap_sig): Set to (SIGTRAP | 0x80).
	(ptrace_setoptions): Set to (PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEEXEC).
	(detach): Do not test for TCB_BPTSET.
	(init): Do not call test_ptrace_setoptions_followfork and
	test_ptrace_setoptions_for_all.  Do not test for TCB_BPTSET.
	* syscall.c (syscall_fixup_on_sysenter, internal_fork, internal_exec,
	syscall_fixup_for_fork_exec, syscall_fixup_on_sysexit): Remove.
	(trace_syscall_entering): Do not test for TCB_WAITEXECVE.  Do not call
	syscall_fixup_on_sysenter and syscall_fixup_for_fork_exec.
	(trace_syscall_exiting): Do not call syscall_fixup_on_sysexit and
	syscall_fixup_for_fork_exec.
	[IA64] (ia64_ia32mode): Make static.
	* linux/ia64/arch_regs.h (ia64_ia32mode): Remove declaration.
	* util.c: Do not include "syscall.h".
	(arg_setup, get_arg0, get_arg1, set_arg0, set_arg1, restore_arg0,
	restore_arg1, arg_finish_change, change_syscall, setbpt, clearbpt):
	Remove.
	* tests/ptrace_setoptions.test: Remove.
	* tests/Makefile.am (TESTS): Remove it.

2015-02-24  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify pc.test.
	* tests/pc.c (main): Unmap larger memory region.
	Dump process map for debug purposes.
	* tests/pc.test: Update regexps to take CLD_DUMPED child process
	into account.

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix "make dist" regression.
	* tests/Makefile.am (EXTRA_DIST): Add getrandom.awk.

	tests: workaround broken awk.
	* tests/getdents.out: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/getdents.test: Check whether awk is capable of matching long
	regular expressions.

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

	Fix compilation warnings about incompatible print formats.
	On some platforms printing of __s64 types with "%lld" format,
	or __u64 types with "%llu" or "%llx" formats causes a warning
	that __s64/__u64 type is not compatible with long long format.
	From my PoV, this is nonsense, but the workaround costs nothing.

	* scsi.c (print_sg_io_v4_req, print_sg_io_v4_res): Cast __u64 types
	to (unsigned long long).
	* v4l2.c (v4l2_ioctl): Likewise.  Cast __s64 type to (long long).

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

	powerpc64: fix build regression.
	* linux/powerpc64/arch_regs.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.

	signalent: update from linux v3.19.
	* linux/alpha/signalent.h: Update from linux v3.19 signalent.sh.
	* linux/hppa/signalent.h: Likewise.
	* linux/mips/signalent.h: Likewise.
	* linux/sparc/signalent.h: Likewise.

	Cleanup auxiliary signalent files.
	* linux/aarch64/signalent1.h: Include "signalent.h".
	* linux/powerpc64/signalent1.h: Likewise.
	* linux/sparc64/signalent2.h: Likewise.
	* linux/tile/signalent1.h: Likewise.
	* linux/x32/signalent1.h: Likewise.
	* linux/x86_64/signalent1.h: Likewise.
	* linux/x86_64/signalent2.h: Likewise.
	* linux/sparc64/signalent.h: Include "sparc/signalent.h".
	* linux/sparc64/signalent1.h: Include "sparc/signalent1.h".
	* linux/x32/signalent.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove linux/x32/signalent.h.

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

	x86_64, x32: fix sys_sigreturn.
	On x86_64/x32, sys_sigreturn is defined only for i386 personality.

	* signal.c (sys_sigreturn): Define for X32.
	(sys_sigreturn) [X86_64 || X32]: Implement for i386 personality only.

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

	sparc, x32: fix build regression.
	* syscall.c (print_pc): Use current_wordsize iff it is defined.

	Change errnoent.h files to use designated initializers.
	* signal.c (printsiginfo): Allow elements of errnoent array to be zero.
	* syscall.c (trace_syscall_exiting): Likewise.
	* errnoent.sh: Output designated initializers.
	* linux/errnoent.h: Regenerated.
	* linux/alpha/errnoent.h: Regenerated.
	* linux/hppa/errnoent.h: Regenerated.
	* linux/mips/errnoent.h: Regenerated.
	* linux/sparc/errnoent.h: Regenerated.
	* linux/sparc/errnoent1.h: Regenerated.
	* linux/powerpc/errnoent.h: New file.
	* linux/powerpc64/errnoent.h: Include "powerpc/errnoent.h".
	* Makefile.am (EXTRA_DIST): Add linux/powerpc/errnoent.h
	and linux/powerpc64/errnoent.h.

	errnoent: update from linux v3.19.
	* linux/errnoent.h: Update from linux v3.19 using errnoent.sh.
	* linux/alpha/errnoent.h: Likewise.
	* linux/hppa/errnoent.h: Likewise.
	* linux/mips/errnoent.h: Likewise.
	* linux/sparc/errnoent.h: Likewise.

	Cleanup auxiliary errnoent files.
	* linux/aarch64/errnoent1.h: Include "errnoent.h".
	* linux/powerpc64/errnoent1.h: Likewise.
	* linux/sparc64/errnoent2.h: Likewise.
	* linux/tile/errnoent1.h: Likewise.
	* linux/x32/errnoent1.h: Likewise.
	* linux/x86_64/errnoent1.h: Likewise.
	* linux/x86_64/errnoent2.h: Likewise.
	* linux/sparc64/errnoent.h: Include "sparc/errnoent.h".
	* linux/sparc64/errnoent1.h: Include "sparc/errnoent1.h".
	* linux/x32/errnoent.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove linux/x32/errnoent.h.

2015-02-22  Dmitry V. Levin  <ldv@altlinux.org>

	evdev: update constants from linux v3.19.
	* xlat/evdev_keycode.in: Update from linux v3.19.
	* xlat/evdev_prop.in: Likewise.

	evdev: decode keycode value in EVIOC[GS]KEYCODE_V2 commands.
	* evdev.c (keycode_V2_ioctl): Use evdev_keycode to print
	input_keymap_entry.keycode.

	evdev: fix build with old kernel headers.
	* configure.ac: Check whether struct input_absinfo.resolution is defined
	in <linux/input.h>.
	* evdev.c (SYN_MAX): Add fallback definition.
	(abs_ioctl): Wrap use of struct input_absinfo.resolution in #ifdef check.
	(keycode_V2_ioctl, mtslots_ioctl, repeat_ioctl): Wrap in #ifdef checks.
	(evdev_read_ioctl): Wrap in #ifdef checks the code that uses EV_SW,
	EVIOCGREP, EVIOCGKEYCODE_V2, EVIOCGMTSLOTS, EVIOCGPROP, and EVIOCGSW.
	(evdev_write_ioctl): Wrap in #ifdef checks the code that uses EVIOCSREP,
	EVIOCSKEYCODE_V2, EVIOCSCLOCKID, and EVIOCREVOKE.

2015-02-22  Etienne Gemsa  <etienne.gemsa@lse.epita.fr>

	Add decoding for evdev ioctls.
	This patch introduces decoding for evdev ioctls.  For EVIOCSFF the five
	first members are decoded, the union is not.  The code was compiled and
	tested on x86_64 with Linux 3.13.

	* evdev.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (evdev_ioctl): New prototype.
	* ioctl.c (ioctl_decode): Call evdev_ioctl for 'E' ioctl commands.
	* xlat/evdev_autorepeat.in: New file.
	* xlat/evdev_ff_status.in: New file.
	* xlat/evdev_ff_types.in: New file.
	* xlat/evdev_keycode.in: New file.
	* xlat/evdev_leds.in: New file.
	* xlat/evdev_misc.in: New file.
	* xlat/evdev_mtslots.in: New file.
	* xlat/evdev_prop.in: New file.
	* xlat/evdev_relative_axes.in: New file.
	* xlat/evdev_snd.in: New file.
	* xlat/evdev_switch.in: New file.
	* xlat/evdev_sync.in: New file.

2015-02-22  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build with old kernel headers.
	* strace.c (print_debug_info, maybe_allocate_tcb, print_signalled,
	print_exited): Remove "const" qualifier from status variable to
	workaround some old implementations of WIFSIGNALED/WIFSTOPPED/WIFEXITED
	macros.
	* v4l2.c: Include <linux/types.h>.
	(v4l2_ioctl): Check that V4L2_CTRL_FLAG_NEXT_CTRL and VIDIOC_S_EXT_CTRLS
	macros are defined.
	* tests/Makefile.am (AM_CPPFLAGS): Define.

	Fix "make dist" regression.
	* Makefile.am (EXTRA_DIST): Remove README-linux.

2015-02-20  Elliott Hughes  <enh@google.com>

	test/sfd.c: add missing includes.

2015-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	Remove linux/fanotify.h.
	* linux/fanotify.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* fanotify.c: Do not include <linux/fanotify.h>.
	* xlat/fan_classes.in: Add default values.
	* xlat/fan_event_flags.in: Likewise.
	* xlat/fan_init_flags.in: Likewise.
	* xlat/fan_mark_flags.in: Likewise.

	Remove linux/keyctl.h.
	* linux/keyctl.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* keyctl.c: Do not include <linux/keyctl.h>.
	* xlat/key_perms.in: Add default values.
	* xlat/key_reqkeys.in: Likewise.
	* xlat/key_spec.in: Likewise.
	* xlat/keyctl_commands.in: Likewise.

	Remove linux/kexec.h.
	* linux/kexec.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* kexec.c: Do not include <linux/kexec.h>.
	* xlat/kexec_arch_values.in: Add default values.
	* xlat/kexec_flags.in: Rename to kexec_load_flags.in, add default
	values.

	Remove linux/inotify.h.
	* linux/inotify.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* inotify.c: Do not include <linux/inotify.h>.
	* xlat/inotify_flags.in: Add default values.

	Remove linux/reboot.h.
	* linux/reboot.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* reboot.c: Do not include <linux/reboot.h>.
	* xlat/bootflags1.in: Add default values.
	* xlat/bootflags2.in: Likewise.
	* xlat/bootflags3.in: Likewise.

	seccomp: fix fallback definitions of some SECCOMP_* constants.
	* seccomp.c (SECCOMP_SET_MODE_STRICT, SECCOMP_SET_MODE_FILTER,
	SECCOMP_FILTER_FLAG_TSYNC): Remove fallback definitions.
	* xlat/seccomp_filter_flags.in: Add default value.
	* xlat/seccomp_ops.in: Add default values.

2015-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	is_negated_errno: sync MAX_ERRNO with the kernel.
	Linux kernel used to guarantee that the largest errno value will not
	exceed 4095, but SECCOMP_RET_ERRNO support introduced by kernel commit
	v3.4-rc2-13-gacf3b2c71ed20c53dc69826683417703c2a88059 inadvertently
	broke it.  The guarantee is back with kernel commit
	v3.19-8275-g580c57f1076872ebc2427f898b927944ce170f2d.

	* syscall.c (is_negated_errno): Set maximum errno value to 4095.

2015-02-19  Mike Frysinger  <vapier@gentoo.org>

	README-linux: punt.
	Considering we're requiring linux-2.6 era kernels, the discussion of
	header troubles that plagued 2.2 and 2.4 are no longer relevant.

	* README-linux: Delete.

2015-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	Improve prctl decoding.
	* configure.ac (AC_CHECK_HEADERS): Add linux/securebits.h.
	* prctl.c (sys_prctl): Implement full decoding of all PR_* constants
	as defined in linux v3.19.
	(sys_arch_prctl): Fix decoding of unknown commands.
	* xlat/cap.in: New file.
	* xlat/pr_mce_kill.in: New file.
	* xlat/pr_mce_kill_policy.in: New file.
	* xlat/pr_set_mm.in: New file.
	* xlat/pr_tsc.in: New file.
	* xlat/pr_unalign_flags.in: New file.
	* xlat/secbits.in: New file.
	* xlat/prctl_options.in: Remove non-linux constants, add fallback
	definitions.
	* xlat/seccomp_mode.in: Add fallback definitions.

	xlat: extend syntax.
	* xlat/gen.sh (gen_header): If the name of constant is specified with a
	value, generate a default definition for the constant using this value.
	* xlat/timerfdflags.in: Use extended syntax.

	Move CAP_* definitions out to header files.
	* Makefile.am (strace_SOURCES): Add caps0.h and caps1.h.
	* caps0.h: New file.
	* caps1.h: New file.
	* capability.c: Remove CAP_* definitions, include "caps0.h"
	and "caps1.h" instead.
	Include "xlat/cap_mask0.h" instead of "xlat/capabilities.h".
	Include "xlat/cap_mask1.h" instead of "xlat/capabilities1.h".
	(print_cap_bits): Update callers.
	* xlat/capabilities.in: Rename to xlat/cap_mask0.in.
	* xlat/capabilities1.in: Rename to xlat/cap_mask1.in.

2015-02-18  Dmitry V. Levin  <ldv@altlinux.org>

	Declare all format printers with printf format attribute.
	* defs.h (printllval, printnum_int, printnum_long): Mark with
	format(printf) attribute.
	* sock.c (sock_ioctl): Fix format string.

2015-02-17  Dmitry V. Levin  <ldv@altlinux.org>

	Rename printnum to printnum_long to avoid confusion.
	* defs.h (printnum): Rename to printnum_long.
	* util.c (printnum): Likewise.
	* process.c (sys_ptrace): Likewise.
	* time.c (sys_time): Likewise.

	Use printnum_int consistently.
	* sock.c (sock_ioctl): Use printnum_int instead of printnum to print
	integer type.
	* stream.c (sys_getpmsg): Likewise.

2015-02-16  Dmitry V. Levin  <ldv@altlinux.org>

	print_pc: fix multiple personalities support.
	* syscall.c (print_pc): Choose instruction pointer format depending
	on current_wordsize, not the size of long integer type.
	* tests/pc.c: New file.
	* tests/pc.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add pc.
	(TESTS): Add pc.test.
	* tests/.gitignore: Add pc.

	mips: use PTRACE_GETREGS to fetch all registers.
	* linux/mips/arch_regs.h (struct mips_regs): New structure.
	(mips_REG_*): New macros.
	* signal.c (sys_sigreturn) [MIPS]: Use mips_REG_SP.
	* syscall.c [MIPS] (struct mips_regs): New variable.
	[MIPS] (ARCH_REGS_FOR_GETREGS): New macro.
	(mips_a3, mips_r2): Remove.
	(print_pc) [MIPS]: Use mips_REG_EPC.
	(get_scno) [MIPS]: Use mips_REG_V0 and mips_REG_A3.
	(get_syscall_args) [MIPS]: Use mips_REG_A[0-5].
	(get_syscall_result) [MIPS]: Remove.
	(get_error) [MIPS]: Use mips_REG_A3 and mips_REG_V0.

	mips: move ABI check to configure.ac.
	* configure.ac [MIPS]: Check for MIPS ABI.
	* defs.h [MIPS]: Remove MIPS ABI check.
	* ioctlsort.c: Likewise.

	tests: support alternative names of select syscall.
	* tests/select.awk: Recognize "_newselect" as another name of "select".
	* tests/select.test: Try alternative names of select syscall.

2015-02-15  Dmitry V. Levin  <ldv@altlinux.org>

	i386: fix compilation warning.
	Some gcc versions complain about assigning long* to uint32_t* on i386.

	* syscall.c [I386] (i386_esp_ptr): Change type from uint32_t* to long*.
	* linux/i386/arch_regs.h (i386_esp_ptr): Likewise.
	* linux/x86_64/arch_regs.h: Do not include "i386/arch_regs.h".
	(i386_esp_ptr): New prototype.

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

	Do not reset get_regs_error unnecessarily.
	As get_regs() is now guaranteed to set get_regs_error,
	there is no need to reset get_regs_error before get_regs() call.

	* strace.c (trace): Call clear_regs() iff !WIFSTOPPED.

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

	get_syscall_result: remove redundant ifdefs.
	As get_regs() is now guaranteed to fetch registers when either
	ARCH_REGS_FOR_GETREGSET or ARCH_REGS_FOR_GETREGS is defined, we can
	safely replace all checks for architectures where these macros are defined
	with a single check for these macros.

	* syscall.c (get_syscall_result): Check for [ARCH_REGS_FOR_GETREGSET ||
	ARCH_REGS_FOR_GETREGS].  Remove all checks for architectures where
	nothing has to be done after get_regs().

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

	get_regs: define for all architectures.
	* defs.h (get_regs_error): Remove.
	(clear_regs): Update prototype, declare unconditionally.
	(get_regs): Declare unconditionally.
	* syscall.c (clear_regs): New function.
	(get_regs): Define unconditionally.
	(get_regs_error): Define unconditionally, change scope to static.

	get_regs: unify code for architectures that use PTRACE_GETREGS.
	* syscall.c [I386, POWERPC, ARM, AVR32, SPARC, SPARC64, TILE]
	(ARCH_REGS_FOR_GETREGS): New macro.
	(get_regs): Unify code for ARCH_REGS_FOR_GETREGS architectures.

	get_regset: define iff PTRACE_GETREGSET is used.
	* syscall.c [AARCH64, X86_64, X32] (ARCH_REGS_FOR_GETREGSET,
	ARCH_IOVEC_FOR_GETREGSET): New macros.
	(get_regset): Define iff ARCH_REGS_FOR_GETREGSET is defined; change
	return type to long, return ptrace() return code instead of assigning it
	to get_regs_error; do not list individual architectures, implement
	constant and variable iovec cases depending on ARCH_IOVEC_FOR_GETREGSET.
	(get_regs): Assign get_regset() return code to get_regs_error.

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

	arm, i386: switch back to use PTRACE_GETREGS.
	PTRACE_GETREGSET and PTRACE_GETREGS methods are equally good on arm and
	i386 architectures, but PTRACE_GETREGSET with fallback to PTRACE_GETREGS
	is a bit more costly, so choose the method that costs less.
	This partially reverts commit v4.7-149-gfaa177e.

	* syscall.c [ARM, I386] (ARCH_REGS_FOR_GETREGSET): Remove.
	(get_regset) [ARM || I386]: Remove.
	(get_regs) [ARM || I386]: Use PTRACE_GETREGS unconditionally.

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

	syscall.c: remove obsolete ifdefs.
	* syscall.c (get_regset, get_regs): Do not check for availability
	of PTRACE_GETREGSET and NT_PRSTATUS macros.

	syscall.c: ensure that NT_PRSTATUS is defined.
	* syscall.c: Do not include <elf.h>.
	(NT_PRSTATUS): New macro.

2015-02-13  Dmitry V. Levin  <ldv@altlinux.org>

	Move regs-related macros and declarations from defs.h to regs.h.
	* regs.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/arch_regs.h: New file.
	* linux/alpha/arch_regs.h: Likewise.
	* linux/arm/arch_regs.h: Likewise.
	* linux/hppa/arch_regs.h: Likewise.
	* linux/i386/arch_regs.h: Likewise.
	* linux/ia64/arch_regs.h: Likewise.
	* linux/mips/arch_regs.h: Likewise.
	* linux/powerpc/arch_regs.h: Likewise.
	* linux/sh64/arch_regs.h: Likewise.
	* linux/sparc/arch_regs.h: Likewise.
	* linux/sparc64/arch_regs.h: Likewise.
	* linux/tile/arch_regs.h: Likewise.
	* linux/x86_64/arch_regs.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add them.
	* defs.h: Remove definitions of PTRACE_*, REG_*, PT_*, U_REG_*,
	and ARM_* macros.
	Remove declarations of struct pt_regs variables.
	[SPARC]: Do not include <asm/psr.h>.
	[SPARC64]: Do not include <asm/psrcompat.h>.
	* bjm.c: Do not include <sys/user.h>.
	* process.c: Include "regs.h".
	Do not include <sys/user.h> and <sys/reg.h>.
	[IA64]: Do not include <asm/ptrace_offsets.h> and <asm/rse.h>.
	* util.c: Likewise.
	* syscall.c: Likewise.
	[AARCH64]: Define struct arm_pt_regs and ARM_* macros.
	[SPARC]: Include <asm/psr.h>.
	[SPARC64]: Include <asm/psrcompat.h>.
	* signal.c: Include "regs.h".
	Do not include <sys/user.h> and <sys/reg.h>.
	[IA64]: Do not include <asm/ptrace_offsets.h>.
	* strace.c [IA64]: Do not include <asm/ptrace_offsets.h>.

	Move all ptrace-related macros and declarations from defs.h to ptrace.h.
	* ptrace.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* configure.ac (AC_CHECK_HEADERS): Remove linux/ptrace.h and sys/ptrace.h.
	* defs.h: Do not include <sys/ptrace.h> and <asm/ptrace.h>.
	Remove definitions of PTRACE_* macros.
	* process.c: Remove <linux/ptrace.h> workarounds, include "ptrace.h".
	* signal.c: Likewise.
	* syscall.c: Likewise.
	* util.c: Likewise.
	* strace.c: Include "ptrace.h".
	* wait.c: Likewise.

2015-02-12  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance wait status decoding.
	* xlat/ptrace_events.in: New file.
	* wait.c: Include "xlat/ptrace_events.h".
	(printstatus): In case of WIFSTOPPED, print 0x80 flag separately from
	the stop signal name.
	[WIFCONTINUED]: Add WIFCONTINUED support.
	Decode PTRACE_EVENT_* events.

2015-02-08  Bart Van Assche  <bart.vanassche@sandisk.com>

	scsi: add bsg support.
	The Linux kernel supports two different versions of the SG_IO API,
	namely v3 and v4. This patch adds support for version 4 of this API.
	At least the sg3_utils package supports version 4 of this API.  Version
	4 of this API is used if /dev/bsg/H:C:I:L is used as device name.

	This patch has been tested by inspecting the output of the following
	commands:

	modprobe scsi_debug dev_size_mb=16 delay=0
	dev=$(lsscsi | sed -n '/ scsi_debug /s,^[^/]*,,p')
	./strace -eioctl -s256 sg_inq $dev
	echo 'Test XDWRITEREAD(10)'
	bsg=/dev/bsg/$(lsscsi | sed -n '/ scsi_debug /s,^\[\([^]]\+\)\].*,\1,p')
	dd if=/dev/zero bs=512 count=1 |
	  ./strace -eioctl -s256 sg_raw -s 512 -r 1024 $bsg 53 00 00 00 00 01 00 00 01 00

	* configure.ac (AC_CHECK_HEADERS): Add linux/bsg.h.
	* xlat/bsg_protocol.in: New file.
	* xlat/bsg_subprotocol.in: Likewise.
	* scsi.c: Include them and <linux/bsg.h>.
	(print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req,
	print_sg_io_v4_res): New functions.
	(print_sg_io_req, print_sg_io_res): Use them.
	(scsi_ioctl): Update callers.

2015-02-08  Bart Van Assche  <bart.vanassche@sandisk.com>

	scsi: Add iovec support.
	* scsi.c (print_sg_io_req, print_sg_io_res): Add support for decoding
	iovecs passed via the SG I/O v3 interface.  Decode the "data in" and
	"data out" buffers in hex instead of in ASCII.

	scsi: on exit, print only initialized part of the buffer.
	* scsi.c (print_sg_io_res): Only print that part of the data in buffer
	that has been initialized by the SCSI LLD driver.

	scsi: make print_sg_io_buffer() print square brackets instead of its callers
	* scsi.c (print_sg_io_buffer): Print square brackets in this function.
	(print_sg_io_req, print_sg_io_res): Update callers.

2015-02-08  Bart Van Assche  <bart.vanassche@sandisk.com>

	scsi: improve consistency with other decoding functions.
	Pass pointers to tracee's memory as integers instead of pointers.

	* scsi.c (print_sg_io_buffer): Change second argument's type to
	unsigned long.
	(print_sg_io_req, print_sg_io_res): Update callers.

2015-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: extend getdents to support all filesystems regardless of file order
	* tests/getdents.awk: Include all 6 possible permutations of 3
	direntries to regexps.

2015-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	print_setsockopt: fix fall-through bug in SOL_IP switch case.
	This fixes the bug introduced by commit v4.9-250-ga0a4909.

	* net.c (print_setsockopt): Separate SOL_IP case from SOL_PACKET.

	Reported-by: Ben Noordhuis <info@bnoordhuis.nl>

2015-02-07  Dmitry V. Levin  <ldv@altlinux.org>

	Do not watch for post-execve SIGTRAP if PTRACE_O_TRACEEXEC is enabled.
	If PTRACE_O_TRACEEXEC option is enabled, then post-execve SIGTRAPs are
	suppressed and we can safely skip -ENOSYS heuristics.  This partially
	reverts commits v4.9-258-g8e398b6 and v4.9-261-gd70c41d.

	* syscall.c (syscall_fixup_on_sysenter): Skip if PTRACE_O_TRACEEXEC
	flag is set in ptrace_setoptions.  Remove all SECCOMP_RET_ERRNO
	workarounds as they are not needed when PTRACE_O_TRACEEXEC is not
	supported by the kernel.

2015-02-07  Dmitry V. Levin  <ldv@altlinux.org>

	When the process stared by strace exits/terminates, forget its pid.
	The process stared by strace can exit/terminate only once.  When this
	happens, forget its pid, so that any other event or action related to a
	process with the same pid as the pid of that first process would not be
	confused with that first process.

	* strace.c (print_signalled, print_exited): Clear strace_child when it
	equals to the given pid.

2015-02-07  Dmitry V. Levin  <ldv@altlinux.org>

	-b execve: avoid misleading warning about unknown pid.
	* strace.c (maybe_allocate_tcb): If detach_on_execve is set, do not warn
	about !WIFSTOPPED process with pid == strace_child.
	* tests/bexecve.test: New test.
	* tests/Makefile.am (TESTS): Add it.

	-b execve: do not use struct tcb after detach.
	* strace.c (trace): Do not proceed after detach.

2015-02-07  Dmitry V. Levin  <ldv@altlinux.org>

	trace: split into several functions.
	This change moves the main loop back to main() and splits trace()
	into several functions.  There are no algorithmic changes.

	* strace.c (print_debug_info, maybe_allocate_tcb, maybe_switch_tcbs,
	print_signalled, print_exited, print_stopped, startup_tcb): New
	functions.
	(trace) Use them.  Move the main loop ...
	(main): ... here.

2015-02-07  Dmitry V. Levin  <ldv@altlinux.org>

	printsiginfo: constify the first argument.
	* signal.c (printsiginfo): Make the first argument a pointer to a const type.
	* defs.h (printsiginfo): Likewise.
	(printsiginfo, printsiginfo_at): Always define these prototypes.
	* configure.ac (AC_CHECK_TYPES): Remove siginfo_t, as HAVE_SIGINFO_T
	is no longer used.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	test: add a manual test for seccomp decoding.
	* test/.gitignore: Add seccomp.
	* test/Makefile (PROGS): Likewise.
	* test/seccomp.c: New file.
	* test/README: Mention ../tests/.

	Implement seccomp decoding.
	* configure.ac (AC_CHECK_HEADERS): Add linux/filter.h
	and linux/seccomp.h.
	* defs.h (print_seccomp_filter): New prototype.
	* linux/dummy.h (sys_seccomp): Remove.
	* linux/syscall.h (sys_seccomp): New prototype.
	* prctl.c: Include <linux/seccomp.h>.
	(sys_prctl): Decode PR_SET_SECCOMP.
	* seccomp.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* xlat/bpf_class.in: New file.
	* xlat/bpf_miscop.in: Likewise.
	* xlat/bpf_mode.in: Likewise.
	* xlat/bpf_op_alu.in: Likewise.
	* xlat/bpf_op_jmp.in: Likewise.
	* xlat/bpf_rval.in: Likewise.
	* xlat/bpf_size.in: Likewise.
	* xlat/bpf_src.in: Likewise.
	* xlat/seccomp_filter_flags.in: Likewise.
	* xlat/seccomp_mode.in: Likewise.
	* xlat/seccomp_ops.in: Likewise.
	* xlat/seccomp_ret_action.in: Likewise.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	is_negated_errno: support large errno values.
	Thanks to SECCOMP_RET_DATA == 0xffff, abnormally large errno
	values could be easily seen when a seccomp filter is used, e.g.
	BPF_STMT(BPF_RET, SECCOMP_RET_ERRNO | SECCOMP_RET_DATA)

	* syscall.c (is_negated_errno): Allow errno values as large as 0xffff.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	x86, x32, x86_64: print SECCOMP_RET_ERRNO filtered syscalls.
	This is required to process SECCOMP_RET_ERRNO filtered syscalls on
	systems where linux kernel does not change the syscall number to -1.

	* syscall.c (is_negated_errno): Move before syscall_fixup_on_sysenter.
	(syscall_fixup_on_sysenter) [I386 || X32 || X86_64] : Use it to check
	AX register.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	is_negated_errno: merge x86_64 and x32 definitions.
	* syscall.c (kernel_long_t, kernel_ulong_t): New types.
	(is_negated_errno): Merge [X32] and [!X32] definitions.
	(get_error): Merge [X86_64] and [X32] code.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	x32: rename is_negated_errno_x32 to is_negated_errno.
	Use the same function name on all architectures.

	* syscall.c [X32] (is_negated_errno_x32): Rename to is_negated_errno.
	(get_error) [X32]: Update callers.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	x86, x32, x86_64: do not skip syscall number -1.
	Syscall number -1 might be a side effect of SECCOMP_RET_ERRNO filtering.

	* syscall.c (syscall_fixup_on_sysenter) [I386 || X32 || X86_64]:
	Do not skip syscalls that have number -1.

2015-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	x86_64: do not interpet syscall number -1 as a x32 personality syscall.
	Syscall number -1 might be a side effect of SECCOMP_RET_ERRNO filtering.

	* syscall.c (get_scno) [X86_64]: Handle the case of scno == -1.

2015-02-05  Dmitry V. Levin  <ldv@altlinux.org>

	Implement getrandom syscall decoding.
	* getrandom.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/dummy.h (sys_getrandom): Remove.
	* linux/syscall.h (sys_getrandom): New prototype.
	* xlat/getrandom_flags.in: New file.
	* tests/getrandom.c: New file.
	* tests/getrandom.awk: New file.
	* tests/getrandom.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add getrandom.
	(TESTS): Add getrandom.test.
	(EXTRA_DIST): Add getrandom.awk.
	* tests/.gitignore: Add getrandom.

2015-02-04  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a test for select syscall decoding.
	Convert test/select.c into a regular test.

	* test/Makefile (PROGS): Remove select.
	* test/.gitignore: Likewise.
	* test/select.c: Rewrite to ...
	* tests/select.c: ... new file.
	* tests/select.awk: New file.
	* tests/select.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add select.
	(TESTS): Add select.test.
	(EXTRA_DIST): Add select.awk.
	* tests/.gitignore: Add select.

2015-02-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a test for the latest dumpio fix.
	* tests/dumpio.expected: New file.
	* tests/unix-pair-send-recv.c: New file.
	* tests/dumpio.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add unix-pair-send-recv.
	(TESTS): Add dumpio.test.
	(EXTRA_DIST): Add dumpio.expected.
	* tests/.gitignore: Add unix-pair-send-recv.

2015-02-01  Aurelien Jacobs  <aurel@gnuage.org>

	Fix simultaneous -e read and -e write usage.
	This allows using both -e read=FD and -e write=FD at the same time
	with the same FD.
	Without this patch, the -e write=FD is ignored if -e read=FD is used
	at the same time.

2015-01-31  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: remove unused HAVE_SIN6_SCOPE_ID_LINUX-based code.
	The AC_SIN6_SCOPE_ID autoconf macro that was able to define
	HAVE_SIN6_SCOPE_ID_LINUX was removed by commit v4.4-98-g64f793a.

	* net.c [HAVE_SIN6_SCOPE_ID_LINUX]: Remove.

2015-01-30  Dmitry V. Levin  <ldv@altlinux.org>

	printsock: do not fetch sockaddr.sa_data twice.
	* net.c (printsock): Print addrbuf.sa.sa_data using print_quoted_string.

	setsockopt: add decoding of MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP.
	* net.c (print_group_req): New function.
	(print_setsockopt): Use it.

2015-01-29  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a test for sockaddr_un.sun_path decoding.
	* tests/net-accept-connect.c: Allow long socket addresses.
	* tests/sun_path.test: New test.
	* tests/Makefile.am (TESTS): Add it.

	printsock: print the whole sockaddr_un.sun_path.
	* net.c (printsock): If sockaddr_un.sun_path is not NUL-terminated,
	do not omit the last byte of sockaddr_un.sun_path array.

	printsock: do not fetch sockaddr_un.sun_path twice.
	* net.c (printsock): Print addrbuf.sau.sun_path using
	print_quoted_string.

2015-01-29  Dmitry V. Levin  <ldv@altlinux.org>

	net: define all SOL_* constants.
	Ensure that all known SOL_* constants are defined.
	Sync the list of known SOL_* constants with linux/socket.h.

	* net.c: Provide definitions for all SOL_* constants.
	Remove all SOL_* preprocessor conditionals.
	(socketlayers): Disconnect from inet_protocols.
	* xlat/socketlayers.in: Remove SOL_ICMP, add SOL_ALG and SOL_NFC.

2015-01-29  Dmitry V. Levin  <ldv@altlinux.org>

	setsockopt: decode PACKET_ADD_MEMBERSHIP.
	* xlat/packet_mreq_type.in: New file.
	* net.c: Include "xlat/packet_mreq_type.h".
	(print_packet_mreq): New function.
	(print_setsockopt): Use it.

2015-01-29  Dmitry V. Levin  <ldv@altlinux.org>

	getsockopt, setsockopt: do not decode structures in non-verbose mode.
	Move the code that is common between getsockopt and setsockopt parsers
	to a separate function.
	Move printers specific to getsockopt and setsockopt to separate
	functions, choose appropriate parsers depending on verbose mode.
	Move parsers of specific socket options to separate functions.

	* net.c (printicmpfilter): Rename to print_icmp_filter.
	(printsockopt): Remove.
	(print_sockopt_fd_level_name, print_linger, print_ucred,
	print_tpacket_stats, print_getsockopt, print_tpacket_req,
	print_packet_mreq, print_setsockopt): New functions.
	(sys_getsockopt, sys_setsockopt): Use them.

2015-01-28  Dmitry V. Levin  <ldv@altlinux.org>

	sendmsg: do not decode msghdr in non-verbose mode.
	* net.c (printmsghdr): Do not decode struct msghdr in non-verbose mode.

	decode_select: do not allocate unused memory.
	* desc.c (decode_select): On entering syscall, do not allocate memory
	in non-verbose mode.

2015-01-26  Dmitry V. Levin  <ldv@altlinux.org>

	xattr: quote using print_quoted_string.
	* xattr.c (print_xattr_val): Drop local quoting code, use
	print_quoted_string.

	v4l2: quote pixelformat.
	* v4l2.c (print_pixelformat): Output in quoted v4l2_fourcc() format.

	v4l2: quote strings.
	* v4l2.c (v4l2_ioctl): Print strings using print_quoted_string.

	mips: quote sysmips nodename.
	* sysmips.c (sys_sysmips): Print nodename using print_quoted_string.

	block_ioctl: quote strings.
	* block.c (print_blkpg_req): Print blkpg_partition.devname and
	blkpg_partition.volname using print_quoted_string.
	(block_ioctl): Print blk_user_trace_setup.name using print_quoted_string.

	sys_uname: quote struct utsname members.
	* uname.c (PRINT_UTS_MEMBER): New macro.
	(sys_uname): Use them.

	sock_ioctl: quote network interface names.
	* sock.c (print_ifname): New function.
	(sock_ioctl): Use it to quote ifr_name, ifru_newname, and ifru_slave.

	printsock: quote network interface names.
	* net.c (printsock): Print network interface names returned by
	if_indextoname() using print_quoted_string.

	getdents, getdents64: quote filenames.
	* dirent.c (print_old_dirent): Fix quoting.
	(sys_getdents): Print d_name using print_quoted_string.
	(sys_getdents64): Likewise.
	* tests/getdents.test: Test it.
	* tests/getdents.awk: Update.

2015-01-26  Dmitry V. Levin  <ldv@altlinux.org>

	printfd: quote pathnames.
	Change printfd() behaviour in show_fd_path mode to quote pathnames
	the same way printpathn() does.

	* util.c (printfd): Print non-socket paths using print_quoted_string.
	* tests/scm_rights-fd.test: Test it.
	* tests/scm_rights.c: Update.

2015-01-26  Dmitry V. Levin  <ldv@altlinux.org>

	Rework string_quote API.
	string_quote() has proven to be too hard to use, replace it with
	print_quoted_string() that does memory allocation and prints the result.

	* defs.h (string_quote): Remove.
	(QUOTE_0_TERMINATED, QUOTE_OMIT_LEADING_TRAILING_QUOTES): New macros.
	(print_quoted_string): New prototype.
	* util.c (string_quote): Make static; take "style" flags instead
	of "len", treat QUOTE_0_TERMINATED style flag as former (len == -1);
	add QUOTE_OMIT_LEADING_TRAILING_QUOTES style flag support.
	(ALLOCA_CUTOFF, use_alloca): New macros.
	(print_quoted_string): New function.
	(printpathn, printstr): Update to new API.
	* loop.c (loop_ioctl): Likewise.
	* mtd.c (ubi_ioctl): Likewise.
	* net.c (print_scm_security): Likewise.
	* socketutils.c (unix_parse_response): Likewise.

2015-01-24  Dmitry V. Levin  <ldv@altlinux.org>

	avr32: fix typo in sys_timerfd syscall entry.
	* linux/avr32/syscallent.h (timerfd): Change sys_name to "timerfd".

	hppa: fix typos in getresuid and getresgid syscall entries.
	* linux/hppa/syscallent.h (getresuid): Change sys_func to sys_getresuid.
	(getresgid): Change sys_func to sys_getresgid.

2015-01-24  Helge Deller  <deller@gmx.de>

	hppa: fix typo in getpeername syscall entry.
	This fixes an obvious typo which prints "lock" instead of "getpeername"
	for the getpeername syscall.

	* linux/hppa/syscallent.h (getpeername): Change sys_name to "getpeername".

2015-01-24  Dmitry V. Levin  <ldv@altlinux.org>

	Impove struct cmsghdr decoding.
	Print all cmsghdr structures in msg_control array,
	not just the first one.
	Change output format to be consistent with other parts of strace
	where structures and arrays are printed.
	Implement decoder for SCM_SECURITY message type.

	* net.c (print_scm_rights, print_scm_creds, print_scm_security):
	New functions.
	(printcmsghdr): Use them.  Iterate over all members of the array.
	* xlat/scmvals.in: Add SCM_SECURITY.
	* tests/scm_rights.c (main): Pass one more descriptor to the receiver.
	Set SO_PASSCRED on the receiver part.  Reserve enough space to receive
	SCM_CREDENTIALS and SCM_RIGHTS.
	* tests/scm_rights-fd.test: Update.

2015-01-24  Dmitry V. Levin  <ldv@altlinux.org>

	Update SO_* constants.
	* xlat/sockoptions.in: Add SO_DOMAIN, SO_MARK, SO_NOFCS, SO_PASSSEC,
	SO_PROTOCOL, SO_RCVBUFFORCE, SO_SNDBUFFORCE, SO_TIMESTAMPING,
	and SO_TIMESTAMPNS.

2015-01-24  Dmitry V. Levin  <ldv@altlinux.org>

	tests: run tests for each supported personality.
	When strace supports more than one personality, run test suite
	for each personality supported by the host system.

	* bootstrap: Create tests-m32 and tests-mx32 subtrees from tests.
	* configure.ac: Check for -m32 and -mx32 runtime support.
	(AC_CONFIG_FILES): Add tests-m32/Makefile and tests-mx32/Makefile.
	* Makefile.am [HAVE_M32_RUNTIME] (TESTS_M32): Define.
	[HAVE_MX32_RUNTIME] (TESTS_MX32): Define.
	(SUBDIRS): Add $(TESTS_M32) $(TESTS_MX32).
	* .gitignore: Add /tests-m32 and /tests-mx32.

2015-01-24  Dmitry V. Levin  <ldv@altlinux.org>

	Fix ILP32 personality struct cmsghdr decoding on LP64 architectures.
	* net.c (union_cmsghdr): New union.
	[SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (cmsghdr32): New structure.
	(printcmsghdr): Properly handle the case of current_wordsize < sizeof(long).

	Fix ILP32 personality preadv/pwritev offset decoding on LP64 architectures
	* io.c (print_llu_from_low_high_val) [SIZEOF_LONG == SIZEOF_LONG_LONG
	&& SUPPORTED_PERSONALITIES > 1]: Properly handle the case of
	current_wordsize < sizeof(long).

2015-01-22  Dmitry V. Levin  <ldv@altlinux.org>

	ioctl: take all 32 bits of ioctl commands into account.
	Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl
	commands were used for decoding, which was the source for numerous
	annoying collisions like this:

		ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
		ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device)

	The solution is to use all 32 bits for decoding, not just "number" and
	"type", but also "size" and "direction".

	As some architectures override defaults that come from asm-generic/ and
	provide alternative definitions for some ioctl commands, we support
	per-architecture ioctl definitions and merge them with common
	definitions at build time.  During the merge, we used to keep both
	generic and architecture-specific definitions, now architecture-specific
	definitions have precedence over generic ones -- ioctlsort omits
	definitions from asm-generic/ for those ioctl names that have different
	definitions in asm/.

	Additional bits of "direction" are architecture specific -- the number
	of bits and their values differ between architectures.  To reduce
	architecture differences in the source code, we keep "direction" in
	symbolic form and compile it in ioctlsort.

	Additional bits of "size" are also architecture specific -- not only the
	number of bits differ between architectures, but sizes of many types
	depend on sizeof(long).  To reduce architecture differences in the
	source code, we keep 32-bit and 64-bit versions of common ioctl
	definitions, and use the appropriate version for each architecture and
	personality.

	To implement this, the tools for generating ioctl definitions from
	kernel headers have been rewritten, and the source format of ioctl
	definitions has been extended.   The final ioctlent*.h files that are
	included by syscall.c are now generated from source ioctls_inc*.h and
	ioctls_arch*.h files at build time with ioctlsort.

	* ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code.
	* ioctlsort.c: Rewritten.
	* linux/32/ioctls_inc.h: New file.
	* linux/64/ioctls_inc.h: New file.
	* linux/aarch64/ioctls_arch0.h: New file.
	* linux/aarch64/ioctls_arch1.h: New file.
	* linux/aarch64/ioctls_inc0.h: New file.
	* linux/aarch64/ioctls_inc1.h: New file.
	* linux/alpha/ioctls_arch0.h: New file.
	* linux/alpha/ioctls_inc0.h: New file.
	* linux/arc/ioctls_arch0.h: New file.
	* linux/arc/ioctls_inc0.h: New file.
	* linux/arm/ioctls_arch0.h: New file.
	* linux/arm/ioctls_inc0.h: New file.
	* linux/avr32/ioctls_arch0.h: New file.
	* linux/avr32/ioctls_inc0.h: New file.
	* linux/bfin/ioctls_arch0.h: New file.
	* linux/bfin/ioctls_inc0.h: New file.
	* linux/hppa/ioctls_arch0.h: New file.
	* linux/hppa/ioctls_inc0.h: New file.
	* linux/i386/ioctls_arch0.h: New file.
	* linux/i386/ioctls_inc0.h: New file.
	* linux/ia64/ioctls_arch0.h: New file.
	* linux/ia64/ioctls_inc0.h: New file.
	* linux/m68k/ioctls_arch0.h: New file.
	* linux/m68k/ioctls_inc0.h: New file.
	* linux/metag/ioctls_arch0.h: New file.
	* linux/metag/ioctls_inc0.h: New file.
	* linux/microblaze/ioctls_arch0.h: New file.
	* linux/microblaze/ioctls_inc0.h: New file.
	* linux/mips/ioctls_arch0.h: New file.
	* linux/mips/ioctls_inc0.h: New file.
	* linux/or1k/ioctls_arch0.h: New file.
	* linux/or1k/ioctls_inc0.h: New file.
	* linux/powerpc/ioctls_arch0.h: New file.
	* linux/powerpc/ioctls_inc0.h: New file.
	* linux/powerpc64/ioctls_arch0.h: New file.
	* linux/powerpc64/ioctls_arch1.h: New file.
	* linux/powerpc64/ioctls_inc0.h: New file.
	* linux/powerpc64/ioctls_inc1.h: New file.
	* linux/s390/ioctls_arch0.h: New file.
	* linux/s390/ioctls_inc0.h: New file.
	* linux/s390x/ioctls_arch0.h: New file.
	* linux/s390x/ioctls_inc0.h: New file.
	* linux/sh/ioctls_arch0.h: New file.
	* linux/sh/ioctls_inc0.h: New file.
	* linux/sh64/ioctls_arch0.h: New file.
	* linux/sh64/ioctls_inc0.h: New file.
	* linux/sparc/ioctls_arch0.h: New file.
	* linux/sparc/ioctls_inc0.h: New file.
	* linux/sparc64/ioctls_arch0.h: New file.
	* linux/sparc64/ioctls_arch2.h: New file.
	* linux/sparc64/ioctls_inc0.h: New file.
	* linux/sparc64/ioctls_inc2.h: New file.
	* linux/tile/ioctls_arch0.h: New file.
	* linux/tile/ioctls_arch1.h: New file.
	* linux/tile/ioctls_inc0.h: New file.
	* linux/tile/ioctls_inc1.h: New file.
	* linux/x32/ioctls_arch0.h: New file.
	* linux/x32/ioctls_arch1.h: New file.
	* linux/x32/ioctls_inc0.h: New file.
	* linux/x32/ioctls_inc1.h: New file.
	* linux/x86_64/ioctls_arch0.h: New file.
	* linux/x86_64/ioctls_arch1.h: New file.
	* linux/x86_64/ioctls_inc0.h: New file.
	* linux/x86_64/ioctls_inc1.h: New file.
	* linux/xtensa/ioctls_arch0.h: New file.
	* linux/xtensa/ioctls_inc0.h: New file.
	* linux/aarch64/ioctlent.h.in: Remove.
	* linux/aarch64/ioctlent1.h: Remove.
	* linux/alpha/ioctlent.h.in: Remove.
	* linux/arc/ioctlent.h.in: Remove.
	* linux/arm/ioctlent.h.in: Remove.
	* linux/avr32/ioctlent.h.in: Remove.
	* linux/bfin/ioctlent.h.in: Remove.
	* linux/hppa/ioctlent.h.in: Remove.
	* linux/i386/ioctlent.h.in: Remove.
	* linux/ia64/ioctlent.h.in: Remove.
	* linux/ioctlent.h.in: Remove.
	* linux/ioctlent.sh: Remove.
	* linux/m68k/ioctlent.h.in: Remove.
	* linux/metag/ioctlent.h.in: Remove.
	* linux/microblaze/ioctlent.h.in: Remove.
	* linux/mips/ioctlent.h.in: Remove.
	* linux/mips/ioctlent.sh: Remove.
	* linux/or1k/ioctlent.h.in: Remove.
	* linux/powerpc/ioctlent.h.in: Remove.
	* linux/powerpc64/ioctlent.h: Remove.
	* linux/powerpc64/ioctlent1.h: Remove.
	* linux/s390/ioctlent.h.in: Remove.
	* linux/s390x/ioctlent.h.in: Remove.
	* linux/sh/ioctlent.h.in: Remove.
	* linux/sh64/ioctlent.h.in: Remove.
	* linux/sparc/ioctlent.h.in: Remove.
	* linux/sparc64/ioctlent.h.in: Remove.
	* linux/sparc64/ioctlent2.h: Remove.
	* linux/tile/ioctlent.h.in: Remove.
	* linux/tile/ioctlent1.h: Remove.
	* linux/x32/ioctlent.h.in: Remove.
	* linux/x32/ioctlent1.h: Remove.
	* linux/x86_64/ioctlent.h.in: Remove.
	* linux/x86_64/ioctlent1.h: Remove.
	* linux/xtensa/ioctlent.h.in: Remove.
	* linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h.
	* syscall.c (struct_ioctlent ioctlent0): Likewise.
	* Makefile.am: Remove all ioctlent-related definitions.
	Define the list of ioctlent*.h files that have to be generated by
	presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files.
	Add rules for ioctlent*.h files generation.
	(EXTRA_DIST): Update.
	* maint/ioctls_gen.sh: New file.
	* maint/ioctls_hex.sh: New file.
	* maint/ioctls_sym.sh: New file.
	* maint/print_ioctlent.c: New file.
	* HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration.
	* .gitignore: Add ioctlent[012].h and ioctls_all[012].h.
	* configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h
	and linux/mmtimer.h for tests.
	* tests/ioctl.c: New file.
	* tests/ioctl.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add ioctl.
	(TESTS): Add ioctl.test.
	* tests/.gitignore: Add ioctl.

2015-01-21  Gabriel Laskar  <gabriel@lse.epita.fr>

	ioctl: add decoding for parametrized command names.
	Some ioctl commands from evdev, hiddev, mixer, uinput, spi, and joystick
	are parametrized by a size or a number that are variable.  This change
	implements printing of these parametrized ioctl command names.

	* configure.ac (AC_CHECK_HEADERS): Add linux/input.h.
	* defs.h (ioctl_decode_number): New prototype.
	* io.c (sys_ioctl): Use ioctl_decode_number.
	* ioctl.c (ioctl_decode_number): New function.
	* xlat/evdev_abs.in: New file.
	* xlat/evdev_ev.in: New file.

2015-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	Update auxiliary maintainer mode build tools.
	* git-set-file-times: Update from rsync.
	* git-version-gen: Update from gnulib.
	* gitlog-to-changelog: Likewise.

	Update warnings.m4.
	* m4/warnings.m4: Update from gnulib.

2015-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	powerpc64: maintain own linux/powerpc64 subdirectory.
	Most architectures supported by strace have their own subdirectory in
	linux directory, but powerpc64 didn't, causing inconveniences.

	* configure.ac (arch): Define to "powerpc64" on powerpc64.
	* linux/powerpc/errnoent1.h: Move to linux/powerpc64/.
	* linux/powerpc/ioctlent1.h: Likewise.
	* linux/powerpc/signalent1.h: Likewise.
	* linux/powerpc/syscallent1.h: Likewise.
	* linux/powerpc64/ioctlent.h: New file.
	* linux/powerpc64/syscallent.h: Likewise.
	* linux/powerpc64/userent.h: Likewise.
	* Makefile.am (EXTRA_DIST): Remove linux/powerpc/ioctlent1.h,
	linux/powerpc/syscallent1.h, linux/powerpc/errnoent1.h, and
	linux/powerpc/signalent1.h; added linux/powerpc64/errnoent1.h,
	linux/powerpc64/ioctlent.h, linux/powerpc64/ioctlent1.h,
	linux/powerpc64/signalent1.h, linux/powerpc64/syscallent.h,
	linux/powerpc64/syscallent1.h, and linux/powerpc64/userent.h.

2015-01-21  Dmitry V. Levin  <ldv@altlinux.org>

	configure.ac: remove unused AC_INCLUDEDIR.
	* configure.ac (AC_INCLUDEDIR): Remove.
	* m4/includedir.m4: Remove.

	ioctl: print unrecognized ioctl codes in _IOC(dir,type,nr,size) format.
	* defs.h (ioctl_print_code): New prototype.
	* ioctl.c: Include xlat/ioctl_dirs.h.
	(ioctl_print_code): New function.
	* io.c (sys_ioctl): Use it.
	* xlat/ioctl_dirs.in: New file.

2015-01-20  Dmitry V. Levin  <ldv@altlinux.org>

	ioctl: assume that all ioctl commands have unsigned int type.
	In linux, ioctl command number has a 32-bit unsigned integer type:
		fs/ioctl.c:SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)
	If the kernel completely ignores other bits on 64-bit architectures,
	why should strace care?
	Let's follow the kernel and treat it as unsigned int.

	* defs.h (struct_ioctlent): Change "code" type to "unsigned int".
	(ioctl_decode, ioctl_lookup, block_ioctl, loop_ioctl, mtd_ioctl,
	ubi_ioctl, ptp_ioctl, scsi_ioctl, sock_ioctl, term_ioctl, rtc_ioctl,
	v4l2_ioctl): Likewise.
	* ioctl.c (ioctl_decode, ioctl_lookup, compare, ioctl_next_match):
	Likewise.
	* block.c (block_ioctl): Likewise.
	* loop.c (loop_ioctl): Likewise.
	* mtd.c (mtd_ioctl, ubi_ioctl): Likewise.
	* ptp.c (ptp_ioctl): Likewise.
	* scsi.c (scsi_ioctl): Likewise.
	* sock.c (sock_ioctl): Likewise.
	* term.c (term_ioctl): Likewise.
	* time.c (rtc_ioctl): Likewise.
	* v4l2.c (v4l2_ioctl): Likewise.
	* ioctlsort.c (struct ioctlent, compare, main): Likewise.

2015-01-16  Dmitry V. Levin  <ldv@altlinux.org>

	ioctlent.sh: cleanup regexps that are used to fetch bases.

	ioctlent.sh: sync lookup regexps that are used in grep and sed.
	ioctlent.sh looks for ioctl command names using grep, and fetches them
	with their definitions using sed.  Historically, lookup regexps used in
	grep and sed are slightly different, which makes the script more
	complicated than necessary.

	qemu_multiarch_testing: update.
	* qemu_multiarch_testing/.gitignore: New file.
	* qemu_multiarch_testing/README: Update statistics.
	* qemu_multiarch_testing/hdc.dir/init2: Run "make check".
	* qemu_multiarch_testing/make-hdc-img.sh: Robustify,
	automatically calculate hdc image size.
	* qemu_multiarch_testing/parallel-build-hdc-img.sh: Reduce
	hdb image size.  Report completion of each parallelized task.

2015-01-14  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add IPC_STAT to ipc tests, workaround limitiations of old kernels
	* tests/ipc_msg.c: Include <errno.h>.
	(main): Add a test call with IPC_STAT, handle old kernels MSG_STAT behaviour.
	* tests/ipc_sem.c: Include <errno.h>.
	(main): Add a test call with IPC_STAT, handle old kernels SEM_STAT behaviour.
	* tests/ipc_shm.c: Include <errno.h>.
	(main): Add a test call with IPC_STAT, handle old kernels SHM_STAT behaviour.

	Change length type of umoven and umovestr to unsigned.
	* defs.h (umoven, umovestr): Change type of 3rd argument from "int"
	to "unsigned int".
	* util.c (umoven, umovestr): Likewise.  Adjust the code appropriately.

	tests: skip sendmmsg/recvmmsg test if these syscalls are not implemented in kernel
	* tests/mmsg.c: #include <errno.h>
	(main): Return 77 if sendmmsg failed with ENOSYS.

	tests: skip ip network tests when the network is not functional.
	* tests/inet-accept-connect-send-recv.c (main): Return 77 if inet stream
	socket cannot be created or it cannot be bound to INADDR_LOOPBACK.
	* tests/net-yy.test: Skip the test if inet-accept-connect-send-recv
	returns 77.

	tests: handle the case when all 64 process capability bits are set.
	* tests/caps.awk: Handle the case when all bits of 64-bit capability
	word are set.

	tests: explicitly request gawk when using gawk features.
	* tests/uid.test: Check for gawk availability and invoke gawk instead of
	plain awk because the test uses gawk's match() feature.

	tests: skip detach tests if kill does not work.
	* tests/detach-running.test: Skip if "kill -0" does not work.
	* tests/detach-sleeping.test: Likewise.
	* tests/detach-stopped.test: Likewise.

	ARM OABI: fix potential compilation warning.
	* syscall.c (get_scno) [!__ARM_EABI__ || ENABLE_ARM_OABI]: Fix
	"comparison between signed and unsigned" warning reported by some
	gcc versions.

	powerpc: fix potential compilation warning.
	* mem.c [POWERPC] (sys_subpage_prot): Fix "comparison between signed
	and unsigned" warning reported by some gcc versions.

2015-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	sparc, sparc64: remove ioctl header file names from solaris ioctl entries
	Starting with commit v4.9-27-g3e252ca, header file names should not be
	part of ioctlent files included by syscall.c

	* linux/sparc/ioctlent1.h: Remove ioctl header file names.
	* linux/sparc64/ioctlent2.h: Remove all entries, include "ioctlent.h".

2015-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	mips: enable indirect ipc subcall support.
	* linux/mips/syscallent-n32.h [LINUX_MIPSN32]: Define SYS_socket_subcall,
	include "subcall.h".
	* linux/mips/syscallent-n64.h [LINUX_MIPSN64]: Likewise.
	* linux/mips/syscallent-o32.h [LINUX_MIPSO32]: Likewise.

	mips: remove stub entries from syscallent files, generate stubs at build time
	* linux/mips/genstub.sh: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* configure.ac [MIPS]: Use it to generate syscallent stubs.
	* linux/mips/.gitignore: Add syscallent stubs.
	* linux/mips/syscallent-n32.h: Remove stub entries, include
	the stub file instead.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.

	build: add $(builddir)/$(OS)/$(ARCH) to the headers search list.
	* Makefile.am (AM_CPPFLAGS): Add -I$(builddir)/$(OS)/$(ARCH) before
	-I$(srcdir)/$(OS)/$(ARCH).

	build: fix build if siginfo_t lacks si_timerid/si_overrun.
	* configure.ac (AC_CHECK_MEMBERS): Check for siginfo_t.si_timerid and
	siginfo_t.si_overrun.
	* signal.c (printsiginfo) [SI_TIMER]: Check HAVE_SIGINFO_T_SI_TIMERID
	and HAVE_SIGINFO_T_SI_OVERRUN.

	configure.ac: remove unused AM_CONDITIONAL expressions.
	* configure.ac (AM_CONDITIONAL): Remove I386, X86_64, X32.

	tests: portability fixes.
	* tests/stat.test: dd obs= is not portable, use bs= instead.
	* tests/stat32-v.test: Likewise.
	* tests/stat64-v.test: Likewise.
	* tests/net.test: Use $* instead of $@ in the quoted string.
	* tests/net-fd.test: Likewise.
	* tests/statfs.test: Quote { and } in regexps.
	* tests/caps.awk: Likewise.
	* tests/getdents.awk: Likewise.
	* tests/net-yy-accept.awk: Likewise.
	* tests/net-yy-connect.awk: Likewise.
	* tests/sigaction.awk: Likewise.
	* tests/unix-yy-accept.awk: Likewise.
	* tests/unix-yy-connect.awk: Likewise.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	Wire up new syscalls.
	* linux/dummy.h (sys_bpf, sys_execveat, sys_getrandom,
	sys_kexec_file_load, sys_memfd_create, sys_seccomp): New stub aliases.
	* linux/32/syscallent.h (seccomp, getrandom, memfd_create, bpf,
	execveat): New entries.
	* linux/64/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/ia64/syscallent.h (getrandom, memfd_create, bpf, execveat):
	New entries.
	* linux/m68k/syscallent.h: Likewise.
	* linux/s390/syscallent.h: (seccomp, getrandom, memfd_create, bpf,
	s390_pci_mmio_write, s390_pci_mmio_read, execveat): New entries.
	* linux/s390x/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h (seccomp, getrandom, memfd_create,
	kexec_file_load, bpf, execveat): New entries.
	* linux/x32/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h (seccomp, getrandom, memfd_create):
	New entries.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	s390x: adjust some syscall entries.
	According to linux/arch/s390/include/uapi/asm/unistd.h, readdir is
	defined both on s390 and s390x, while getrlimit, _llseek, sendfile64,
	and fadvise64_64 are defined on s390 only.

	* linux/s390x/syscallent.h (readdir): Add.
	(getrlimit, _llseek, sendfile64, fadvise64_64): Remove.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	Change syscallent.h files to use designated initializers.
	Automatically convert all linux syscallent.h files to a form that uses
	designated initializers, with subsequent correction of whitespace
	indentation.

	* linux/alpha/syscallent.h: Use designated initializers.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	Create generic 32-bit syscallent.h.
	Since arc/syscallent.h, metag/syscallent.h, or1k/syscallent.h, and
	tile/syscallent1.h share a lot of identical syscall entries described in
	<asm-generic/unistd.h>, move these entries to a new file 32/syscallent.h
	using the following automated conversion with subsequent correction of
	whitespace indentation:

	sed -e 's|^[[:space:]]*\({[^}]\+},\)[[:space:]]*/\*[[:space:]]\([[:space:]]*[0-9]\+\)[[:space:]]*\*/|[\2] = \1|' -e '/^[[:space:]]*\[[[:space:]]*2\(4[4-9]\|5[0-9]\)/d' linux/arc/syscallent.h

	* linux/32/syscallent.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* linux/arc/syscallent.h: Include "32/syscallent.h",
	remove generic 32-bit syscall entries, use designated initializers.
	* linux/metag/syscallent.h: Likewise.
	* linux/or1k/syscallent.h: Likewise.
	* linux/tile/syscallent1.h: Likewise.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	tile: fix syscall entries.
	* linux/tile/syscallent1.h (truncate64, ftruncate64): Change nargs to 3.
	(pread64, pwrite64): Change nargs to 5.
	(llseek): Change sys_name to _llseek.

	s390: fix fadvise64 and fadvise64_64 syscall entries.
	* linux/s390/syscallent.h (fadvise64, fadvise64_64): Change sys_func to
	printargs until special parsers for 31-bit 31 s390 emulation wrappers
	are written.

	alpha: fix fadvise64 syscall entry.
	* linux/alpha/syscallent.h (fadvise64): Change sys_name to fadvise64.

	tile: fix fadvise64_64 syscall entry.
	* linux/tile/syscallent1.h (fadvise64_64): Fix nargs, sys_func,
	and sys_name.

	Fix getrlimit and ugetrlimit syscall entries.
	* linux/arm/syscallent.h (getrlimit, ugetrlimit): Fix sys_name.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/avr32/syscallent.h (getrlimit): Fix sys_name.
	* linux/or1k/syscallent.h: Likewise.
	* linux/s390/syscallent.h (ugetrlimit): Fix sys_name.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.

	Fix umount and umount2 syscall entries.
	* linux/aarch64/syscallent1.h (umount): Change nargs to 1.
	* linux/avr32/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* linux/ia64/syscallent.h (umount2): Change nargs to 2.
	* linux/arm/syscallent.h (umount, umount2): Fix sys_name.
	* linux/bfin/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/metag/syscallent.h: (umount2): Fix sys_name.
	* linux/or1k/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.

	Fix sendfile64 syscall entries.
	* linux/arc/syscallent.h (sendfile64): Change sys_name to sendfile64.
	* linux/metag/syscallent.h: Likewise.
	* linux/or1k/syscallent.h: Likewise.

	Fix number of arguments in ipc family syscall entries.
	* linux/64/syscallent.h (msgget, semget, semtimedop, semop, shmget,
	shmctl, shmat, shmdt): Fix nargs for direct ipc syscalls.
	* linux/alpha/syscallent.h (msgctl, msgget, msgrcv, semget, shmctl,
	shmdt, shmget, semtimedop): Likewise.
	* linux/avr32/syscallent.h (msgget, semget, semop, semtimedop, shmat,
	shmget, shmdt, shmctl): Likewise.
	* linux/bfin/syscallent.h (semget, semop, msgctl, msgget, msgrcv, shmat,
	* shmctl, shmdt, shmget, semtimedop): Likewise.
	* linux/hppa/syscallent.h (semop, semget, msgrcv, msgget, msgctl,
	semtimedop): Likewise.
	* linux/microblaze/syscallent.h (semtimedop, semget, semop, msgctl,
	msgget, msgrcv, shmat, shmctl, shmdt, shmget): Likewise.
	* linux/ia64/syscallent.h (semtimedop): Likewise.
	* linux/mips/syscallent-n32.h (semtimedop): Likewise.
	* linux/mips/syscallent-n64.h (semtimedop): Likewise.
	* linux/or1k/syscallent.h (msgget, msgctl, msgrcv, semget, semtimedop,
	semop, shmget, shmctl, shmat, shmdt): Likewise.
	* linux/sh64/syscallent.h (semget, msgget, shmget): Likewise.
	* linux/tile/syscallent1.h (msgget, semget, semtimedop, semop, shmget,
	shmctl, shmat, shmdt): Likewise.
	* linux/x32/syscallent.h (shmget, shmat, shmctl, semget, semop, shmdt,
	msgget, semtimedop): Likewise.
	* linux/x86_64/syscallent.h (shmget, shmat, shmctl, semget, semop,
	shmdt, msgget, semtimedop): Likewise.
	* linux/xtensa/syscallent.h (shmget, shmat, shmctl, shmdt, semtimedop,
	semget, semop, msgget, msgrcv, msgctl): Likewise.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	Create generic 64-bit syscallent.h.
	Since aarch64/syscallent1.h and tile/syscallent.h share a lot of
	identical syscall entries described in <asm-generic/unistd.h>, move
	these entries to a new file 64/syscallent.h using the following
	automated conversion with subsequent correction of whitespace
	indentation:

	sed -e 's|^[[:space:]]*\({[^}]\+},\)[[:space:]]*/\*[[:space:]]\([[:space:]]*[0-9]\+\)[[:space:]]*\*/|[\2] = \1|' -e '/^\[[[:space:]]*2\(4[4-9]\|5[0-9]\)\]/d' linux/tile/syscallent.h

	* linux/64/syscallent.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* linux/aarch64/syscallent1.h: Include "64/syscallent.h",
	remove generic 64-bit syscall entries, use designated initializers.
	* linux/tile/syscallent.h: Likewise.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	Fix nfsservctl syscall entries.
	* linux/arc/syscallent.h (nfsservctl): Set nargs, sys_func, and sys_name.
	* linux/metag/syscallent.h: Likewise.

	Add missing syscall entries for sched_[gs]etattr and renameat2.
	* linux/alpha/syscallent.h (sched_setattr, sched_getattr, renameat2):
	New syscall entries.
	* linux/arc/syscallent.h: Likewise.
	* linux/metag/syscallent.h: Likewise.
	* linux/or1k/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.
	* linux/tile/syscallent1.h: Likewise.

	Fix NUMA related syscall entries.
	* linux/alpha/syscallent.h (mbind, get_mempolicy, set_mempolicy):
	Set sys_func.
	* linux/hppa/syscallent.h (mbind, get_mempolicy, set_mempolicy):
	Fix nargs, set sys_func.
	* linux/microblaze/syscallent.h (mbind): Fix nargs.
	* linux/mips/syscallent-n32.h (move_pages): Set sys_func.
	* linux/mips/syscallent-n64.h (move_pages): Likewise.
	* linux/mips/syscallent-o32.h (mbind): Fix nargs.
	* linux/or1k/syscallent.h (migrate_pages): Likewise.
	* linux/powerpc/syscallent.h (migrate_pages): Likewise.
	* linux/sh/syscallent.h (mbind): Likewise.
	* linux/sh64/syscallent.h (mbind): Likewise.

	xtensa: fix syscall entries.
	* linux/xtensa/syscallent.h (sendmmsg): Fix sys_func and sys_name.
	(restart_syscall, io_setup, io_destroy, io_submit, io_getevents,
	io_cancel, add_key, request_key, keyctl): Set sys_func.
	(migrate_pages, mbind, get_mempolicy, set_mempolicy, move_pages,
	fstatat64): Fix nargs.
	(renameat2): New entry.

	Fix sched_setparam syscall entries.
	* linux/aarch64/syscallent1.h (sched_setparam): Change nargs to 2.
	* linux/arm/syscallent.h (sched_setparam): Likewise.
	* linux/avr32/syscallent.h (sched_setparam): Likewise.
	* linux/bfin/syscallent.h (sched_setparam): Likewise.
	* linux/i386/syscallent.h (sched_setparam): Likewise.
	* linux/m68k/syscallent.h (sched_setparam): Likewise.
	* linux/microblaze/syscallent.h (sched_setparam): Likewise.
	* linux/s390/syscallent.h (sched_setparam): Likewise.
	* linux/s390x/syscallent.h (sched_setparam): Likewise.
	* linux/sh/syscallent.h (sched_setparam): Likewise.
	* linux/sh64/syscallent.h (sched_setparam): Likewise.
	* linux/tile/syscallent.h (sched_setparam): Likewise.
	* linux/tile/syscallent1.h (sched_setparam): Likewise.
	* linux/x32/syscallent.h (sched_setparam): Likewise.
	* linux/x86_64/syscallent.h (sched_setparam): Likewise.

	arc: fix fanotify_mark syscall entry.
	* linux/arc/syscallent.h (fanotify_mark): Change nargs to 6.

	ia64: add fallocate syscall entry.
	* linux/ia64/syscallent.h (fallocate): Add syscall entry.

	Fix lookup_dcookie syscall entries.
	* linux/s390/syscallent.h (lookup_dcookie): Add syscall entry.
	* linux/s390x/syscallent.h (lookup_dcookie): Likewise.
	* linux/tile/syscallent.h (lookup_dcookie): Change nargs to 3.
	* linux/x32/syscallent.h (lookup_dcookie): Likewise.

	aarch64: fix syscall names for statfs, fstatfs, truncate, and ftruncate.
	* linux/aarch64/syscallent1.h (statfs, fstatfs, truncate, ftruncate):
	Use correct syscall names.

	aarch64: fix mlock syscall entry.
	* linux/aarch64/syscallent1.h (mlock): Change to mlock entry.

	sh, sh64: fix mlock syscall entry.
	* linux/sh/syscallent.h (mlock): Change nargs to 2.
	* linux/sh64/syscallent.h (mlock): Likewise.

	tile: fix swapon syscall entries.
	* linux/tile/syscallent.h (swapon): Change nargs to 2.
	* linux/tile/syscallent1.h (swapon): Likewise.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	ARM EABI: reserve some space for new syscalls.
	Reserve the same space for new syscalls on EABI as it is already
	reserved on OABI.

	* linux/arm/syscallent.h [__ARM_EABI__] (ARM_FIRST_SHUFFLED_SYSCALL):
	Raise to 400.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	arm: rewrite shuffle_scno in a bit more readable way.
	* linux/arm/syscallent.h: Define ARM_FIRST_SHUFFLED_SYSCALL instead of
	ARM_LAST_ORDINARY_SYSCALL.
	* syscall.c [ARM || AARCH64] (shuffle_scno): Update.

	tests: add tests for ipc syscalls decoding.
	* tests/ipc_msg.c: New file.
	* tests/ipc_sem.c: Likewise.
	* tests/ipc_shm.c: Likewise.
	* tests/ipc_msg.test: New test.
	* tests/ipc_sem.test: Likewise.
	* tests/ipc_shm.test: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add ipc_msg, ipc_sem, and ipc_shm.
	(TESTS): Add ipc_msg.test, ipc_sem.test, and ipc_shm.test.
	* tests/.gitignore: Add ipc_msg, ipc_sem, and ipc_shm.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	Fix indirect ipc subcall handling.
	indirect_ipccall used to guess whether currently decoded ipc syscall is
	an indirect subcall or not based on generic knowledge, while there is a
	robust method to identify indirect ipc subcalls.

	* defs.h (TRACE_INDIRECT_SUBCALL): New flag.
	* ipc.c (indirect_ipccall): Check it.
	* linux/subcall.h: Set it.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	Move socket and ipc subcall entries to subcall.h.
	Syscall entries for socket and ipc subcalls are the same on all
	architectures, or at least they should be the same, so move them
	to the single file.

	* linux/subcall.h: Add syscall entries for socket and ipc subcalls.
	* linux/arm/syscallent.h: Remove entries for socket and ipc subcalls.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.

2015-01-12  Dmitry V. Levin  <ldv@altlinux.org>

	sh: fix typo introduced by commit v4.9-121-gd535b8b.
	* linux/sh/syscallent.h (getresgid32): Fix typo in sys_func and sys_name.

2015-01-10  Dmitry V. Levin  <ldv@altlinux.org>

	Fix fanotify_mark decoding on 32-bit architectures.
	The fanotify_mark syscall takes a 64-bit mask, and on 32-bit
	architectures it is split up into two syscall arguments.

	* configure.ac (AC_CHECK_FUNCS): Add fanotify_mark.
	(AC_CHECK_HEADERS): Add sys/fanotify.h.
	* defs.h (getllval): New prototype.
	* util.c (getllval): New function based on printllval.
	(printllval): Use getllval.
	* fanotify.c (sys_fanotify_mark): Use getllval to properly decode
	64-bit mask and two syscall arguments followed by it.
	* tests/fanotify_mark.c: New file.
	* tests/fanotify_mark.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add fanotify_mark.
	(TESTS): Add fanotify_mark.test.
	* tests/.gitignore: Add fanotify_mark.

2015-01-09  Dmitry V. Levin  <ldv@altlinux.org>

	v4l2: fix build on systems with older kernel headers.
	* v4l2.c (print_v4l2_format_fmt): Do not use
	V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY unless it is defined.
	(v4l2_ioctl): Do not use VIDIOC_ENUM_FRAMESIZES and
	VIDIOC_ENUM_FRAMEINTERVALS unless they are defined.

2015-01-09  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix build with awk that does not support switch-case.
	The switch-case statement is a gawk-specific feature which is not
	necessarily available, let's use traditional if-else statements instead.

	* tests/uid.awk: Rewrite without switch-case statements.

2015-01-09  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build on systems that lack O_CLOEXEC definition.
	* xlat/timerfdflags.in [!TFD_CLOEXEC]: Check that O_CLOEXEC is defined.

2015-01-09  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build on systems that lack NETLINK_SOCK_DIAG definition.
	NETLINK_INET_DIAG was introduced in linux v2.6.14,
	NETLINK_SOCK_DIAG was added much later in linux v3.3.

	* net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG]
	(NETLINK_SOCK_DIAG): Define.
	* socketutils.c: Likewise.
	* tests/netlink_unix_diag.c: Likewise.

2015-01-09  Dmitry V. Levin  <ldv@altlinux.org>

	Cleanup local copy of linux/fanotify.h.
	* linux/fanotify.h: Remove macros and structures not used by
	fanotify_init and fanotify_mark parsers.

	Fix "make dist" regression introduced by commit v4.9-125-g120e5db.
	* Makefile.am (EXTRA_DIST): Add linux/unix_diag.h.

2015-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix build with fresh glibc.
	* tests/netlink_unix_diag.c: Include <stdint.h>.

2015-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	ioctlent.sh: handle linux/aufs_type.h properly.
	Before this change, ioctlent.sh could not recognize unusual constants
	defined by linux/aufs_type.h, resulting to ioctls.h with references to
	these constants without appropriate definitions in ioctldefs.h.

	* linux/ioctlent.sh: Update the regexp that is used to lookup constants
	referenced by generated ioctls.h.

2015-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix distcheck.
	* tests/stat32-v.test: Remove work files if the test is skipped.

	Fix printing of time_t values set in the distant future.
	* util.c (sprinttime): Increase buffer size.
	* tests/stat64-v.test: Try to set modification time of the sample file
	to a value set in the distant future.

	Use AC_CHECK_TYPES to check for struct statfs64.
	* m4/statfs.m4: Remove.
	* configure.ac (AC_STATFS64): Remove.
	(AC_CHECK_TYPES): Add struct statfs64.
	* statfs.c: Replace HAVE_STATFS64 with HAVE_STRUCT_STATFS64.

	Use AC_CHECK_TYPES to check for struct stat64.
	* m4/stat.m4: Remove.
	* configure.ac (AC_STAT64): Remove.
	(AC_CHECK_TYPES): Add struct stat64.
	* file.c: Replace HAVE_STAT64 with HAVE_STRUCT_STAT64.

	file.c: fix 32-bit stat decoding on 64-bit architectures.
	* file.c [SPARC || SPARC64] (struct stat): Remove, use generic
	definition from <asm/stat.h>.
	[SPARC64] (struct stat_sparc64, printstat_sparc64): Remove.
	[AARCH64 || X86_64 || X32 || POWERPC64 || SPARC64] (struct stat32,
	STAT32_PERSONALITY): Define.
	[STAT32_PERSONALITY] (struct stat_powerpc32): Rename to struct stat32.
	[STAT32_PERSONALITY] (printstat_powerpc32): Rename to printstat32.
	(printstat) [STAT32_PERSONALITY]: Call printstat32 when
	current_personality == STAT32_PERSONALITY.
	[HAVE_STAT64] (printstat64) [STAT32_PERSONALITY]: Call printstat when
	current_personality != STAT32_PERSONALITY.
	[!HAVE_STAT64] (sys_stat64): Fallback to sys_stat.
	[!HAVE_STAT64] (sys_fstat64): Fallback to sys_fstat.

	sparc: reuse struct stat parser code for struct solstat decoding.
	* printstat.h: Parametrize major() and minor().
	* file.c [SPARC || SPARC64]: Define do_printstat_sol by instantiating
	printstat.h template.
	[SPARC || SPARC64] (printstatsol): Use do_printstat_sol.

	ppc64: reuse struct stat parser code for struct stat_powerpc32 decoding.
	* file.c [POWERPC64]: Define do_printstat32 by instantiating printstat.h
	template.
	[POWERPC64] (printstat_powerpc32): Use do_printstat32.

	file.c: group related parsers together.
	* file.c (sys_stat, sys_fstat): Collect in one place right before
	the definition of printstat64.
	(sys_stat64, sys_fstat64): Collect in one place right after the
	definition of printstat64.

	file.c: collect scattered __old_kernel_stat related code.
	* file.c [HAVE_STRUCT___OLD_KERNEL_STAT] (convertoldstat, printoldstat,
	sys_oldstat, sys_oldfstat): Collect functions in one place.

	Use the same source code for struct stat/stat64 decoding.
	* file.c: Define do_printstat64 by instantiating printstat.h template.
	(printstat64): Use do_printstat64.

	x32: use generic printstat/printstat64 parsers.
	* file.c (printstat) [X32]: Define.
	(printstat64) [X32]: Use "struct stat64" instead of "struct stat".
	Use printstat for x32 personality processes.
	(printstat64_x32): Remove.
	(sys_stat64, sys_fstat64) [X32]: Use printstat64 instead of
	printstat64_x32.

	x32: remove redundant definitions.
	* file.c [X32]: Do not define "struct stat" and "struct
	__old_kernel_stat" locally, use definitions provided by <asm/stat.h>.
	Do not define "struct stat64" exclusively, reuse another definition
	added earlier for X86_64.

	Convert do_printstat to a template function.
	* printstat.h: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c: Include "printstat.h".
	(do_printstat): Move to printstat.h, parametrize its name
	and struct stat.

	file.c: prepare realprintstat for parametrization.
	* file.c (realprintstat): Adjust format strings so that all 64-bit
	integer fields are printed with %llu format, and %u format is used for
	all the rest.  Rename to do_printstat.
	(printstat, printoldstat): Update callers.

	tests: cleanup stat.test.
	* tests/stat.test: Rewrite in a more readable way.

	tests: check verbose decoding of 32-bit and 64-bit struct stat.
	* tests/stat.c: New file.
	* tests/stat32.c: Likewise.
	* tests/stat32-v.test: New file.
	* tests/stat64-v.test: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add stat and stat32.
	(stat_CFLAGS): Define.
	(TESTS): Add stat32-v.test and stat64-v.test.
	* tests/.gitignore: Add stat and stat32.

2015-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	Cleanup struct stat.st_flags decoding.
	There are no symbolic constants defined for struct stat.st_flags,
	so decode this rare field as unsigned int.

	* xlat/fileflags.in: Remove.
	* file.c (realprintstat, printstat64) [HAVE_STRUCT_STAT_ST_FLAGS]:
	Decode struct stat.st_flags as unsigned int.

2015-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	Drop struct stat.st_aclcnt and stat.st_level support.
	Remove the code that supports struct stat.st_aclcnt and stat.st_level
	decoding -- these fields are not defined in system headers.

	* configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_aclcnt and
	struct stat.st_level.
	* file.c (realprintstat, printstat64)
	[HAVE_STRUCT_STAT_ST_ACLCNT || HAVE_STRUCT_STAT_ST_LEVEL]: Remove.

2015-01-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix race condition in net-accept-connect based tests.
	Change all net-accept-connect based tests to use different unix domain
	socket addresses, so that these tests could be safely run in parallel.

	* tests/net-accept-connect.c: Parametrize unix domain socket address.
	* tests/net-fd.test: Pass socket address to net-accept-connect.
	* tests/net.test: Likewise.
	* tests/unix-yy.test: Likewise.
	* tests/unix-yy-accept.awk: Update regexps.
	* tests/unix-yy-connect.awk: Likewise.

2014-12-31  Mike Frysinger  <vapier@gentoo.org>

	timerfd: update flags decoding.
	The current code only decodes TFD_TIMER_ABSTIME when the kernel has
	a bunch of newer flags.  We have to handle fallbacks for all of them
	since the kernel doesn't currently export things to userspace.

	* time.c: Include fcntl.h for O_* defines.
	(TFD_TIMER_ABSTIME): Move to xlat/timerfdflags.in.
	* xlat/timerfdflags.in: Add more definitions.

2014-12-29  Dmitry V. Levin  <ldv@altlinux.org>

	sparc: fix fxstat decoding.
	* file.c [SPARC || SPARC64] (sys_fxstat): Print file descriptor
	using printfd.

2014-12-29  Dmitry V. Levin  <ldv@altlinux.org>

	sparc: drop _STAT64_VER support.
	Starting with commit v4.6-240-g5afdf12, nobody compiles this
	non-Linux code.

	* file.c [SPARC || SPARC64] (sys_xstat, sys_fxstat): Remove
	_STAT64_VER code.

2014-12-29  Dmitry V. Levin  <ldv@altlinux.org>

	sparc: remove redundant sys_lxstat.
	* file.c [SPARC || SPARC64] (sys_lxstat): Remove.
	* linux/sparc/dummy2.h (solaris_lxstat): Alias to sys_xstat.
	* linux/sparc64/dummy2.h (solaris_lxstat): Likewise.

2014-12-28  Dmitry V. Levin  <ldv@altlinux.org>

	file.c: do not include unused headers.
	* file.c: Do not include <fcntl.h>.

2014-12-27  Dmitry V. Levin  <ldv@altlinux.org>

	Cleanup UTIME_NOW/UTIME_OMIT decoding.
	Move the code that's present in two copies from sprinttv()
	to a new helper function.

	* time.c (do_sprinttv): New function.
	(sprinttv): Use it.

2014-12-27  Elliott Hughes  <enh@google.com>

	Fix UTIME_NOW/UTIME_OMIT decoding.
	The kernel doesn't actually care what tv_sec is set to --- it only checks
	tv_nsec when looking for the special values.

2014-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Make -yy output for inet sockets consistent with unix domain sockets.
	Prepend -yy output generated for INET/INET6 TCP/UDP sockets with their
	protocol name obtained using getxattr.

	* socketutils.c (inet_parse_response): Add proto_name argument.
	Print proto_name for connected and unconnected sockets.
	(receive_responses): Add proto_name argument, pass it to the parser.
	(inet_print): Add proto_name argument, pass it to receive_responses.
	(unix_parse_response): Add proto_name argument.
	(print_sockaddr_by_inode): Pass protocol name to inet_print calls.
	* tests/net-yy-accept.awk: Update to match new output format.
	* tests/net-yy-connect.awk: Likewise.

2014-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify unix domain socket decoding test.
	Unix domain socket address family name is not universally decoded as
	AF_LOCAL, other names like AF_UNIX and AF_FILE are valid synonyms.
	Similarly, PF_UNIX and PF_FILE are valid synonyms for PF_LOCAL.

	Some test regexps have to be properly initialized before they could
	be used, so make sure they are initialized before use.

2014-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix unix domain socket decoding availability test.
	Since inet_diag and unix_diag interfaces are implemented by different
	kernel modules, they have to be tested separately.

	* tests/netlink_unix_diag.c: New file.
	* tests/unix-yy.test: Use it.
	* tests/Makefile.am (check_PROGRAMS): Add it.
	* tests/.gitignore: Likewise.

2014-12-25  Masatake YAMATO  <yamato@redhat.com>

	tests: add a test for decoding unix domain socket addresses.
	* tests/unix-yy-accept.awk: New file.
	* tests/unix-yy-connect.awk: New file.
	* tests/unix-yy.test: New test.
	* tests/Makefile.am (TESTS): Add it.
	(EXTRA_DIST): Add unix-yy-accept.awk and unix-yy-connect.awk.

2014-12-25  Masatake YAMATO  <yamato@redhat.com>

	Support unix domain sockets in -yy option.
	This change extends -yy option to handle unix domain sockets:
	their peer addresses will be printed, similar to inet sockets.

	For a listening socket, its socket inode and socket path are printed.
	For an accepted socket, its socket inode, the peer inode, and the
	socket path are printed.
	For a client socket, its socket inode and the peer inode are printed.

	An example of a server side communication using netcat:

		$ ./strace -yy -e network nc -l -U /tmp/example.sock
		socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
		setsockopt(3<UNIX:[14728348]>, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
		bind(3<UNIX:[14728348]>, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0
		listen(3<UNIX:[14728348,"/tmp/example.sock"]>, 10) = 0
		accept(3<UNIX:[14728348,"/tmp/example.sock"]>, {sa_family=AF_LOCAL, NULL}, [2]) = 4<UNIX:[14727246->14727245,"/tmp/example.sock"]>
		recvfrom(4<UNIX:[14727246->14727245,"/tmp/example.sock"]>, "INPUT\n", 8192, 0, NULL, NULL) = 6
		INPUT

	An example of a client side communication using netcat:

		$ ./strace -yy -e network nc -U /tmp/example.sock
		socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
		connect(3<UNIX:[14727245]>, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0
		getsockopt(3<UNIX:[14727245]>, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
		INPUT
		...
		sendto(3<UNIX:[14727245->14727246]>, "INPUT\n", 6, 0, NULL, 0) = 6

	* linux/unix_diag.h: New file.
	* socketutils.c (send_query): Rename to inet_send_query.
	(parse_response): Rename to inet_parse_response.
	(unix_print, unix_send_query, unix_parse_response): New functions.
	(receive_responses): Add a new argument named parser: a function for
	handling protocol specific data parts of diag messages.
	(print_sockaddr_by_inode): Call unix_print.
	Replace NETLINK_INET_DIAG with NETLINK_SOCK_DIAG, they are equal
	but NETLINK_SOCK_DIAG looks more generic.

2014-12-16  Masatake YAMATO  <yamato@redhat.com>

	Use the protocol name of a socket as a hint for peer address resolution.
	To resolve the peer address of socket, all combinations of families
	(AF_INET, AF_INET6) and protocols(IPPROTO_TCP, IPPROTO_UDP) were tried.
	This change utilizes the protocol name obtained via getxattr to specify
	the right combination.

	* socketutils.c (inet_print): New helper function.
	(print_sockaddr_by_inode): Use it.  Utilize the protocol name
	associated with the given inode for resolving the peer socket
	address.  If the protocol name is NULL, resolve the address
	by trying combinations of families and protocols as before.
	* defs.h (print_sockaddr_by_inode): Update prototype.
	* util.c (printfd): Pass the protocol name associated with
	the given path to print_sockaddr_by_inode as the 2nd argument.

2014-12-16  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of getgroups, getgroups32, setgroups, and setgroups32 syscalls
	Convert parsers of these syscalls to the same scheme as were applied to
	parsers of other uid/gid related syscalls.
	That is, define two sets of parsers on architectures that support
	(either directly or via multiarch) 16-bit and 32-bit gid getgroups
	and setgroups syscalls simultaneously, and reuse essentially the same
	code by parametrizing uid_t and names of parser functions.

	* groups.c: Remove.
	(sys_getgroups, sys_setgroups): Move ...
	* uid.c: ... here and parametrize their names.
	* Makefile.am (strace_SOURCES): Remove groups.c.
	* linux/syscall.h (sys_getgroups32, sys_setgroups32): Remove.
	[NEED_UID16_PARSERS] (sys_getgroups16, sys_setgroups16): New prototypes.
	* linux/arm/syscallent.h: Rename sys_[gs]etgroups to sys_[gs]etgroups16,
	rename sys_[gs]etgroups32 to sys_[gs]etgroups.
	* linux/bfin/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* tests/uid.c: Test for getgroups.
	* tests/uid16.c: Likewise.
	* tests/uid32.c: Test for getgroups32.
	* tests/uid.awk: Test for getgroups/getgroups32 decoding.
	* tests/uid.test: Trace getgroups/getgroups32 syscalls.

2014-12-16  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of 16-bit *chown and [gs]et*[gu]id syscalls.
	Define two sets of parsers on architectures that support (either
	directly or via multiarch) 16-bit and 32-bit uid/gid syscalls
	simultaneously.  Since the code in these two sets is essentially
	the same and the key difference between them is the size of uid_t,
	implement it by parametrizing uid_t and names of parser functions.

	* defs.h (NEED_UID16_PARSERS): New macro.
	* linux/syscall.h [NEED_UID16_PARSERS] (sys_chown16, sys_fchown16,
	sys_getresuid16, sys_getuid16, sys_setfsuid16, sys_setresuid16,
	sys_setreuid16, sys_setuid16): New prototypes.
	* linux/dummy.h (sys_geteuid16): Alias to sys_getuid16.
	(sys_getegid16, sys_getgid16, sys_getresgid16, sys_setfsgid16,
	sys_setgid16, sys_setregid16, sys_setresgid16): Alias to corresponding
	sys_*uid16 functions.
	* uid.c: Stop including <asm/posix_types.h>.
	Parametrize uid_t and names of all exported functions.
	(get_print_uid): New function.
	(sys_getresuid): Use it.
	(printuid): Check for (uid_t) -1.
	* uid16.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* linux/arm/syscallent.h: Use sys_chown16, sys_fchown16, sys_getegid16,
	sys_geteuid16, sys_getgid16, sys_getresgid16, sys_getresuid16,
	sys_getuid16, sys_setfsgid16, sys_setfsuid16, sys_setgid16,
	sys_setregid16, sys_setresgid16, sys_setresuid16, sys_setreuid16,
	and sys_setuid16 parsers for *chown and [gs]et*[gu]id syscall entries.
	* linux/bfin/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* tests/uid16.c: New file.
	* tests/uid16.test: New test.
	* tests/Makefile.am (CHECK_PROGRAMS): Add uid16.
	(TESTS): Add uid16.test.
	* tests/.gitignore: Add uid16.

2014-12-16  Dmitry V. Levin  <ldv@altlinux.org>

	sh, sh64: fix uid/gid syscall entries.
	* linux/sh/syscallent.h: Replace printargs with real syscall
	parsers in *chown32 and [gs]et*[gu]id32 syscall entries.
	* linux/sh64/syscallent.h: Likewise.

	s390: fix uid/gid syscall entries.
	* linux/s390/syscallent.h: Add "32" suffix to names of *chown32
	and [gs]et*[gu]id32 syscalls #198..216.

	sparc: fix uid/gid syscall entries.
	* linux/sparc/syscallent.h: Add "32" suffix to names
	of [gs]etres[gu]id32 syscalls #108..112.
	Fix entry for syscall #112 from setresgid32 to setregid32.

2014-12-15  Dmitry V. Levin  <ldv@altlinux.org>

	chown.c: split into separate files.
	This will make further uid/gid fixes simpler.

	* fchownat.c: New file.
	* chown.c (sys_fchownat: Move to fchownat.c.
	(sys_chown, sys_fchown): Move to uid.c.
	* Makefile.am (strace_SOURCES): Remove chown.c, add fchownat.c.

2014-12-15  Dmitry V. Levin  <ldv@altlinux.org>

	util.c: move printuid to uid.c.
	This will make further uid/gid fixes simpler.

	* util.c (printuid): Move
	* uid.c: ... here.

2014-12-15  Dmitry V. Levin  <ldv@altlinux.org>

	tests/uid.awk: rewrite in a more maintainable style.
	Since the test is virtually a FSM, rewrite it as a FSM.

2014-12-14  Dmitry V. Levin  <ldv@altlinux.org>

	printuid: fix uid_t decoding on 64-bit architectures.
	It was not a good idea to treat uid_t as a long int type because
	the latter is twice larger than uid_t on 64-bit architectures.

	* defs.h (printuid): Change uid argument type from "unsigned long"
	to "unsigned int".
	* util.c (printuid): Likewise.  When uid equals to -1, print "-1".
	* tests/uid.awk: New file.
	* tests/uid.c: New file.
	* tests/uid32.c: Likewise.
	* tests/uid.test: New test.
	* tests/uid32.test: Likewise.
	* tests/Makefile.am (CHECK_PROGRAMS): Add uid and uid32.
	(TESTS): Add uid.test and uid32.test.
	(EXTRA_DIST): Add uid.awk.
	* tests/.gitignore: Add uid and uid32.

2014-12-13  Dmitry V. Levin  <ldv@altlinux.org>

	Update PTRACE_* constants.
	* xlat/ptrace_cmds.in: Add PTRACE_PEEKSIGINFO, PTRACE_GETSIGMASK,
	and PTRACE_SETSIGMASK.

	Update SWAP_FLAG_* constants.
	* swapon.c: Ensure that SWAP_FLAG_DISCARD_ONCE and
	SWAP_FLAG_DISCARD_PAGES are defined.
	* xlat/swap_flags.in: Add SWAP_FLAG_DISCARD_ONCE and
	SWAP_FLAG_DISCARD_PAGES.

2014-12-11  Dmitry V. Levin  <ldv@altlinux.org>

	Update SCHED_* constants.
	* xlat/schedulers.in: Add SCHED_BATCH, SCHED_ISO, SCHED_IDLE, and
	SCHED_DEADLINE.

	Update prctl PR_* constants.
	* xlat/prctl_options.in: Add PR_SET_THP_DISABLE, PR_GET_THP_DISABLE,
	PR_MPX_ENABLE_MANAGEMENT, and PR_MPX_DISABLE_MANAGEMENT.

2014-12-11  Dmitry V. Levin  <ldv@altlinux.org>

	Always compile sys_prctl parser.
	Since sys_prctl is referenced by syscallent files unconditionally,
	conditional compilation of sys_prctl depending on prctl availability is
	pointless.

	* prctl.c (unalignctl_string, sys_prctl): Compile unconditionally.

2014-12-11  Dmitry V. Levin  <ldv@altlinux.org>

	process.c: split struct_user_offsets into architecture-specific include files
	* Makefile.am (EXTRA_DIST): Add linux/alpha/userent.h,
	linux/arm/userent.h, linux/avr32/userent.h, linux/bfin/userent.h,
	linux/crisv10/userent.h, linux/crisv32/userent.h,
	linux/i386/userent.h, linux/i386/userent0.h, linux/ia64/userent.h,
	linux/m68k/userent.h, linux/microblaze/userent.h,
	linux/mips/userent.h, linux/or1k/userent.h, linux/powerpc/userent.h,
	linux/s390/userent.h, linux/s390/userent0.h, linux/s390/userent1.h,
	linux/s390x/userent.h, linux/sh/userent.h, linux/sh/userent0.h,
	linux/sh64/userent.h, linux/sparc/userent.h, linux/sparc64/userent.h,
	linux/tile/userent.h, linux/userent.h, linux/userent0.h,
	linux/x32/userent.h, linux/x86_64/userent.h, and
	linux/xtensa/userent.h.
	* process.c (struct_user_offsets): Split into architecture-specific
	include files, inculde userent.h.

	process.c: include less headers.
	* process.c: Do not include <fcntl.h> and <sys/stat.h>.
	Reorder inclusion of xlat header files.

	Unexport struct_user_offsets.
	* defs.h (struct_user_offsets): Remove.
	* process.c (struct_user_offsets): Make static.

2014-12-11  Dmitry V. Levin  <ldv@altlinux.org>

	process.c: introduce XLAT_UOFF macro.
	Introduce XLAT_UOFF macro and use it to automatically transform
	struct_user_offsets array into a more readable and compact form.

	for n in $(sed -n 's/^[[:space:]]*{[[:space:]]*uoff(\([a-z_0-9]\+\)),.*/\1/p' process.c |sort -u); do
		sed -i 's/^\([[:space:]]*\){[[:space:]]*uoff('"$n"'),[[:space:]]*"offsetof(struct user,[[:space:]]*'"$n"')"[[:space:]]*},$/\1XLAT_UOFF('"$n"'),/' process.c
	done

	* process.c (XLAT_UOFF): New macro.
	(struct_user_offsets): Use it.

2014-12-11  Dmitry V. Levin  <ldv@altlinux.org>

	process.c: move sethostname and gethostname parsers to a separate file.
	* hostname.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c (sys_sethostname, sys_gethostname): Move to hostname.c.

	process.c: move exit parser to a separate file.
	* exit.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c (sys_exit): Move to exit.c.

	process.c: move clone, setns, unshare, and fork parsers to a separate file
	* clone.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c: Move sys_clone, sys_setns, sys_unshare, sys_fork, and
	related code to clone.c.

	process.c: move get*uid and set*uid parsers to a separate file.
	* uid.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c (sys_getuid, sys_setfsuid, sys_setuid, sys_getresuid,
	sys_setreuid, sys_setresuid): Move to uid.c.

	process.c: move getgroups* and setgroups* parsers to a separate file.
	* groups.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c: Move sys_setgroups, sys_getgroups, sys_setgroups32,
	sys_getgroups32, and related code to groups.c.

	process.c: move execve and execv parsers to a separate file.
	* execve.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c: Move sys_execve, sys_execv, and related code to execve.c.

	process.c: move waitpid, wait4, osf_wait4, and waitid parsers to a separate file
	* wait.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c: Move sys_waitpid, sys_wait4, sys_osf_wait4, sys_waitid and
	related code to wait.c.

	process.c: move uname parser to a separate file.
	* uname.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c (sys_uname): Move to uname.c.

	process.c: move futex parser to a separate file.
	* futex.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c: Move sys_futex and related code to futex.c.

	process.c: move get_robust_list parser to a separate file.
	* get_robust_list.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c (sys_get_robust_list): Move to get_robust_list.c.

	process.c: move sched_* parsers to a separate file.
	* sched.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c: Move sys_sched_getscheduler, sys_sched_setscheduler,
	sys_sched_getparam, sys_sched_setparam, sys_sched_get_priority_min,
	sys_sched_rr_get_interval, and related code to sched.c.

	process.c: move sched_setaffinity and sched_getaffinity parsers to a separate file
	* affinity.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c (sys_sched_setaffinity, sys_sched_getaffinity): Move
	to affinity.c.

	process.c: move prctl and arch_prctl parsers to a separate file.
	* prctl.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c: Move sys_prctl, sys_arch_prctl, and related code to prctl.c.

	process.c: move getcpu parser to a separate file.
	* getcpu.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c (sys_getcpu): Move to getcpu.c.

	process.c: move process_vm_readv and process_vm_writev parsers to a separate file
	* process_vm.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* process.c (sys_process_vm_readv, sys_process_vm_writev): Move
	to process_vm.c.

	Implement decoding of fallocate FALLOC_FL_* flags.
	* xlat/falloc_flags.in: New file.
	* configure.ac (AC_CHECK_HEADERS): Add linux/falloc.h.
	* fallocate.c [HAVE_LINUX_FALLOC_H]: Include <linux/falloc.h>.
	Include xlat/falloc_flags.h.
	(sys_fallocate): Decode flags.

	Fix decoding of renameat2 RENAME_* flags.
	* renameat.c: Include <linux/fs.h> where RENAME_NOREPLACE,
	RENAME_EXCHANGE, and RENAME_WHITEOUT are usually defined.

	file.c: move open, openat, and creat parsers to a separate file.
	* open.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c: Move sys_open, sys_openat, sys_creat, and related code
	to open.c.

	file.c: move access and faccessat parsers to a separate file.
	* access.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c: Move sys_access, sys_faccessat and related code to access.c.

	file.c: move umask parser to a separate file.
	* umask.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c (sys_umask): Move to umask.c.

	file.c: move lseek and llseek parsers to a separate file.
	* lseek.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c: Move sys_lseek, sys_llseek, and related code to lseek.c.

	file.c: move readahead parser to a separate file.
	* readahead.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c (sys_readahead): Move to readahead.c.

	file.c: move truncate, truncate64, ftruncate, and ftruncate64 parsers to a separate file
	* truncate.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c (sys_truncate, sys_truncate64, sys_ftruncate, sys_ftruncate64):
	Move to truncate.c.

	file.c: move chdir parser to a separate file.
	* chdir.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c (sys_chdir): Move to chdir.c.

	file.c: move link, linkat, unlinkat, and symlinkat parsers to a separate file
	* link.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c: Move sys_link, sys_linkat, sys_unlinkat, sys_symlinkat, and
	related code to link.c.

	file.c: move readlink and readlinkat parsers to a separate file.
	* readlink.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c (decode_readlink, sys_readlink, sys_readlinkat): Move
	to readlink.c.

	file.c: move renameat and renameat2 parsers to a separate file.
	* renameat.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c: Move sys_renameat, sys_renameat2, and related code
	to renameat.c.

	file.c: move chown, fchown, and fchownat parsers to a separate file.
	* chown.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c (sys_chown, sys_fchownat, sys_fchown): Move to chown.c.

	Export at_flags.
	* defs.h (at_flags): New prototype.

	file.c: move chmod, fchmod, and fchmodat parsers to a separate file.
	* chmod.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c (sys_chmod, sys_fchmodat, sys_fchmod): Move to chmod.c.

	file.c: move utimes, futimesat, utimensat, and osf_utimes parsers to a separate file
	* utimes.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c (decode_utimes, sys_utimes, sys_futimesat, sys_utimensat,
	sys_osf_utimes): Move to utimes.c.

	file.c: move utime parser to a separate file.
	* utime.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c (sys_utime): Move to utime.c.

	Export sprinttime.
	* defs.h (sprinttime): New prototype.
	* file.c (sprinttime): Make global and move to util.c.

	file.c: move mknod, mknodat, and xmknod parsers to a separate file.
	* mknod.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c: Move sys_mknod, sys_mknodat, sys_xmknod, and related code
	to mknod.c.

	file.c: export sprintmode and move it to a separate file.
	* printmode.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (sprintmode): New prototype.
	* file.c (sprintmode): Make global and move to printmode.c.

	file.c: move getcwd parser to a separate file.
	* getcwd.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c (sys_getcwd): Move to getcwd.c.

	file.c: move *xattr parsers to a separate file.
	* xattr.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c: Move sys_setxattr, sys_fsetxattr, sys_getxattr, sys_fgetxattr,
	sys_listxattr, sys_flistxattr, sys_removexattr, sys_fremovexattr,
	and related code to xattr.c.

	file.c: move fadvise64 and fadvise64_64 parsers to a separate file.
	* fadvise.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c: Move sys_fadvise64, sys_fadvise64_64, and related code
	to fadvise.c.

	file.c: move sync_file_range and sync_file_range2 parsers to a separate file
	* sync_file_range.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c: Move sys_sync_file_range, sys_sync_file_range2, and related
	code to sync_file_range.c.

	file.c: move fallocate parser to a separate file.
	* fallocate.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c (sys_fallocate): Move to fallocate.c.

	file.c: move swapon parser to a separate file.
	* swapon.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c: Move sys_swapon and related code to swapon.c.

2014-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	Implement full decoding of 64-bit capabilities.
	Unlike v1 capabilities which are 32-bit, v2 and v3 are 64-bit, but
	before this change only lower 32 capability bits were decoded for
	v2 and v3.

	* xlat/capabilities1.in: New file.
	* capability.c: Define v2/v3 CAP_* constants.
	Include xlat/capabilities1.h.
	(get_cap_header): New function.
	(print_cap_header): Update to use get_cap_header result.
	(print_cap_data): Decoder higher capability bits for v2 and v3.
	(sys_capget, sys_capset): Use get_cap_header, update print_cap_header
	and print_cap_data calls.
	* tests/caps.c: New file.
	* tests/caps.awk: New file.
	* tests/caps.test: New test.
	* tests/Makefile.am (CHECK_PROGRAMS): Add caps.
	(TESTS): Add caps.test.
	(EXTRA_DIST): Add caps.awk.

2014-12-06  Dmitry V. Levin  <ldv@altlinux.org>

	Make parsers of capget and capset syscalls self-contained.
	Various versions of <linux/capability.h> used to require different
	workarounds to avoid conflicts with types defined by libc headers.
	Define all required types and constants locally to fix this issue.

	* configure.ac (AC_CHECK_HEADERS): Remove linux/capability.h.
	* capability.c: Do not include <linux/capability.h>, remove workarounds
	for problematic versions of <linux/capability.h> file.
	Define CAP_* and _LINUX_CAPABILITY_VERSION_* constants as enums.
	(struct __user_cap_header_struct, struct __user_cap_data_struct): Define.
	* xlat/cap_version.in: Add #unconditional.
	* xlat/capabilities.in: Likewise.

2014-12-04  Dmitry V. Levin  <ldv@altlinux.org>

	Remove system.c.
	All disjoint parts of system.c have been moved to separate files.

	* system.c: Remove.
	* Makefile.am (strace_SOURCES): Remove it.

2014-12-04  Dmitry V. Levin  <ldv@altlinux.org>

	Move mount parser to a separate file.
	* mount.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* system.c: Move sys_mount and related code to mount.c.

	Move umount2 parser to a separate file.
	* umount.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* system.c: Move sys_umount2 and related code to umount.c.

	Move personality parser to a separate file.
	* personality.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* system.c: Move sys_personality and related code to personality.c.

	Move syslog parser to a separate file.
	* syslog.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* system.c: Move sys_syslog and related code to syslog.c.

	Move cacheflush parser to a separate file.
	* cacheflush.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* system.c: Move inclusion of <asm/cachectl.h> to cacheflush.c.
	[M68K, BFIN, SH]: Move to cacheflush.c.

	bfin: move sram_alloc parser to a separate file.
	* sram_alloc.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* system.c [BFIN]: Move sys_sram_alloc and related code to sram_alloc.c.

	Move capget and capset parsers to a separate file.
	* capability.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* system.c: Move inclusion of headers and macro definitions related
	to capget and capset decoding to capability.c.
	(print_cap_header, print_cap_data, sys_capget, sys_capset): Move
	to capability.c.

2014-12-03  Dmitry V. Levin  <ldv@altlinux.org>

	Move sysctl parser to a separate file.
	* sysctl.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* system.c: Move sys_sysctl and related code to sysctl.c.

	mips: move sysmips parser to a separate file.
	* sysmips.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* system.c: Fix typo in the check for <linux/utsname.h>.
	Move inclusions of <linux/utsname.h> and <asm/sysmips.h> to sysmips.c.
	[MIPS]: Likewise.

	or1k: move or1k_atomic parser to a separate file.
	* or1k_atomic.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* system.c [OR1K]: Move to or1k_atomic.c.

2014-12-02  Dmitry V. Levin  <ldv@altlinux.org>

	Alias sys_setdomainname to sys_sethostname.
	Since parsers for setdomainname and sethostname syscalls are identical,
	replace sys_setdomainname with an alias to sys_sethostname.

	* linux/dummy.h (sys_setdomainname): Alias to sys_sethostname.
	* linux/syscall.h (sys_setdomainname): Remove.
	* process.c (sys_setdomainname): Remove.

2014-12-02  Dmitry V. Levin  <ldv@altlinux.org>

	Alias sys_getpeername to sys_getsockname.
	Since parsers for getpeername and getsockname syscalls are identical,
	replace sys_getpeername with an alias to sys_getsockname.

	* linux/dummy.h (sys_getpeername): Alias to sys_getsockname.
	* linux/syscall.h (sys_getpeername): Remove.
	* net.c (sys_getpeername): Remove.

2014-12-02  Dmitry V. Levin  <ldv@altlinux.org>

	Alias sys_stime to sys_time.
	Since parsers for stime and time syscalls are identical,
	replace sys_stime with an alias to sys_time.

	* linux/dummy.h (sys_stime): Alias to sys_time.
	* linux/syscall.h (sys_stime): Remove.
	* time.c (sys_stime): Remove.

2014-12-02  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unused sys_mctl.
	Starting with commit v4.6-240-g5afdf12, nobody compiles this
	non-Linux code.

	* mem.c [MC_SYNC]: Remove.
	* xlat/mctl_funcs.in: Remove.
	* xlat/mctl_lockas.in: Remove.

2014-12-01  Dmitry V. Levin  <ldv@altlinux.org>

	Alias sys_mkdir and sys_mkdirat to sys_chmod and sys_fchmodat.
	Special parsers for mkdir and mkdirat are redundant because
	sys_chmod and sys_fchmodat implement the same decoding.

	* file.c (decode_mkdir, sys_mkdir, sys_mkdirat): Remove.
	* linux/dummy.h (sys_mkdir): Alias to sys_chmod.
	(sys_mkdirat): Alias to sys_fchmodat.
	* linux/syscall.h (sys_mkdir, sys_mkdirat): Remove.
	* pathtrace.c (pathtrace_match): Do not check for sys_mkdirat.

2014-12-01  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unused <sys/acl.h> based code.
	Starting with commit v4.6-240-g5afdf12, nobody compiles this
	non-Linux code.

	* configure.ac (AC_CHECK_HEADERS): Remove sys/acl.h.
	* file.c [HAVE_SYS_ACL_H]: Remove.
	* xlat/aclcmds.in: Remove.

2014-12-01  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unused <sys/asynch.h> based code.
	Starting with commit v4.6-240-g5afdf12, nobody compiles this
	non-Linux code.

	* configure.ac (AC_CHECK_HEADERS): Remove sys/asynch.h.
	* file.c [HAVE_SYS_ASYNCH_H]: Remove.

2014-11-27  Masatake YAMATO  <yamato@redhat.com>

	Print protocol name of socket descriptors with -yy option.
	For those socket descriptors that have no associated ip:port pairs
	(or when this information is not available), -yy option prints
	the same <socket:[INODE]> information as -y option, e.g.

	$ strace -e sendto -yy ip l > /dev/null
	sendto(3<socket:[23456789]>, ...

	This change makes -yy output more informative: instead of just
	printing "socket", the name of protocol behind the socket descriptor
	will be printed, e.g.

	sendto(3<NETLINK:[23456789]>, ...

	* configure.ac (AC_CHECK_HEADERS): Add sys/xattr.h.
	* tests/net-yy-accept.awk: Update to support protocol names.
	* tests/net-yy-connect.awk: Likewise.
	* util.c [HAVE_SYS_XATTR_H]: Include <sys/xattr.h>.
	(getfdproto): New function.
	(printfd): Use it.

2014-11-21  Dmitry V. Levin  <ldv@altlinux.org>

	Replace MAXPATHLEN with PATH_MAX.
	MAXPATHLEN is defined to PATH_MAX, so replace the former with the latter.

	* strace.c (startup_child): Replace MAXPATHLEN with PATH_MAX.
	* util.c (printpathn, printpath): Likewise.

2014-11-21  Mike Frysinger  <vapier@gentoo.org>

	Decode FIFREEZE/FITHAW/FITRIM ioctls.
	The freeze/thaw ones are simple, but the trim is an interesting struct.

	* block.c (block_ioctl): Handle FIFREEZE/FITHAW/FITRIM.
	* ioctl.c (ioctl_decode): Pass 'X' ioctls to block_ioctl.

2014-11-21  Dmitry V. Levin  <ldv@altlinux.org>

	Include <sys/uio.h> unconditionally.
	Since <sys/uio.h> is standardized by POSIX and is present in all
	available versions of glibc, it's safe to assume that any usable
	libc implementation provides this header file.

	* configure.ac (AC_CHECK_HEADERS): Remove sys/uio.h.
	* io.c: Include <sys/uio.h> unconditionally.
	(tprint_iov_upto, tprint_iov, sys_readv, sys_writev,
	print_llu_from_low_high_val, sys_preadv, sys_pwritev): Define
	unconditionally.
	* net.c: Include <sys/uio.h> unconditionally.
	* util.c: Include <sys/uio.h> unconditionally.
	(dumpiov): Define unconditionally.

2014-11-21  Dmitry V. Levin  <ldv@altlinux.org>

	Consistently use C99 designated initializers in the new netlink code.
	* socketutils.c (send_query, receive_responses): Use designated
	initializers for sockaddr_nl, nlmsghdr, and inet_diag_req_v2 structures.
	* tests/netlink_inet_diag.c (send_query, check_responses): Likewise.

2014-11-20  Mike Frysinger  <vapier@gentoo.org>

	Decode open's O_TMPFILE.
	* xlat/open_mode_flags.in: Add O_TMPFILE definition.

2014-11-11  Helge Deller  <deller@gmx.de>

	hppa: update error codes and signal numbers.
	There are two important changes in here:

	1. EWOULDBLOCK has been up to kernel 3.14 errorcode #246. Since hppa
	folks had problems with EWOULDBLOCK != EAGAIN, this was changed in
	kernel 3.14.

	2. Starting with kernel 3.18, hppa folks changed some signal numbers in
	such a way that we end up with SIGRTMIN == 32, which brings hppa in sync
	with other linux ports.

	Both were incompatible changes which basically broke hppa ABI, but since
	they have been merged into the kernel, we have to follow.

2014-11-11  Thomas De Schampheleire  <thomas.de.schampheleire@gmail.com>

	stack trace support: fix check on symbol name presence.
	The output format of the stack trace is supposed to be different
	depending on whether symbol names are available in the build.

	However, the check only verified the validity of the pointer, not of the
	string pointed to (which could be empty).

	This commit fixes the check so that the original output:

	mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x5e000
	 > /lib/libc-2.10.1.so(_IO_file_doallocate+0x8c) [0x68a38]
	 > /lib/libc-2.10.1.so(_IO_doallocbuf+0x6c) [0x78574]
	 > /lib/libc-2.10.1.so(_IO_file_overflow+0x184) [0x7763c]
	 > /lib/libc-2.10.1.so(_IO_file_xsputn+0x88) [0x76aac]
	 > /lib/libc-2.10.1.so(_IO_puts+0xc8) [0x6b64c]
	 > /bin/busybox(+0x0) [0x62c60]
	 > /bin/busybox(+0x0) [0x4940]
	 > /bin/busybox(+0x0) [0x499c]
	 > /bin/busybox(+0x0) [0x4e08]
	 > /lib/libc-2.10.1.so(__libc_init_first+0x30c) [0x1f84c]
	 > /lib/libc-2.10.1.so(__libc_start_main+0xd8) [0x1f9f8]

	becomes:

	mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x5e000
	 > /lib/libc-2.10.1.so(_IO_file_doallocate+0x8c) [0x68a38]
	 > /lib/libc-2.10.1.so(_IO_doallocbuf+0x6c) [0x78574]
	 > /lib/libc-2.10.1.so(_IO_file_overflow+0x184) [0x7763c]
	 > /lib/libc-2.10.1.so(_IO_file_xsputn+0x88) [0x76aac]
	 > /lib/libc-2.10.1.so(_IO_puts+0xc8) [0x6b64c]
	 > /bin/busybox() [0x62c60]
	 > /bin/busybox() [0x4940]
	 > /bin/busybox() [0x499c]
	 > /bin/busybox() [0x4e08]
	 > /lib/libc-2.10.1.so(__libc_init_first+0x30c) [0x1f84c]
	 > /lib/libc-2.10.1.so(__libc_start_main+0xd8) [0x1f9f8]

	Acked-by: Masatake YAMATO <yamato@redhat.com>

2014-11-11  Masatake YAMATO  <yamato@redhat.com>

	tests: add a test for decoding and dumping of recvmmsg/sendmmsg.
	* configure (AC_CHECK_FUNCS): Add sendmmsg.
	* tests/mmsg.c: New file.
	* tests/mmsg.expected: New file.
	* tests/mmsg.test: New test.
	* tests/.gitignore: Add mmsg.
	* tests/Makefile.am (CHECK_PROGRAMS): Add mmsg.
	(TESTS): Add mmsg.test.
	(EXTRA_DIST): Add mmsg.expected.

2014-11-11  Masatake YAMATO  <yamato@redhat.com>

	Add functions for dumping iovecs in mmsghdr used in sendmmsg and recvmmsg
	This patch is similar to what I did in commit
	02f9f6b386741a52f58e1b31ad4e7fff60781ef8.
	That commit was for sendmsg and recvmsg system calls.
	This one is for sendmmsg and recvmmsg system calls.

	* defs.h (dumpiov_in_mmsghdr): New declaration.
	* net.c (extractmmsghdr): New function derived from printmmsghdr.
	(printmmsghdr): Use it.
	(dumpiov_in_mmsghdr): New function.
	* syscall.c (dumpio) [HAVE_SENDMSG]: Call dumpiov_in_mmsghdr
	for recvmmsg and sendmmsg syscalls.

2014-11-11  Masatake YAMATO  <yamato@redhat.com>

	Use the definition of struct mmsghdr if it is defined in build environment
	mmsghrd structure type is defined locally in printmmsghdr function.

	However, more functions will refer the definition in modifications for
	supporting "-e write=set" and "-e read=set" option for sendmmsg and
	recvmmsg system calls.

	After this change, the system definition of struct mmsghdr will be used
	if configure reports it is available, falling back to the old local
	definition.

	* configure.ac (AC_CHECK_TYPES): Add struct mmsghdr.
	* net.c [!HAVE_STRUCT_MMSGHDR] (struct mmsghdr): Define.
	(printmmsghdr): Use previously defined struct mmsghdr.

2014-11-11  Masatake YAMATO  <yamato@redhat.com>

	Introduce a separate function to copy from msghdr32 to msghdr.
	This patch is an initial step for supporting "-e write=set" and
	"-e read=set" option for sendmmsg and recvmmsg system calls.

	Coverting a data of msghdr32 to msghdr is needed both for
	{send,recv}msg and {send,recv}mmsg to decode parameters.
	To share the copying code in both decoders, a separate
	function named copy_from_msghdr32 is introduced.

	* net.c [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4]
	(copy_from_msghdr32): New function.
	(extractmsghdr) [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4]: Use it.

2014-11-11  Dmitry V. Levin  <ldv@altlinux.org>

	ioctlsort: rewrite build rules using noinst_PROGRAMS.
	* linux/ioctlsort.c: Rename to ioctlsort.c
	* Makefile.am (EXTRA_DIST): Rename linux/ioctlsort.c to ioctlsort.c.
	[MAINTAINER_MODE] (noinst_PROGRAMS): Add ioctlsort.
	(ioctlsort_SOURCES): Add ioctlsort.c.
	(nodist_ioctlsort_SOURCES): Add ioctls.h and ioctldefs.h.
	(CLEANFILES): Add $(nodist_ioctlsort_SOURCES).
	(ioctlsort.$(OBJEXT)): Likewise.
	(ioctlsort): Remove.

2014-11-11  Lubomir Rintel  <lkundrak@v3.sk>

	Makefile.am: look for ioctl definitions in the kernel build tree by default
	While most of ioctl-related kernel headers are now exported by kernel's
	headers_install, some are still modules_install only.  The kernel's
	headers installed into /usr/include/ are usually headers_install'ed and
	therefore don't contain some internal headers we need.  The solution is
	to look for modules_install'ed headers for the running kernel, and fall
	back to old behavior if they aren't found.

2014-11-04  Lubomir Rintel  <lkundrak@v3.sk>

	Dump details for Bluetooth socket operations.
	* configure.ac (AC_CHECK_HEADERS): Add bluetooth/bluetooth.h.
	* xlat/bt_protocols.in: New file.
	* net.c [AF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Include bluetooth
	headers.
	[PF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/bt_protocols.h".
	(printsock) [AF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Dump details
	for AF_BLUETOOTH sockets.
	(sys_socket) [PF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Decode
	protocol for PF_BLUETOOTH sockets.

2014-11-04  Philippe De Muyter  <phdm@macqel.be>

	Implement Video4Linux video-input ioctls decoder.
	Introduce v4l2.c, a decoder for the arguments of the video-input subset
	of the v4l2 ioctl's.  This is a combination of
	- previous work by Peter Zotov <whitequark@whitequark.org>, found at
	https://gist.githubusercontent.com/whitequark/1263207/raw/strace-4.6-v4l2-ioctls.patch
	- previous work by William Manley <will@williammanley.net>, found at
	http://marc.info/?l=strace&m=139395588520675
	- forward port, additions and fixes by Philippe De Muyter <phdm@macqel.be>

	As v4l2 is a moving target, I have made v4l2.c compilable with ancient
	linux kernels by testing the availability of some macros.  It has been
	succesfully compiled on linux 3.10, 3.1, 2.6.31 and 2.6.22, and
	succesfully used on linux 3.10 with a camera device.

	* configure.ac: Check for availabilty of V4L2_* enum constants.
	* Makefile.am (strace_SOURCES): Add v4l2.c.
	* defs.h (v4l2_ioctl): New prototype.
	* ioctl.c (ioctl_decode): Use v4l2_ioctl.
	* v4l2.c: New file.
	* xlat/v4l2_*.in: New files.

	Cc: Peter Zotov <whitequark@whitequark.org>
	Cc: William Manley <will@williammanley.net>

2014-11-04  Dmitry V. Levin  <ldv@altlinux.org>

	Update ioctl entries.
	* linux/ioctlent.h.in: Regenerate from v3.17 headers.

	Remove ioctl header file names from the executable.
	* defs.h (struct ioctlent): Remove "doth" field.
	* Makefile.am ($(ioctlent_h)): Remove 1st field.

2014-11-04  Dmitry V. Levin  <ldv@altlinux.org>

	Filter out redundant ioctl entries early.
	For two ioctl entries with the same code, if one's name is a prefix
	to another's name, keep the entry with a shorter name.  Filter out
	redundant ioctl entries at ioctlsort stage so that distributed
	ioctlent.h.in files will be already filtered.

	* linux/ioctlsort.c (is_not_prefix): New function.
	(main): Use it.
	* linux/ioctlent-filter.awk: Remove.
	* Makefile.am (EXTRA_DIST): Remove linux/ioctlent-filter.awk.
	($(ioctlent_h)): Don't use linux/ioctlent-filter.awk.

2014-11-03  Dmitry V. Levin  <ldv@altlinux.org>

	ioctlent.sh: update the list of directories exported by headers_install.
	* linux/ioctlent.sh: Add drm, mtd, rdma, video, and xen directories.

2014-11-01  Masatake YAMATO  <yamato@redhat.com>

	Add a function for dumping iovec in msghdr used in sendmsg and recvmsg.
	Here is an example session:

	    $ ./strace -e write=all ip link change dev enp0s25 mtu 1501 > /dev/null
	    sendmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"(...
	     * 40 bytes in buffer 0
	     | 00000  28 00 00 00 10 00 05 00  d0 d9 aa 53 00 00 00 00  (..........S.... |
	     | 00010  00 00 00 00 02 00 00 00  00 00 00 00 00 00 00 00  ................ |
	     | 00020  08 00 04 00 dd 05 00 00                           ........         |
	    ...

	    $ ./strace -e read=all ip link show > /dev/null
	    recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"...
	     * 8192 bytes in buffer 0
	     | 00000  34 00 00 00 02 00 00 00  00 00 00 00 ff 23 00 00  4............#.. |
	     | 00010  ff ff ff ff 20 00 00 00  10 00 05 00 00 00 00 00  .... ........... |
	    ...

	* defs.h (dumpiov_in_msghdr): New prototype.
	* net.c (extractmsghdr): New function derived from printmsghdr.
	(printmsghdr): Use extractmsghdr.
	(dumpiov_in_msghdr): New function.
	* syscall.c (dumpio) [HAVE_SENDMSG]: Call dumpiov_in_msghdr for recvmsg
	and sendmsg syscalls.

2014-10-31  Maarten ter Huurne  <maarten@treewalker.org>

	Include <linux/ptrace.h> regardless of <sys/reg.h> existence.
	This fixes compilation with musl libc.
	This approach was already used in process.c, so I assume it is safe.

	* signal.c: Move [HAVE_LINUX_PTRACE_H] code out of [HAVE_SYS_REG_H] check.
	* syscall.c: Likewise.
	* util.c: Likewise.

2014-10-31  Dmitry V. Levin  <ldv@altlinux.org>

	sock: decode SIOCSIFNAME on entering syscall.
	* sock.c (sock_ioctl): Handle SIOCSIFNAME on entering syscall.

2014-10-31  Mike Frysinger  <vapier@gentoo.org>

	sock: fix decoding of SIOCSIFNAME.
	The decoding of SIOCSIFNAME is incorrect.  It does not use
	the ifr_index field to look things up, but ifr_newname.

	* sock.c (sock_ioctl): Split out SIOCSIFNAME from SIOCGIFNAME and
	display ifr_newname.

2014-10-31  Mike Frysinger  <vapier@gentoo.org>

	sock: fix decoding of struct ifreq.ifr_name.
	The ifr name fields of the ifreq structure might not be NUL terminated.
	If the user makes an ioctl call where they aren't, then strace ends up
	reading random content from its own stack.  Limit the printf lengths.

	* sock.c (sock_ioctl): Add explicit length limits to ifr_name printfs.

2014-10-03  Elliott Hughes  <enh@google.com>

	Don't risk truncating open flags by using mode_t.
	On Android, 32-bit arm and x86 use __kernel_mode_t (an unsigned short)
	as their mode_t.  The open(2) flags are actually an int, so high ones
	like O_CLOEXEC get truncated if you coerce them to mode_t.

	* defs.h (tprint_open_modes, sprint_open_modes): Change argument type
	from mode_t to int.
	* file.c (tprint_open_modes, sprint_open_modes): Likewise.

2014-09-29  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance sysinfo decoding.
	* configure.ac (AC_CHECK_MEMBERS): Check for struct sysinfo.totalhigh,
	struct sysinfo.freehigh, and struct sysinfo.mem_unit.
	* sysinfo.c (sys_sysinfo): Treat failed umove() call as syserror().
	Print totalhigh, freehigh, and mem_unit members when struct sysinfo
	supports them.

	Move sysinfo parser to a separate file.
	* sysinfo.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* resource.c (sys_sysinfo): Move to sysinfo.c.

2014-09-29  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build with musl libc.
	* resource.c: Include <sys/sysinfo.h> for struct sysinfo definition.

	Reported-by: Steven Honeyman <stevenhoneyman@gmail.com>

2014-09-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: cleanup checks for basic programs.
	* tests/init.sh: Check for cat and rm.
	* tests/getdents.test: Check for awk.
	* tests/ptrace_setoptions.test: Check for grep.
	* tests/net-fd.test: Do not check for rm.
	* tests/net.test: Likewise.
	* tests/scm_rights-fd.test: Likewise.
	* tests/stat.test: Likewise.
	* tests/uio.test: Likewise.

	tests: add a test for -yy option.
	* tests/net-yy.test: New test.
	* tests/inet-accept-connect-send-recv.c: New file.
	* tests/netlink_inet_diag.c: Likewise.
	* tests/net-yy-accept.awk: Likewise.
	* tests/net-yy-connect.awk: Likewise.
	* tests/.gitignore: Add inet-accept-connect-send-recv,
	netlink_inet_diag, *.tmp-*, and *.tmp.*.
	* tests/Makefile.am (check_PROGRAMS): Add inet-accept-connect-send-recv
	and netlink_inet_diag.
	(TESTS): Add net-yy.test.
	(EXTRA_DIST): Add net-yy-accept.awk and net-yy-connect.awk.

2014-09-22  Dmitry V. Levin  <ldv@altlinux.org>

	Move statfs related parsers to a separate file.
	* statfs.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c (sprintfstype, printstatfs, sys_statfs, sys_fstatfs): Move
	to statfs.c.
	[HAVE_STATFS64] (printstatfs64, printcompat_statfs64, sys_statfs64,
	sys_fstatfs64): Likewise.
	[ALPHA] (osf_statfs, osf_fstatfs): Likewise.

	fsmagic: sort array by value and use bsearch for faster lookup.
	* defs.h (xlat_search): New prototype.
	* util.c (xlat_bsearch_compare, xlat_search): New functions.
	* file.c (sprintfstype): Use xlat_search for fsmagic lookup.
	* xlat/fsmagic.in: Sort by value and mark as not NULL-terminated.
	* tests/statfs.c: New file.
	* tests/statfs.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add statfs.
	(statfs_CFLAGS): Define.
	(TESTS): Add statfs.test.
	* tests/.gitignore: Add statfs.

2014-09-21  Dmitry V. Levin  <ldv@altlinux.org>

	fsmagic: update from <linux/magic.h>
	* xlat/fsmagic.in: Add new constants from <linux/magic.h>.
	Reported by Elliott Hughes.

2014-09-17  Dmitry V. Levin  <ldv@altlinux.org>

	Add -yy option: print ip and port associated with socket descriptors.
	When two ore more -y options are given, print local and remote ip:port
	pairs associated with socket descriptors.  This implementation uses
	NETLINK_INET_DIAG for sockaddr lookup; it's based on the patch
	prepared by Zubin Mithra as a part of his GSoC 2014 strace project.

	* Makefile.am (strace_SOURCES): Add socketutils.c
	(EXTRA_DIST): Add linux/inet_diag.h and linux/sock_diag.h.
	* defs.h (print_sockaddr_by_inode): New prototype.
	* linux/inet_diag.h: New file.
	* linux/sock_diag.h: Likewise.
	* socketutils.c: Likewise.
	* strace.1: Document -yy option.
	* strace.c (usage): Likewise.
	* util.c (printfd): Use print_sockaddr_by_inode.

2014-09-17  Vicente Olivert Riera  <vincent@gentoo.org>

	sigaction: wrap sa_restorer in #ifdef SA_RESTORER consistently.
	Wrap sa_restorer member definitions in #ifdef SA_RESTORER to be
	consistent with their use.
	If an architecture does not provide sa_restorer members but still
	defines SA_RESTORER macro, the latter has to be explicitly undefined.

	This change fixes compilation failures like this one:
	signal.c: In function 'decode_old_sigaction':
	signal.c:631:21: error: 'struct old_sigaction' has no member named 'sa_restorer'
	signal.c: In function 'decode_new_sigaction':
	signal.c:1224:21: error: 'struct new_sigaction' has no member named 'sa_restorer'

	* signal.c (struct old_sigaction, struct old_sigaction32,
	struct new_sigaction, struct new_sigaction32):
	Wrap sa_restorer member in #ifdef SA_RESTORER.
	(decode_old_sigaction, decode_new_sigaction):
	Wrap use of sa32.sa_restorer in #ifdef SA_RESTORER.

2014-09-17  Dmitry V. Levin  <ldv@altlinux.org>

	Fix compilation warnings reported by gcc -Wsign-compare.
	* configure.ac (gl_WARN_ADD): Add -Wsign-compare.
	* defs.h (struct tcb): Change 'currpers' type to unsigned.
	(struct xlat): Change 'val' type to unsigned
	(signame): Add 'const' qualifier to its argument.
	(xlookup, printxval): Add 'const' qualifier to the 2nd argument and
	change its type to unsigned.
	(printpathn): Change the 3rd argument type to unsigned.
	(ioctl_lookup): Change 1st argument type to unsigned.
	* count.c (call_summary_pers, call_summary): Change 'i' type to unsigned.
	* file.c (print_xattr_list): Fix comparisons between signed and unsigned
	long values.
	* ioctl.c (compare): Fix cast.
	(ioctl_lookup): Change 1st argument type to to unsigned.
	(ioctl_next_match): Change 'code' type to unsigned.
	* mem.c (sys_move_pages): Change 'i' type to unsigned.
	* mtd.c (mtd_ioctl): Change 'i' and 'j' types to unsigned.
	Print 'i' using %u format string.
	* process.c (sys_prctl): Change 'i' type to unsigned.
	(printargv): Change 'n' type to unsigned.
	(sys_ptrace): Change 'addr' type to unsigned.
	* scsi.c (print_sg_io_buffer): Add 'const' qualifier to 'len' argument
	and change its type to unsigned.  Change 'i' and 'allocated' types
	to unsigned.
	* signal.c (signame): Add 'const' qualifier to its argument.
	Fix comparisons between signed and unsigned values.
	(sprintsigmask_n, printsiginfo): Fix comparisons between signed and
	unsigned values.
	* sock.c (sock_ioctl): Change 'i' and 'nifra' types to unsigned.
	* strace.c (expand_tcbtab, alloctcb): Change 'i' type to unsigned.
	(detach): Change 'sig' type to unsigned.
	(startup_attach): Change 'tcbi' type to unsigned.
	(startup_child): Change 'm', 'n', and 'len' types to unsigned.
	(init): Use new variable to iterate 'tcbtab'.
	(pid2tcb): Change 'i' type to unsigned.
	(cleanup): Change 'i' and 'sig' types to unsigned.
	* syscall.c (update_personality): Change 'personality' argument type
	to unsigned.
	(struct qual_options): Change 'bitflag' type to unsigned.
	(reallocate_qual): Add 'const' qualifier to its argument and change its
	type to unsigned.
	(qualify_one): Change 'n' and 'bitflag' arguments types to unsigned.
	Add 'const' qualifier to 'n', 'not', and 'pers' arguments.
	Change 'p' type to signed int.
	(qual_syscall): Change 'bitflag' argument type to unsigned.
	Add 'const' qualifier to 'bitflag' and 'not' arguments.
	Change 'p' type to signed int.
	(qual_signal): Change 'bitflag' argument type to unsigned.
	Add 'const' qualifier to 'bitflag' and 'not' arguments.
	Change 'i' type to unsigned.
	(qual_desc): Change 'bitflag' argument type to unsigned.
	Add 'const' qualifier to 'bitflag' and 'not' arguments.
	(qualify): Change 'i' type to unsigned.
	(get_scno): Change 'currpers' type to unsigned.
	Fix a comparison between signed and unsigned values.
	* system.c (sys_sysctl): Change 'cnt' and 'max_cnt' types to unsigned.
	Fix comparisons between signed and unsigned values.
	* util.c (xlookup, printxval): Add 'const' qualifier to 'val' argument
	and change its type to unsigned.
	(printuid): Fix a comparison between signed and unsigned values.
	(printpathn): Change 'n' argument type to unsigned.
	(printstr): Change 'size' type to unsigned.
	Fix a comparison between signed and unsigned values.
	(setbpt): Change 'i' type to unsigned.
	* net.c (printsock): Silence a compilation warning.
	* reboot.c (sys_reboot): Likewise.

2014-09-11  Dmitry V. Levin  <ldv@altlinux.org>

	Move dirent related parsers to a separate file.
	* dirent.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* file.c (print_old_dirent, sys_readdir, sys_getdents, sys_getdents64):
	Move to dirent.c.

	getdents, getdents64: fix potential out-of-bounds read issues.
	* file.c (sys_getdents): Check for invalid d_reclen.
	Avoid reading from uninitialized memory.
	(sys_getdents64): Likewise.
	* tests/getdents.awk: New file.
	* tests/getdents.test: New test.
	* tests/Makefile.am (TESTS): Add it.
	(EXTRA_DIST): Add getdents.awk.

2014-09-10  Dmitry V. Levin  <ldv@altlinux.org>

	tprint_sock_type: remove unused parameter.
	* net.c (tprint_sock_type): Remove unused parameter 'tcp'.
	(sys_socket, sys_socketpair): Update callers.

	printsock: fix decoding of unrecognized AF_PACKET packet types.
	* net.c (printsock): Fix fallback string for AF_PACKET packet types.

2014-09-09  Dmitry V. Levin  <ldv@altlinux.org>

	decode_select: fix potential use of an uninitialized variable.
	A pointer to fd_set was used uninitialized when nfds == 0.

	* desc.c (decode_select): Initialize fds.

	Reported-by: Zubin Mithra <zubin.mithra@gmail.com>

2014-09-08  Dmitry V. Levin  <ldv@altlinux.org>

	Use external libaio.h.
	Stop using an outdated partial copy of libaio.h, switch back to external
	libaio.h from libaio.
	This partially reverts commit 2df03c494eb3c36c4178eba35c374831031d1a58.

	* aio.c: Drop a partial copy of libaio.h, include <libaio.h> instead.
	(print_common_flags): Check for HAVE_STRUCT_IOCB_U_C_FLAGS.
	(sys_io_submit): Check for HAVE_DECL_IO_CMD_PWRITE and
	HAVE_DECL_IO_CMD_PWRITEV.
	* configure.ac: Check for libaio.h and declaration it provides.

2014-08-19  Dmitry V. Levin  <ldv@altlinux.org>

	maint: post-release administrivia.
	* NEWS: Add header line for next release.

2014-08-15  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.9 release.
	* NEWS: Update for 4.9 release.
	* debian/changelog: 4.9-1.
	* strace.spec: 4.9-1.

	Sync strace.spec and debian/ with packages.
	* debian/changelog: Sync with 4.8-1.1.
	* debian/control: Likewise.
	* debian/rules: Likewise.
	* strace.spec: Sync with 4.8-5.

	NEWS: Update for 4.9 release.

2014-08-15  Mike Frysinger  <vapier@gentoo.org>

	Update syscall tables to the point where they include renameat2.
	* linux/dummy.h: Add printargs aliases for sys_sched_getattr and
	sys_sched_setattr.
	* linux/aarch64/syscallent1.h: Add kcmp/finit_module/sched_setattr/
	sched_getattr/renameat2.
	* linux/alpha/syscallent.h: Add kcmp/finit_module.
	* linux/arm/syscallent.h: Add sched_setattr/sched_getattr/renameat2.
	* linux/hppa/syscallent.h: Add sched_setattr/sched_getattr/utimes/renameat2.
	* linux/i386/syscallent.h: Add sched_setattr/sched_getattr/renameat2.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Add getdents64/sched_setattr/sched_getattr/
	renameat2.
	* linux/mips/syscallent-o32.h: Add sched_setattr/sched_getattr/renameat2.
	* linux/powerpc/syscallent.h: Fix finit_module/kcmp order.  Add sched_setattr/
	sched_getattr/renameat2.
	* linux/s390/syscallent.h: Add sched_setattr/sched_getattr/renameat2.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Add sched_setattr/sched_getattr.

	renameat2: add decoding support.
	* file.c (decode_renameat, sys_renameat2): New functions.
	(sys_renameat): Use decode_renameat.
	* pathtrace.c (pathtrace_match): Handle sys_renameat2.
	* linux/syscall.h (sys_renameat2): New prototype.
	* xlat/rename_flags.in: New file.

2014-08-14  Mike Frysinger  <vapier@gentoo.org>

	CREDITS: fix generation in out of tree builds.
	The {...} code changes the working dir with `cd`, but the commands outside
	of that block expects to be in the original dir.  Change to a subshell so
	the path outside of this block remains unchanged.

	* Makefile.am ($(srcdir)/CREDITS): Change {...} to (...).

2014-08-14  Mike Frysinger  <vapier@gentoo.org>

	ia64: add missing syscalls.
	When the preadv/pwritev syscalls were added, the ones before it in the
	ia64 list were missed, so all the syscalls there and later were not in
	the right location (causing things to be decoded incorrectly).

	Add the missing syscalls before preadv which also re-aligns all the
	syscalls after that point.  This fixes the uio.test.

	* linux/ia64/syscallent.h: Add syscalls 1310 through 1318.

2014-08-14  Mike Frysinger  <vapier@gentoo.org>

	ia64: fix sigaction decoding.
	Looks like ia64 doesn't have sa_restorer either, yet still defines
	SA_RESTORER.  Deploy the same trick that HPPA is using to make the
	test pass.

	* signal.c (SA_RESTORER): Undefine when IA64 is defined.
	(struct new_sigaction) [IA64]: Disable sa_restorer.

2014-08-12  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip detach-stopped.test when PTRACE_SEIZE doesn't work.
	detach-stopped.test is known to fail when PTRACE_SEIZE is not available,
	so skip the test in that case.

	* tests/detach-stopped.test: Check for "strace -d" output and skip the
	test when it says that PTRACE_SEIZE doesn't work.

2014-08-11  Erik Johansson  <erik@ejohansson.se>

	sh: fix syscall numbering for recv and sendto.
	* linux/sh/syscallent.h: Swap recv and sendto syscall entries.

2014-08-11  Mike Frysinger  <vapier@gentoo.org>

	tests: fix uio building w/out preadv/pwritev.
	The preadv/pwritev symbols weren't added to glibc until the 2.10 release,
	so trying to build the uio test leads to link failures.  Add configure
	tests and update uio.test to handle this.

	* configure.ac (AC_CHECK_FUNCS): Add preadv/pwritev.
	* tests/uio.c: Include config.h.
	(main): Check for HAVE_PREADV and HAVE_PWRITEV.
	* tests/uio.test: Check exit status of uio helper.

2014-08-11  Mike Frysinger  <vapier@gentoo.org>

	tests: ignore *.tmp files.
	The tests like to generate random .tmp files, so ignore them.

	* tests/.gitignore: Add *.tmp.

2014-08-11  Mike Frysinger  <vapier@gentoo.org>

	tests: fix shell errors in detach tests.
	The current detach test code does:
		set -e
		...
		cleanup() {
			set +e
			kill ...
			wait ...
		}
		...
		cleanup
		exit 0

	The problem is that while `set -e` is disabled for the body of the
	cleanup function, it isn't necessarily disabled in the caller scope.
	So if the return value of the cleanup function (`wait` in this case)
	is non-zero, the script ends up failing overall.

	Add an explicit return 0 to the cleanup function so that we don't kill
	the overall test pipeline.

	* tests/detach-running.test (cleanup): Add return 0.
	* tests/detach-sleeping.test (cleanup): Likewise.
	* tests/detach-stopped.test (cleanup): Likewise.

2014-08-11  Mike Frysinger  <vapier@gentoo.org>

	set_ptracer_any: add a little documentation.
	This way I don't have to keep reading up on these options and wondering
	why the code isn't aborting when the call fails.

	* tests/set_ptracer_any.c (main): Note prctl failures are ok.

2014-08-10  Mike Frysinger  <vapier@gentoo.org>

	signal: fix thinko in sa_restorer.
	Previous commit here re-added the bugs trying to be fixed due to a
	logic thinko.  The patches were tested in isolation and hand merged
	later.  Oops.

	* signal.c (struct new_sigaction): Change || to &&.

2014-08-09  Mike Frysinger  <vapier@gentoo.org>

	sigaction test: support arches w/out SA_RESTORER and swapped args.
	Running Linux 3.15 (sparc64) and glibc 2.17 (sparc32) triggers a
	rt_sigaction call that does not use SA_RESTORER and has an order
	where it inserts a restorer and a size.  The current tests don't
	support that ordering, so add another regex.

	* tests/sigaction.awk: Support no SA_RESTORER and swapped args.

2014-08-09  Mike Frysinger  <vapier@gentoo.org>

	alpha/sparc: fix arg count for rt_sigaction.
	Both these arches have a rt_sigaction syscall that takes 5 args, not 4.

	* linux/alpha/syscallent.h (rt_sigaction): Change nargs to 5.
	* linux/sparc/syscallent.h (rt_sigaction): Change nargs to 5.

2014-08-09  Mike Frysinger  <vapier@gentoo.org>

	hppa: fix sigaction decoding.
	Since the rt_sigaction syscall on hppa doesn't have a sa_restorer,
	do not include it in the kernel struct.

	We also have to undefine SA_RESTORER so that code doesn't try to
	use it.  The headers will export this, but the syscall doesn't
	actually respect it.

	* signal.c (SA_RESTORER): Undefine when HPPA is defined.
	(struct new_sigaction): Disable sa_restorer on hppa.

2014-08-09  Mike Frysinger  <vapier@gentoo.org>

	alpha: fix sigaction decoding.
	Since the rt_sigaction syscall on alpha doesn't have a sa_restorer,
	do not include it in the kernel struct.

	* signal.c (struct new_sigaction): Disable sa_restorer on alpha.

2014-08-08  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for -yy option support.
	* defs.h (show_fd_path): Change type to unsigned int.
	* strace.c (show_fd_path): Likewise.
	(init): Handle repeated -y option.

2014-08-07  Dmitry V. Levin  <ldv@altlinux.org>

	Fix preadv/pwritev offset decoding on ILP32 architectures.
	This fixes regression introduced by the previous commit.

	* io.c (print_llu_from_low_high_val) [SIZEOF_LONG != SIZEOF_LONG_LONG]:
	Cast argument to unsigned long before casting it to unsigned long long.

2014-08-07  Dmitry V. Levin  <ldv@altlinux.org>

	Fix preadv/pwritev offset decoding on bigendian architectures.
	This partially reverts commit 7845a42b39e59e904d01e75e21f7bc7eb6462560.

	* util.c (printllval): Remove align argument.
	* defs.h (printllval): Update prototype.
	(printllval_aligned, printllval_unaligned): Remove.
	* file.c (sys_readahead, sys_truncate64, sys_ftruncate64, sys_fadvise64,
	sys_fadvise64_64, sys_sync_file_range, sys_sync_file_range2,
	sys_fallocate): Replace printllval_aligned call with printllval.
	* io.c (sys_pread, sys_pwrite): Likewise.
	(print_llu_from_low_high_val): New function.
	(sys_preadv, sys_pwritev): Use it instead of printllval_unaligned.

2014-08-06  Dmitry V. Levin  <ldv@altlinux.org>

	Decode file descriptors returned by accept and accept4 syscalls.
	* net.c (do_accept): Rename to do_sockname.
	(sys_accept, sys_accept4): Update callers, return RVAL_FD.
	(sys_getsockname, sys_getpeername): Call do_sockname directly.
	* tests/net-fd.test: Update.

2014-08-01  Mike Frysinger  <vapier@gentoo.org>

	x32: update io_{setup,submit} syscalls.
	Starting in 3.16, these two syscalls have gotten their own entry
	point for x32.  See linux 7fd44dacdd803c0bbf38bf478d51d280902bb0f1.

	* linux/x32/syscallent.h: Change existing io_{setup,submit} to 64bit,
	and add new entry points for x32 specifically.

2014-06-18  Max Filippov  <jcmvbkbc@gmail.com>

	xtensa: sort values in struct_user_offsets.
	Otherwise ptrace syscall argument decoding is wrong:
	  ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x4048eb]) = 0
	  ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x3fa6cd30]) = 0
	  ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x8040676d]) = 0
	instead of
	  ptrace(PTRACE_PEEKUSER, 296, pc, [0x4048eb]) = 0
	  ptrace(PTRACE_PEEKUSER, 296, a1, [0x3fa6cd30]) = 0
	  ptrace(PTRACE_PEEKUSER, 296, a0, [0x8040676d]) = 0

	* process.c (struct_user_offsets) [XTENSA]: Sort values.

2014-06-18  Dmitry V. Levin  <ldv@altlinux.org>

	Document -k option as experimental.
	strace -k does not produce a reliable output on all supported
	configurations yet, even basic strace-k.test is known to fail
	on some of them.

	* strace.c (usage): Document -k option as experimental.
	* strace.1: Likewise.
	* NEWS: Likewise.

2014-06-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify -k test.
	Split stack-fcall.c into several compilation units so that intermediate
	function calls would not be optimized out by compiler.

	* tests/stack-fcall.c: Move intermediate functions to ...
	* tests/stack-fcall-*.c: ... new files.
	* tests/Makefile.am (stack_fcall_SOURCES): Add stack-fcall-*.c.

2014-06-13  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance -k test.
	Add two more function calls to the stack.  Suggested by Masatake YAMATO.

	* tests/stack-fcall.c (f1): Rename to f3.
	(f1, f2): New functions.
	* tests/strace-k.test: Update.

2014-06-13  Dmitry V. Levin  <ldv@altlinux.org>

	unwind: ignore memory mappings that have no PROT_EXEC bit set.
	* unwind.c (build_mmap_cache): For each memory mapping being scanned,
	save its PROT_EXEC bit and skip the mapping if it is not set.

	unwind: cleanup build_mmap_cache.
	* unwind.c (build_mmap_cache): Move local variables to the code branch
	where they are used.  Check return code of sscanf and strdup.  Do not
	treat unusual memory mappings as fatal errors.  Do not skip memory
	mappings with path names starting with "[".

	unwind: remove unused field from mmap_cache_t.
	* unwind.c (mmap_cache_t): Remove "deleted" field.
	(build_mmap_cache): Remove initialization of "deleted" field.

2014-06-12  Dmitry V. Levin  <ldv@altlinux.org>

	unwind: refactor stacktrace_walk.
	* unwind.c (stacktrace_walk): Move stack frame printing code
	to separate function print_stack_frame.

	unwind: constify binary_filename and symbol_name functions arguments.
	* unwind.c (call_action_fn, print_call_cb, sprint_call_or_error,
	queue_put, queue_put_call): Add const qualifier to binary_filename and
	symbol_name arguments.

2014-06-11  Luca Clementi  <luca.clementi@gmail.com>

	unwind: disable stack trace with multiple personalities.
	* unwind.c (unwind_cache_invalidate, unwind_print_stacktrace,
	unwind_capture_stacktrace): Disable stack tracing of non-default
	personality processes.

2014-06-05  Dmitry V. Levin  <ldv@altlinux.org>

	unwind: rename function_off_set to function_offset.
	* unwind.c (call_action_fn, stacktrace_walk, STACK_ENTRY_SYMBOL_FMT,
	print_call_cb, sprint_call_or_error, queue_put, queue_put_call):
	Rename function_off_set to function_offset.

	unwind: fix a bug in range updating of binary search.
	* unwind.c (print_stacktrace): Fix another off-by-one error in binary search.

	unwind: use fopen64 instead of fopen.
	* unwind.c (fopen_for_input): Define to fopen64 iff
	[_LARGEFILE64_SOURCE && HAVE_FOPEN64], otherwise define it to fopen.
	(build_mmap_cache): Use fopen_for_input instead of fopen.

2014-06-05  Dmitry V. Levin  <ldv@altlinux.org>

	unwind: fix build on 32-bit architectures.
	Fix compilation warnings in unwind.c on 32-bit architectures.
	On some architectures getuid is actually getuid32, so change the test
	to use getpid instead of getuid.

	* unwind.c (STACK_ENTRY_SYMBOL_FMT): Explicitly cast function_off_set
	to unsigned long.
	(queue_put_error): Change the 3rd argument's type to unsigned long.
	* tests/stack-fcall.c (f1): Use getpid instead of getuid.
	* tests/strace-k.test: Likewise.

2014-06-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify -w option test.
	* tests/count.test: Allow nanosleep to spend a bit less time than 1 second.

2014-06-04  Dmitry V. Levin  <ldv@altlinux.org>

	Fix delete_module decoding.
	* xlat/delete_module_flags.in: New file.
	* file.c (sys_delete_module): Move ...
	* bjm.c (sys_delete_module): ... to here.
	Decode 1st argument using printstr instead of printpath.
	* NEWS: Mention it.

2014-06-04  Zubin Mithra  <zubin.mithra@gmail.com>

	Decode paths associated with file descriptors returned by syscalls.
	* defs.h (RVAL_FD): New macro.
	(RVAL_MASK, RVAL_STR, RVAL_NONE): Update.
	* desc.c (sys_dup, sys_delete_module): New functions.
	(do_dup2, decode_open, sys_creat): Change return value to RVAL_FD.
	* linux/dummy.h (sys_delete_module, sys_dup): Remove.
	* linux/syscall.h (sys_delete_module, sys_dup): New prototypes.
	* syscall.c (trace_syscall_exiting): Handle RVAL_FD.

2014-06-03  Dmitry V. Levin  <ldv@altlinux.org>

	NEWS: Prepare for 4.9 release.

	Warn about flags that have no effect with -c.
	* strace.c (init): Issue a warning if -i, -k, -r, -t, -T, or -y is used
	along with -c.
	This fixes Debian bug #443895.

	debian: enable security hardening features.
	* debian/rules: Follow the advice in https://wiki.debian.org/Hardening
	and enable maximum hardening as for programs that handle untrusted data.
	Patch by Markus <waldeck@gmx.de>.

2014-06-03  Dmitry V. Levin  <ldv@altlinux.org>

	debian: update control file.
	* debian/control (strace64): Fix a typo in package description.
	Patch by Pascal De Vuyst <pascal.devuyst@gmail.com>.
	(strace, strace-udeb): Add x32 to architecture list.
	Patch by Guillaume Morin <guillaume@morinfr.org>.
	(strace, strace-udeb): Add or1k to architecture list.
	Patch by Christian Svensson <debian@cmd.nu>.
	(strace, strace-udeb): Add arm64 to architecture list,
	and remove defunct arm.
	Patch by Wookey <wookey@debian.org>.

	This fixes Debian bugs: #697625, #727018, #742235, #749956.

2014-06-03  Dmitry V. Levin  <ldv@altlinux.org>

	manpage: minor corrections.
	$ groff -ww -mandoc -z strace.1
	strace.1:65: warning: macro `IX' not defined

	* strace.1: define IX macro as empty for groff.
	Change remaining '-' as minus to '\-'.
	Have two word spaces after a full stop as an end of sentence.
	Use extra space ('\,' or '\/') between roman and italic characters.
	Based on patch by Bjarni Ingi Gislason <bjarniig@rhi.hi.is>.
	This fixes Debian bug #725987.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

	unwind: tests: add a test for -k option.
	* tests/stack-fcall.c: New test target.
	* tests/strace-k.test: New test driver.
	* tests/Makefile.am (check_PROGRAMS): Add stack-fcall.
	(TESTS): Add strace-k.test.
	* tests/.gitignore: Add stack-fcall.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

	unwind: move stacktrace capturing and mmap cache invalidating to trace_syscall_entering
	Instead of handling stacktrace capturing and mmap cache invalidating in
	sys_* functions, handle them uniformly in trace_syscall_entering using
	new flags introduced by previous two commits.

	The patch is simpler than its older version(v3).  The value of
	hide_log_until_execve is just ignored.  I found the value is nothing
	to do with this patch.  unwind_cache_invalidate is mentioned only
	once in trace_syscall_exiting.
	Both are suggested by Dmitry Levin.

2014-05-30  Dmitry V. Levin  <ldv@altlinux.org>

	unwind: add SE and SI flags to syscall entries for all architectures.
	Add SE flag to execve, exit, and exit_group syscall entries.
	Add SI flag to brk, execve, mmap, mprotect, mremap, munmap,
	remap_file_pages, shmat, and shmdt syscall entries.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

	unwind: introduce markers specifying the needs of special care in unwinding
	Some system calls require capturing the stack trace before they are
	processed in kernel.  Typical one is execve.  Some system calls require
	invalidating mmap cache after they are processed in kernel.

	In current implementation these requirements are handled directly by
	appropriate syscall handlers.  However, it is difficult to keep the
	source code maintainable using this approach to cover all system calls
	which have such requirements.

	A more generic way to implement this is to flag all syscalls that
	require special processing, and handle these flags right in
	trace_syscall_entering instead of changing syscall handlers.

	This patch just defines new flags: STACKTRACE_INVALIDATE_CACHE and
	STACKTRACE_CAPTURE_ON_ENTER.

	The names of macros are suggested by Dmitry Levin.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

	unwind: enable dwarf cache of libunwind.
	Here is the benchmark of the dwarf cache.

	Target program:

	    #include <sched.h>
	    int main(void)
	    {
	      unsigned int max = 0x6fff, i;
	      for (i = 0; i < max; i++)
		sched_yield();
	      return 0;
	    }

	Command line:

		./strace -o /dev/null -k a.out

	With the dwarf cache:

	    real	0m12.081s
	    user	0m3.858s
	    sys 	0m8.194s

	Without the dwarf cache:

	    real	0m22.326s
	    user	0m5.218s
	    sys		0m16.952s

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

	unwind: report expected backtracing error.
	When a file mmap'ed to the target process is unlink'ed, backtracing the
	stack would fail.  Current implementation reports it as
	"backtracing_error".  To avoid confusion, the message is changed to
	"expected_backtracing_error".

	Here is the reproducer:

	  $ cat ./p-deleted.c
	  #include <unistd.h>

	  int main(int argc, char **argv) {
	    return unlink(argv[0]) < 0;
	  }

	  $ strace -e unlink -k ./p-deleted
	  unlink("./p-deleted")                   = 0
	   > /usr/lib64/libc-2.18.so(unlink+0x7) [0xe7f17]
	   > /home/yamato/var/strace/t_unwind/p-deleted (deleted)(+0x0) [0x575]
	   > /usr/lib64/libc-2.18.so(__libc_start_main+0xf5) [0x21d65]
	   > backtracing_error [0x7ffff1365590]
	  +++ exited with 0 +++

	p-deleted is deleted therefore backtracing_error is reported.  This
	patch records the deleted marker when making mmap cache and refers the
	recorded information in the case "backtracing_error" to switch the
	message.

	Here is the output of this patch:

	  $ strace -e unlink -k ./p-deleted
	  unlink("./p-deleted")                   = 0
	   > /usr/lib64/libc-2.18.so(unlink+0x7) [0xe7f17]
	   > /home/yamato/var/strace/t_unwind/p-deleted (deleted)(+0x0) [0x575]
	   > /usr/lib64/libc-2.18.so(__libc_start_main+0xf5) [0x21d65]
	   > expected_backtracing_error [0x7ffff1365590]
	  +++ exited with 0 +++

	This solution is not perfect: if a file is unlink'ed after making the
	mmap cache and before unwinding, strace cannot have a chance to record
	the deleted marker.

	In this version of patch, hardcoded magic number used in comparing "(delete)"
	string is replaced with strlen as suggested by Dmitry Levin.

	In old version of patch, the deleted entry was thrown away from mmap
	cache to avoid to report "backtracing_error".  In this patch I keep it,
	and just switch the error message.
	Inspired by the review comment from Dmitry Levin.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

	unwind: call unwind_tcb_fin before printing detached message.
	captured stacktrace is printed in unwind_tcb_fin if tcp->queue is not
	empty.  This should happen before printing detached message, so
	unwind_tcb_fin is moved to the top of droptcb.

	This is implicitly suggested by Dmitry Levin in patch review process.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

	unwind: implement automatic mmap cache invalidation.
	A mmap cache belonging to a tcb was updated when a system call which
	changed the memory mapping was called.  This implementation was assumed
	the mapping was changed only by the tcb.  However, this assumption is
	incorrect if the target application is multi-threaded; more than two
	tcbs can shared the same memory mapping and a tcb can modify it without
	being noticed by the others.

	This change introduces a global integer variable mmap_cache_generation,
	and mmap_cache_generation field to struct tcb.  The variable
	is incremented each time a process enters a syscall that can modify its
	memory mapping.  Each tcb records the value of this variable at the
	moment if  building its mmap cache.  Every mmap cache associated with
	the given tcb can be validated by comparing its mmap_cache_generation
	field with the variable mmap_cache_generation.

	This implementation is inefficient.  If strace attaches two processes
	which don't share the memory mapping, rebuilding mmap cache of a tcb
	triggered by another tcb's mmap system call is not necessary.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

	unwind: introduce queue_t for capturing stacktrace.
	This is the second step for splitting capturing from printing.

	New `queue' field is added to tcb.  Captured stacktrace is stored here.
	The field is initialized/finalized at unwind_tcb_init/unwind_tcb_fin.

	New API function unwind_capture_stacktrace is added.  This function
	captures the currest stack using stracktrace_walker and records it in
	tcb.  It's printing is delayed to the next call of
	unwind_print_stacktrace.

	unwind_print_stacktrace is extended.  Now it checks queue field of
	the given tcb at the start of function.  If the function finds a
	captured stack trace, the latter is printed using stracktrace_walker.

	Currently unwind_capture_stacktrace invocations are added directly to
	handlers of mmap, munmap, mprotect, and execve.

	Here is the difference of output with/without patch:

	(without patch)
	  execve("./test-fork", ["./test-fork"], [/* 56 vars */]) = 0
	   > /usr/lib64/ld-2.18.so(check_one_fd.part.0+0x82) [0x11f0]

	(with patch)
	  execve("./test-fork", ["./test-fork"], [/* 54 vars */]) = 0
	   > /usr/lib64/libc-2.18.so(execve+0x7) [0xbcd27]
	   > /home/yamato/var/strace/strace(exec_or_die+0x10c) [0x26ac]
	   > /home/yamato/var/strace/strace(startup_child+0x346) [0x134f6]
	   > /home/yamato/var/strace/strace(init+0x89f) [0x13dff]
	   > /home/yamato/var/strace/strace(main+0xa) [0x26ca]
	   > /usr/lib64/libc-2.18.so(__libc_start_main+0xf5) [0x21d65]
	   > /home/yamato/var/strace/strace(_start+0x29) [0x2799]

	In older version output lines of captured elements were built when
	printing.  In this version they are built when capturing the stack.
	As result, unneeded dynamic memory allocations are avoided.
	Suggested by Luca Clementi.

	In older version the combination of snprintf and realloc were used.
	In this version they are replaced with asprintf.
	Suggested by Dmitry Levin.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

	unwind: introduce own debug macro.
	* unwind.c (DPRINTF): New macro, to be utilized in debugging cache
	management code.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

	unwind: introduce stacktrace_walker.
	In current implementation, the stack trace is captured and printed at
	the same time, in trace_syscall_exiting.  This approach cannot
	provide user expected information when a system call changes the
	memory mapping.  In such cases, the stack trace should be captured on
	entering syscall and printed on exiting.

	As the initial step for splitting capturing from printing, this change
	introduces stacktrace_walker utility function.  It can be used both for
	capturing in trace_syscall_entering and printing in
	trace_syscall_exiting.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

	unwind: give all exported functions "unwind_" prefix.
	* unwind.c (init_unwind_addr_space): Rename to unwind_init.
	(init_libunwind_ui): Rename to unwind_tcb_init.
	(free_libunwind_ui): Rename to unwind_tcb_fin.
	(delete_mmap_cache): Rename to unwind_cache_invalidate.
	(print_stacktrace): Rename to unwind_print_stacktrace.
	* defs.h: Update prototypes.
	* mem.c: All callers updated.
	* process.c: Likewise.
	* strace.c: Likewise.
	* syscall.c: Likewise.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

	unwind: delete mmap cache in free_libunwind_ui.
	free_libunwind_ui is expected to release all unwind related resources
	attached to tcp.

	* strace.c (droptcb): Move delete_mmap_cache call ...
	* unwind.c (free_libunwind_ui): ... to here.

2014-05-30  Masatake YAMATO  <yamato@redhat.com>

	unwind: make alloc_mmap_cache function local.
	* defs.h (alloc_mmap_cache): Remove.
	* unwind.c (alloc_mmap_cache): Add static qualifier.

	unwind: fix a bug in range updating of binary search.
	* unwind.c (print_stacktrace): Fix off-by-one error in binary search.

2014-05-30  Luca Clementi  <luca.clementi@gmail.com>

	Add -k option to print stack trace after each syscall.
	Print the stack trace of the traced process after each system call when
	-k option is specified.  It is implemented using libunwind to unwind the
	stack and to obtain the function name pointed by the IP.

	Based on the code that was originally taken from strace-plus
	of Philip J. Guo.

	* configure.ac: Add --with-libunwind option.  Check libunwind support.
	* Makefile.am: Add libunwind support.
	* defs.h (struct tcb) [USE_LIBUNWIND]: Append libunwind specific fields.
	[USE_LIBUNWIND] (stack_trace_enabled, alloc_mmap_cache,
	delete_mmap_cache, print_stacktrace): New prototypes.
	* mem.c (print_mmap, sys_munmap, sys_mprotect): Add libunwind support.
	* process.c (sys_execve): Likewise.
	* strace.c (usage, alloctcb, droptcb, init): Likewise.
	* syscall.c (trace_syscall_exiting): Likewise.
	* unwind.c: New file.
	* strace.1: Document -k option.

2014-05-30  Dmitry V. Levin  <ldv@altlinux.org>

	sysctl: update CTL_*, KERN_*, NET_*, and VM_* constants.
	* configure.ac (AC_CHECK_DECLS): Add CTL_*, KERN_*, NET_*, and
	VM_* constants.
	* system.c (CTL_PROC, CTL_CPU): Remove definitions.
	* xlat/sysctl_*.in: Update.

	Check for constants used by waitid function.
	* configure.ac (AC_CHECK_DECLS): Add P_* constants.

	Check for LO_FLAGS_READ_ONLY constant.
	* configure.ac (AC_CHECK_DECLS): Add LO_FLAGS_READ_ONLY.

	Compress blank lines.
	Suppress empty lines left after automated xlat conversion.

	xlat: cleanup the aftermath of automatic conversion.

	Generate xlat/*.in files.
	Automatically convert xlat structures from *.c files to xlat/*.in files
	using "./generate_xlat_in.sh *.c" command.

	Rename several xlat structures to avoid collisions.
	* bjm.c (which): Rename to qm_which.
	* ipc.c (msg_flags): Rename to ipc_msg_flags.
	* time.c (which): Rename to itimer_which.

	Enhance xlat generator.
	* xlat/gen.sh: Define all xlat structs not declared in defs.h as static.
	Some symbolic constants are not macros, extend #ifdef check to cover
	symbolic constants checked by AC_CHECK_DECLS.
	Handle complex symbolic constants in SYMBOL|... form.
	Handle symbolic constants in 1<<SYMBOL form.
	Handle numeric constants.
	Implement #unconditional directive that turns off preprocessor checks.
	Implement #unterminated directive that turns off adding XLAT_END.

2014-05-30  Dmitry V. Levin  <ldv@altlinux.org>

	Use bootstrap script consistently.
	Now that ./xlat/gen.sh has to be run before autoreconf,
	replace all autoreconf calls with ./bootstrap call.

	* bootstrap: Forward arguments to autoreconf.
	* build_static_example.sh: Replace autoreconf call with bootstrap call.
	* make-dist: Likewise.
	* qemu_multiarch_testing/README: Likewise.

2014-05-30  Mike Frysinger  <vapier@gentoo.org>

	Implement xlat generator.
	* bootstrap: New file.
	* xlat/gen.sh: Likewise.
	* Makefile.am: Include xlat/Makemodule.am
	(EXTRA_DIST): Add $(XLAT_INPUT_FILES), $(XLAT_HEADER_FILES), and
	xlat/gen.sh.

2014-05-30  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix SCM_RIGHTS test for big-endian systems.
	* tests/scm_rights.c (main): Send zero integer to avoid issues with
	endianness.
	* tests/scm_rights-fd.test: Update grep patterns.

	Decode file descriptors passed via SCM_RIGHTS control messages.
	* net.c (printcmsghdr): Print descriptors from SCM_RIGHTS control
	messages using printfd.
	* tests/scm_rights.c: New file.
	* tests/scm_rights-fd.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add scm_rights.
	(TESTS): Add scm_rights-fd.test.
	* tests/.gitignore: Add scm_rights and uio.

	tests: add a test for -c and -w options.
	* tests/count.test: New test.
	* tests/Makefile.am (TESTS): Add it.

2014-05-29  Mark Hills  <Mark.Hills@framestore.com>

	Optionally produce stats on syscall latency.
	Time spent in system time is not useful where a syscall depends on some
	non-CPU resource, eg. typically open() or stat() to a network drive.

	This patch adds a new flag (-w) to produce a summary of the time
	difference between beginning and end of the system call (ie. latency)

	This functionality has been useful to profile slow processes that
	are not CPU-bound.

2014-05-29  Dmitry V. Levin  <ldv@altlinux.org>

	Constify count_syscall function.
	* count.c (count_syscall): Add const qualifier to timeval argument and
	rename it.  Store the wall clock time spent while in syscall in separate
	timeval variable.
	* defs.h (count_syscall): Update prototype.
	* syscall.c (trace_syscall_exiting): Update count_syscall invocation.

	Constify tv_* functions.
	* defs.h (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_mul, tv_div): Add
	const qualifier to read only arguments.
	* util.c (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_mul, tv_div):
	Likewise.

2014-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	Use printstr for sethostname, setdomainname, and gethostname decoding.
	The argument passed to sethostname and setdomainname syscalls, as well
	as the string returned by gethostname syscall, is not a pathname, so
	printpathn is not the right method for its decoding.

	* process.c (sys_sethostname, sys_setdomainname): Decode 1st argument
	using printstr instead of printpathn.
	[ALPHA] (sys_gethostname): Likewise.

2014-05-21  James Hogan  <james.hogan@imgtec.com>

	Fix {get,set}rlimit decoding with unreliable SIZEOF_RLIM_T.
	When strace is built with large file support definitions in CFLAGS (as
	may be provided by buildroot) the C library headers may expose a 64-bit
	rlim_t even though the struct rlimit fields used by the system call
	interface are only 32-bit.  The SIZEOF_RLIM_T will then be 8 which
	results in bad decoding of the getrlimit and setrlimit syscalls.

	This is fixed by replacing unreliable SIZEOF_RLIM_T based checks with
	checks for current_wordsize.

2014-05-13  Masatake YAMATO  <yamato@redhat.com>

	Enhance setns syscall decoding.
	* process.c (sys_setns): New function.
	Decode the 2nd syscall argument using clone_flags.
	* linux/syscall.h (sys_setns): New prototype.
	* linux/dummy.h (sys_setns): Remove.

2014-05-12  Dmitry V. Levin  <ldv@altlinux.org>

	mips: fix syscall entries that should have TP flag set.

	xtensa: fix unshare syscall entry.

	alpha, hppa, mips n64: fix waitid syscall entry.

	Add TM flag to shmat and shmdt syscall entries.

	Alias sys_vfork to sys_fork.
	* process.c (sys_vfork): Remove.
	* linux/syscall.h (sys_vfork): Likewise.
	* linux/dummy.h (sys_vfork): Alias to sys_fork.
	* linux/alpha/syscallent.h: Fix vfork entry.
	* util.c (setbpt): Do not check for sys_vfork.
	* syscall.c (syscall_fixup_for_fork_exec): Likewise.

2014-04-17  Dmitry V. Levin  <ldv@altlinux.org>

	epoll_ctl: fix EPOLL_CTL_DEL argument decoding.
	* desc.c (sys_epoll_ctl): Do not parse the event structure for
	EPOLL_CTL_DEL operation.

	Reported-by: Марк Коренберг <socketpair@gmail.com>

2014-04-17  Dmitry V. Levin  <ldv@altlinux.org>

	Update CLOCK_* constants.
	* time.c (clocknames): Add CLOCK_BOOTTIME, CLOCK_REALTIME_ALARM,
	CLOCK_BOOTTIME_ALARM, CLOCK_SGI_CYCLE, and CLOCK_TAI.
	Fixes RH#1088455.

2014-04-17  Dmitry V. Levin  <ldv@altlinux.org>

	Fix preadv/pwritev offset decoding.
	* util.c (printllval): Add align argument.
	* defs.h (printllval): Update prototype.
	(printllval_aligned, printllval_unaligned): New macros.
	* file.c (sys_readahead, sys_truncate64, sys_ftruncate64, sys_fadvise64,
	sys_fadvise64_64, sys_sync_file_range, sys_sync_file_range2,
	sys_fallocate): Replace printllval call with printllval_aligned.
	* io.c (sys_pread, sys_pwrite): Likewise.
	(sys_preadv, sys_pwritev): Replace printllval call with
	printllval_unaligned.
	* linux/arm/syscallent.h: Set the number of preadv and pwritev
	arguments to 5.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

	Reported-by: Dima Kogan <dima@secretsauce.net>

2014-04-16  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a test for pread/pwrite and preadv/pwritev offset decoding.
	* tests/uio.c: New file.
	* tests/uio.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add uio.
	(uio_CFLAGS): Define.
	(TESTS): Add uio.test.

2014-04-10  Dmitry V. Levin  <ldv@altlinux.org>

	Refactor LDT decoding.
	* configure.ac (AC_CHECK_TYPES): Remove struct user_desc.
	* ldt.c: New file.
	* Makefile.am (strace_SOURCES): Add ldt.c.
	* mem.c: Do not include <asm/ldt.h>.
	(print_ldt_entry): Remove.
	(sys_modify_ldt, sys_set_thread_area, sys_get_thread_area): Move...
	* ldt.c: ... here.
	* process.c: Do not include <asm/ldt.h>.
	(sys_clone) [I386 || X86_64 || X32]: Use print_user_desc.

2014-04-10  Denys Vlasenko  <dvlasenk@redhat.com>

	Make int3 example in comments more cut-n-pastable.
	I found that I use it quite often. Lets make it so that
	after cut-n-pasting it into a file, there is no need
	to edit the result (e.g. no need to remove C comment
	chars from every line.

2014-04-09  Dmitry V. Levin  <ldv@altlinux.org>

	mips: enable decoding of set_thread_area.
	* linux/dummy.h [MIPS]: Do not redirect sys_set_thread_area to printargs.
	* mem.c [MIPS] (sys_set_thread_area): Define.

	x86_64, x32: enable decoding of modify_ldt, get_thread_area, and set_thread_area
	* linux/dummy.h [X86_64 || X32]: Do not redirect sys_modify_ldt,
	sys_get_thread_area, and sys_set_thread_area to printargs.

	x32: decode clone LDT user_desc entries for x86 processes.
	* mem.c [X32]: Include asm/ldt.h.
	[X32] (print_ldt_entry, sys_modify_ldt, sys_set_thread_area,
	sys_get_thread_area): Define.
	* process.c [X32]: Include asm/ldt.h.
	(sys_clone) [X32]: Decode LDT entry if current_personality == 1.

2014-04-09  Elliott Hughes  <enh@google.com>

	x86-64: decode clone LDT user_desc entries for x86 processes.
	* mem.c [X86_64]: Include asm/ldt.h.
	[X86_64] (print_ldt_entry, sys_modify_ldt, sys_set_thread_area,
	sys_get_thread_area): Define.
	* process.c [X86_64]: Include asm/ldt.h.
	(sys_clone) [X86_64]: Decode LDT entry if current_personality == 1.

2014-04-09  Dmitry V. Levin  <ldv@altlinux.org>

	x32: fix clone(2) argument order for x86 processes.
	Apply the same fix that was made for x86_64.

	* process.c [X32] (ARG_CTID, ARG_TLS): Take current
	personality into account.

2014-04-09  Elliott Hughes  <enh@google.com>

	x86-64: fix clone(2) argument order for x86 processes.
	Without this patch, strace claims that parent_tidptr == tls, which is
	clearly wrong.  It is expected that parent_tidptr == child_tidptr.

	* process.c [X86_64] (ARG_CTID, ARG_TLS): Take current
	personality into account.

2014-04-06  Elliott Hughes  <enh@google.com>

	aarch64: Fix decoding of arm struct stat64.
	We need to handle this situation more like x86-64.  32-bit arm and i386
	actually have a common struct stat64, except the arm one must not be
	packed.  Additionally, on aarch64 the 32-bit personality is personality 0.

2014-03-20  Dmitry V. Levin  <ldv@altlinux.org>

	ARM EABI: disable OABI support by default.
	OABI is rarely used in ARM EABI systems nowadays, so disable its support
	by default.  Add --enable-arm-oabi option to enable ARM OABI support.

	* configure.ac: New option --enable-arm-oabi.
	* syscall.c (get_scno) [ARM]: Check ENABLE_ARM_OABI macro defined by
	configure instead of undocumented STRACE_KNOWS_ONLY_EABI macro.

2014-03-12  Elliott Hughes  <enh@google.com>

	Fix stat decoding for LP64 bionic.
	Patch fb642bb6d63f7ffe2228bf48a6008bc8f56f67ff fixed building with
	HAVE_STAT64 for aarch64 with uapi kernel headers but not x86_64.
	The workaround needed to be applied to all LP64 architectures, not
	just aarch64.  This patch fixes that and adds an explanatory comment.

2014-03-11  Masatake YAMATO  <yamato@redhat.com>

	Decode protocol argument for PF_NETLINK sockets.
	* net.c (protocols): Rename to inet_protocols.
	[PF_NETLINK] (netlink_protocols): New xlat structure.
	(sys_socket): Rename protocols to inet_protocols.
	[PF_NETLINK]: Decode protocol argument using netlink_protocols.

	Acked-by: Mike Frysinger <vapier@gentoo.org>

2014-03-11  Dmitry V. Levin  <ldv@altlinux.org>

	Cleanup socketpair decoding.
	The only supported domain for socketpair syscall is AF_UNIX, so
	no decoding related to other domains is required for socketpair.

	* net.c (sys_socketpair): Remove support for PF_INET and PF_IPX domains,
	print the protocol argument as is.

2014-03-11  Dmitry V. Levin  <ldv@altlinux.org>

	printsiginfo: add SIGSYS decoding.
	* configure.ac (AC_CHECK_MEMBERS): Check for siginfo_t.si_syscall.
	* signal.c (SYS_SECCOMP): Define if not yet defined.
	(sigsys_codes): new xlat structure.
	(printsiginfo): Decode SIGSYS.

	Update siginfo codes.
	* signal.c (siginfo_codes): Add SI_DETHREAD.

	Factor out printing of si_pid and si_uid members of siginfo_t.
	* signal.c (printsigsource): New function.
	(printsiginfo): Use it.

2014-03-10  Elliott Hughes  <enh@google.com>

	Improve SI_TIMER decoding.
	Decode siginfo_t more clearly for si_code SI_TIMER.
	The 'pid' is actually a POSIX timer id, and the 'uid' is actually the
	overrun.
	Also factor out the si_value dumping so it's the same for every si_code.

2014-03-03  Elliott Hughes  <enh@google.com>

	aarch64: fix decoding of arm syscall numbers.
	If an aarch64 strace is tracing a process using the arm personality, it
	also needs to call the shuffle_scno function for the ARM-specific
	syscalls.

	* syscall.c (shuffle_scno): Define on AARCH64.
	(get_scno) [AARCH64]: Call shuffle_scno when the tracee is in 32-bit mode.

2014-03-03  Dmitry V. Levin  <ldv@altlinux.org>

	Fix fcntl decoding.
	Assume that F_SETLK64, F_SETLKW64, and F_GETLK64 are either defined or
	not defined altogether.
	Do not assume that sizeof(off_t) < sizeof(long long) when F_SETLK64 is
	undefined.

	This change fixes build with musl libc on x86.

	* configure.ac: Define SIZEOF_OFF_T.
	* desc.c (USE_PRINTFLOCK64): New macro.
	(struct flock64, printflock64): Do not define on X32.
	(printflock): Replace X32 specific workaround with SIZEOF_OFF_T check.
	Fix printing off_t members of struct flock.
	(sys_fcntl): Use USE_PRINTFLOCK64.

2014-03-01  Dmitry V. Levin  <ldv@altlinux.org>

	sys_fcntl: remove F_FREESP and F_FREESP64 support.
	F_FREESP and F_FREESP64 fcntl commands are not available in Linux
	and therefore the code implementing their decoding is useless.
	Besides that, F_FREESP64 decoding is too complicated to support.

	* desc.c (fcntlcmds): Remove F_FREESP and F_FREESP64.
	Remove F_FREESP64 from the check whether to define struct flock64.
	(sys_fcntl): Remove F_FREESP and F_FREESP64 support.

2014-02-28  Elliott Hughes  <enh@google.com>

	Add multi-personality support to struct old_sigaction decoding.
	struct sigaction is another structure that contains members
	whose size differs between 32-bit and 64-bit personalities.

	* signal.c [HAVE_SIGACTION] (old_sigaction32): New structure.
	[HAVE_SIGACTION] (decode_old_sigaction): Decode 32-bit struct
	old_sigaction on a 64-bit host.

2014-02-28  Elliott Hughes  <enh@google.com>

	Fix decoding of arm struct stat64 by aarch64 strace.
	aarch64's uapi header files have a struct stat but no struct stat64.
	To correctly decode a 32-bit process' s struct stat64 we need
	HAVE_STAT64, but then the build fails because there is no struct stat64.
	Luckily, the aarch64 struct stat is structurally equivalent to the arm
	struct stat64, so we can just reuse that.

	* file.c [AARCH64] (stat64): Define to stat.

2014-02-28  Dmitry V. Levin  <ldv@altlinux.org>

	Remove obsolete ioctlsort.c.
	The generic version of ioctlsort.c became obsolete after commit
	v4.6-240-g5afdf12 that removed its last non-Linux users.

	* ioctlsort.c: Remove.
	* Makefile.am (EXTRA_DIST): Remove ioctlsort.c.

	Reported-by: Elliott Hughes <enh@google.com>

2014-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	Add multi-personality support to stack_t decoding.
	stack_t is one of many structures that contain members
	whose size differs between 32-bit and 64-bit personalities.

	* signal.c (print_stack_t): Decode 32-bit stack_t on a 64-bit host.

	Reported-by: Elliott Hughes <enh@google.com>

2014-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	Rewrite signal mask decoding without sigset_t.
	The sigset_t provided by libc is not quite convenient.
	In glibc, sigset_t is an array with space for 1024 bits, which is much
	more than required: all architectures supported by Linux have only 64
	signals except MIPS, which has 128.
	In bionic libc, LP32 sigset_t is only 4 bytes long, which is less than
	necessary.

	With this change, signal mask is decoded without use of intermediate
	sigset_t structure, which saves us some cpu cycles in case of glibc with
	its inflated sigset_t, and enables build with libcs where sigset_t is
	broken.

	Old implementation used to check each signal number in the given signal
	mask twice using sigismember().
	New implementation is based on popcount and next_set_bit() so it's
	noticeably faster.

	* configure.ac: Check for __builtin_popcount.
	* signal.c: Ensure that NSIG >= 32.
	(sprintsigmask, sprintsigmask_long, printsigmask): Remove.
	(popcount32, sprintsigmask_n): New functions.
	(tprintsigmask_addr, sprintsigmask_val, tprintsigmask_val): New macros.
	(print_sigset_addr_len, sys_sigsetmask, sys_sigreturn, sys_siggetmask,
	sys_sigsuspend, sys_sigprocmask, decode_new_sigaction): Update to use
	new signal mask decoding interface.
	* tests/sigaction.c (main): Add a test with almost filled signal mask.
	* tests/sigaction.awk: Update.

2014-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build with Bionic libc.
	Add generic tests for fopen64 and fputs_unlocked functions to fix build
	with Bionic libc that does not provide them.

	* configure.ac (AC_CHECK_FUNCS): Add fopen64 and fputs_unlocked.
	* strace.c [_LARGEFILE64_SOURCE]: Use fopen instead of fopen64
	if !HAVE_FOPEN64.
	Use fputs instead of fputs_unlocked if !HAVE_FPUTS_UNLOCKED.
	* vsprintf.c: Use fputs instead of fputs_unlocked
	if !HAVE_FPUTS_UNLOCKED.

	Reported-by: Elliott Hughes <enh@google.com>

2014-02-25  James Yang  <james.yang@freescale.com>

	powerpc64: fix 64-bit process detection on embedded.
	* syscall.c (get_scno) [POWERPC64]: Fix 64-bit process detection
	on embedded powerpc.

2014-02-25  Dmitry V. Levin  <ldv@altlinux.org>

	Do not compile scsi ioctl decoding if <scsi/sg.h> is not available.
	Add a generic test for <scsi/sg.h> availability to fix build with
	Bionic libc that does not provide <scsi/sg.h>.

	* configure.ac (AC_CHECK_HEADERS): Add scsi/sg.h.
	* ioctl.c (ioctl_decode): Do not call scsi_ioctl if !HAVE_SCSI_SG_H.
	* scsi.c: Do not compile scsi ioctl decoding if !HAVE_SCSI_SG_H.

	Reported-by: Elliott Hughes <enh@google.com>

2014-02-14  Dmitry V. Levin  <ldv@altlinux.org>

	Revert "Add support for Altera's Nios-II softcore architecture"
	The patch originally submitted by Ezequiel García was OK, but I somehow
	managed to mangle it so that most of the patch was not applied.

	According to Ezequiel García, an architecture port based on the generic
	syscall ABI is in progress.

	This reverts commit 61e426e87ac81be4b4ff9de581635b4ea585624f.

2014-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tighten sigaction check.
	* tests/sigaction.awk: Check that input conatins all expected lines.

2014-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	Fix sigaction reporting on non-x86 architectures.
	If SA_RESTORER is not defined by libc headers but defined by kernel
	headers, use the definition provided by kernel headers for proper
	sigaction decoding.

	* signal.c [!SA_RESTORER]: Define to ASM_SA_RESTORER if the latter is
	defined, regardless of architecure.

2014-02-08  Dmitry V. Levin  <ldv@altlinux.org>

	Check for SA_RESTORER definition in <asm/signal.h>
	Kernel header <asm/signal.h> cannot be included from regular code
	because it conflicts with libc headers, but SA_RESTORER is needed in
	signal.c, so SA_RESTORER value is forwarded from <asm/signal.h> to
	config.h using a configure check.

	* configure.ac (ASM_SA_RESTORER): Define if SA_RESTORER is defined
	in <asm/signal.h>.

2014-02-07  Dmitry V. Levin  <ldv@altlinux.org>

	arm: fix compilation warning.
	Fix "dereferencing type-punned pointer will break strict-aliasing rules"
	warning introduced by commit v4.8-54-g670b21b.

	* signal.c (sys_sigreturn) [ARM]: Avoid dereferencing type-punned pointers.

2014-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	kexec: fix typo.
	* kexec.c (print_kexec_segments) [SUPPORTED_PERSONALITIES == 1]: Fix typo.

2014-02-06  Ezequiel Garcia  <ezequiel@vanguardiasur.com.ar>

	Add support for Altera's Nios-II softcore architecture.
	This commit adds strace support for Altera's Nios-II official
	kernel port as found in git://git.rocketboards.org/linux-socfpga.git

	Notice that this an out-of-tree kernel architectural port, and uses the
	legacy (non-generic) system call ABI. In particular, the port doesn't
	support PTRACE_GETREGSET, so the implementation is based on PTRACE_GETREGS.

	Given it's mandatory for new architectures to support the generic
	syscall ABI and PTRACE_GETREGSET, if the nios2 architecure is ever
	mainlined, the strace support will have to be re-factored accordingly.

	* linux/nios2/ioctlent.h.in: New file.
	* linux/nios2/syscallent.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add linux/nios2/ioctlent.h.in and
	linux/nios2/syscallent.h.
	* configure.ac: Add NIOS2 to the list of supported architectures.
	* defs.h [NIOS2]: Use register reading system.
	* process.c (struct_user_offsets): Add NIOS2 support.
	* syscall.c (get_regs, get_scno, get_syscall_args,
	get_syscall_result, get_error): Likewise.
	* util.c (change_syscall): Likewise.
	* mem.c (sys_getpagesize): Define on NIOS2.
	* system.c [NIOS2] (sys_cacheflush, sys_nios2cmpxchg): New functions.

	Acked-by: Mike Frysinger <vapier@gentoo.org>

2014-02-05  Dmitry V. Levin  <ldv@altlinux.org>

	Implement add_key, keyctl, and request_key decoding.
	* keyctl.c: New file.
	* linux/keyctl.h: Likewise.
	* Makefile.am (strace_SOURCES): Add keyctl.c.
	(EXTRA_DIST): Add linux/keyctl.h.
	* linux/dummy.h (sys_add_key, sys_keyctl, sys_request_key): Remove.
	* linux/syscall.h (sys_add_key, sys_keyctl, sys_request_key): New
	prototypes.

	Implement ioprio_get and ioprio_set decoding.
	* ioprio.c: New file.
	* Makefile.am (strace_SOURCES): Add ioprio.c.
	* linux/dummy.h (sys_ioprio_get, sys_ioprio_set): Remove.
	* linux/syscall.h (sys_ioprio_get, sys_ioprio_set): New prototypes.

	Implement finit_module decoding.
	* bjm.c (module_init_flags): New xlat structure.
	(sys_finit_module): New function.
	* linux/dummy.h (sys_finit_module): Remove.
	* linux/syscall.h (sys_finit_module): New prototype.

	Cleanup inotify syscalls decoding.
	* linux/inotify.h: New file.
	* file.c (inotify_modes, inotify_init_flags, sys_inotify_add_watch,
	sys_inotify_rm_watch, sys_inotify_init1): Move...
	* inotify.c: ... here.
	(inotify_modes): Rename to inotify_flags, convert to XLAT form.
	(inotify_init_flags): Convert to XLAT form.
	* Makefile.am (strace_SOURCES): Add inotify.c.
	(EXTRA_DIST): Add linux/inotify.h.

	Enhance reboot decoding.
	* linux/reboot.h: New file.
	* system.c (bootflags1, bootflags2, bootflags3, sys_reboot): Move...
	* reboot.c: ... here.
	(bootflags2, bootflags3): Update constants.
	* Makefile.am (strace_SOURCES): Add reboot.c.
	(EXTRA_DIST): Add linux/reboot.h.

	Implement kexec_load decoding.
	* kexec.c: New file.
	* linux/kexec.h: Likewise.
	* Makefile.am (strace_SOURCES): Add kexec.c.
	(EXTRA_DIST): Add linux/kexec.h.
	* linux/dummy.h (sys_kexec_load): Remove.
	* linux/syscall.h (sys_kexec_load): New prototype.

	Use prepared editions of recently imported linux headers.
	* linux/fanotify.h: Replace with edition prepared with headers_install.sh.
	* linux/personality.h: Likewise.

	Implement fanotify_init and fanotify_mark decoding.
	* fanotify.c: New file.
	* linux/fanotify.h: Likewise.
	* Makefile.am (strace_SOURCES): Add fanotify.c.
	(EXTRA_DIST): Add linux/fanotify.h.
	* defs.h (print_dirfd): New prototype.
	* file.c (print_dirfd): Export.
	* linux/dummy.h (sys_fanotify_init, sys_fanotify_mark): Remove.
	* linux/syscall.h (sys_fanotify_init, sys_fanotify_mark): New
	prototypes.
	* pathtrace.c (pathtrace_match): Handle sys_fanotify_init and
	sys_fanotify_mark.

	Use XLAT_END macro.
	Automatically update all xlat structures using the following sed regexp:
	s/^[[:space:]]*{[[:space:]]*0[[:space:]]*,[[:space:]]*NULL[[:space:]]*,\?[[:space:]]*}[[:space:]]*,\?[[:space:]]*/\tXLAT_END/

	Itroduce XLAT_END macro to make xlat structures more compact.
	* defs.h (XLAT_END): New macro.

	Convert personality_options to XLAT form.
	* linux/personality.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* system.c: Include <linux/personality.h>.
	(personality_options): Update PER_* constants, convert to XLAT form.

	Convert futexops to XLAT form.
	* process.c: Define FUTEX_*_PRIVATE macros.
	(futexops): Convert to XLAT form.

	Convert sigev_value to XLAT form.
	* time.c (sigev_value): Convert to XLAT form.
	(printsigevent32, printsigevent): Update use of sigev_value.

	Use XLAT macro.
	Automatically convert all xlat structures to XLAT form
	using the following sed regexp:
	s/^[[:space:]]*{[[:space:]]*\([^",}[:space:]]\+\)[[:space:]]*,[[:space:]]*"\1",\?[[:space:]]*}[[:space:]]*/\tXLAT(\1)/

2014-02-05  Dmitry V. Levin  <ldv@altlinux.org>

	Introduce XLAT macro to ease maintenance of xlat structures.
	* defs.h (XLAT): New macro.

	Suggested-by: Mike Frysinger <vapier@gentoo.org>

2014-02-04  Stefan Sørensen  <stefan.sorensen@spectralink.com>

	Decode ptp ioctls.
	* defs.h (ptp_ioctl): New prototype.
	* ioctl.c (ioctl_decode): Call ptp_ioctl when code is '='.
	* Makefile.am (strace_SOURCES): Add ptp.c.
	(EXTRA_DIST): Add linux/ptp_clock.h.
	* ptp.c: New file.
	* linux/ptp_clock.h: New file.

2014-02-03  Stefan Sørensen  <stefan.sorensen@spectralink.com>

	Decode dynamic posix clocks.
	* time.c (cpuclocknames): New xlat structure.
	(printclockname): New function that decodes posix clock names,
	including dynamic fd encoded clocks.
	(sys_clock_settime, sys_clock_gettime, sys_clock_nanosleep,
	sys_clock_adjtime, sys_timer_create, sys_timerfd, sys_timerfd_create):
	Use it.

	Update ADJ_* constants.
	* time.c (adjtimex_modes): Add ADJ_TAI, ADJ_SETOFFSET, ADJ_MICRO,
	ADJ_NANO, ADJ_OFFSET_SS_READ.

2014-02-02  Philippe Ombredanne  <pombredanne@nexb.com>

	Add decoding of sockets descriptor 'paths' for network calls.
	* net.c (sys_bind, sys_listen, do_accept, sys_send, sys_sendto,
	sys_sendmsg, sys_sendmmsg, sys_recv, sys_recvfrom, sys_recvmsg,
	sys_recvmmsg, sys_shutdown, sys_getsockopt, sys_setsockopt): Decode
	socket descriptor arguments using printfd.
	* pathtrace.c (pathtrace_match): Also check TRACE_NETWORK syscalls
	that take socket descriptor arguments.
	* tests/net-fd.test: New test for socket descriptor arguments decoding.
	* tests/Makefile.am (TESTS): Add net-fd.test.
	(net-fd.log): New dependency on net.log.

2014-02-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rename all tests so that their names end in .test suffix.
	Due to automake limitations, some features work only for tests
	that end in one of the suffixes listed in TEST_EXTENSIONS.

	* tests/detach-running: Rename to detach-running.test.
	* tests/detach-sleeping: Rename to detach-sleeping.test.
	* tests/detach-stopped: Rename to detach-stopped.test.
	* tests/net: Rename to net.test.
	* tests/ptrace_setoptions: Rename to ptrace_setoptions.test.
	* tests/qual_syscall: Rename to qual_syscall.test.
	* tests/sigaction.sh: Rename to sigaction.test.
	* tests/stat: Rename to stat.test.
	* tests/strace-f: Rename to strace-f.test.
	* tests/Makefile.am (TESTS): Update.
	(LOG_COMPILER): Rename to TEST_LOG_COMPILER.

2014-01-31  Mike Frysinger  <vapier@gentoo.org>

	net: add more sockopt options.
	This syncs with the defines as available in linux-3.13.

	* net.c (sockipoptions): Add IP_IPSEC_POLICY, IP_XFRM_POLICY,
	IP_PASSSEC, IP_TRANSPARENT, IP_ORIGDSTADDR, IP_RECVORIGDSTADDR,
	IP_MINTTL, IP_NODEFRAG, IP_UNBLOCK_SOURCE, IP_BLOCK_SOURCE,
	IP_ADD_SOURCE_MEMBERSHIP, IP_DROP_SOURCE_MEMBERSHIP, MCAST_JOIN_GROUP,
	MCAST_BLOCK_SOURCE, MCAST_UNBLOCK_SOURCE, MCAST_LEAVE_GROUP,
	MCAST_JOIN_SOURCE_GROUP, MCAST_LEAVE_SOURCE_GROUP, IP_MULTICAST_ALL,
	IP_UNICAST_IF.

2014-01-08  Chris Dearman  <chris.dearman@imgtec.com>

	mips: fix sigaction reporting.
	MIPS userland uses the same sigaction structure with a full signal
	mask for old_sigaction and new_sigaction and does does not have
	an sa_restorer field.

	These changes have been tested on MIPS O32 big/little endian, MIPS N64
	big endian and x86-64.

	* signal.c (old_sigaction) [MIPS]: Add definition for MIPS.
	(decode_old_sigaction) [MIPS]: Print sa_mask according to its definition.
	(new_sigaction) [MIPS]: Add definition for MIPS.

2014-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	Factor out struct sigaction printing code.
	* signal.c [HAVE_SIGACTION] (decode_old_sigaction): New function.
	[HAVE_SIGACTION] (sys_sigaction): Use it.
	(decode_new_sigaction): New function.
	(sys_rt_sigaction): Use it.

2014-01-08  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a test for rt_sigaction output.
	Since "struct sigaction" varies between architectures, rt_sigaction
	decoding sometimes produces incorrect output.  This test is expected
	to catch basic rt_sigaction decoding bugs.

	Based on a patch proposed by Chris Dearman.

	* tests/sigaction.c: New file.
	* tests/sigaction.awk: Likewise.
	* tests/sigaction.sh: New test.
	* tests/Makefile.am (check_PROGRAMS): Add sigaction.
	(TESTS): Add sigaction.sh.
	(EXTRA_DIST): Add sigaction.awk.
	* tests/.gitignore: Add sigaction.

2014-01-05  Kirill A. Shutemov  <kirill.shutemov@linux.intel.com>

	mem: add missed MAP_HUGETLB mmap flag.
	* mem.c (mmap_flags): Add MAP_HUGETLB mmap flag.

	Acked-by: Mike Frysinger <vapier@gentoo.org>

2013-12-31  Mike Frysinger  <vapier@gentoo.org>

	Delete old PTRACE_{PEEK,POKE}USR logic.
	The code base has settled on PTRACE_{PEEK,POKE}USER (with an E) and has
	logic in defs.h to make sure it's set sanely.  Delete this old logic as
	the defs.h takes care of it now.

	* process.c: Delete PTRACE_PEEKUSR/PTRACE_POKEUSR defines.
	* signal.c: Likewise.
	* syscall.c: Delete PTRACE_PEEKUSR define.
	* util.c: Likewise.

2013-12-31  Mike Frysinger  <vapier@gentoo.org>

	Decode the O_PATH flag.
	* file.c (open_mode_flags): Add O_PATH.

2013-11-13  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unused configure checks.
	* configure.ac (AC_CHECK_FUNCS): Remove _sys_siglist and sys_siglist.
	(AC_CHECK_DECLS): Likewise.

2013-11-13  Dmitry V. Levin  <ldv@altlinux.org>

	Assume that <sys/ptrace.h> provides a valid ptrace prototype.
	We used to explicitly list architectures where <sys/ptrace.h> from glibc
	is known to provide a valid prototype for ptrace, and use a homegrown
	replacement for all the rest.  Situation seems to be better nowadays,
	glibc is not the only libc available, so let's use ptrace prototype from
	<sys/ptrace.h> by default, leaving the replacement for rare broken cases
	if any.

	* defs.h: Use ptrace prototype workaround iff
	NEED_PTRACE_PROTOTYPE_WORKAROUND is defined.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	Stop using _LFS64_LARGEFILE.
	There is only one place left in the code where strace guesses whether
	libc provides LFS64 functions and structures.  The most natural thing to
	do there is to check for _LARGEFILE64_SOURCE - the macro provided by
	glibc.  Other libc implementations that provide nondegenerate LFS64
	interfaces are expected to define this macro as well.

	* defs.h (_LFS64_LARGEFILE): Remove.
	* strace.c: Use _LARGEFILE64_SOURCE instead of _LFS64_LARGEFILE.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	Define truncate64, ftruncate64, and getdents64 decoders unconditionally.
	These decoders are referenced by most architectures, there were no
	undefined references so far because _LFS64_LARGEFILE appears to be
	always defined by glibc when _GNU_SOURCE is defined.

	* file.c (sys_truncate64, sys_ftruncate64, sys_getdents64): Define
	unconditionally.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	Define printflock64 only if it is referenced by other code.
	* configure.ac (AC_CHECK_TYPES): Add struct flock64.
	* desc.c (HAVE_F_SETLK64, HAVE_F_SETLKW64, HAVE_F_GETLK64): New macros.
	[!HAVE_STRUCT_FLOCK64] (struct flock64): Define.
	(printflock64): Define only if referenced by other code.
	(sys_fcntl): Handle F_FREESP64, F_SETLK64, F_SETLKW64, and F_GETLK64 iff
	these constants are defined and differ from their non-64bit versions.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	Make PTRACE_PEEKUSER/PTRACE_POKEUSER checks less glibc specific.
	* configure.ac (AC_CHECK_DECLS): Add PTRACE_PEEKUSER and
	PTRACE_POKEUSER.
	* defs.h: Define PTRACE_PEEKUSER and PTRACE_POKEUSER only if
	they are not provided by <sys/ptrace.h>.

	Reported by John Spencer.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unneeded redefinitions of IPPROTO_* macros.
	IPPROTO_* macros are defined by <netinet/in.h>, no need to redefine
	them.

	* net.c (IPPROTO_EGP, IPPROTO_PUP, IPPROTO_IDP, IPPROTO_IGMP,
	IPPROTO_RAW, IPPROTO_MAX): Remove.

	Reported by John Spencer.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unused AC_OFF_T_IS_LONG_LONG configure check.
	* configure.ac: Remove AC_OFF_T_IS_LONG_LONG.
	* m4/long_long.m4: Likewise.

	Remove unused code.
	* configure.ac (AC_CHECK_TYPES): Remove struct opthdr and
	struct t_opthdr.
	* net.c (print_sock_optmgmt): Remove.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	Use struct sigcontext instead of struct sigcontext_struct.
	* configure.ac (AC_CHECK_TYPES): Remove struct sigcontext_struct.
	* signal.c (sys_sigreturn) [S390 || S390X || POWERPC || ALPHA): Replace
	struct sigcontext_struct with struct sigcontext.

	Reported by John Spencer.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	Use standard names of sched_param structure members.
	* process.c (sys_sched_setscheduler, sys_sched_getparam,
	sys_sched_setparam): Use portable struct sched_param member name
	sched_priority instead of glibc specific __sched_priority.

	Reported by John Spencer.

2013-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	Make SIGEV_THREAD_ID decoding less glibc specific.
	SIGEV_THREAD_ID decoding requires access to an internal member of
	struct sigevent.  There seems to be no portable way to do it besides
	adding a configure check.

	* configure.ac (AC_CHECK_MEMBERS): Check for
	struct sigevent._sigev_un._pad and struct sigevent.__pad.
	* time.c (printsigevent): Use an appropriate struct sigevent member
	to print thread id.

	Reported by John Spencer.

2013-11-11  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unused configure checks.
	* configure.ac (AC_CHECK_MEMBERS): Remove T_conn_res.QUEUE_ptr,
	T_conn_res.ACCEPTOR_id, dqblk.dqb_curblocks, sigcontext.sc_hi2.

2013-11-11  Dmitry V. Levin  <ldv@altlinux.org>

	Assume "long long" availability.
	Most of the code already uses long long types unconditionally.

	* configure.ac: Remove the check for long long.
	* file.c (printstat64): Remove HAVE_LONG_LONG checks, use %llu format
	string unconditionally.

2013-11-11  Dmitry V. Levin  <ldv@altlinux.org>

	Include <sys/poll.h> only if there is no <poll.h>
	* pathtrace.c: Do not include <sys/poll.h> if <poll.h> is available.
	* stream.c: Likewise.

	Move io_* syscalls decoding to a separate file.
	* desc.c (sys_io_setup, sys_io_destroy, sys_io_submit, sys_io_cancel,
	sys_io_getevents, declarations from libaio.h): Move to ...
	* aio.c: new file.
	* Makefile.am (strace_SOURCES): Add aio.c.

2013-11-11  Denys Vlasenko  <dvlasenk@redhat.com>

	Stop using external libaio.h.
	This change incorporates a partial copy instead
	of using external libaio.h.
	Why?
	Because we want to properly decode 32-bit aio calls
	by 64-bit strace. For that, we need more definitions than
	libaio.h provides.
	(These defs are not done yet, but will eventually be done).
	Keeping our local 32-bit compat defs in sync with libaio.h
	_without seeing libaio structs_ is hard/more bug prone.
	A smaller benefit is that we don't need libaio installed.

2013-11-11  Denys Vlasenko  <dvlasenk@redhat.com>

	sys_io_submit: simplify iocb_cmd_lookup() helper.
	This helper returns two values (a string and an enum).
	The caller prints the string. It's simpler to just print
	the string in the caller itself. This eliminates
	"return by reference" and more importantly, an intermediate
	static string buffer for the string result.

	Since function of the helper is different now,
	it is renamed to tprint_lio_opcode().

2013-11-11  Denys Vlasenko  <dvlasenk@redhat.com>

	sys_io_submit: stop traversing iocb vector after first failure.
	The program may use a very large nr but supply either outright
	invalid iocbpp[], or one with far fewer elements than nr.
	We used to try reading iocbpp[i] until i == nr.
	With this change, we stop on the first failure.

2013-11-09  Denys Vlasenko  <dvlasenk@redhat.com>

	Fix pathtrace_match() to match recent fixes to select decoding.

	Fix select decoding on e.g. 32-bit ppc process by 64-bit strace.
	Added next_set_bit() function which finds the next set bit,
	properly taking into account word size of the traced process.
	Use it in decode_select() instead of fd_isset().
	Also, properly round fdsize up to word size of traced process,
	not to strace's word size.

2013-11-06  Denys Vlasenko  <dvlasenk@redhat.com>

	Speed up and explain fd_isset()

2013-11-05  Dr. David Alan Gilbert  <dave@treblig.org>

	Add a test for the latest select decoding fix.
	* test/select.c (main): Add a test for nfds larger than FD_SETSIZE.

2013-11-05  Dmitry V. Levin  <ldv@altlinux.org>

	Fix select decoding for glibc in _FORTIFY_SOURCE mode.
	glibc in _FORTIFY_SOURCE mode raises SIGABRT when descriptor greater
	or equal to FD_SETSIZE is passed to FD_ISSET.  Select family syscalls,
	however, can legitimately accept such descriptors.  To overcome this
	limitation, we have to replace FD_ISSET with an equivalent that imposes
	no such restrictions.

	* desc.c (fd_isset): New function.
	(decode_select): Use it instead of FD_ISSET.

2013-11-05  Dmitry V. Levin  <ldv@altlinux.org>

	More select decoding fixes.
	* desc.c (decode_select): Actually print arg[0] as int on entering
	syscall.  When arg[0] is negative, do not attempt to fetch and decode
	descriptor sets on entering syscall, kernel will reject it anyway.
	On exiting syscall, stop checking descriptor sets as soon as all
	returned descriptors are found.

2013-11-05  Denys Vlasenko  <dvlasenk@redhat.com>

	Truncate arg[0] to int in select decoding.
	This matches kernel's behavior.

	test/select.c: make comment more understandable.

2013-11-05  Dr. David Alan Gilbert  <dave@treblig.org>

	Fix select decoding with bogus (huge or negative) nfds.
	We used to allocate and fetch bit arrays using a sanitized
	length, but then iterate over them with "j < arg[0]" condition,
	where arg[0] is not sanitized. This segfaults if arg[0] is huge
	or negative. This change fixes this.

	Add test/select.c to capture the case.

2013-09-26  Ali Polatel  <alip@exherbo.org>

	Work around conflict between <sys/ptrace.h> and <linux/ptrace.h>
	Since glibc-2.18~39 <sys/ptrace.h> defines ptrace_peeksiginfo_args
	which collides with <linux/ptrace.h>.

	* configure.ac: Check for `struct ptrace_peeksiginfo_args' in
	<sys/ptrace.h>.
	* process.c: Work around potential conflict between <sys/ptrace.h>
	and <linux/ptrace.h> by redefining ptrace_peeksiginfo_args.
	* signal.c: Likewise.
	* syscall.c: Likewise.
	* util.c: Likewise.

2013-09-11  Vineet Gupta  <Vineet.Gupta1@synopsys.com>

	Add support for ARC Cores from Synopsys.
	Take #2 on mainlining strace support for ARC (last one was 4.6 based back
	in March 2011), see
	http://sourceforge.net/p/strace/mailman/message/27210168/

	The syscall ABI is asm-generic/unistd.h based (so no legacy syscalls),
	hence very similar to metag port.

	test/* all seem to work well.

	* linux/arc/ioctlent.h.in: New file.
	* linux/arc/syscallent.h: Likewise.
	* Makefile.am (EXTRA_DIST): Add linux/arc/ioctlent.h.in and
	linux/arc/syscallent.h.
	* configure.ac: Add ARC to the list of supported architectures.
	* defs.h: Add ARC support.
	* process.c (struct_user_offsets): Likewise.
	* signal.c (sys_sigreturn): Likewise.
	* syscall.c (print_pc, get_regset, get_regs, get_scno, get_syscall_args,
	get_syscall_result, get_error): Likewise.
	* util.c (change_syscall): Likewise.

	Acked-by: Mike Frysinger <vapier@gentoo.org>

2013-09-11  William Manley  <william.manley@youview.com>

	Add support for decoding sync_file_range.
	* file.c (sync_file_range_flags): New xlat structure.
	(sys_sync_file_range, sys_sync_file_range2): New functions.
	* linux/syscall.h (sys_sync_file_range, sys_sync_file_range2): New
	prototypes.
	* linux/dummy.h (sys_sync_file_range, sys_sync_file_range2): Remove.
	* linux/mips/syscallent-o32.h: Set the number of sync_file_range
	arguments to 7.

2013-09-11  Mike Frysinger  <vapier@gentoo.org>

	fanotify_mark: fix number of args for 32bit arches.
	The fanotify_mark func takes a 64bit mask, so 32bit arches have to split
	it up into two fields.  When the syscall was added, it was listed as only
	having 5 fields total (since that's correct for 64bit systems).

	* linux/arm/syscallent.h: Set the number of fanotify_mark arguments to 6.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/metag/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/or1k/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/tile/syscallent1.h: Likewise.

	Acked-by: Chris Metcalf <cmetcalf@tilera.com> [for tile]

2013-09-11  Dmitry V. Levin  <ldv@altlinux.org>

	x86, x86_64: fix compilation warnings.
	Fix "dereferencing type-punned pointer will break strict-aliasing rules"
	warnings introduced by commit v4.8-52-gb51f364.

	* signal.c (sys_sigreturn): Avoid dereferencing type-punned pointers.

2013-07-18  Denys Vlasenko  <dvlasenk@redhat.com>

	Remove rt parameter from [s]printsigmask()
	In almost all cases, the parameter was 1 ("decode RT sigs too").
	This change hardwires it to be 1.

	The cases where it was 0 are, and why the change to "decode RT sigs too"
	is fine:

	IA64: 64-bit arch, all 64 signals fit in one word in any case.
	S390[x]: sc.oldmask is a sigset_t on kernel side,
		(sigset_t *)&sc.oldmask[0] does contain all 64 signals.
	TILE: uc.uc_sigmask is a sigset_t on kernel side,
		memcpy(&sigm, &uc.uc_sigmask, NSIG / 8) copies all 64 signals.

2013-07-18  Denys Vlasenko  <dvlasenk@redhat.com>

	Convert some uses of long_to_sigmask+printsigmask to sprintsigmask_long.
	This allows to drop long_to_sigmask function,
	and a whole bunch of sigset_t variables.

	Simplify some sigmask manipulations.

	Add compat support for sys_pselect6.

	I386: fix signedness mismatch warning.
	&i386_regs.esp is a pointer to long, not unsigned long.
	It needs a cast.

2013-07-18  Denys Vlasenko  <dvlasenk@redhat.com>

	Fix sigset printing via print_sigset().
	Replace print_sigset() with print_sigset_addr_len(),
	which takes not only addr, but also len parameter.
	This allows us to drop "do we need to print RT signals?" parameter,
	and this fixes RT signals printing in many syscalls.

	sys_epoll_pwait: print RT signals too, print sigmask size argument.

	sys_sigprocmask: print_sigset -> print_sigset_addr_len(current_wordsize),
	no change in functionality.

	sys_sigpending: use print_sigset_addr_len(current_wordsize)
	instead of open-coding it.

	sys_rt_sigprocmask: use print_sigset_addr_len instead of open-coding it.
	sys_rt_sigpending: ditto.
	sys_rt_sigsuspend: ditto.
	sys_rt_sigtimedwait: ditto.

	do_signalfd: print_sigset -> print_sigset_addr_len. This fixes
	RT signals printing (wasn't showing them before).

	sys_ppoll: ditto.

	copy_sigset_len() is folded into its only user, print_sigset_addr_len(),
	and copy_sigset() is gone.

	While at it, checked kernel sources and noted where kernel enforces
	sigset_size == NSIG / 8 (== sizeof(kernel_sigset_t)),
	and where it allows word-sized sigset_size ([rt_]sigpending).

2013-07-18  Denys Vlasenko  <dvlasenk@redhat.com>

	sys_rt_sigaction: fix sigset copying.
	In practice, we always copy as many bytes as syscall param says
	(8, or 16 on mips). However, malicious program can call sigaction
	with wrong sigset size. Such syscall will result in EINVAL,
	but we (strace) end up copying 128 bytes (sizeof(sigset_t)),
	which copyes some garbage from stack after struct sigaction.

	Now we always copy NSIG / 8 bytes (which is 8 bytes, or 16 on mips).

2013-07-18  Denys Vlasenko  <dvlasenk@redhat.com>

	ARM: remove wrong NSIG = 32 define.
	ARM in fact has 64 signals (1..64), and NSIG should be 65
	(as usual, rememebr that NSIG_libc == NSIG_kernel+1).

	I carefully reviewed all usages of NSIG. In syscall.c,
	the only usage is:
	        for (i = 0; i <= NSIG; i++)
	                if (strcasecmp(s, signame(i) + 3) == 0)...
	which is safe even if NSIG is way too big - signame(i)
	returns a well-formed string for any i.

	In signal.c, memcpy(&sigset, &sc.sc_mask, NSIG / 8) is used by
	IA64 and TILE code, so ARM change can't affect it. And final
	usage is:
	 struct new_sigaction::unsigned long sa_mask[NSIG / sizeof(long)];
	It will grow on ARM (and become correct in the process).
	Its only use is
	 memcpy(&sigset, &sa.sa_mask, NSIG / 8);
	 printsigmask(&sigset, 1);
	which used to copy garbage in high bits, now it will copy actual data.

2013-07-17  Denys Vlasenko  <dvlasenk@redhat.com>

	ARM: fix sigreturn decoding.
	Decoding of test/sigreturn testcase:
	Was:
	sigreturn() (mask [QUIT TRAP ABRT BUS SEGV USR2 PIPE STKFLT STOP XCPU VTALRM PROF WINCH IO PWR RTMIN]) = 0
	Now:
	sigreturn() (mask [CHLD RT_1 RT_3 RT_31 RT_32]) = 0

2013-07-16  Denys Vlasenko  <dvlasenk@redhat.com>

	Group USE_CUSTOM_PRINTF define with other tweakables.
	No code changes.

2013-07-16  Denys Vlasenko  <dvlasenk@redhat.com>

	Improve sigreturn decoding on x86 to show RT signal bits too.
	This includes decoding of 32-bit sigreturn by 64-bit strace,
	which previously wasn't done.

	Added a test for it.

2013-07-12  Anton Blanchard  <anton@samba.org>

	powerpc: enhance 32/64bit detection.
	We were using uname to determine if userspace was 32 or 64bit.
	This fails when we have a 64bit kernel and a 32bit userspace.

	* configure.ac (powerpc*): Similar to x86, use a runtime test
	to determine if we are 32 or 64bit.

2013-07-12  Anton Blanchard  <anton@samba.org>

	powerpc: fix some compiler warnings.
	Fix a number of differing signedness warnings when building on
	powerpc.

	powerpc: fix iflag build issue (static -> extern)

2013-07-10  Denys Vlasenko  <dvlasenk@redhat.com>

	PTRACE_SEIZE can set ptrace options immediately, use this feature.
	This eliminates some rare bugs, such as post-execve SIGTRAP
	generation when we attach to a process, and it manages to finish
	execve'ing before we set TRACEEXEC option to suppress that.

2013-07-08  Denys Vlasenko  <dvlasenk@redhat.com>

	If -o|logger is in use, exit trace loop if nprocs == 0.

	Exit trace loop if got ECHILD, not if nprocs == 0.
	Comment gives a testcase which wasn't handled correctly
	by the old code.

2013-07-07  Denys Vlasenko  <dvlasenk@redhat.com>

	s390[x]: get rid of syscall_mode, delete code which never triggers.
	Before this change, the logic was as follows:
	syscall entry:
	  get_scno:
	    syscall_mode = GPR2
	    scno = syscall_mode unless syscall_mode == -ENOSYS
	    (if -ENOSYS, scn is retrieved by decoding current insn)
	  fixup:
	    gpr2 = GPR2
	    syscall_mode = scno unless syscall_mode == -ENOSYS
	    if (gpr2 != syscall_mode) stray_entry
	syscall exit:
	  get_res:
	    gpr2 = GRP2
	  fixup:
	    syscall_mode = scno unless syscall_mode == -ENOSYS
	    if (WAITEXECVE && gpr2 in (-ENOSYS, scno)) gpr2 = 0;
	  get_error:
	    gpr2 is retval

	Entry fixup's if() can never trigger:
	regardless whether GPR2 is -ENOSYS or not, syscall_mode is always
	equal to GRP2 value there. So it can be removed.

	On sysexit path, syscall mode is never used.

	Therefore, syscall_mode variable is deleted. grp2 is read from
	GPR2 register in get_scno, redundant read in entry fixup is removed.
	As a result, entry fixup's s390 code block vanishes completely.

	gpr2 variable is renamed s390_gpr2 to match the convention used
	by other arches.

2013-07-04  Denys Vlasenko  <dvlasenk@redhat.com>

	ARM: add STRACE_KNOWS_ONLY_EABI define which can be used to omit OABI support

	Add paranoia check before passing a long to pid2tcb(int pid)

2013-07-02  Denys Vlasenko  <dvlasenk@redhat.com>

	In debug output, show waitpid status with 6 hex digits, not 4.
	This shows event byte values better (without variable offset):

	 [wait(0x01057f) = 29491] WIFSTOPPED,sig=SIGTRAP,EVENT_FORK (1)
	 [wait(0x80057f) = 29492] WIFSTOPPED,sig=SIGTRAP,EVENT_STOP (128)
	         ^^

2013-07-02  Denys Vlasenko  <dvlasenk@redhat.com>

	Replace suspicious popen_pid assignment with an obviously correct one.
	popen_pid = vfork() does work correctly, but for a subtle reason
	that wrong assignment of 0 happens in the child _first_,
	and _then_ correct value overwrites it in the parent.

	(And in a hyphothetical system where vfork = fork,
	popen_pid wouldn't be shared, so it will also be ok.)

	However, it's not necessary to be difficult.
	This change makes it so that assignment is done only in parent.

2013-07-01  Denys Vlasenko  <dvlasenk@redhat.com>

	Convert trace() from returning int to returning void.
	The cleanup sequence in error cases, and on normal code path
	was nearly the same, no point in duplicating it.

	Remove ia64-specific printing of current address on signal delivery.
	The address is printed anyway by printleader() if -i is active.

	Rename ia32 to ia64_ia32mode, and make it bool, not long.
	Grepping for just ia32 was turning up many false positives.

2013-06-30  Denys Vlasenko  <dvlasenk@redhat.com>

	Fold is_restart_error() into its sole user.

2013-06-29  Denys Vlasenko  <dvlasenk@redhat.com>

	Update qemu_multiarch_testing/README.

2013-06-28  Denys Vlasenko  <dvlasenk@redhat.com>

	sys_clone: add a comment about CLONE_PTRACE and CLONE_UNTRACED.
	No code changes.

	POWERPC: get rid of "static long ppc_result"

	POWERPC: read ppc_regs.nip if -i.

	POWERPC: if GETREGS fails with EIO, don't try it again.

	Get rid of powerpc_getreg(), it's a copy of upeek()

	Change upeek() to take pid, not full tcp.
	This will be used by next change.

2013-06-26  Anton Blanchard  <anton@samba.org>

	powerpc: Provide a fallback for old kernels without PTRACE_GETREGS.
	PTRACE_GETREGS was added to the ppc kernel in 2.6.23. In order to
	provide backward compatibility for very old kernels, add a manual
	fallback.

	* syscall.c (powerpc_getreg, powerpc_getregs_old): New functions.
	(get_regs): Call powerpc_getregs_old if PTRACE_GETREGS is not supported.

2013-06-26  Anton Blanchard  <anton@samba.org>

	powerpc: Use PTRACE_GETREGS to fetch all registers.
	* defs.h: declare ppc_regs and get_regs_error.
	* signal.c (sys_sigreturn): Use ppc_regs instead of upeek.
	* syscall.c: define ppc_regs.
	(printcall): Use ppc_regs instead of upeek.
	(get_scno): Replace multiple upeek calls with one PTRACE_GETREGS call.
	(get_syscall_result): Likewise.

2013-06-26  Denys Vlasenko  <dvlasenk@redhat.com>

	Another manpage tweak.

	Manpage update.

	Update build_static_example.sh.
	Now it also contains a tested example of i686 build on 64-bit host.

	In -f mode, do not assume that new pid is stopped - handle exits too.

2013-06-26  Denys Vlasenko  <dvlasenk@redhat.com>

	Set strace_child only in the right branch.
	"strace_child = pid" assignment was racing in NOMMU case
	because of vfork (no way to know which process would win).

	After this change, strace_child is set to nonzero only
	in one process after [v]fork.

2013-06-26  Denys Vlasenko  <dvlasenk@redhat.com>

	Get rid of TCB_INUSE and TCB_STRACE_CHILD.
	We can use tcb::pid == 0 as an indicator of free tcb,
	and we already have strace_child variable which holds
	pid of our child, if any.

2013-06-21  Denys Vlasenko  <dvlasenk@redhat.com>

	Fix debug output of wait4 result (was reusing buf[] on unknown events)

	Show PTRACE_EVENT_STOP correctly in debug output.

2013-06-21  Denys Vlasenko  <dvlasenk@redhat.com>

	Panic a bit less when we see an unknown pid.
	I stumbeld over this case when I used "exec stace ...".

	* strace.c (trace): Do not exit if we see an unknown pid in wait4.

2013-06-21  Denys Vlasenko  <dvlasenk@redhat.com>

	detach(): Reorganize code. Logic is the same.
	* strace.c (detach): Use goto's instead of excessive nesting.
	Drop sigstop_expected and interrupt_done variables.

	Eat pending SIGSTOP _before_ PTRACE_DETACH in detach()
	* strace.c (detach): If TCB_IGNORE_ONE_SIGSTOP is set,
	di not PTRACE_DETACH - wait for SIGSTOP first.

2013-06-20  Denys Vlasenko  <dvlasenk@redhat.com>

	detach(): warn if we see ECHILD from waitpid.
	* strace.c (detach): Warn if we see ECHILD from waitpid.
	Explain in comments that we don't normally expect !WIFSTOPPED
	either, and also that PTRACE_CONT failure isn't expected
	(the "break" there is a "I'm confused, bailing out" code style)..

	Improve error messages in detach()
	* strace.c (detach): Change return type from int to void.
	Improve error meesages: show PID, tell exactly which operation fails.

2013-06-20  Denys Vlasenko  <dvlasenk@redhat.com>

	Remove workarounds for ancient kernels lacking __WALL.
	__WALL is available and working at least since 2.4 kernels: 10 years ago.

	* strace (detach): Remove workarounds for ancient kernels lacking __WALL.
	Add missing EINTR check.
	(trace): Remove workarounds for ancient kernels lacking __WALL.
	Remove redundant double error printout.

2013-06-20  Denys Vlasenko  <dvlasenk@redhat.com>

	USE_SEIZE: fix detaching from stopped processes.
	V3: split SEIZE/!SEIZE code paths to reduce confusion.
	Extensively comment every possible case.
	Verified that all tests/detach* tests work in both SEIZE and !SEIZE
	cases.

	* strace.c (detach): If PTRACE_SEIZE API is in use, stop the tracee
	using PTRACE_INTERRUPT instead of sending it a SIGSTOP.
	In a subsequent waitpid loop, correctly wait and suppress SIGSTOP
	on detach if PTRACE_INTERRUPT wasn't used, or wait for any ptrace
	stop and detach without suppressing signals.

2013-06-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: disable /proc based checks when /proc is not mounted.
	* tests/detach-running: Disable /proc based checks when
	/proc/self/status is not available.
	* tests/detach-sleeping: Likewise.
	* tests/detach-stopped: Likewise.

2013-06-19  Denys Vlasenko  <dvlasenk@redhat.com>

	tests/detach-{running,sleeping,stopped}: check post-detach state.
	Check that traced process still exists and is in a right state
	after strace detached from it.

2013-06-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: ensure that strace can detach from running processes.
	* tests/detach-running: New test.
	* tests/Makefile.am (TESTS): Add it.

	tests: ensure that strace does not leave sleeping processes stopped.
	* tests/detach-sleeping: Do not send SIGCONT to the sleeping process.

2013-06-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix parallel-tests support in detach-* tests.
	* tests/detach-sleeping: Use $LOG file for set_ptracer_any output.
	* tests/detach-stopped: Likewise.

	tests: parametrize "sleep 1"
	* tests/init.sh (SLEEP_A_BIT): New variable.
	* tests/detach-sleeping: Use it.
	* tests/detach-stopped: Likewise.

	tests: ensure that strace can detach from sleeping and stopped processes
	* tests/set_ptracer_any.c: New file.
	* tests/detach-sleeping: New test.
	* tests/detach-stopped: Likewise.
	* tests/Makefile.am (check_PROGRAMS): Add set_ptracer_any.
	(TESTS): Add detach-sleeping and detach-stopped.
	* tests/.gitignore: Add set_ptracer_any.

2013-06-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance timeout checks.
	Run each test using a wrapper that does all necessary timeout checks.

	* tests/run.sh: New file.
	* tests/Makefile.am (EXTRA_DIST, LOG_COMPILER): Add it.
	* tests/init.sh (check_strace, check_timeout): Remove.
	* tests/detach-stopped: Update callers.
	* tests/net: Likewise.
	* tests/ptrace_setoptions: Likewise.
	* tests/qual_syscall: Likewise.
	* tests/stat: Likewise.
	* tests/strace-f: Likewise.

2013-06-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enable parallel-tests support.
	* configure.ac (AM_INIT_AUTOMAKE): Add parallel-tests.

	tests: prepare for parallel-tests support.
	* tests/Makefile.am (CLEANFILES): Calculate dynamically from TESTS.
	* tests/init.sh (LOG): New variable.
	* tests/detach-stopped: Use it.
	* tests/net: Likewise.
	* tests/qual_syscall: Likewise.
	* tests/stat: Likewise.
	* tests/strace-f: Likewise.

2013-06-18  Denys Vlasenko  <dvlasenk@redhat.com>

	Cleanups. No logic changes.
	* defs.h: Define new ptrace constants unconditionally.
	* strace.c (detach): Fix comment.
	(trace): Remove now unnecessary "if USE_SEIZE".

2013-06-05  Dmitry V. Levin  <ldv@altlinux.org>

	maint: post-release administrivia.
	* NEWS: Add header line for next release.

2013-06-03  Dmitry V. Levin  <ldv@altlinux.org>

	ioctlent: add UAPI support.
	* Makefile.am (IOCTLSORT_INCLUDEDIR): Define.
	(ioctlsort): Use it.
	* linux/ioctlent.sh (lookup_ioctls): Look into uapi directory tree.
	Strip "uapi/" prefix from output path names.
	* linux/ioctlent.h.in: Regenerate from v3.9 headers.
	* NEWS: Mention it.

	Prepare for 4.8 release.
	* NEWS: Update for 4.8 release.
	* debian/changelog: 4.8-1.
	* strace.spec: 4.8-1.

2013-06-02  Dmitry V. Levin  <ldv@altlinux.org>

	Fix "make dist" on recently added architectures.
	* Makefile.am (EXTRA_DIST): Add linux/aarch64/errnoent1.h,
	linux/aarch64/ioctlent.h.in, linux/aarch64/ioctlent1.h,
	linux/aarch64/signalent1.h, linux/aarch64/syscallent.h,
	linux/aarch64/syscallent1.h, linux/metag/ioctlent.h.in,
	linux/metag/syscallent.h, linux/or1k/ioctlent.h.in,
	linux/or1k/syscallent.h, linux/tile/errnoent1.h, linux/tile/ioctlent1.h,
	linux/tile/signalent1.h, linux/tile/syscallent1.h, linux/ubi-user.h,
	linux/xtensa/ioctlent.h.in, and linux/xtensa/syscallent.h.

	Fix "make dist" regression introduced by commit v4.7-184-gd648f29.
	* Makefile.am (EXTRA_DIST): Add linux/ubi-user.h.

2013-05-28  Dmitry V. Levin  <ldv@altlinux.org>

	Do not suppress signal delivery messages with -qq.
	Current implementation of -qq does not allow suppressing exit status
	messages without suppressing signal delivery messages, which is not
	good.  There is a traditional "-e signal=none" syntax that can be used
	to suppress all signal delivery messages.
	This partially reverts commit v4.7-222-g01997cf.

	* strace.c (trace): Do not suppress signal delivery messages with -qq.
	* strace.1: Update documentation about -qq option.

2013-05-23  Chris Metcalf  <cmetcalf@tilera.com>

	tile: use siginfo_t, not struct siginfo.
	As of glibc 2.16, "struct siginfo" is no longer supported,
	and "siginfo_t" must be used instead.

	tile: remove MAP_CACHE_xxx support in mem.c.
	These flags support functionality in mmap() that has not been
	pushed back to the community, and which may or may not eventually
	end up being the final community model.  In the interim, having
	these flags unconditionally present for "#ifdef TILE" just means
	that the TILE build breaks if using the community versions of
	the kernel and glibc, so just revert the code until such time
	as it may end up in the community.

2013-05-17  Mike Frysinger  <vapier@gentoo.org>

	Rename COPYRIGHT to COPYING.
	The standard name people have adopted is "COPYING" rather than
	"COPYRIGHT".  Use that as a lot of license scanning tools look for it.

	* COPYRIGHT: Rename to ...
	* COPYING: ... this.
	* Makefile.am (EXTRA_DIST): Rename COPYRIGHT to COPYING.
	* README: Likewise.
	* strace.spec (%files): Likewise.

2013-05-17  Dmitry V. Levin  <ldv@altlinux.org>

	Sync strace.spec and debian/ with packages.
	* debian/changelog: Sync with 4.7-1.
	* debian/strace.docs: Likewise.
	* strace.spec: Sync with 4.7-3.

	Update PTRACE_O_* constants.
	* process.c (ptrace_setoptions_flags): Sync with Linux 3.9.

	Update AF_*, PF_*, MSG_*, and TCP_* constants.
	* net.c (domains, addrfams, protocols, socktcpoptions): Sync with
	Linux 3.9.

2013-05-14  Dmitry V. Levin  <ldv@altlinux.org>

	NOMMU: do not hide startup syscalls unless in -D mode.
	On NOMMU systems in "strace PROG" case, we have no way to attach to
	the tracee before it calls execve unless in -D mode.  That is, the
	first execve call is very likely to be missed, and setting
	hide_log_until_execve just results to empty log.

	* strace.c (init) [NOMMU_SYSTEM]: Do not set hide_log_until_execve
	unless in -D mode.

2013-05-14  Dmitry V. Levin  <ldv@altlinux.org>

	Make -D mode work when the Yama LSM is enabled.
	* strace.c [HAVE_PRCTL]: Include sys/prctl.h.
	(startup_child) [HAVE_PRCTL && PR_SET_PTRACER && PR_SET_PTRACER_ANY]:
	In -D mode, allow tracing the process that is going to become the
	tracee.

	Update PR_* constants.
	* process.c (prctl_options): Add PR_SET_PTRACER.

2013-05-14  Denys Vlasenko  <dvlasenk@redhat.com>

	Hide startup syscalls.
	Tested with "./strace [-D] [-q] [-bexecve] env true",
	all cases seem to work.

	* defs.h: Declare new variable: bool hide_log_until_execve.
	* strace.c: Define hide_log_until_execve.
	Rename skip_startup_execve to skip_one_b_execve.
	(startup_child): Do not set skip_one_b_execve = 1 here.
	(init): If "strace PROG" case (as opposed to "strace -pPID"),
	set skip_one_b_execve and hide_log_until_execve to 1.
	(trace): Don't print signal messages if hide_log_until_execve == 1.
	* syscall.c (trace_syscall_entering):
	Skip syscall printing if hide_log_until_execve == 1.
	Reset hide_log_until_execve if we enter execve syscall.
	(trace_syscall_exiting): Skip syscall printing if hide_log_until_execve == 1.

2013-05-13  Daniel P. Berrange  <berrange@redhat.com>

	Allow -q to be repeated for very quiet output.
	Even with the -q flag specified, tracing output is still mixed
	with messages about signals and process exit status, which is
	often irrelevant.  Allow the -q option to be repeated to force
	the suppression of signals / exit status info too.

	* defs.h: Change 'qflag' from 'bool' to 'unsigned int'.
	* strace.1: Document ability to repeat '-q' option.
	* strace.c: Allow '-q' to be repeated to quieten process
	exit status and signal messages.

2013-05-11  Dmitry V. Levin  <ldv@altlinux.org>

	mips o32: fix syscall table.
	* linux/mips/syscallent-o32.h: Add entries for getpmsg, putpmsg,
	get_mempolicy, set_mempolicy and vserver.  Fix names for umount,
	umount2, mmap, mmap2, pread64, pwrite64, sigaltstack and fstatat64
	syscalls.

2013-05-10  Dmitry V. Levin  <ldv@altlinux.org>

	mips n64: fix syscall table.
	* linux/mips/syscallent-n64.h: Add entries for get_mempolicy,
	set_mempolicy and timerfd syscalls.  Fix entry for socket syscall.
	Fix names for pread64, pwrite64, shmat, rt_sigsuspend, sigaltstack
	and umount2 syscalls.

	mips n32: fix syscall table.
	* linux/mips/syscallent-n32.h: Add entries for mbind, get_mempolicy,
	set_mempolicy and timerfd syscalls.  Fix entry for socket syscall.
	Fix handlers for truncate, ftruncate and getdents64 syscalls.
	Fix names for pread64, pwrite64, shmat, rt_sigsuspend, sigaltstack,
	umount2, and getdents64 syscalls.

2013-05-08  Dmitry V. Levin  <ldv@altlinux.org>

	sync_file_range: fix number of syscall arguments.
	* linux/avr32/syscallent.h: Set the number of sync_file_range arguments
	to 6.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/or1k/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Change sync_file_range to
	sync_file_range2, set the number of sync_file_range2 arguments to 6.
	* linux/tile/syscallent.h: Change sync_file_range to sync_file_range2,
	set the number of sync_file_range2 arguments to 4.
	* linux/tile/syscallent1.h: Change sync_file_range to sync_file_range2.
	update handler.
	* linux/xtensa/syscallent.h: Likewise.

	Add syscall entries for new linux syscalls.
	* linux/dummy.h: Add printargs aliases for sys_finit_module, sys_kcmp
	and sys_sync_file_range2.
	* linux/alpha/syscallent.h: Add entries for process_vm_readv
	and process_vm_writev.
	* linux/bfin/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Add entries for sync_file_range2, kcmp
	and finit_module.
	* linux/hppa/syscallent.h: Add entries for process_vm_readv,
	process_vm_writev, kcmp and finit_module.
	* linux/tile/syscallent.h: Likewise.
	* linux/tile/syscallent1.h: Likewise.
	* linux/ia64/syscallent.h: Add entry for finit_module.
	* linux/i386/syscallent.h: Add entries for kcmp and finit_module.
	* linux/m68k/syscallent.h: Likewise.
	* linux/metag/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/or1k/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Add entries for s390_runtime_instr, kcmp
	and finit_module.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Add entries for kern_features, kcmp
	and finit_module.

	tests/net: fix portability issues.
	* tests/net-accept-connect.c: Fix address length passed to bind()
	and connect().
	* tests/net: Update regexps.

	tests: add a test for basic network syscalls.
	* tests/.gitignore: Add net-accept-connect, *.o and *.log.*.
	* tests/Makefile.am (AM_CFLAGS): New variable.
	(check_PROGRAMS): Add net-accept-connect.
	(TESTS): Add net.
	* tests/net-accept-connect.c: New file.
	* tests/net: New file.

	tests: do not skip tests when timeout utility is not available.
	* tests/init.sh (check_timeout): New function.
	* tests/ptrace_setoptions: Use it.
	* tests/qual_syscall: Likewise.
	* tests/stat: Likewise.
	* tests/strace-f: Likewise.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	Move subcall decoding configuration out of the common code.
	* Makefile.am (EXTRA_DIST): Add linux/subcall.h.
	* linux/syscall.h (SYS_socket_subcall): Remove.
	(SYS_socket_nsubcalls, SYS_ipc_subcall, SYS_ipc_nsubcalls): Move to ...
	* linux/subcall.h: ... new file.
	* linux/arm/syscallent.h: Define SYS_socket_subcall, include subcall.h.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.

	Suggested by Mike Frysinger and Chris Metcalf.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	sparc: remove some unused declarations and macros.
	* linux/syscall.h [SPARC || SPARC64] (sys_msgsys, sys_semsys,
	sys_shmsys): Remove declarations.
	[SPARC || SPARC64] (SYS_semsys_subcall, SYS_semsys_nsubcalls,
	SYS_msgsys_subcall, SYS_msgsys_nsubcalls, SYS_shmsys_subcall,
	SYS_shmsys_nsubcalls): Remove macros.

2013-05-07  Mike Frysinger  <vapier@gentoo.org>

	mips: fix build regression.
	The recent commit (2690fadc8b35190dddd29274a7405bac13adc469) shuffled
	the mips headers around causing it to check the ABI defines before it
	included the header which set those up.  Now all mips builds fail with:
		In file included from count.c:36:0:
		defs.h:48:4: error: #error Unsupported _MIPS_SIM

	* defs.h [MIPS]: Move sgidefs.h above _MIPS_SIM check.

2013-05-07  James Hogan  <james.hogan@imgtec.com>

	metag: rename llseek syscall to _llseek.
	The raw llseek syscall is called _llseek from userland, so fix the
	naming of it for metag to allow the stat test to pass.

	* linux/metag/syscallent.h: Rename llseek syscall to _llseek.

2013-05-07  James Hogan  <james.hogan@imgtec.com>

	metag: disable socket and ipc subcall support.
	The metag architecture also uses dedicated syscalls and doesn't need to
	multiplex ipc and socket subcalls.

	* linux/syscall.h [METAG]: Do not define SYS_socket_subcall and
	SYS_ipc_subcall.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	pread, pwrite: fix number of syscall arguments.
	The number of pread and pwrite arguments depends on architecture and
	personality.  For 64bit and ilp32 it equals to 4, for unaligned
	32bit it equals to 5, and for aligned 32bit it equals to 6.

	* linux/aarch64/syscallent1.h: Change the number of pread and pwrite
	arguments to 4.
	* linux/alpha/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/or1k/syscallent.h: Change the number of pread and pwrite
	arguments to 5.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	preadv, pwritev: fix number of syscall arguments.
	The number of preadv and pwritev arguments depends on architecture and
	personality.  For 64bit and ilp32 it equals to 4, for unaligned 32bit
	it equals to 5, and for aligned 32bit it equals to 6.

	* linux/aarch64/syscallent1.h: Change the number of preadv and pwritev
	arguments to 4.
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Change the number of preadv and pwritev
	arguments to 6.
	* linux/sh/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Likewise.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	ftruncate64, truncate64: fix number of syscall arguments.
	The number of ftruncate64/truncate64 arguments depends on architecture
	and personality.  For 64bit and ilp32 it equals to 2, for unaligned
	32bit it equals to 3, and for aligned 32bit it equals to 4.

	* linux/or1k/syscallent.h: Change the number of ftruncate64 and
	truncate64 arguments to 3.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Change ftruncate64 and truncate64 handlers.
	* linux/sparc/syscallent.h: Change ftruncate64 handler, change the
	number of its arguments to 3.
	* linux/xtensa/syscallent.h: Change the number of ftruncate64 and
	truncate64 arguments to 4.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	fallocate: fix number of syscall arguments.
	The number of fallocate arguments depends on architecture and
	personality.  For 64bit and ilp32 it equals to 4,
	for 32bit it equals to 6.

	* linux/aarch64/syscallent1.h: Change the number of fallocate arguments
	to 4.
	* linux/alpha/syscallent.h: Likewise.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Set fallocate handler and flags.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	fadvise64, fadvise64_64: fix handlers and number of syscall arguments.
	The number of fadvise64 arguments depends on architecture and
	personality.  For 64bit and ilp32 it equals to 4, for unaligned
	32bit it equals to 5, and for aligned 32bit it equals to 6.

	The number of fadvise64_64 arguments is 4 for 64bit and ilp32, for
	unaligned 32bit and most of aligned 32bit it equals to 6, and for
	mips o32 it equals to 7.

	* linux/alpha/syscallent.h: Set fadvise64 handler.
	* linux/s390/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Set fadvise64_64 handler, change the number
	of syscall arguments to 6.
	* linux/ia64/syscallent.h: Change the number of fadvise64 arguments
	to 4.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/tile/syscallent1.h: Change the number of fadvise64 arguments
	to 5.
	* linux/mips/syscallent-o32.h: Change the number of fadvise64_64
	arguments to 7.
	* linux/s390x/syscallent.h: Change fadvise64_64 handler.  Set fadvise64
	handler.  Change numbers of fadvise64 and fadvise64_64 arguments to 4.
	* linux/sh64/syscallent.h: Change fadvise64_64 handler.
	Change numbers of fadvise64 and fadvise64_64 arguments to 4.
	* linux/sparc/syscallent.h: Set fadvise64 and fadvise64_64 handlers,
	change numbers of their arguments to 5 and 6.
	* linux/x86_64/syscallent.h: Change fadvise64 handler.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	mips o32: raise the max number of syscall arguments to 7.
	On mips o32, fadvise64_64 takes 7 arguments.

	* defs.h [LINUX_MIPSO32]: Raise MAX_ARGS to 7.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	mips: split syscallent.h.
	linux/mips/syscallent.h consisted of several parts that had little in
	common.  Split them into separate files to ease maintenance.

	* linux/mips/syscallent-compat.h: New file.
	* linux/mips/syscallent-n32.h: Likewise.
	* linux/mips/syscallent-n64.h: Likewise.
	* linux/mips/syscallent-o32.h: Likewise.
	* linux/mips/syscallent.h: Include them.
	* Makefile.am (EXTRA_DIST): Add them.

2013-05-07  Dmitry V. Levin  <ldv@altlinux.org>

	readahead: fix number of syscall arguments.
	The number of readahead arguments depends on architecture and
	personality.  For 64bit and ilp32 it equals to 3, for unaligned 32bit it
	equals to 4, and for aligned 32bit it equals to 5.

	* linux/aarch64/syscallent1.h: Set number of readahead arguments to 3.
	* linux/alpha/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/or1k/syscallent.h: Set number of readahead arguments to 4.
	* linux/sh/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.
	* linux/xtensa/syscallent.h: Set number of readahead arguments to 5.

2013-05-06  Dmitry V. Levin  <ldv@altlinux.org>

	linux/syscall.h: make subcall decoding configuration more readable.
	* linux/syscall.h: Inverse and sort the subcall ifdef,
	add a comment why subcall decoding support is not enabled
	on some architectures.

2013-05-06  Chris Zankel  <chris@zankel.net>

	xtensa: disable socket and ipc subcall support.
	The Xtensa architecture also uses dedicated syscalls and doesn't
	need to multiplex ipc and socket subcalls.

	* linux/syscall.h [XTENSA]: Do not define SYS_socket_subcall and
	SYS_ipc_subcall.

2013-05-06  Dmitry V. Levin  <ldv@altlinux.org>

	Fix syscall flags.
	* linux/aarch64/syscallent1.h: Fix syscall flags for send.
	* linux/alpha/syscallent.h: Fix syscall flags for fchdir, getcwd,
	oldumount, sigaltstack, umount, uselib, and utimes.
	* linux/arm/syscallent.h: Fix syscall flags for close, creat, dup, dup2,
	fchdir, fchmod, fchown, fchown32, fcntl, fcntl64, fdatasync, flock,
	fsetxattr, fsync, getdents, getdents64, ioctl, oldfstat, oldselect,
	open, pipe, poll, pread, pwrite, read, readahead, readdir, readv,
	select, socketcall, write, and writev.
	* linux/avr32/syscallent.h: Fix syscall flags for inotify_init and
	unshare.
	* linux/bfin/syscallent.h: Fix syscall flags for pread64 and pwrite64.
	* linux/hppa/syscallent.h: Fix syscall flags for fchdir, flistxattr,
	getcwd, pause, signal, umount2, uselib, utime, and vfork.
	* linux/ia64/syscallent.h: Fix syscall flags for creat, fchdir,
	lstat, umount, uselib, and utimes.  Fix syscall handlers for
	fgetxattr, flistxattr, fremovexattr, and fsetxattr.
	* linux/m68k/syscallent.h: Fix syscall flags for close, creat, dup,
	dup2, fchdir, fchmod, fchown, fchown32, fcntl, fcntl64, fdatasync,
	flock, fsetxattr, getdents, ioctl, oldfstat, oldselect, open, pipe,
	poll, pread64, pwrite64, read, readahead, readdir, readv, select,
	socketcall, write, and writev.
	* linux/metag/syscallent.h: Fix syscall flags for fanotify_init,
	prlimit64, process_vm_readv, process_vm_writev, and quotactl.
	* linux/microblaze/syscallent.h: Fix syscall flags for close, creat,
	dup, dup2, fchdir, fchmod, fchown, fchown32, fcntl, fcntl64,
	fdatasync, flock, fsetxattr, getdents, ioctl, oldfstat, oldselect,
	open, perf_event_open, pipe, poll, pread64, pwrite64, read, readahead,
	readdir, readv, select, socketcall, write, and writev.
	* linux/mips/syscallent.h: Fix syscall flags for close, creat, dup,
	dup2, fchdir, fchmod, fchown, fcntl, fcntl64, fdatasync, flock,
	fsetxattr, getdents, getdents64, getxattr, ioctl, lgetxattr,
	listxattr, llistxattr, lremovexattr, lsetxattr, oldfstat, open, pipe,
	pivot_root, poll, pread, pwrite, read, readahead, readv, removexattr,
	select, setxattr, socketcall, statfs, write, and writev.
	* linux/or1k/syscallent.h: Fix syscall flags for fchdir and quotactl.
	* linux/powerpc/syscallent.h: Fix syscall flags for fchdir.
	* linux/sh/syscallent.h: Fix syscall flags for getcwd.
	* linux/sparc/syscallent.h: Fix syscall flags for getresgid, getresuid,
	setresgid, setresgid32, and setresuid.
	* linux/xtensa/syscallent.h: Fix syscall flags for close, creat, dup,
	dup2, fallocate, fchdir, fchmod, fchown, fcntl, fcntl64, fdatasync,
	flock, fsetxattr, fstatfs, fstatfs64, fsync, getdents, getdents64,
	ioctl, open, pipe, pivot_root, poll, pread64, pwrite64, read,
	readahead, readv, rt_sigreturn, select, setfsgid, setfsuid, setuid,
	swapoff, times, utime, write, and writev.

	tests/stat: enhance regexps.
	* tests/stat: Enhance regexps that check tracing of stat/stat64 and
	fstatat/fstatat64 syscalls.

2013-05-06  Chris Metcalf  <cmetcalf@tilera.com>

	tests/stat: support fstatat syscall for stat()
	Newer Linux architectures don't support the stat/stat64 syscalls.
	Instead they use fstatat() with AT_FDCWD and an extra flags argument.
	Support seeing this output in the 'strace -efile' test.

	As part of this change, use "grep -E -x" syntax consistently for
	all stat tests, since the number of \(foo\)\? expressions was becoming
	pretty unwieldy.

	* tests/stat: Update stat/stat64 check regexp to handle architectures
	that use fstatat instead.  Use "grep -E -x" syntax consistently.

2013-05-06  Dmitry V. Levin  <ldv@altlinux.org>

	ARM OABI: fix 64-bit arguments decoding.
	ARM OABI and ARM EABI have different function parameters passing rules,
	see commit v4.6-11-g7a5b08f for details.

	* util.c (printllval): Do not align argument number in case of ARM OABI.
	* file.c (sys_fadvise64_64): Likewise.

2013-05-06  Mike Frysinger  <vapier@gentoo.org>

	printllval: fix 64bit unpacking on mips/o32 and xtensa.
	The mips/o32 ABI and xtensa arch also do 64bit aligning, so add it to the
	printllval list for this.

	Normally for sys_fadvise64_64 we'd handle the same list of arches, but
	mips/o32 ABI is funky and doesn't shift -- it has 7 args.  So just add
	xtensa to it.

	* file.c (sys_fadvise64_64): Add XTENSA to the shifted list.
	* util.c (printllval): Add LINUX_MIPSO32 and XTENSA to the shifted list.

2013-05-06  Chris Metcalf  <cmetcalf@tilera.com>

	tile: disable socket and ipc subcall support.
	The tile arch just has the dedicated syscalls, so disable
	the logic for parsing subcalls.

	* linux/syscall.h [TILE]: Do not define SYS_socket_subcall and
	SYS_ipc_subcall.

2013-05-06  Mike Frysinger  <vapier@gentoo.org>

	Blackfin: disable socketcall and ipc subcall support.
	The Blackfin arch does not have a socketcall or ipc subcall
	(it has dedicated syscalls broken out), so disable the logic for it.

	* linux/syscall.h [BFIN]: Do not define SYS_socket_subcall and
	SYS_ipc_subcall.

2013-05-05  Mike Frysinger  <vapier@gentoo.org>

	s390: fix # of args truncate64/ftruncate64 takes.
	* linux/s390/syscallent.h: Change nargs to 3 for truncate64/ftruncate64.

2013-05-05  Mike Frysinger  <vapier@gentoo.org>

	mtd: clamp ubi name strings.
	Since the length fields with the ubi volnames are signed 16bit values,
	make sure we clamp that number to the size of the buffer we've allocated
	on the stack to prevent buffer overflows.

	* mtd.c (ubi_ioctl): Clamp length to string_quote to 0/UBI_MAX_VOLUME_NAME.
	Check the return of string_quote and tweak the output accordingly.

2013-05-04  Dmitry V. Levin  <ldv@altlinux.org>

	printxval: support more architectures.
	* configure.ac: Define SIZEOF_LONG_LONG.
	* util.c (printllval): Handle all architectures with sizeof(long) > 4
	and sizeof(long) == sizeof(long long).

2013-05-04  Mike Frysinger  <vapier@gentoo.org>

	Fix building for sparc64 targets.
	* util.c (printllval): Handle SPARC64 define.

	Fix building for mips n64 targets.
	* util.c (printllval): Handle LINUX_MIPSN64 define.

2013-05-03  Dmitry V. Levin  <ldv@altlinux.org>

	hppa: fix stat64 and fstat64 decoding.
	* file.c [HPPA]: Do not redefine stat64 to hpux_stat64.

	arm, aarch64, ppc: fix printllval-based decoders.
	* util.c (printllval) [ARM || POWERPC]: Align argument number.
	[AARCH64]: Align argument number in 32bit mode.
	* file.c (sys_fadvise64_64) [ARM || POWERPC]: Remove no longer needed
	printllval workaround.
	[AARCH64]: Fix printing POSIX_FADV_* constants in 32bit mode.

2013-05-02  Mike Frysinger  <vapier@gentoo.org>

	Decode mtd/ubi ioctls.
	Been playing with UBI of late and it'd help if I could see what it was
	doing.  Not entirely sure about the decoding of UBI_IOCVOLUP -- it takes
	a pointer to a 64bit value, not a strict.

	* util.c (MAX, MIN): Move to ...
	* defs.h (MAX, MIN): ... here.
	(CLAMP): Define.
	(ubi_ioctl): New prototype.
	* ioctl.c (ioctl_decode): Call ubi_ioctl when code is 'o' or 'O'.
	* mtd.c: Include ubi user API header.
	(ubi_volume_types): New enum decode.
	(ubi_volume_props): Likewise.
	(ubi_ioctl): Define.
	* linux/ubi-user.h: Import from linux 3.8.

2013-05-02  Mike Frysinger  <vapier@gentoo.org>

	test: add mtd/ubi test helpers.
	I used these to develop the mtd/ubi ioctl decoders.

	* test/.gitignore: Add mtd/ubi.
	* test/Makefile: Declare all tests in a PROGS var.
	Declare build targets .PHONY.
	(all): Depend on $(PROGS) instead of hardcoded list.
	(clean): Remove $(PROGS) instead of hardcoded list.
	* test/mtd.c: New file.
	* test/ubi.c: Likewise.

2013-05-02  Mike Frysinger  <vapier@gentoo.org>

	test: include headers for used funcs.
	These funcs use things like wait/write/read/strcmp but sometimes
	don't include the right header for them.

	* test/Makefile: Add -Wall to CFLAGS.
	* test/clone.c: Include unistd.h.
	* test/fork.c: Include sys/wait.h.
	* test/sig.c: Include unistd.h.
	* test/sigkill_rain.c: Include sys/wait.h.
	* test/vfork.c: Include sys/wait.h.
	* test/wait_must_be_interruptible.c: Include string.h

2013-05-02  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: fix compilation warnings introduced by commit v4.7-174-g44f0ed1.
	* linux/ia64/syscallent.h: Undefine sys_oldlstat, sys_lstat and
	sys_lstat64 before redefining them to printargs.

	Reported-by: Mike Frysinger <vapier@gentoo.org>

2013-05-02  Mike Frysinger  <vapier@gentoo.org>

	tests: stat: fix clean up of sample file.
	* tests/stat: Also rm the sample file at the end of the test.

	Ignore more files.
	* .gitignore: Add gdb related files.
	* tests/.gitignore: Ignore test logs.

2013-05-02  Dmitry V. Levin  <ldv@altlinux.org>

	x32: fix decoding of i386 truncate and ftruncate syscalls.
	* linux/x32/syscallent1.h: Remove sys_*truncate64 redirections.

	x32: fix printllval-based decoders of i386 syscalls.
	* util.c (printllval) [X32]: Handle i386 personality.

	tests: add basic test for ftruncate, lseek and stat family syscalls.
	* tests/stat: New test.
	* tests/Makefile.am (TESTS): Add stat.

2013-05-01  Dmitry V. Levin  <ldv@altlinux.org>

	x32: fix build regressions introduced by commit v4.7-96-g8435d67.
	* desc.c (printflock) [X32]: Add special handling required for
	this architecture with sizeof(long) < sizeof(off_t).
	* file.c [X32] (struct stat64): Add __attribute__((packed)).
	[X32] (HAVE_STAT64): Define.
	(printstat) [X32]: Redirect to printstat64.
	(printstat64) [X32]: Use "struct stat" instead of "struct stat64".
	[X32] (realprintstat64): Rename to printstat64_x32.
	(sys_stat64, sys_fstat64) [X32]: Remove second definitions of these
	functions.  Call printstat64_x32 instead of printstat64
	* linux/x32/syscallent.h: Fix handlers for truncate and ftruncate.

	Alias sys_*lstat* syscall printing functions.
	* file.c (sys_lstat, sys_lstat64, sys_oldlstat): Remove.
	* linux/dummy.h: Move !HAVE_STRUCT___OLD_KERNEL_STAT aliases forward.
	(sys_lstat): Alias to sys_stat.
	(sys_lstat64): Alias to sys_stat64.
	(sys_oldlstat): Alias to sys_oldstat.
	* linux/syscall.h (sys_lstat, sys_lstat64, sys_oldlstat): Remove.
	* linux/x32/syscallent1.h (sys_lstat64): Remove.

	x86_64: decode __old_kernel_stat based syscalls.
	* linux/x86_64/syscallent1.h: Remove sys_old*stat redirections.

	x32: fix decoding of __old_kernel_stat based syscalls.
	* file.c [X32] (struct __old_kernel_stat): Define.
	* linux/x32/syscallent1.h: Remove sys_old*stat redirections.

2013-05-01  James Hogan  <james.hogan@imgtec.com>

	test/threaded_execve: fix on metag.
	The metag ABI has stacks growing upwards so clone expects the stack
	argument to point at the bottom of the stack instead of the top.

	* test/threaded_execve.c [__metag__]: Define clone2 differently
	to avoid a segfault at runtime.

2013-05-01  James Hogan  <james.hogan@imgtec.com>

	test/skodic: make a bit more portable.
	* test/skodic.c (main): Don't use MAP_FIXED since valid virtual addresses
	vary between architectures (as far as I can tell the use of MAP_FIXED is
	not relevant to the test).  Also don't assume the file desriptor returned
	by open call is 3 when passing it to mmap.

2013-05-01  Mike Frysinger  <vapier@gentoo.org>

	printllval: handle s390x.
	This is a 64bit arch w/no personalities, so fix printing.
	It can now trace a simple call like readahead:
	$ cat test.c
	main(){readahead(-1, (unsigned long long)1 << 50, 0);}
	$ gcc test.c
	$ ./strace -ereadahead ./a.out
	readahead(-1, 1125899906842624, 0)      = -1 EBADF (Bad file descriptor)

	* util.c (printllval): Handle S390X define.

2013-05-01  Mike Frysinger  <vapier@gentoo.org>

	Stop using old AM_CONFIG_HEADER macro.
	Building with automake-1.13 throws an error:
	configure.ac:6: error: 'AM_CONFIG_HEADER': this macro is obsolete.
	    You should use the 'AC_CONFIG_HEADERS' macro instead.

	* configure.ac (AM_CONFIG_HEADER): Rename to AC_CONFIG_HEADERS.

2013-04-30  Dmitry V. Levin  <ldv@altlinux.org>

	build: introduce git-version-gen.
	* .gitignore: Add .version.
	* Makefile.am (EXTRA_DIST, BUILT_SOURCES): Add $(srcdir)/.version.
	Add rules to check NEWS, generate $(srcdir)/.version and
	$(distdir)/.tarball-version files.
	Change ChangeLog and CREDITS generation rules to depend on
	$(srcdir)/.version instead of $(srcdir)/.git/refs/heads/*.
	* NEWS: Add dates to recent releases.
	* configure.ac (AC_INIT): Use git-version-gen.
	(AM_INIT_AUTOMAKE): Remove check-news.
	* git-version-gen: Import from gnulib.
	* make-dist: Check NEWS.

	Makefile.am: sort long lists to ease maintenance.
	* Makefile.am (strace_SOURCES, EXTRA_DIST): Sort, place one list element
	per line.

	build: fix "make dist" regression introduced by commit v4.7-105-g7270de5
	* Makefile.am (EXTRA_DIST): Remove linux/arm/syscallent1.h,
	linux/arm/signalent1.h, linux/arm/ioctlent1.h and linux/arm/errnoent1.h.

	build: fix "make dist" regression introduced by commit v4.7-29-g17e3860.
	* Makefile.am (EXTRA_DIST): Add linux/ioctlent-filter.awk.

2013-04-30  Mike Frysinger  <vapier@gentoo.org>

	Blackfin: tweak sram_alloc syscall decode.
	* system.c (sys_sram_alloc): The 2nd argument of sram_alloc syscall
	is a bit field, not a specific value, so decode it as such.

2013-03-31  Zev Weiss  <zev@bewilderbeest.net>

	Print io_submit() offsets in decimal.
	This makes output formatting more consistent with pread()/pwrite(),
	which print their offset parameters in decimal.

	* desc.c (sys_io_submit): Change offset output format from %llx to %lld.

2013-03-30  Andreas Schwab  <schwab@suse.de>

	Fix building outside source directory.
	The file linux/ioctlent.h is generated in the build directory, so
	"../ioctlent.h" won't find it.

	* linux/aarch64/ioctlent1.h: Remove "../" from include file name.
	* linux/powerpc/ioctlent1.h: Likewise.
	* linux/tile/ioctlent1.h: Likewise.
	* linux/x32/ioctlent1.h: Likewise.
	* linux/x86_64/ioctlent1.h: Likewise.
	* linux/x86_64/ioctlent2.h: Likewise.

2013-03-30  Andreas Schwab  <schwab@suse.de>

	AArch64: Fix printing of long long value.
	* util.c (printllval): Fix printing of long long values on
	AArch64.

2013-03-27  Dmitry V. Levin  <ldv@altlinux.org>

	Update PR_* constants.
	* process.c (prctl_options): Add more PR_* constants from linux/prctl.h.

2013-03-25  Chris Zankel  <chris@zankel.net>

	Add support for the XTENSA architecture.
	* configure.ac: Add XTENSA to the list of supported architectures.
	* defs.h: Add XTENSA support.
	* linux/xtensa/syscallent.h: New file.
	* linux/xtensa/ioctlent.h.in: Likewise.
	* process.c (struct_user_offsets): Add XTENSA support.
	* signal.c (sys_sigreturn): Likewise.
	* syscall.c (printcall, get_scno, get_syscall_args,
	  get_syscall_result, get_error): Likewise.
	* util.c (change_syscall): Likewise.

2013-03-22  Denys Vlasenko  <vda.linux@googlemail.com>

	Add example script which builds static (possibly cross-compiled) strace.

2013-03-21  Dmitry V. Levin  <ldv@altlinux.org>

	Use 64-bit versions of stat, readdir and setrlimit functions when available
	strace already has a mechanism to use fopen64 for output when the 64-bit
	version of fopen is available on 32-bit architectures.  Apply this
	mechanism for other three functions to make strace fully adopted for
	64-bit types.

	* strace.c (struct_stat, stat_file, struct_dirent, read_dir,
	struct_rlimit, set_rlimit): New macros.
	(startup_attach): Use read_dir.
	(startup_child): Use struct_stat and stat_file.
	(main): Use struct_rlimit and set_rlimit.

2013-03-20  Dmitry V. Levin  <ldv@altlinux.org>

	Do not use struct dirent in readdir decoding.
	struct dirent from libc should not be used for umove'ing into because it
	contains fixed size d_name.

	* file.c (printdir): Rename to print_old_dirent.
	[SH64]: Decode using struct kernel_dirent.
	[!SH64]: Decode using an open-coded struct with 32-bit d_ino and d_off.
	(sys_readdir): Update.

2013-03-20  Dmitry V. Levin  <ldv@altlinux.org>

	Do not use off_t in sendfile decoding.
	sendfile parser used to decode off_t* parameter as a pointer to host
	off_t type.  With this change, it is decoded as a pointer to target long
	type.

	* io.c (print_off_t): New function.
	(sys_sendfile): Use it.
	* linux/aarch64/syscallent1.h: Use sys_sendfile64 for sendfile decoding.
	* linux/tile/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Use sys_sendfile64 for sendfile64 decoding.
	* linux/metag/syscallent.h: Correct sendfile syscall name.
	* linux/or1k/syscallent.h: Likewise.

2013-03-18  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build with older versions of libaio.h.
	* configure.ac: When libaio.h is available, check for
	struct iocb.u.c.flags, IO_CMD_PWRITE and IO_CMD_PWRITEV.
	* desc.c (print_common_flags): Check for HAVE_STRUCT_IOCB_U_C_FLAGS.
	(sys_io_submit): Check for HAVE_DECL_IO_CMD_PWRITE and
	HAVE_DECL_IO_CMD_PWRITEV.

	Fix io_submit decoding.
	* desc.c (print_common_flags, sys_io_submit): Add missing ", " to
	SUB_COMMON output, remove extra ", " from SUB_VECTOR output.

2013-03-18  Maxin B. John  <maxin.john@enea.com>

	tests: relax check_prog to allow timeout command provided by busybox.
	Busybox version of timeout doesn't have --version option.
	Relax check_prog to handle those cases.

	* tests/init.sh (check_prog): Use type builtin to check program
	availability.

2013-03-18  Dmitry V. Levin  <ldv@altlinux.org>

	Reorganize get_regs code, hopefully without functional changes.
	* syscall.c [I386 || ARM || OR1K || METAG] (ARCH_REGS_FOR_GETREGSET):
	New macro.
	(get_regset): Implement for AARCH64, METAG, OR1K and X32.
	(get_regs) [AARCH64 || METAG || OR1K || X32]: Use it.

	arm, i386: use PTRACE_GETREGSET if available.
	* syscall.c [ARM || I386 || X86_64] (get_regset): New function.
	(get_regs) [ARM || I386 || X86_64]: Use it.

	Include <sys/uio.h> and <elf.h> on all architectures.
	* syscall.c: Include <sys/uio.h> and <elf.h> on all architectures.

	x86-64: enhance PTRACE_GETREGSET test.
	* syscall.c (get_regs) [X86_64]: Check whether PTRACE_GETREGSET
	works regardless of the kernel version.

	x32: use PTRACE_GETREGSET unconditionally.
	* syscall.c (get_regs) [X32]: Assume that PTRACE_GETREGSET always works
	regardless of the kernel version.

	x86-64, x32: do not include linux/ptrace.h unnecessarily.
	* syscall.c [X86_64 || X32]: Stop including linux/ptrace.h.

	i386, tile, x32: do not redefine ptrace prototype.
	* defs.h [I386 || TILE || X32]: Use ptrace prototype from sys/ptrace.h.

	ptrace: decode note segment descriptor types.
	* configure.ac (AC_CHECK_HEADERS): Add elf.h.
	* process.c: Include elf.h.
	(nt_descriptor_types): New xlat structure.
	(sys_ptrace): Use it.

2013-03-14  Dmitry V. Levin  <ldv@altlinux.org>

	Update MADV_* constants.
	* mem.c (madvise_cmds): Add more MADV_* constants from
	asm-generic/mman-common.h

	Reported-by: Robin Hack <hack.robin@gmail.com>

2013-03-07  Denys Vlasenko  <vda.linux@googlemail.com>

	Tweaks for -c: fixed setitimer/getitimer hack; optimized call_summary_pers()
	count_syscall() was calling setitimer/getitimer once in order to find
	smallest "tick" OS uses in time accounting, in order to use it
	for syscalls which apparently spent less than that time in syscall.
	The code assumed that this "tick" is not zero... but it is zero
	on linux-3.6.11. Which means that this hack doesn't work...

	At least this change prevents this measurement from being done
	_repeatedly_, by initializing one_tick to -1, not 0.

	While at it, added comments in count_syscall() explaining what we are doing.

	Optimized call_summary_pers() a bit, by eliminating redundant tv -> float
	conversions, and prevented 0.0/0.0 which was resulting in "% time"
	being shown as "-nan" if total CPU time spent was 0.000000
	(try "strace -c /bin/true").

	The code seems to seriously underestimate CPU usage:
	"strace -c ls -lR /usr/share >/dev/null" shows total time spent
	in syscalls to be only ~10..20% of what "time ls -lR /usr/share >/dev/null"
	shows.

	It might be useful to have a mode where we show wall clock time
	spent in syscalls, not CPU time. It might also be more accurate.

	   text	   data	    bss	    dec	    hex	filename
	 245019	    676	   5708	 251403	  3d60b	strace_old
	 244923	    684	   5676	 251283	  3d593	strace

2013-03-06  Denys Vlasenko  <vda.linux@googlemail.com>

	Open-code isprint(c) and isspace(c)
	We don't call setlocale, thus we always use C locale.
	But libc supports various other locales, and therefore
	its ctype interface is general and at times inefficient.
	For example, in glibc these macros result in function call,
	whereas for e.g. isprint(c) just c >= ' ' && c <= 0x7e
	suffices.

	By open-coding ctype checks (we have only 4 of them)
	we avoid function calls, we get smaller code:

	   text	   data	    bss	    dec	    hex	filename
	 245127	    680	   5708	 251515	  3d67b	strace_old
	 245019	    676	   5708	 251403	  3d60b	strace

	and we don't link in ctype tables (beneficial for static builds).

2013-03-06  Denys Vlasenko  <vda.linux@googlemail.com>

	Makefile: add commented-out tweak to generate link map.

	Stop using a large static buffer in getfdpath.
	   text	   data	    bss	    dec	    hex	filename
	 245075	    680	   9836	 255591	  3e667	strace_old
	 245143	    680	   5708	 251531	  3d68b	strace

2013-03-05  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix wrongly indented closing curly brace. No code changes.

	strace_vfprintf: if malloc fails, exit gracefully.

2013-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	Use sysconf(_SC_PAGESIZE) instead of hardcoded PAGE_SHIFT.
	PAGE_SHIFT couldn't be reliably obtained at compile time,
	thanks to Chris Metcalf for the hint.

	* mem.c: Do not include <sys/user.h>.
	[SH64] Do not include <asm/page.h>.
	(get_pagesize): New function.
	(sys_mmap_pgoff, sys_old_mmap_pgoff): Use it.

2013-03-05  Denys Vlasenko  <vda.linux@googlemail.com>

	Emit better message for ERESTARTNOHAND return.

	Disable STREAMS syscalls for non-SPARC.
	   text	   data	    bss	    dec	    hex	filename
	   3002	      0	   1024	   4026	    fba	stream.o.old
	   1729	      0	   1024	   2753	    ac1	stream.o

	Fix printstrbufarg's address argument to be long, not int.

	Remove variable tracing_paths and check in pathtrace_match.

2013-03-05  Denys Vlasenko  <vda.linux@googlemail.com>

	Use dynamically-sized selected[] array for -P PATH.
	While at it, added a small optimization of not remembering
	the path twice if it happens to be the same.

	   text	   data	    bss	    dec	    hex	filename
	 245111	    680	  10860	 256651	  3ea8b	strace_old
	 245075	    680	   9804	 255559	  3e647	strace

2013-03-05  Denys Vlasenko  <vda.linux@googlemail.com>

	metag,or1k: whitesace style fix. no code changes.

	Assorted fixes to syscallent.h.
	or1k was missing TM on many memory-related syscalls
	sys_lookup_dcookie is 3-arg on 64-bit arches, and isn't TF
	sys_recvmsg is 3-arg on all arches
	sys_nfsservctl is 3-arg on all arches
	sys_timerfd_create is 2-arg on all arches
	sys_[f]truncate64 is 4-arg or 3-arg, never 5-arg
	truncate64 is TF
	sys_[l]lseek is TD
	fstat[64] is TD

2013-03-05  James Hogan  <james.hogan@imgtec.com>

	Add support for Imagination Technologies Meta.
	Add support for Imagination Technologies Meta architecture (the
	architecture/ABI is usually referred to as metag in code). The Meta
	Linux kernel port is in the process of being upstreamed for v3.9 so it
	uses generic system call numbers.

	sys_lookup_dcookie writes a filename to buffer argument, so I've set
	TF flag.
	nfsservctl appears to be set to sys_ni_syscall in asm-generic/unistd.h
	so I've left it blank.
	truncate64/ftruncate64/pread64/pwrite64/readahead have unaligned 64bit
	args which are packed tightly on metag, so less arguments on metag.
	fchdir/llseek takes a file descriptor so s/TF/TD/
	sync_file_range has 2 64bit args so uses 6 args, so s/4/6/
	timerfd_create/msgget/msgctl/msgrcv/semget/segtimedop/semop/shmget/
	shmctl/shmat/shmdt/recvmsg/migrate_pages have different number of args.
	oldgetrlimit is just getrlimit for metag.
	add TM flag to various memory syscalls.
	metag doesn't directly use sys_mmap_pgoff for mmap2.
	prlimit64/process_vm_readv/process_vm_writev take a pid so add TP flag.
	fanotify_init doesn't appear to take a file descriptor so remove TD.
	Add kcmp syscall.

	Cc: Christian Svensson <blue@cmd.nu>

2013-03-01  Denys Vlasenko  <vda.linux@googlemail.com>

	umovestr: speed up check for NUL byte in the fetched word.

2013-03-01  Dmitry V. Levin  <ldv@altlinux.org>

	Fix trace=set regression introduced by commit v4.7-111-g9cbc15b.
	* syscall.c (qual_syscall, qualify): Pass personality down to
	qualify_one.
	* tests/qual_syscall: New test.
	* tests/Makefile.am (TESTS): Add qual_syscall.

2013-03-01  Chris Metcalf  <cmetcalf@tilera.com>

	tile: handle printllval like x86_64 or powerpc64.
	Without this fix the tilegx build fails when it hits the new #error
	about SIZEOF_LONG > 4.

	* util.c (printllval): Fix printing of long long values on TILE.

2013-02-27  Denys Vlasenko  <vda.linux@googlemail.com>

	Make -b take SYSCALL param, document it in --help and in manpage.
	To not waste an option letter for just one trick,
	extend -b to take a parameter:
	"on which syscalls do you want to detach?".
	Currently supports only execve.

	While at it, fixed (by removing non-Linux and stale info)
	and extended manpage text about -f.

2013-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	Cleanup umoven and umovestr.
	Cleanup sloppy error handling.

	First, EFAULT kind of errors from process_vm_readv by itself is not
	something unusual, so a warning message will not be issued unless a
	short read is detected.

	Second, clients of umoven and umovestr are not prepared to detect and
	handle short reads that can happen in these functions.  The most safe
	way to handle them is to return an error code.

	* util.c (umoven, umovestr): Cleanup handling of errors coming from
	process_vm_readv and PTRACE_PEEKDATA.

2013-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	pathtrace: fix umovestr return code check.
	* pathtrace.c (upathmatch): Only NUL-terminated strings can be
	path-matched, so fix the umovestr return code check to filter out
	unsuitable strings.

2013-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	Fix compilation errors uncovered by -Werror=enum-compare.
	This fixes regression introduced by commit v4.7-111-g9cbc15b.

	* syscall.c: Merge all nsyscalls* enums into single enum.
	Likewise merge nerrnos*, nsignals*, and nioctlents* into single enums.

2013-02-26  Denys Vlasenko  <vda.linux@googlemail.com>

	Mass replace error_msg("%s", "literal") -> error_msg("literal")
	There is no need to print literal strings through "%s".
	Only untrusted strings such as filenames need that.

2013-02-26  Ben Noordhuis  <info@bnoordhuis.nl>

	Make umoven report success as 0, not >=0, stop returning success on partial reads
	umoven() uses process_vm_readv() when available but it returns the
	return value of that syscall, which is the number of bytes copied,
	while its callers expect it to simply return zero on success.

	It was causing syscalls that take a user-space argument to print
	the abbreviated version, e.g.:

	  epoll_ctl(5, EPOLL_CTL_ADD, 10, {...})

	Instead of:

	  epoll_ctl(5, EPOLL_CTL_ADD, 10, {EPOLLIN, {u32=10, u64=10}})

	* util.c (umoven): Make umove[n] report success as 0, not >=0,
	stop returning "success" on partial reads.

2013-02-26  Denys Vlasenko  <vda.linux@googlemail.com>

	Assorted NOMMU fixes.
	With -D, strdup'ing of pathname is necessary only on NOMMU.

	Don't set skip_startup_execve to 1 if NOMMU and not in daemonized mode
	(try "strace [-D] -b env echo HI" to see whether we detach on correct execve).

	Fix test_ptrace_FOO shortcuts on NOMMU to always assume success
	and _properly_ set all variables.

2013-02-26  Denys Vlasenko  <vda.linux@googlemail.com>

	Shorten help text - no need to show deprecated option -F.

2013-02-23  Denys Vlasenko  <vda.linux@googlemail.com>

	Merge adjacent tprint's.

	Correct i > MAX_NSYSCALLS commparison: should be i >= MAX_NSYSCALLS.

2013-02-22  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix wrong offset display in dumpstr.
	BTW, the new code from prev commit is 5 times faster
	than old one :)

2013-02-22  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix a bug in dumpstr (no null termination). Essentially rewrote dumpstr.
	This is a 14 year old bug (!).

	It wasn't biting us merely because outstr[80] was static, thus ended up
	in bss and whatever was after it "accidentally" provided the NUL byte.
	When dumpstr was changed to use on-stack buffer, the bug reared its ugly head.

	This is a rewrite which is smaller and should be significantly faster
	for _long_ strings.

	   text	   data	    bss	    dec	    hex	filename
	 244627	    680	  10860	 256167	  3e8a7	strace.t9/strace
	 244563	    680	  10860	 256103	  3e867	strace.ta/strace

	* util.c (dumpstr): Rewrite to be faster and smaller.

2013-02-22  Denys Vlasenko  <vda.linux@googlemail.com>

	Eliminate MAX_QUALS, make qualifier array dynamic.
	MAX_QUALS was 2048, even though most arches used less than 500 entries
	in it. MAX_QUALS had to be maintained by hand to be higher than syscall
	count. It also limited the highest possible fd to track.

	This change makes qual_flagsN[] arrays start sized to the required minimum
	(number of syscalls) and grow dynamically if user requested
	-e read=BIGNUM. As a precaution, BIGNUM should be < 2^15, but this limit
	can be raised with no cost for normal strace invocations.

	qual_flags is now a define to qual_vec[current_personality].

	As a bonus, this patch aliases sysent, errnoent, signalent, ioctlent
	names in one-personality arches to their corresponding <foo>0 arrays,
	removing one indirection level.

	  text   data    bss    dec    hex filename
	244471    700  12928 258099  3f033 strace.t7/strace
	244627    680  10860 256167  3e8a7 strace.t8/strace

2013-02-22  Denys Vlasenko  <vda.linux@googlemail.com>

	Create and use struct_sysent and struct_ioctlent typedefs.
	This is a preparatory mass replace patch with no code changes.

	The future change will need to typedef sysent to sysent0,
	which results in compile failures when "struct sysent" string
	gets mangled into "struct sysent0".

2013-02-22  Denys Vlasenko  <vda.linux@googlemail.com>

	Use tcp->qual_flg instead of qual_flags[] in verbose() and abbrev()
	We have hundreds of uses of these macros.
	Result is more efficient and 1.1 kbyte shorter code:

	  text	   data	    bss	    dec	    hex	filename
	245579	    700	  12928	 259207	  3f487	strace.t5/strace
	244471	    700	  12928	 258099	  3f033	strace.t6/strace

2013-02-21  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove unused QUAL_FAULT code (was used by non-Linux code only).

2013-02-21  Denys Vlasenko  <vda.linux@googlemail.com>

	Use uint8_t for qual_flags[] instead of ints.
	Resulting bss reduction is ~6kbytes:

	   text	   data	    bss	    dec	    hex	filename
	 245703	    700	  19072	 265475	  40d03	strace.t4/strace
	 245687	    700	  12928	 259315	  3f4f3	strace.t5/strace

2013-02-21  Denys Vlasenko  <vda.linux@googlemail.com>

	Eliminate many SCNO_IS_VALID checks.
	By adding tcp->s_ent pointer tot syscall table entry,
	we can replace sysent[tcp->scno] references by tcp->s_ent.
	More importantly, we may ensure that tcp->s_ent is always valid,
	regardless of tcp->scno value. This allows us to drop
	SCNO_IS_VALID(tcp->scno) checks before we access syscall
	table entry.

	We can optimize (qual_flags[tcp->scno] & QUAL_foo) checks
	with a similar technique.

	Resulting code shrink:
	   text    data     bss     dec     hex filename
	 245975     700   19072  265747   40e13 strace.t3/strace
	 245703     700   19072  265475   40d03 strace.t4/strace

	* count.c (count_syscall): Use cheaper SCNO_IN_RANGE() check.
	* defs.h: Add "int qual_flg" and "const struct sysent *s_ent"
	to struct tcb. Remove "int u_nargs" from it.
	Add UNDEFINED_SCNO constant which will mark undefined scnos
	in tcp->qual_flg.
	* pathtrace.c (pathtrace_match): Drop SCNO_IS_VALID check.
	Use tcp->s_ent instead of sysent[tcp->scno].
	* process.c (sys_prctl): Use tcp->s_ent->nargs instead of tcp->u_nargs.
	(sys_waitid): Likewise.
	* strace.c (init): Add compile-time check that DEFAULT_QUAL_FLAGS
	constant is consistent with init code.
	* syscall.c (decode_socket_subcall): Use tcp->s_ent->nargs
	instead of tcp->u_nargs. Set tcp->qual_flg and tcp->s_ent.
	(decode_ipc_subcall): Likewise.
	(printargs): Use tcp->s_ent->nargs instead of tcp->u_nargs.
	(printargs_lu): Likewise.
	(printargs_ld): Likewise.
	(get_scno): [MIPS,ALPHA] Use cheaper SCNO_IN_RANGE() check.
	If !SCNO_IS_VALID, set tcp->s_ent and tcp->qual_flg to default values.
	(internal_fork): Use tcp->s_ent instead of sysent[tcp->scno].
	(syscall_fixup_for_fork_exec): Remove SCNO_IS_VALID check.
	Use tcp->s_ent instead of sysent[tcp->scno].
	(get_syscall_args): Likewise.
	(get_error): Drop SCNO_IS_VALID check where it is redundant.
	(dumpio): Drop SCNO_IS_VALID check where it is redundant.
	Use tcp->s_ent instead of sysent[tcp->scno].
	(trace_syscall_entering): Use (tcp->qual_flg & UNDEFINED_SCNO) instead
	of SCNO_IS_VALID check. Use tcp->s_ent instead of sysent[tcp->scno].
	Drop SCNO_IS_VALID check where it is redundant.
	Print undefined syscall name with undefined_scno_name(tcp).
	(trace_syscall_exiting): Likewise.
	* util.c (setbpt): Use tcp->s_ent instead of sysent[tcp->scno].

2013-02-21  Denys Vlasenko  <vda.linux@googlemail.com>

	ARM: make it one-personality arch.
	ARM in fact _is_ one personality.

	We had two personalities for it because it has a handful of
	syscalls with huge scnos (0x000f00xx).

	Extending syscall table to have [0x000f0005] index is of course
	not a good idea.

	Someone decided to handle that by having a separate personality
	just for these syscalls.

	But multi-personality arch does a bit more work in other parts.

	This patch is another alternative: "move" 0x000f00nn syscalls
	down to the entries just above last ordinary syscall,
	by manipulating scno if it falls into the 0x000f00xx range.

	In order to not worsen genuine undefined scnos' printing,
	the code remaps scno back to actual value before printing
	"syscall_NNN" string.

	* defs.h: Remove multi-reprsonality defines from ARM.
	* syscall.c (shuffle_scno): New function.
	(undefined_scno_name): New function.
	(get_scno): [ARM] Replace personality setting with scno shuffling.
	(trace_syscall_entering): Print unknown syscall name using
	undefined_scno_name().
	(trace_syscall_exiting): Likewise.
	* linux/arm/syscallent.h: Add ARM specific syscalls at the end.
	* linux/arm/errnoent1.h: Deleted.
	* linux/arm/ioctlent1.h: Deleted.
	* linux/arm/signalent1.h: Deleted.
	* linux/arm/syscallent1.h: Deleted.

2013-02-20  Denys Vlasenko  <vda.linux@googlemail.com>

	arm: shorten syscall table for EABI - no point in storing NULL entries.
	Also, reformatted ARM code in get_scno(), mostly improved comments,
	without code changes.

	Use the same style of includes in linux/*/* files.
	While at it, fix some comments which say
	"we use i386 syscalls/ioctls/errnos" but in reality
	common ones are used.

2013-02-19  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix compiler warnings.
	With constant current_wordsize == 4 and 32-bit longs,
	gcc was spooked by "1ul << (8 * current_wordsize)" = "1ul << 32".

	Make such places conditional on SIZEOF_LONG > 4.

2013-02-19  Denys Vlasenko  <vda.linux@googlemail.com>

	Improve comment text. No code changes.

2013-02-19  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix NOMMU + daemonized tracer SEGV.
	pathname[] was getting destroyed, execve of garbage pathname
	failing, and to top it off, the tracer's stack was also
	smashed and trecer segfaulted.

	* strace.c (exec_or_die): New function.
	(startup_child): Don't use pathname[] contents after vfork,
	make a malloced copy instead. Explain "NOMMU + -D bug"
	and how we work around it.

2013-02-19  Denys Vlasenko  <vda.linux@googlemail.com>

	Make it possible to to do test builds for NOMMU architectures.
	And while using it, I discovered that -D doesn't work too well
	on NOMMU. Added a comment about it.

2013-02-19  Denys Vlasenko  <vda.linux@googlemail.com>

	Clean up mmap decoding.
	Previous code merges too many similar, but different ways
	of decoding mmap. For example, sys_old_mmap is "params in memory"
	API... except SH[64], where it is "params in regs",
	i.e. what sys_mmap ("new mmap") function does on other arches!

	It's much simpler when every mmap handler has same API regardless
	of arch. Where API means whether params are in regs or in memory,
	and whether offset is in bytes, pages, or 4k blocks.

	Then we just insert correct function pointers into
	arch syscall tables.

	It turns out there are four common mmap APIs over
	all architectures which exist in Linux kernel,
	and one outlier for S390.

	A number of mmap decoders were plain wrong in arch tables.
	For example, BFIN has no old_mmap. It returns ENOSYS.
	I checked kernel sources for all arches nad fixed the tables.

	There was dead code for x86_64 for old_mmap:
	x86_64 has no old_mmap.

	* mem.c: Refactor mmap functions so that we have five mmap syscall
	handlers, each with the fixed API (not varying by arch).
	* pathtrace.c (pathtrace_match): Adjust sys_func == mmap_func checks.
	* linux/syscall.h: Declare new mmap syscall handler functions.
	* linux/arm/syscallent.h: mmap2 is sys_mmap_pgoff.
	* linux/avr32/syscallent.h: mmap is sys_mmap_pgoff.
	* linux/bfin/syscallent.h: old_mmap is ENOSYS, mmap2 is sys_mmap_pgoff.
	* linux/hppa/syscallent.h: mmap2 is sys_mmap_4koff.
	* linux/i386/syscallent.h: mmap2 is sys_mmap_pgoff.
	* linux/ia64/syscallent.h: mmap2 is sys_mmap_pgoff.
	* linux/m68k/syscallent.h: mmap2 is sys_mmap_pgoff.
	* linux/microblaze/syscallent.h: old_mmap is sys_mmap, mmap2 is sys_mmap_pgoff.
	* linux/mips/syscallent.h: mmap is sys_mmap_4kgoff.
	* linux/or1k/syscallent.h: mmap2 is sys_mmap_pgoff.
	* linux/powerpc/syscallent.h: mmap2 is sys_mmap_4kgoff.
	* linux/s390/syscallent.h: mmap2 is sys_old_mmap_pgoff.
	* linux/s390x/syscallent.h: mmap is sys_old_mmap and thus has 1 arg.
	* linux/sh/syscallent.h: old_mmap2 is sys_mmap, mmap2 is sys_mmap_4koff.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent1.h: mmap is TD|TM.
	* linux/tile/syscallent1.h: mmap2 is sys_mmap_4koff.

2013-02-18  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove unused function sys_mmap64.
	No wonder that it is unused.
	It's code looked quite questionable.

	* mem.c (sys_mmap64): Remove this function.

2013-02-18  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove code which supports systems with long long off_t.
	While looking at mmap mess, did experimenting in order
	to figure out what gets used when.

	Tried building armv4tl, armv5l, armv6l, mips, mipsel, i686,
	x86_64 and none of they have long long off_t,
	which isn't suprprising: we aren't using glibc defines
	which enable that.

	Moreover, we SHOULD NOT use off_t in syscall decode!
	Its size depends on libc, not on arch! I.e. it is essentially
	unpredictable and can even in theory vary on the same arch
	with different libc.

	We should use longs or long longs, in a way which matches
	architectural ABI for the given syscall. There are usually
	*at most* two permutations, no need to add yet another variable
	(sizeof(off_t)) to the mix.

	This change removes almost all HAVE_LONG_LONG_OFF_T conditionals,
	which will reveal further possible simplifications.

	* mem.c: Remove code conditional on HAVE_LONG_LONG_OFF_T.
	As a result, never remap sys_mmap64 to sys_mmap.
	(print_mmap): Compile unconditionally.
	(sys_old_mmap): Compile unconditionally.
	(sys_mmap): Compile unconditionally.
	* io.c (sys_sendfile): Add a FIXME comment.
	* file.c: Remove code conditional on HAVE_LONG_LONG_OFF_T.
	As a result, never remap sys_*stat64 to sys_*stat etc.
	(sys_truncate): Compile unconditionally.
	(realprintstat): Likewise.
	(sys_stat): Likewise.
	(sys_fstat): Likewise.
	(sys_lstat): Likewise.
	* desc.c (printflock): Likewise.

2013-02-18  Denys Vlasenko  <vda.linux@googlemail.com>

	Fixes in "new" mmap.
	* mem.c (sys_mmap): Ensure unsigned expansion of tcp->u_arg[5].
	Add page shift of offset for I386.
	Use tcp->ext_arg[5] as offset for X32.
	(sys_old_mmap): [X32] Remove this function, X32 doesn't use is.

	Preliminary simplifications in mmap functions.
	* mem.c: Move "define sys_mmap64 sys_mmap" from the top
	to the only place it affects.
	(print_mmap): Make offset argument unsigned, for safer implicit conversions.
	(sys_old_mmap): [IA64] use unsigned narrow_arg[].
	Cast u_arg[5] (offset param) to unsigned long, to prevent erroneous signed
	expansion.

2013-02-17  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove broken HAVE_LONG_LONG conditionals.
	We use printllval without HAVE_LONG_LONG guards in many places,
	but define it only if HAVE_LONG_LONG. This means that
	on !HAVE_LONG_LONG systems we won't build for some time now.

	* defs.h: Remove HAVE_LONG_LONG guard around LONG_LONG() macro
	and printllval() function declaration.
	* util.c: Remove HAVE_LONG_LONG guard around printllval()
	function definition.
	(printllval): Add compile-time error check for using wrong
	if branch. Explain places where we deliberately use mismatched
	types for printf formats.

2013-02-17  Denys Vlasenko  <vda.linux@googlemail.com>

	Use explicit long type instead of off_t.
	* file.c (sys_lseek): Use long instead of off_t.

	Merge two identical tables.
	* defs.h: Declare whence_codes[].
	* desc.c: Delete static whence[].
	(printflock[64]): Use whence_codes.
	* file.c: Make whence_codes[] non-static.
	Add SEEK_DATA and SEEK_HOLE to them.

2013-02-17  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove wrong x32-specific lseek.
	Testing confirmed what I suspected: x32 lseek uses kernel-sized
	(i.e. wide) long for offset parameter.

	* file.c: Delete sys_lseek32.
	* linux/syscall.h: Likewise.
	* linux/x32/syscallent1.h: Likewise.
	* test/x32_lseek.c: New file.

2013-02-17  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix SEGV in lseek.
	I found hard way why the code was using "_whence" name.

	* file.c: Rename whence[] to whence_codes[].
	(sys_lseek): Fix printxval() to use whence_codes[].
	(sys_lseek32): Likewise.

2013-02-17  Denys Vlasenko  <vda.linux@googlemail.com>

	Comment inner workings of sys_[l]lseek.
	The code doesn't look fully correct to me, but I need to experiment
	on actual x32 machine before I start "fixing" things.
	For now, add comments, and optimize out one tprints() call...

	* file.c (sys_lseek): Rename '_whence' as 'whence'.
	Merge printing of ", " into subsequent tprintf.
	(sys_lseek32): Likewise.
	(sys_llseek): Likewise.

2013-02-17  Denys Vlasenko  <vda.linux@googlemail.com>

	Cosmetic fixes to syscall tables, no code changes.

2013-02-16  Denys Vlasenko  <vda.linux@googlemail.com>

	Make linux/mips/syscallent.h smaller.
	* linux/mips/syscallent.h: Remove trailing empty elements.
	Compactify huge stretches of NULL elements in the middle.

	Simple optimization in get_error.
	* defs.h: Define SCNO_IN_RANGE(scno) macro.
	* syscall.c (get_error): Change return type to void.
	Use SCNO_IN_RANGE instead of SCNO_IS_VALID.
	(trace_syscall_exiting): Stop checking get_error() return value.

	Mass rename of SCNO_IN_RANGE define to SCNO_IS_VALID.

	Finish prefixing regs struct names with arch_
	* defs: Rename regs -> sparc_regs.
	* signal.c (sys_sigreturn): Use new variable name.
	* syscall.c: Rename regs -> sparc_regs, regs -> avr32_regs.
	(getrval2): Use new variable names.
	(printcall): Likewise.

2013-02-15  Denys Vlasenko  <vda.linux@googlemail.com>

	Use the same type for i386_regs on 32-bit and 64-bit x86.
	* defs.h: Stop including <asm/ptrace.h> for x86.
	Change i386_regs from "struct pt_regs" to "struct user_regs_struct".
	* syscall.c: Likewise.

	Fix build error on Tile.
	* syscall.c (get_scno): [TILE] Remove TCB_WAITEXECVE check,
	it is never true on Tile, and stopped compiling when
	TCB_WAITEXECVE define was removed for Tile.

2013-02-15  Denys Vlasenko  <vda.linux@googlemail.com>

	x86: zero-extend 32-bit args in syscall entry instead of sign-extension.
	Zero-extension is slightly more common that sign-extension:
	all pointers are zero-extended, and some other params are unsigned.

	Whereas signed ones (fds, pids, etc) are often treated as
	_32-bit ints_ even by kernel, so just unconditionally casting
	such tcp->u_arg[N] to int works.

	* syscall.c (get_syscall_args): [X86] Zero-extend 32-bit args
	instead of sign-extension.

2013-02-15  Denys Vlasenko  <vda.linux@googlemail.com>

	Macroize conditional signed widening operation.
	* defs.h: Define widen_to_long() macro.
	* signal.c (sys_kill): Use it instead of open-coding it.
	(sys_tgkill): Use widen_to_long() on pids.
	* resource.c (decode_rlimit): Formatting fix.

2013-02-15  Denys Vlasenko  <vda.linux@googlemail.com>

	A better handling of current_wordsize.
	On x86_64:
	  text	   data	    bss	    dec	    hex	filename
	435661	  26628	  47424	 509713	  7c711	strace_old
	435501	  26612	  47440	 509553	  7c671	strace_new_clever_wordsize

	On x32 and arm it should be even better, current_wordsize becomes
	a constant there.

	* defs.h: Declare current_wordsize as a variable if needed,
	else declare as a constant define.
	Remove declatation of personality_wordsize[].
	* syscall.c: Make personality_wordsize[] static.
	Declare current_wordsize as a variable if needed.
	(set_personality): Set current_wordsize only if non-constant.

2013-02-15  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove unnecessary "return 0" statements.
	* util.c (change_syscall): Remove dummy "return 0"s.

2013-02-14  Denys Vlasenko  <vda.linux@googlemail.com>

	x86: fix required kernel version for GETREGSET.
	* syscall.c (get_regs): [X86] Use GETREGSET only if kernel >= 2.6.35

	Whitespace fix, no code changes.

2013-02-14  Christian Svensson  <blue@cmd.nu>

	Add support for the OpenRISC 1000 platform.
	* configure.ac: Added or1k architecture..
	* defs.h: Added or1k to use register reading system.
	* linux/or1k/ioctlent.h.in: Use i386 ioctls.
	* linux/or1k/syscallent.h: New file.
	* process.c: Added or1k register defs to struct_user_offsets[].
	* syscall.c: Added or1k_io iovec for or1k GETREGSET,
	  regset structure for or1k.
	  (printcall): Added handling for or1k.
	  (get_regs): Likewise.
	  (get_scno): Likewise.
	  (get_syscall_args): Likewise.
	  (get_syscall_result): Likewise.
	  (get_error): Likewise.
	* util.c (change_syscall): Added dummy handling for or1k.
	* system.c (sys_or1k_atomic): New function (or1k specific syscall).

2013-02-14  Denys Vlasenko  <vda.linux@googlemail.com>

	[X86] Use ptrace(PTRACE_GETREGSET, NT_PRSTATUS) to get registers.
	Unlike PTRACE_GETREGS, this new method detects 32-bit processes
	reliably, without checking segment register values which
	are undocumented and aren't part of any sort of API.
	While at it, also fixed x32 detection to use __X32_SYSCALL_BIT,
	as it should have been from the beginning.

	* defs.h: Declare os_release and KERNEL_VERSION.
	* strace.c: Make os_release non-static, remove KERNEL_VERSION define.
	* syscall.c: New struct i386_user_regs_struct,
	static union x86_regs_union and struct iovec x86_io.
	(printcall): Use i386_regs or x86_64_regs depending on x86_io.iov_len.
	(get_regs): On x86 and kernels 2.6.30+, use PTRACE_GETREGSET,
	on earlier kernels fall back to old method.
	(get_scno): [X86] Determine personality based on regset size
	on scno & __X32_SYSCALL_BIT.
	(syscall_fixup_on_sysenter): Use i386_regs or x86_64_regs depending
	on x86_io.iov_len.
	(get_syscall_args): Likewise.
	(get_error): Likewise.

2013-02-13  Denys Vlasenko  <vda.linux@googlemail.com>

	Rename some register statics by prefixing their names with arch.
	This makes it easier to grep for them.

	* syscall.c: Rename variables:
	r0 -> bfin_r0,alpha_r0,sh_r0.
	a3 -> mips_a3.
	r2 -> mips_r2.
	(get_scno): Use new variable names.
	(get_syscall_result): Likewise.
	(get_error): Likewise.

2013-02-13  Denys Vlasenko  <vda.linux@googlemail.com>

	Factor out code to check addr, fetch and print siginfo.
	* defs.h: Declare new function printsiginfo_at(tcp, addr).
	* process.c (sys_waitid): Use printsiginfo_at().
	(sys_ptrace): Likewise.
	* signal.c: (printsiginfo_at): Implement this new function.
	(sys_rt_sigsuspend): Use printsiginfo_at().
	(sys_rt_sigtimedwait): Likewise.

	Decode struct iov in PTRACE_GET/SETREGSET.
	* process.c (sys_ptrace): Decode struct iov in PTRACE_GET/SETREGSET.

2013-02-12  Denys Vlasenko  <vda.linux@googlemail.com>

	Unify representations of struct user fields for subarchitectures.
	* process.c: Unify MIPS and LINUX_MIPSN32, and SH and SH64 parts of
	struct_user_offsets[].

	Add start_code and start_data members of struct user.
	* process.c: Add start_code and start_data members of struct user
	in struct_user_offsets[], where appropriate.

	Remove hacks for old kernels for architectures which require new kernels
	* util.c (change_syscall): For MICROBLAZE, replace code
	with dummy "return 0" and a comment explaining why that is ok
	for this architecture.

2013-02-12  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove stray syscall result reading code on syscall entry for s390.
	This is a leftover from sysenter/sysexit split.
	I can't run-test it, but from code inspection it seems to be correct.

	* syscall.c (get_scno): Remove stray syscall result reading for s390[x].

2013-02-12  Denys Vlasenko  <vda.linux@googlemail.com>

	Deobfuscate definitions of struct user offsets.
	The maze of ifdefs/ifndefs was scaring new contributors.
	Format it so that every arch has its own ifdef block.

	* process.c: Deobfuscate definitions of struct user offsets.

2013-02-12  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove hacks for old kernels for architectures which require new kernels
	* defs.h: Do not define TCB_WAITEXECVE for AARCH64.
	* util.c (change_syscall): For AARCH64 and X32, replace code
	with dummy "return 0" and a comment explaining why that is ok
	for these architectures.

	Remove old kernel hacks for architectures which require new kernels.
	* defs.h: Do not define TCB_WAITEXECVE for AVR32, BFIN and TILE.
	* util.c (change_syscall): For AVR32, BFIN and TILE, replace code
	with dummy "return 0" and a comment explaining why that is ok
	for these architectures.

	Handle recv[m]msg for non-native 32-bit personality syscalls.
	* net.c (printmsghdr): If current_wordsize is 4 and long is wider than it,
	read 32-bit struct msghdr and expand it into a native one before using it.
	(printmmsghdr): Likewise for struct mmsghdr.

2013-02-12  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix is_negated_errno() check for X32.
	X32's return value is 64-bit. We were truncating it to 32-bit long
	before checking for -errno.

	* syscall.c (is_negated_errno_x32): New function.
	(get_error): Use is_negated_errno_x32 for X32 architecture.

2013-02-12  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove unused / ambiguously used defines.
	We sometimes use LINUXSPARC and sometimes (more often)
	use "defined(SPARC) || defined(SPARC64)". Better to use
	one construct consistently.
	LINUX_MIPS64 is altogether unused.

	* defs.h: Remove LINUXSPARC and LINUX_MIPS64 defines.
	Move PTRACE_xxx compat defines up, before arch-specific
	machinery. Use defined(SPARC) || defined(SPARC64)
	instead of LINUXSPARC.
	* file.c: Use defined(SPARC) || defined(SPARC64) instead of LINUXSPARC.
	* signal.c: Likewise.

2013-02-11  Denys Vlasenko  <vda.linux@googlemail.com>

	Preparatory patch for "new" x86 personality detection.
	* syscall.c: Move PT_FLAGS_COMPAT define to its only user, get_scno().
	Rename arm_regs_union's fields to names less likely to collide with
	system defines.
	(get_regs): Use sizeof(arm_regs_union) instead of sizeof(aarch64_regs).
	This should be the same, but htis way it's cleaner.
	Remove __X32_SYSCALL_MASK and use __X32_SYSCALL_BIT instead.
	Explain 64-bit check in X32 build better.

2013-02-09  Dmitry V. Levin  <ldv@altlinux.org>

	Fix sigaltstack decoder.
	strace used to hang when decoding sigaltstack called with invalid
	stack_t pointers because of mishandling umove() return code.

	* signal.c (print_stack_t): Handle unfetchable stack_t properly.
	Change return type to void.
	(sys_sigaltstack): Update print_stack_t() usage.

	Reported-by: kawillia@ucalgary.ca

2013-02-09  Mike Frysinger  <vapier@gentoo.org>

	Fix decoding of sysctl() when oldval fields are NULL.
	If you call glibc's syscall wrapper like so:
		static int name[] = { CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE };
		int buffer[2] = { 32768, 61000 };
		size_t size = sizeof(buffer);
		sysctl(name, 3, 0, 0, buffer, size);
	(note that oldval/oldlenp are NULL).

	The current strace code complains like so:
	_sysctl({{CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE, 38}, 3, process_vm_readv: Bad address
	(nil), 0, 0x7fffe23c3960, 8}) = -1 EACCES (Permission denied)

	Since passing NULL for the old values is valid, handle that explicitly.
	This also simplifies the code a bit by splitting up the handling of the
	new and old args so that we only handle the new args once.

	Now the output looks like:
	_sysctl({{CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE, 38}, 3, NULL, 0, 0x7fff8c0c91b0, 8) = -1 EACCES (Permission denied)

	* system.c (sys_sysctl): Check if info.oldval is NULL first.  Move the
	processing of oldlen/info.newval/info.newlen out so they always get
	executed.  Fix the format strings so we use %lu for unsigned long rather
	than a mix of %ld and %lu.

2013-02-08  Denys Vlasenko  <vda.linux@googlemail.com>

	If we are on a glibc system, assume it's at least glibc 2.1.
	It is not likely anyone uses glibc older that that:
	glibc 2.1.1 was released in 1999

	* net.c: Remove test for glibc >= 2.1.
	* signal.c: Remove code which is compiled only for glibc < 2.1.
	* util.c: Likewise.

2013-02-08  Denys Vlasenko  <vda.linux@googlemail.com>

	S390: stop using needlessly static long pc variable.
	* syscall.c: Remove "static long pc" variable.
	(get_scno): Use an automatic long variable instead of a static.

	Dying suddenly with abort() is rude, avoid if possible.
	* file.c (sys_utime): Don't call abort() if wordsize is strange.
	Instead, warn user about it.
	* desc.c (printflock): Use the same message string as in sys_utime.

	Remove vestigial hacks around non-Linux struct sigactions.
	* signal.c: Stop using __sighandler_t glibc'ism. Remove SA_HANDLER macro.
	Explain why we can't use "sa_handler" as a field name.
	(sys_sigaction): Use __sa_handler instead of SA_HANDLER macro.
	(sys_rt_sigaction): Likewise.

2013-02-08  Denys Vlasenko  <vda.linux@googlemail.com>

	Optimize AArch64 handling of 32-bit personality.
	By putting aarch64_regs and arm_regs into a union,
	register copying is eliminated.
	No need to check and change personality on syscall exit.

	* defs.h: Remove unused NUM_ARM_REGS define. Fix indentation.
	* syscall.c: Put aarch64_regs and arm_regs into a union.
	(update_personality): Shorten bitness message.
	(printcall): Add commented-out PC printing.
	(get_regs): Remove now-unnecessary 64-to-32 bits register copying.
	(get_syscall_result): Drop personality changing code.

2013-02-07  Denys Vlasenko  <vda.linux@googlemail.com>

	Rename some register statics by prefixing their names with arch.
	This makes it easier to grep for them.

	* syscall.c: Make IA64's r8, r10 global variables static.
	Rename variables:
	r8,r10 -> ia64_r8,ia64_r10.
	d0 -> m68k_d0.
	a3 -> alpha_a3.
	r28 -> hppa_r28.
	r9 -> sh64_r9.
	r10 -> cris_r10.
	r3 -> microblaze_r3.
	(get_scno): Use new variable names.
	(syscall_fixup_on_sysenter): Likewise.
	(get_syscall_result): Likewise.
	(get_error): Likewise.

2013-02-06  Denys Vlasenko  <vda.linux@googlemail.com>

	Rename ARM's regs structure to arm_regs.
	Compile-tested.

	* defs.h: Rename regs structure to arm_regs.
	* syscall.c: Likewise.
	(printcall): Use new name instead of old one.
	(get_regs): Likewise.
	(get_scno): Likewise.
	(get_syscall_args): Likewise.
	(get_error): Likewise.
	* signal.c (sys_sigreturn): Likewise.

2013-02-06  Denys Vlasenko  <vda.linux@googlemail.com>

	Stop needlessly using static variable.
	* syscall.c: Remove static long psr.
	(get_scno): Use local psr variable.
	(get_syscall_result): Likewise.

2013-02-06  Denys Vlasenko  <vda.linux@googlemail.com>

	Shortcut tests for fork/exec syscalls.
	This change should speed up strace by a tiny bit.

	More importantly, it makes it much more clear that
	fork and exec fixups are not necessary for any reasonably
	recent kernels. IOW: syscall_fixup_for_fork_exec() and its callees
	are all dead code.

	* defs.h: Declare new need_fork_exec_workarounds flag variable.
	* strace.c: Define need_fork_exec_workarounds flag variable.
	(test_ptrace_setoptions_followfork): Return 0/1 as success/fail indicator.
	(test_ptrace_setoptions_for_all): Likewise.
	(init): Set need_fork_exec_workarounds to TRUE if needed.
	* syscall.c: Rename internal_syscall() to syscall_fixup_for_fork_exec().
	(trace_syscall_entering): Call syscall_fixup_for_fork_exec() only if
	need_fork_exec_workarounds == TRUE.
	(trace_syscall_exiting): Likewise.

2013-02-05  Ben Noordhuis  <info@bnoordhuis.nl>

	Improve perf_event_open argument decoding.
	* configure.ac (AC_CHECK_HEADERS): Add linux/perf_event.h.
	* desc.c [HAVE_LINUX_PERF_EVENT_H]: Include <linux/perf_event.h>.
	(perf_event_open_flags): New xlat structure.
	(sys_perf_event_open): New function.
	* linux/dummy.h (sys_perf_event_open): Remove.
	* linux/syscall.h (sys_perf_event_open): New prototype.

2013-02-05  Chris Metcalf  <cmetcalf@tilera.com>

	tile: fix merge skew with new get_regs architecture.
	* defs.h [TILE]: Declare clear_regs(), get_regs() and get_regs_error.
	* syscall.c (get_regs) [TILE]: Fix merge skew.
	(printcall) [TILE]: fix a compiler warning about pt_reg_t in
	a printf expression.

2013-02-05  Bernhard Reutner-Fischer  <rep.dot.nop@gmail.com>

	mount: decode MS_NOSEC.
	* system.c (MS_NOSEC): Define.
	(mount_flags): Add MS_NOSEC.

	mmap: decode MAP_UNINITIALIZED.
	* mem.c (mmap_flags): Add MAP_UNINITIALIZED.

2013-02-05  Dmitry V. Levin  <ldv@altlinux.org>

	Print 64-bit instruction pointers zero padded.
	* syscall.c (printcall): Print 64-bit instruction pointers zero padded.

	x86_64: fix compilation warning introduced in previous commit.
	* syscall.c (printcall): Cast x86_64_regs.rip to the type being printed.

2013-02-05  Denys Vlasenko  <vda.linux@googlemail.com>

	Simple bug fix for x86_86.
	* syscall.c (printcall): Use x86_64_regs.rip, not x86_64_regs.ip.

2013-02-05  Chris Metcalf  <cmetcalf@tilera.com>

	Add tilegx support to strace.
	tilegx support has been in the kernel since 3.0.
	In addition, fix some issues with the tilepro support already
	present in strace, primarily the decision to use the
	<asm/unistd.h> numbering space for system calls.

	* defs.h [TILE]: Include <asm/ptrace.h> and provide an extern
	struct pt_regs tile_regs for efficiency.  Provide compat 32-bit
	personality via SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE,
	PERSONALITY1_WORDSIZE, and DEFAULT_PERSONALITY.
	* linux/tile/errnoent1.h: New file, includes linux/errnoent.h.
	* linux/tile/ioctlent1.h: New file, includes linux/ioctlent.h.
	* linux/tile/signalent1.h: New file, includes linux/signalent.h.
	* linux/tile/syscallent.h: Update with new asm-generic syscalls.
	The version previously committed was the from the first tile patch
	to LKML, which subsequently was changed to use <asm-generic/unistd.h>.
	* linux/tile/syscallent1.h: Copy from linux/tile/syscallent.h.
	* mem.c (addtileflags) [TILE]: use %ld properly for a "long" variable.
	* process.c [TILE]: Choose clone arguments correctly and properly
	suppress all "struct user" related offsets in user_struct_offsets.
	* signal.c [TILE]: Use tile_regs not upeek.
	* syscall.c (update_personality) [TILE]: Print mode.
	(PT_FLAGS_COMPAT) [TILE]: Provide if not in system headers.
	(tile_regs) [TILE]: Define 'struct pt_regs' variable to hold state.
	(get_regs) [TILE]: use PTRACE_GETREGS to set tile_regs rather than using upeek.
	(get_scno) [TILE]: Set personality.
	(get_syscall_args) [TILE]: Use tile_regs.
	(get_syscall_result) [TILE]: Update tile_regs.
	(get_error) [TILE]: Use tile_regs.
	(printcall) [TILE]: Print pc.
	(arg0_offset, arg1_offset, restore_arg0, restore_arg1) [TILE]:
	Properly handle tile call semantics and support tilegx.

2013-02-05  Denys Vlasenko  <vda.linux@googlemail.com>

	Small optimization for SPARC[64] get_scno.
	* syscall.c: Remove static unsigned long trap veriable.
	(get_scno): Use local trap variable.

	Do not compile getrval2() if not needed.
	* syscall.c (getrval2): Do not compile it for architetures where
	it isn't ever used.

2013-02-05  Denys Vlasenko  <vda.linux@googlemail.com>

	Optimize out PTRACE_PEEKUSER with -i.
	strace -i was fetching PC with a separate PEEKUSER
	despite having GETREGS data:

	ptrace(PTRACE_GETREGS, 22331, 0, 0x8087f00) = 0
	ptrace(PTRACE_PEEKUSER, 22331, 4*EIP, [0x80dd7b7]) = 0
	write(3, "[080dd7b7] ioctl(0, SNDCTL_TMR_T"..., 82) = 82
	ptrace(PTRACE_SYSCALL, 22331, 0, SIG_0) = 0

	Now it does this:

	ptrace(PTRACE_GETREGS, 22549, 0, 0x8087ea0) = 0
	write(3, "[080dd7b7] ioctl(0, SNDCTL_TMR_T"..., 82) = 82
	ptrace(PTRACE_SYSCALL, 22549, 0, SIG_0) = 0

	Analogous improvement in sys_sigreturn() is also implemented.

	* defs.h: Declare extern struct pt_regs regs for SPARC[64] and ARM.
	Declare clear_regs(), get_regs() and get_regs_error flag variable.
	* strace.c (trace): Call get_regs(pid) as soon as we know the tcb
	and that it is stopped.
	* syscall.c (get_regs): New function. Used to fetch registers early,
	just after tracee has stopped.
	(printcall): Move it here from util.c. Use global regs.REG data,
	if available on the arch, instead of re-fetching it.
	(get_scno): Use global regs.REG data.
	(get_syscall_result): Likewise.
	* signal.c (sys_sigreturn): Likewise.
	* util.c (printcall): Moved to syscall.c.

2012-12-15  Stanislav Brabec  <sbrabec@suse.cz>

	Fix sys_semtimedop decoding on s390x.
	The s390 and s390x pass semtimedop arguments differently from other
	architectures.  sys_semtimedop parser was fixed for s390 by commit
	v4.6-177-ge0f5fd8, and s390x requires the same fix.

	* linux/ipc.c (sys_semtimedop): Fix timespec decoding on s390x.

2012-12-08  Dmitry V. Levin  <ldv@altlinux.org>

	Fix *xattr decoding.
	* file.c (print_xattr_val): Do not attempt to decode a zero sized array.
	Fixes RH#885233.

2012-12-08  Stanislav Brabec  <sbrabec@suse.cz>

	sys_semtimedop: fix timeval argument index in wrapped call.
	Looking at the implementation of wrapped semtimedop() call inside glibc
	and kernel, I started to believe that timeval should be located in
	tcp->u_arg[4] and not tcp->u_arg[5].  Fortunately, tcp->u_arg[5] now
	works correctly as well, due to side effects of decode_ipc_subcall().

	declaration in header:
	int semtimedop(semid, *sops, nsops, *timeout);
	                 0      1      2        3

	sys_ipc arguments in glibc on all patforms except s390*:
	semid, (int) nsops, 0, CHECK_N (sops, nsops), timeout
	  0            1    2            3                4
	We have to use indexes: 0 3 1 4

	sys_ipc arguments on s390*:
	semid, (int) nsops, timeout, sops
	  0            1       2       3
	We have to use indexes: 0 3 1 2

	* ipc.c (sys_semtimedop) [!S390]: Fix timeval argument index in
	indirect_ipccall case.

2012-12-06  John Spencer  <maillist-strace@barfooze.de>

	Fix glibc version checks.
	* util.c: Check if __GLIBC__ is defined before using it.
	* signal.c: Likewise.  Fix __GLIBC_MINOR__ checks.

2012-11-29  James Hogan  <james.hogan@imgtec.com>

	Add state argument to change_syscall and fix SPARC.
	Add a state argument to change_syscall() so that SPARC can modify that
	instead of read-modify-writing the whole register set.  This function is
	always called within an arg_setup/arg_finish_change sequence which on
	certain architectures like SPARC will also be doing a read-modify-write.
	This prevents the second write (from arg_finish_change) from undoing the
	effects of the change_syscall call.

	* util.c (change_syscall): Move below definition of arg_setup_state.
	Add state argument.
	[SPARC || SPARC64] Change to set state->u_regs[U_REG_G1] rather than
	read-modify-writing it with PTRACE_GETREGS and PTRACE_SETREGS.
	(setbpt, clearbpt): Pass state argument to change_syscall.

2012-11-12  Steve McIntyre  <steve.mcintyre@linaro.org>

	Add support for tracing 32-bit ARM EABI binaries on AArch64.
	* defs.h [AARCH64]: Copy in the definition of arm_pt_regs and the
	accessor macros, so it's possible to build on AArch64 without
	ARM system headers.  Set SUPPORTED_PERSONALITIES to 2.
	Define PERSONALITY0_WORDSIZE and PERSONALITY1_WORDSIZE.
	Set DEFAULT_PERSONALITY to 1.
	* linux/aarch64/errnoent1.h: New file, includes generic errnoent.h.
	* linux/aarch64/ioctlent1.h: New file, includes generic ioctlent.h.
	* linux/aarch64/signalent1.h: New file, includes generic signalent.h.
	* linux/aarch64/syscallent1.h: Rename from linux/aarch64/syscallent.h.
	* linux/aarch64/syscallent.h: New file, includes arm/syscallent.h.
	* syscall.c [AARCH64]: Define aarch64_regs.
	(update_personality) [AARCH64]: Add debug output.
	(get_scno) [AARCH64]: Determine if we're in ARM or AArch64 mode by
	checking the size of the returned uio structure from PTRACE_GETREGSET
	and interpret the structure accordingly.
	(get_syscall_result): Likewise.
	(get_syscall_args): Merge the AArch64 and ARM sections so that on
	AArch64 we can fall back to supporting the ARM personality.
	(get_error): Likewise.

2012-11-12  Dmitry V. Levin  <ldv@altlinux.org>

	Move asm-generic ioctl definitions to linux/ioctlent.h.in.
	* linux/ioctlent.h.in: Add asm-generic ioctl entries from all
	linux/*/ioctlent.h.in files.
	* linux/bfin/ioctlent.h.in: Remove asm-generic ioctl entries.
	* linux/i386/ioctlent.h.in: Likewise.
	* linux/powerpc/ioctlent.h.in: Likewise.
	* linux/s390/ioctlent.h.in: Likewise.
	* linux/sparc/ioctlent.h.in: Likewise.

2012-10-27  Dmitry V. Levin  <ldv@altlinux.org>

	Filter out redundant "*32" ioctl entries.
	* linux/ioctlent-filter.awk: New file.
	* Makefile.am: Use it.
	* linux/ioctlent.h.in: Removed redundant "*32" entries.

2012-10-26  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance quotactl decoding.
	* quota.c (sys_quotactl): Decode 2nd syscall argument using printpath.
	* pathtrace.c (pathtrace_match): Add quotactl support.
	* linux/*/syscallent.h: Add TF flag to quotactl entry.

2012-10-26  Steve McIntyre  <steve.mcintyre@linaro.org>

	Add AArch64 support to strace.
	AArch64 has been included in linux from 3.7 onwards.
	Add support for AArch64 in strace, tested on linux in a simulator.

	* configure.ac: Support AArch64.
	* defs.h [AARCH64]: Include <sys/ptrace.h>, define TCB_WAITEXECVE.
	* ipc.c (indirect_ipccall): Support AArch64.
	* process.c (struct_user_offsets): Likewise.
	* syscall.c [AARCH64]: Include <asm/ptrace.h>,  <sys/uio.h>, and
	<elf.h>.  Define struct user_pt_regs regs.
	(get_scno, get_syscall_result): Support AArch64 using PTRACE_GETREGSET.
	(get_syscall_args, get_error): Support AArch64.
	* linux/aarch64/ioctlent.h.in: New file.
	* linux/aarch64/syscallent.h: New file, based on linux 3.7 version of
	asm-generic/unistd.h.

2012-10-26  Steve McIntyre  <steve.mcintyre@linaro.org>

	linux: add new errno values for EPROBE_DEFER and EOPENSTALE.
	New definitions match updates in Linux 3.4 and Linux 3.5 respectively.

	* linux/errnoent.h (ERRNO_517): Change to EPROBE_DEFER.
	(ERRNO_518): Change to EOPENSTALE.

2012-10-26  Namhyung Kim  <namhyung.kim@lge.com>

	Add -e trace=memory option.
	Add a new 'memory' category for tracing memory mapping related syscalls.

	Affected syscalls are: break, brk, get_mempolicy, madvise, mbind,
	migrate_pages, mincore, mlock, mlockall, mmap, move_pages, mprotect,
	mremap, msync, munlock, munlockall, munmap, remap_file_pages, and
	set_mempolicy.

	* defs.h (TRACE_MEMORY): New macro.
	* syscall.c (lookup_class): Handle trace=memory option.
	* strace.1: Document it.
	* linux/alpha/syscallent.h: Add TM flag to memory mapping related syscalls.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.

2012-09-28  Mike Frysinger  <vapier@gentoo.org>

	x32: add 64bit annotation too.
	Since someone can invoke these entry points directly with syscall(),
	at least decode their name and show that they're 64bit versions rather
	than just showing syscall_###.

	* linux/x32/syscallent.h: Sync all missing entries below 312 with x86_64.

2012-09-28  Dmitry V. Levin  <ldv@altlinux.org>

	Ignore fflush(3) return value.
	strace used to honor fflush(3) return value in trace_syscall_entering
	which resulted to tracees not being PTRACE_SYSCALL'ed which in turn
	caused nasty hangups like this one:

	$ strace -o'|:' pwd
	|:: Broken pipe

	There is little strace can do in case of fflush(3) returning EOF, and
	hangup is certainly not the best solution for the issue.

	* syscall.c (trace_syscall_entering): Ignore fflush(3) return value.

2012-09-28  Dmitry V. Levin  <ldv@altlinux.org>

	Use perror_msg instead of perror.
	* signal.c (sys_sigreturn): Use perror_msg instead of perror.
	* strace.c (tprintf, tprints, detach, startup_attach): Likewise.
	* syscall.c (get_scno): Likewise.
	* util.c (umoven, umovestr): Likewise.

2012-09-27  Denys Vlasenko  <vda.linux@googlemail.com>

	process_vm_readv may return ESRCH if tracee was killed, don't complain.
	Discovered by running test/sigkill_rain under strace.

	* util.c (umoven): Do not emit error message if process_vm_readv
	fails with ESRCH.
	(umovestr): LikeWise.

2012-09-13  Denys Vlasenko  <vda.linux@googlemail.com>

	Trivial fixes, no code changes.
	* strace.c: Fix compiler warning message about tgkill - we don't use it.
	Fix indentation of preprocessor directives.
	(trace): Remove outdated comment.

2012-08-24  Dmitry V. Levin  <ldv@altlinux.org>

	Always check setreuid return code.
	* strace.c (startup_child): Check setreuid return code.

2012-08-24  Mike Frysinger  <vapier@gentoo.org>

	x32: update {g,s}etsockopt syscall numbers.
	Starting with linux 3.6 (and backported to earlier kernels), these two
	syscalls have changed numbers (moving from native to compat entry points).
	Update the strace syscall list accordingly.

	* linux/x32/syscallent.h: Move setsockopt from 54 to 541, and move
	getsockopt from 55 to 542.

2012-08-16  Dmitry V. Levin  <ldv@altlinux.org>

	Decode file type returned by getdents system call.
	* file.c (sys_getdents): Decode d_type in unabbreviated mode.

2012-07-12  Dmitry V. Levin  <ldv@altlinux.org>

	Close pipe and wait for the pipe process termination.
	In case of normal strace termination, when the trace output is
	redirected to a file or a pipe, close it and wait for the pipe
	process termination.

	* strace.c (main): Before normal exit, close shared_log when it
	differs from stderr, and wait for popen_pid termination.

2012-07-10  Denys Vlasenko  <vda.linux@googlemail.com>

	Enable usage of PTRACE_SEIZE.
	* defs.h: Define USE_SEIZE to 1. Remove PTRACE_SEIZE_DEVEL
	and PTRACE_EVENT_STOP1.
	* strace.c (ptrace_attach_or_seize): Replace PTRACE_SEIZE_DEVEL
	with 0.
	(trace): Do not check for PTRACE_EVENT_STOP1.

2012-06-05  Mike Frysinger  <vapier@gentoo.org>

	x32: update syscall table.
	This syncs with the syscall table as it is in linux 3.4.

	* linux/x32/syscallent.h (59): Fix comment typo.
	(78): Add missing getdents entry.
	(174): Delete create_module entry (not in the kernel).
	(181, 182, 183, 184, 185): Add missing entries.
	(524, 536, 539, 540): Fix spacing.

2012-05-18  Denys Vlasenko  <vda.linux@googlemail.com>

	Merge adjacent printing operations in a few places.
	* file.c (sys_readahead): Merge tprints() with following printllval().
	(sys_ftruncate64): Likewise.
	(sys_fadvise64): Likewise.
	(sys_fadvise64_64): Likewise.
	(sys_fallocate): Merge tprints() with following tprintf().

2012-05-16  Denys Vlasenko  <vda.linux@googlemail.com>

	Use %d printf format instead of %i everywhere.
	* loop.c (loop_ioctl): Use %d instead of %i.
	* mtd.c (mtd_ioctl): Likewise.

	Fix a few goofs in sys_sysctl()
	* system.c (sys_sysctl): Cast pointer to long, not size_t,
	when we intend to use it as an address. Set oldlen to 0 prior
	to reading into it - we want to have deterministic result
	if read fails.

2012-05-16  Denys Vlasenko  <vda.linux@googlemail.com>

	Stop using non-standard %Zu and %Zd formats for size_t printing.
	The documented formats are %zu and %zd, but since our (normally disabled)
	"fast" printf code doesn't support those too, I convert them to %lu and %ld.

	* bjm.c (sys_query_module): Convert %Zd usages to %lu.
	* system.c (sys_sysctl): Likewise.

2012-05-15  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove outdated comment about suspending new tracees.
	We no longer track parent/child relationship between tracees.
	Therefore, we no longer suspend new tracee until parent is seen
	exiting form [v]fork/clone. The comment is obsolete.

	* strace.c (trace): Remove outdated comment.

2012-05-15  Denys Vlasenko  <vda.linux@googlemail.com>

	Make sure current_wordsize and PERSONALITY0_WORDSIZE are ints in all arches
	On 64bit systems with a single personality, they used to be sizeof(long),
	which has type "long", not "int", which complicates printf formats.

	* defs.h: Ensure that PERSONALITY0_WORDSIZE;s tyoe is int.
	This in turn makes sure current_wordsize is also an int.
	* count.c (call_summary): Revert the change which added cast to int.

2012-05-15  Dmitry V. Levin  <ldv@altlinux.org>

	Add configure --enable-gcc-Werror option.
	* configure.ac: New option --enable-gcc-Werror.

	Make x86-64 build free of artificial warnings.
	* signal.c (sys_sigreturn): Do not issue "no sys_sigreturn" warning
	on X86_64.

2012-05-14  Dmitry V. Levin  <ldv@altlinux.org>

	Fix kernel release string parsing.
	* strace.c (get_os_release): Handle "X.Y-something" utsname.release
	strings properly.

	Reported-by: Bryce Gibson <bryce@gibson-consulting.com.au>

2012-05-14  Denys Vlasenko  <vda.linux@googlemail.com>

	On clearing "breakpopint", restore syscall number too.
	This fixes Fedora bug 659382.
	Low risk: this code is not supposed to be used on any non-acient kernel.

	* util.c (clearbpt): Restore syscall number too.

2012-05-05  Mike Frysinger  <vapier@gentoo.org>

	util: fix building when glibc has a stub process_vm_readv.
	If you have a newer glibc which provides process_vm_readv, but it is built
	against older kernel headers which lack __NR_process_vm_readv, the library
	will contain a stub implementation that just returns ENOSYS.  Autoconf
	checks for this case explicitly and will declare it as unavailable.  So we
	end up in a case where the headers provide the prototype, but autoconf has
	not defined HAVE_PROCESS_VM_READV, so we hit the same build failure again:

	util.c:738:16: error: static declaration of 'process_vm_readv' follows non-static declaration
	/usr/include/bits/uio.h:58:16: note: previous declaration of 'process_vm_readv' was here

	So rename our local function to something unique, and add a define so the
	callers all hit the right place.

	* util.c (strace_process_vm_readv): Rename from process_vm_readv.
	(process_vm_readv): Define to strace_process_vm_readv.

2012-05-03  Dmitry V. Levin  <ldv@altlinux.org>

	doc: describe documentation policy.
	* README-hacking: Describe documentation policy.

2012-05-02  Dmitry V. Levin  <ldv@altlinux.org>

	maint: post-release administrivia.
	* NEWS: Add header line for next release.

	Prepare for 4.7 release.
	* configure.ac: Version 4.7.
	* debian/changelog: 4.7-1.
	* strace.spec: 4.7-1.

	Fix build with <linux/loop.h> from 2.6.18 kernel headers.
	* configure.ac: Check for LO_FLAGS_AUTOCLEAR and LO_FLAGS_PARTSCAN
	declarations.
	* loop.c (loop_flags_options): Use LO_FLAGS_AUTOCLEAR and
	LO_FLAGS_PARTSCAN only when appropriate declarations are available.
	(loop_ioctl): Use LOOP_SET_CAPACITY only when it is defined.

2012-05-01  Dmitry V. Levin  <ldv@altlinux.org>

	* vsprintf.c: Check for USE_CUSTOM_PRINTF earlier.

	Remove duplicate names from CREDITS.
	* .mailmap: Merge email addresses.
	* CREDITS.in: Remove a duplicate name.

2012-05-01  Dmitry V. Levin  <ldv@altlinux.org>

	tests: raise strace check timeout to 60 seconds.
	* tests/init.sh (check_timeout): New variable.
	* tests/ptrace_setoptions: Use it.
	* tests/strace-f: Likewise.

	Reported-by: Mike Frysinger <vapier@gentoo.org>

2012-05-01  Dmitry V. Levin  <ldv@altlinux.org>

	Update STA_* constants.
	* time.c (adjtimex_status): Add STA_NANO, STA_MODE, and STA_CLK.
	* NEWS (Improvements): Mention it.

	NEWS: update for release.
	* NEWS (Improvements): Mention recent recvmsg/recvmmsg decoders
	enhancements.
	(Portability): Add a recommendation for the minimum Linux kernel
	version to use.

	Make printing of utsname.domainname more portable.
	* configure.ac: Check for struct utsname.domainname field.
	* process.c (sys_uname): Print utsname.domainname when the field is
	available.

2012-05-01  Dmitry V. Levin  <ldv@altlinux.org>

	Fix recvmmsg decode: do not show more data than actually returned.
	This change complements recent fix for recvmsg decoding.

	* net.c (printmmsghdr): Add msg_len parameter to pass down to do_msghdr.
	When this parameter is zero, pass mmsghdr.msg_len to do_msghdr instead.
	(decode_mmsg): Add msg_len parameter, pass it down to printmmsghdr.
	(sys_sendmmsg): Call decode_mmsg with msg_len == (unsigned long) -1L.
	(sys_recvmmsg): Call decode_mmsg with msg_len == 0.

2012-05-01  Dmitry V. Levin  <ldv@altlinux.org>

	Remove recently introduced use of ULONG_MAX.
	* io.c: Remove limits.h inclusion.
	(tprint_iov): Use "(unsigned long) -1L" instead of "ULONG_MAX".
	* net.c: Remove limits.h inclusion.
	(printmmsghdr, sys_sendmsg): Use "(unsigned long) -1L" instead of
	"ULONG_MAX".

2012-04-28  Denys Vlasenko  <vda.linux@googlemail.com>

	Enable printing of uts.domainname in uname syscall.
	* process.c (sys_uname): Enable printing of uts.domainname

2012-04-28  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix printstr's len parameter width.
	We often pass syscall params and other long-sized values
	as printstr(len). Truncating them to int may be a bad thing.

	* defs.h: Change len parameter's type from int to long in
	string_quote and printstr function declarations.
	* util.c (string_quote): Special-case only len==-1, not all len<0.
	(printstr): Likewise.

2012-04-28  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix recvmsg decode: do not show more data than actually returned.
	I noticed that "hostname -d" talks over netlink and gets 20 bytes
	of response, but we show entire 1024 bytes of iov.
	This changes fixes that.

	* defs.h: New function tprint_iov_upto.
	* io.c (tprint_iov_upto): Definition of this function.
	(tprint_iov): Call tprint_iov_upto.
	* net.c (do_msghdr): Add data_size parameter, pass it down to tprint_iov_upto.
	(printmsghdr): Add data_size parameter, pass it down to do_msghdr.
	(printmmsghdr): Call do_msghdr with data_size==ULONG_MAX.
	(sys_sendmsg): Call printmsghdr with data_size==ULONG_MAX.
	(sys_recvmsg): Call printmsghdr with data_size==tcp->u_rval.

2012-04-27  Dmitry V. Levin  <ldv@altlinux.org>

	Package strace-log-merge.
	* strace.spec (%files): Add strace-log-merge.

2012-04-27  Mike Frysinger  <vapier@gentoo.org>

	NEWS: clarify & fix typo.

2012-04-27  Mike Frysinger  <vapier@gentoo.org>

	Cast current_wordsize to an int.
	On 64bit systems with a single personality, we see:
	count.c: In function 'call_summary':
	count.c:223:5: warning: format '%u' expects type 'unsigned int',
		but argument 3 has type 'long unsigned int'

	Since on multi-personality systems this is an array of ints, cast
	the multiplication to an int and update the printf format.

	* count.c (call_summary): Change %u to %d and cast first argument to int.

2012-04-20  Dmitry V. Levin  <ldv@altlinux.org>

	Update NEWS for upcoming 4.7 release.
	* NEWS: Update for 4.7 release.

	Sync strace.spec and debian/ with packages.
	* debian/changelog: Sync with 4.5.20-2.3.
	* debian/control: Likewise.
	* strace.spec: Sync with 4.6-2.

2012-04-18  Mike Frysinger  <vapier@gentoo.org>

	Decode /dev/loop ioctls.
	Needed to debug some losetup failures, and it's easier when you can see
	what the kernel is getting vs what you think you're sending, so add some
	decoders for those ioctls.

	* loop.c: New file.
	* Makefile.am (strace_SOURCES): Add loop.c.
	* defs.h (loop_ioctl): New prototype.
	(string_quote): Likewise.
	* ioctl.c (ioctl_decode): Call loop_ioctl when code is 'L'.
	* util.c (string_quote): Remove static keyword.

2012-04-18  H.J. Lu  <hongjiu.lu@intel.com>

	x32: add ia32 support.
	* Makefile.am (EXTRA_DIST): Add linux/x32/errnoent1.h,
	linux/x32/ioctlent1.h, linux/x32/signalent1.h and
	linux/x32/syscallent1.h.
	* configure.ac: Remove AC_GNU_SOURCE, obsoleted by
	AC_USE_SYSTEM_EXTENSIONS.
	* defs.h (SUPPORTED_PERSONALITIES): Set to 2 for X32.
	(PERSONALITY1_WORDSIZE): Set to 4 for X32.
	* file.c (stat64): New struct for X32.
	(sys_lseek32): New function for X32.
	(stat64): Undef.
	(sys_fstat64): Likewise.
	(sys_stat64): Likewise.
	(realprintstat64): New function for X32.
	(sys_fstat64): Likewise.
	(sys_stat64): Likewise.
	* mem.c (sys_old_mmap): New function for X32.
	* pathtrace.c (pathtrace_match): Also check sys_old_mmap for X32.
	* syscall.c (update_personality): Add X32 support.
	(get_scno): Support currpers == 1 for X32.
	* linux/syscall.h (sys_lseek32): New function prototype for X32.
	* linux/x32/errnoent1.h: New file.
	* linux/x32/ioctlent1.h: Likewise.
	* linux/x32/signalent1.h: Likewise.
	* linux/x32/syscallent1.h: Likewise.

2012-04-17  H.J. Lu  <hongjiu.lu@intel.com>

	Cast clock_t type to unsigned long long.
	* resource.c (sys_times): Cast clock_t type to unsigned long long.
	* signal.c (printsiginfo): Likewise.

2012-04-16  Denys Vlasenko  <vda.linux@googlemail.com>

	Add custom (faster) vfprintf implementation (disabled by default)
	* defs.h: Declare strace_vfprintf either as a alias to vfprintf
	or as a bona fide function. USE_CUSTOM_PRINTF define controls whether
	we use strace_vfprintf. By default, we don't.
	* strace.c (tprintf): Call strace_vfprintf instead of vfprintf.
	* vsprintf.c: New file, implements strace_vfprintf.

2012-04-16  Denys Vlasenko  <vda.linux@googlemail.com>

	Stop using %h[h]u format specifiers.
	This is needed for simplified printf, and reduces code size a bit.

	* block.c (block_ioctl): Cast the value to unsinged and use %u
	instead of using %hu.
	* desc.c (sys_io_cancel): Likewise.
	* resource.c (sys_sysinfo): Likewise.

2012-04-16  Denys Vlasenko  <vda.linux@googlemail.com>

	Trivial speed optimization.
	* strace.c (tprints): Use fputs_unlocked instead of fputs.

2012-04-16  H.J. Lu  <hongjiu.lu@intel.com>

	Fix a problem with sys_lseek on x32.
	* file.c (sys_lseek): Use MIPS-n32 variant also for x32

2012-04-16  H.J. Lu  <hongjiu.lu@intel.com>

	Add x32 support to strace.
	X32 support is added to Linux kernel 3.4. In a nutshell, x32 is x86-64 with
	32bit pointers.  At system call level, x32 is also identical to x86-64,
	as shown by many changes like "defined(X86_64) || defined(X32)".  The
	main differerence bewteen x32 and x86-64 is off_t in x32 is long long
	instead of long.

	This patch adds x32 support to strace.  Tested on Linux/x32.

	* configure.ac: Support X32.
	* defs.h: Set SUPPORTED_PERSONALITIES to 3 for X86_64,
	Set PERSONALITY2_WORDSIZE to 4 for X86_64.
	Add tcb::ext_arg for X32.
	* file.c (stat): New for X32.
	(sys_lseek): Use 64-bit version for X32.
	(printstat64): Check current_personality != 1 for X86_64.
	* ipc.c (indirect_ipccall): Check current_personality == 1
	for X86_64.
	* mem.c (sys_mmap64): Also use tcp->u_arg for X32.  Print NULL
	for zero address.  Call printllval for offset for X32.
	* pathtrace.c (pathtrace_match): Don't check sys_old_mmap for
	X32.
	* process.c (ARG_FLAGS): Defined for X32.
	(ARG_STACK): Likewise.
	(ARG_PTID): Likewise.
	(change_syscall): Handle X32.
	(struct_user_offsets): Support X32.
	(sys_arch_prctl): Likewise.
	* signal.c: Include <asm/sigcontext.h> for X32.
	(SA_RESTORER): Also define for X32.
	* syscall.c (update_personality): Support X32 for X86_64.
	(is_restart_error): Likewise.
	(syscall_fixup_on_sysenter): Likewise.
	(get_syscall_args): Likewise.
	(get_syscall_result): Likewise.
	(get_error): Likewise.
	(__X32_SYSCALL_BIT): Define if not defined.
	(__X32_SYSCALL_MASK): Likewise.
	(get_scno): Check DS register value for X32.  Use
	__X32_SYSCALL_MASK on X32 system calls.
	* util.c (printllval): Use ext_arg for X32.
	(printcall): Support X32.
	(change_syscall): Likewise.
	(arg0_offset): Likewise.
	(arg1_offset): Likewise.
	* Makefile.am (EXTRA_DIST): Add linux/x32/errnoent.h,
	linux/x32/ioctlent.h.in, linux/x32/signalent.h,
	linux/x32/syscallent.h, linux/x86_64/errnoent2.h,
	linux/x86_64/ioctlent2.h, linux/x86_64/signalent2.h and
	linux/x86_64/syscallent2.h.
	* linux/x32/errnoent.h: New.
	* linux/x32/ioctlent.h.in: Likewise.
	* linux/x32/signalent.h: Likewise.
	* linux/x32/syscallent.h: Likewise.
	* linux/x86_64/errnoent2.h: Likewise.
	* linux/x86_64/ioctlent2.h: Likewise.
	* linux/x86_64/signalent2.h: Likewise.
	* linux/x86_64/syscallent2.h: Likewise.

2012-04-16  H.J. Lu  <hongjiu.lu@intel.com>

	Restore tcb::u_lrval; fix lseek on MIPS-n32.
	Linux kernel v3.4 adds x32 support.  Both x32 and n32 use 64bit offset
	for lseek parameter and return value.  We need u_lrval to handle it
	properly.  Also we shouldn't check HAVE_LONG_LONG_OFF_T for n32 lseek.
	This patch fixes it properly and prepares lseek for x32.

	* defs.h (tcb): Restore tcb::u_lrval field, RVAL_Lfoo constants.
	Set RVAL_MASK to 7.
	* file.c (sys_lseek): Print 64bit offset and return RVAL_LUDECIMAL
	for n32.
	* syscall.c (get_error): Set u_lrval for MIPS-n32.
	(trace_syscall_exiting): Handle RVAL_Lfoo return value types.

2012-04-06  Mike Frysinger  <vapier@gentoo.org>

	Decode mtd ioctls.
	I got tired of figuring out mtd structures (which show up a lot
	in the embedded space), so add decoders for those ioctls.

	* defs.h (mtd_ioctl): New prototype.
	(print_loff_t): Likewise.
	* io.c (print_loff_t): Delete static keyword
	* ioctl.c (ioctl_decode): Call mtd_ioctl when code is 'M'.
	* Makefile.am (strace_SOURCES): Add mtd.c.
	(EXTRA_DIST): Add linux/mtd-abi.h.
	* mtd.c: New file.
	* linux/mtd-abi.h: New file.

2012-04-05  Mike Frysinger  <vapier@gentoo.org>

	Fix indefinite hang on no-mmu systems.
	The ptrace setoptions code will fork a child which goes to sleep and
	expects the parent to continue on to do tests.  Unfortunately, this
	does not work on no-mmu systems as fork() is actually vfork() and any
	vforked children will hang the parent until it exits or execs.

	We might be able to make this test work on no-mmu systems with a bit
	of work, but easier to just disable this for the release so it works
	now.

	* strace.c (test_ptrace_setoptions_for_all): Return if strace_vforked.

2012-03-29  Denys Vlasenko  <vda.linux@googlemail.com>

	Makefile.am: whitespace fix.

2012-03-27  Anton Blanchard  <anton@samba.org>

	powerpc: Add syscall entries for direct socket system calls.
	* linux/powerpc/syscallent.h: Add direct socket system calls.

2012-03-26  Dmitry V. Levin  <ldv@altlinux.org>

	qual_syscall: fix potential NULL dereference.
	Fix regression introduced by commit
	c1371ebc400fe9578908beca87f2bf407daf1506

	* syscall.c (qual_syscall): Handle null sys_name.

	Reported-by: Fr. Br. George <george@altlinux.org>

2012-03-26  Dmitry V. Levin  <ldv@altlinux.org>

	strace-log-merge: fix file suffix calculation.
	* strace-log-merge: Quote file prefix to fix file suffix calculation.

	Reported-by: Denys Vlasenko <vda.linux@googlemail.com>
	Suggested-by: Andreas Schwab <schwab@linux-m68k.org>

2012-03-26  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove unreachable code.
	* strace.c (process_opt_p_list): Remove unreachable code.

	manpage: remove false info about -p being limited to 32 processes.

	Tweak help text and manpage (added -In to manpage)

2012-03-25  Dmitry V. Levin  <ldv@altlinux.org>

	printstr: check for potential integer overflow.
	* util.c (printstr): Check for potential integer overflow during outstr
	buffer size calculation.

	Robustify parsing of numbers from strings.
	* defs.h (string_to_uint): New prototype.
	* util.c (string_to_uint): New function.
	* strace.c (error_opt_arg): New function.
	(process_opt_p_list): Use string_to_uint instead of atoi.
	Terminate in case of invalid process id.
	(init): Use string_to_uint instead of atoi.
	Use error_opt_arg in case of invalid option argument.
	* syscall.c (qual_syscall, qual_signal, qual_desc): Use string_to_uint
	instead of atoi.

	strace-log-merge: enhance usage error diagnostics.
	* strace-log-merge: Add --help option.  Check number of arguments.
	Issue an error message when no strace output was merged.

	configure.ac: sort lists and use m4_normalize to ease maintenance.
	* configure.ac (AC_CHECK_FUNCS, AC_CHECK_HEADERS, AC_CHECK_MEMBERS,
	AC_CHECK_DECLS): Sort lists, use m4_normalize.

2012-03-23  Denys Vlasenko  <vda.linux@googlemail.com>

	Simple optimizations.
	Why open-coding isdigit is a good idea?

	Before: call   __ctype_b_loc
	        movzbl (%ebx),%edx
	        mov    (%eax),%eax
	        testb  $0x8,0x1(%eax,%edx,2)
	        je     lbl

	After:  movzbl (%eax),%edx
	        sub    $0x30,%edx
	        cmp    $0x9,%dl
	        ja     lbl

	   text	   data	    bss	    dec	    hex	filename
	 236869	    704	  18944	 256517	  3ea05	strace.before
	 236719	    700	  18944	 256363	  3e96b	strace

	* defs.h: Alias sigemptyset to __sigemptyset on glibc.
	* syscall.c (qual_syscall): Open-code isdigit.
	(qual_desc): Likewise.
	(qual_signal): Open-code isdigit. Remove string copying
	which was done for no apparent reason.

2012-03-23  Denys Vlasenko  <vda.linux@googlemail.com>

	Reorder declarations in defs.h. No code changes.
	* defs.h: Reorder declarations (such as: keep all printing functions together).

2012-03-22  Denys Vlasenko  <vda.linux@googlemail.com>

	Simplify current tcp switching and current column handling.
	Instead of using "static FILE *outf and static unsigned int curcol"
	to cache current outfile and its position, we can simply
	remember current tcb and use its ->outf and ->curcol.
	This allows to drop numerous "tcp->curcol = curcol" ops in trace().

	Turns out we can't drop "static FILE *outf", but now its role is
	a bit clearer: it newer changes after init, stays == stderr or
	opened to shared log (which may be the same thing if neither -o
	nor -ff was specified). Let's rename it then.

	   text	   data	    bss	    dec	    hex	filename
	 236953	    704	  18944	 256601	  3ea59	strace.before.prev.commit
	 236905	    704	  18944	 256553	  3ea29	strace.before
	 236869	    704	  18944	 256517	  3ea05	strace

	* strace.c: Replace curcol static variable by struct tcb *current_tcp.
	Rename static FILE *outf to shared_log (since it no longer caches tcp->outf).
	(ptrace_restart): Use current_tcp->curcol instead of curcol.
	(tprintf): Check current_tcp != NULL instead of outf != NULL.
	Use current_tcp->outf instead of outf, current_tcp->curcol instead of curcol.
	(tprints): Likewise.
	(line_ended): Likewise.
	(printleader): Switch current tcb by "current_tcp = tcp" istead of
	assignments to outf and curcol.
	(droptcb): Set current_tcp to NULL if we dropped it.
	(startup_child): Rename outf to shared_log.
	(init): Likewise.
	(cleanup): Likewise.
	(trace): Simplify current tcp switching and current column handling.

2012-03-22  Denys Vlasenko  <vda.linux@googlemail.com>

	Make threaded execve handling code more reabable and somewhat simpler.
	* strace.c (droptcb): Remove outfname check in "outfname && followfork >= 2" -
	with recent changes, followfork >= 2 check guarantees that outfile
	was specified, and _is already opened_.
	(trace): Move tcb existence check before threaded execve handling.
	This allows to remove tcp != NULL checks in threaded execve handling.
	Rewrite threaded execve handling code to be less indented,
	keeping the same logic.

2012-03-21  Denys Vlasenko  <vda.linux@googlemail.com>

	simple cleanups in defs.h. No logic changes.
	* defs.h: Move offsetof macro definition into "libc stuff" section.
	Renumber TCB_foo constants (smaller constants -> sometimes smaller code).
	Remove uoff macro.
	* process.c: Move uoff macro here (sole user).

	Show "+++ exited..." with -C.
	* strace.c (trace): Show "+++ exited..." with -C too.
	Save tcp->curcol after PTRACE_LISTEN failure too, just in case.

	Slight tweak to qemu_multiarch_testing scripts.

2012-03-21  Denys Vlasenko  <vda.linux@googlemail.com>

	Replace reprinting decision logic.
	After this change, we no longer need to decide when we need
	to set TCB_REPRINT, and when we don't: it's never needed :)

	Well, almost. That pesky pid-changing execve needs special treatment.
	If not it, it'd be possible to nuke TCB_REPRINT...

	While at it, fix a case of mishandled -C.

	* strace.c (printleader): Do not set TCB_REPRINT.
	(trace): Set TCB_REPRINT only for execve with changing pid.
	Fix mishandling of -C.
	* syscall.c (trace_syscall_entering): Do not clear TCB_REPRINT.
	(trace_syscall_exiting): Replace reprinting decision logic.
	Remove call to printargs(): it is known to just return 0 here.

2012-03-21  Denys Vlasenko  <vda.linux@googlemail.com>

	Report some ptrace failures; nuke tcp->ptrace_errno.
	Report some (not all) ptrace errors, namely,
	errors on ptrace restart operations.

	Before: 10533 sendto(-1, 0x804895e, 17, 0, NULL, 0 <unfinished ...>
	After:  10533 sendto(-1, 0x804895e, 17, 0, NULL, 0 <ptrace(SYSCALL):No such process>

	This tells user that strace failed to let sendto syscall
	to be entered - process was dead at that point of time.
	It is (marginally) better than to always say "<unfinished ...>"

	While at it, patch removes tcp->ptrace_errno.
	I added it many months ago, and it looks that after all
	it is not needed for ptrace error detection: I failed to execute
	a single existing code path which is accessible
	through that variable only.

	* defs.h: Remove struct tcp::ptrace_errno field.
	* strace.c (ptrace_restart): Emit message to log on error.
	(printleader): Remove "if (printing_tcp->ptrace_errno)..." code.
	(trace): Remove !tcp->ptrace_errno check, it's always true.

2012-03-20  Denys Vlasenko  <vda.linux@googlemail.com>

	Eliminate redundant checks of res variable.
	* syscall.c (trace_syscall_entering): Eliminate redundant checks of res variable.
	(trace_syscall_exiting): Likewise.

	Rename POWERPC-specific static variable result to ppc_result.
	* syscall.c: Rename POWERPC-specific static variable result to ppc_result.

	Remove redundant checks in syscall entry/exit, rename badly named function
	* syscall.c (syscall_enter): Rename to get_syscall_args.
	Document its return values.
	(trace_syscall_entering): Don't check get_syscall_args() return
	value for 0, it never returns that.
	(syscall_fixup_on_sysexit): Make it return void.
	(trace_syscall_exiting): Fix up syscall_fixup_on_sysexit()
	call site accordingly.

	Trivial tweaks. No logic changes.
	* process.c (sys_ptrace): Remove unneeded line wrapping.
	* syscall.c (trace_syscall_entering): Use tprints() instead of tprintf().

	Make ptrace_restart() static. No code changes.
	* defs.h: Remove ptrace_restart() declaration.
	* strace.c (ptrace_restart): Move its definition here.
	* util.c (ptrace_restart): Remove its definition.

2012-03-20  Dmitry V. Levin  <ldv@altlinux.org>

	Do not include limits.h unnecessarily.
	* ioctl.c: Remove limits.h inclusion left after the reverted change.

2012-03-20  Denys Vlasenko  <vda.linux@googlemail.com>

	Partially revert last change.
	Thank you Dmitry for spotting it.

	* ioctl.c (compare): Partially revert last change - the new
	comparison logic was buggy.

2012-03-20  Denys Vlasenko  <vda.linux@googlemail.com>

	Simplify search in ioctl table.
	   text	   data	    bss	    dec	    hex	filename
	 236973	    704	  18944	 256621	  3ea6d	strace.before
	 236929	    704	  18944	 256577	  3ea41	strace

	* ioctl.c (compare): Simplify generation of compare result.
	(ioctl_lookup): Pass key directly, not as part of dummy struct.
	(ioctl_next_match): More readable code. No logic changes.

2012-03-19  Denys Vlasenko  <vda.linux@googlemail.com>

	Update qemu build script: now tries to upload result back to host.

2012-03-19  Denys Vlasenko  <vda.linux@googlemail.com>

	Shrink space needed by undefined syscalls in syscall tables.
	Undefined syscall looked like this before this change:
	{ 5,    0,      printargs,              "SYS_53"                },
	That is, "SYS_53" string had to be allocated and stored in strace binary.
	Since now SCNO_IN_RANGE() macro requires sysent[scno].sys_func != NULL
	for valid syscalls, we can replace printargs with NULL in such lines
	and make them "invalid", thus not requiring syscall name string.

	Savings on i386:
	   text	   data	    bss	    dec	    hex	filename
	 237389	    704	  18944	 257037	  3ec0d	strace.before
	 236973	    704	  18944	 256621	  3ea6d	strace
	Savings on mips:
	 336551  153692   38320  528563   810b3 strace.before
	 275543  153688   38320  467551   7225f strace

	Tested to still decode undefined syscalls correctly (syscall no. 222 on i386).

	* linux/*/syscallent.h: Replace 'printargs, "SYS_nnn"' with
	'NULL, NULL'.

2012-03-19  Denys Vlasenko  <vda.linux@googlemail.com>

	Optimize code if we have only one personality.
	On i386:
	   text	   data	    bss	    dec	    hex	filename
	 238025	    672	  18980	 257677	  3ee8d	strace.before
	 237389	    704	  18944	 257037	  3ec0d	strace

	* defs.h: Define PERSONALITY0_WORDSIZE as sizeof(long) if not defined.
	Introduce new define, current_wordsize as
	(personality_wordsize[current_personality]).
	Make set_personality() no-op, current_personality constant zero,
	current_wordsize as PERSONALITY0_WORDSIZE if we have only one personality.
	* count.c (call_summary): Use current_wordsize instead of
	personality_wordsize[current_personality].
	* desc.c (printflock): Likewise.
	* file.c (sys_utime): Likewise.
	* io.c (tprint_iov): Likewise.
	* process.c (printargv): Likewise.
	* resource.c (decode_rlimit): Likewise.
	* signal.c (sys_kill): Likewise.
	(sys_rt_sigaction): Likewise.
	* time.c (sprinttv): Likewise.
	(sprint_timespec): Likewise.
	(printitv_bitness): Likewise.
	(tprint_timex): Likewise.
	(printsigevent): Likewise.
	* util.c (dumpiov): Likewise.
	(umoven): Likewise.
	(umovestr): Likewise.
	* syscall.c: Initialize sysent to sysent0 etc.
	Make current_personality, personality_wordsize[], set_personality()
	conditional on SUPPORTED_PERSONALITIES > 1.

2012-03-18  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix mips64 build failure: sys_pwrite64 doesn't exist.
	sys_pwrite seems to do the same thing as sys_pwrite64
	which we deleted when we removed non-Linux code.

	* linux/mips/syscallent.h: s/sys_pwrite64/sys_pwrite/

2012-03-18  Denys Vlasenko  <vda.linux@googlemail.com>

	qemu_multiarch_testing/: a directory with scripts for build testing.

2012-03-18  Denys Vlasenko  <vda.linux@googlemail.com>

	Make internal_fork and internal_exec static.
	   text	   data	    bss	    dec	    hex	filename
	 237917	    672	  18980	 257569	  3ee21	strace
	 237845	    672	  18980	 257497	  3edd9	strace_new

	* defs.h: Remove declarations of internal_fork and internal_exec.
	* process.c: Remove definitions of internal_fork and internal_exec.
	* syscall.c: Move them here.
	(internal_syscall): Return void instead of int. We were always
	returning zero, and callers weren't checking it anyway.

2012-03-18  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove code which is not used on Linux.
	Compile tested in qemu on armv4l,armv4tl,armv5l,armv6l,i686,
	mipsel,mips,x86_64

	* syscall.c: Remove code which handles RVAL_Lfoo constants.
	* defs.h: Remove struct tcb::u_lrval member - it is never set.
	Remove RVAL_Lfoo constants which signify return of "long" result -
	they are never used.

2012-03-18  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove unused version of sys_lseek.
	It is buggy: it returns RVAL_LUDECIMAL, which means the return value
	is in tcp->u_lrval. But tcp->u_lrval is never set
	(on Linux - it used to be set on other OSes).

	* file.c (sys_lseek): Remove a version of this function which is
	supposed to be used if off_t is long long. It appears to be buggy
	and unused.

2012-03-17  Denys Vlasenko  <vda.linux@googlemail.com>

	Revert "Remove underscores from a few syscall names which have them"
	This reverts commit 31972d52b1059d8faca1c5f417c2db1a90b868ae.

2012-03-17  Denys Vlasenko  <vda.linux@googlemail.com>

	Simplify sys_lseek64 conditional compilation.
	It looks like sys_lseek64() is never used.
	For one, it is buggy (always shows 0 return value), and no one complains.

	From code inspection: sys_lseek64 name is not used anywhere.
	It is defined to sys_lseek if HAVE_LONG_LONG_OFF_T is true.
	Thus, if !HAVE_LONG_LONG_OFF_T, it is never used.
	Therefore "if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T"
	conditional it sits in can be simplified to
	"if HAVE_LONG_LONG_OFF_T".
	Therefore, we can move it a bit up and merge with
	"if !HAVE_LONG_LONG_OFF_T, use this sys_lseek()" code block,
	by addind an "else" clause to it.
	To simplify it more, drop define and just rename sys_lseek64 ->
	sys_lseek.

	Since the function is buggy, I think it is unused and we can
	just drop it. (I checked: at least I386 never uses it).

	* file.c (sys_lseek64): Rename to sys_lseek; don't compile it
	if _LFS64_LARGEFILE but !HAVE_LONG_LONG_OFF_T since in this case
	it is never used.

2012-03-17  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove underscores from a few syscall names which have them.
	Affected names are "_newselect", "_llseek", "_sysctl".
	I see no apparent reason why they have leading underscores.
	Moreover, some arches have underscored names and some have
	non-underscored ones. This is not consistent.

	I verified that every architectire I touched did not have
	a similarly named syscall without underscore, thus this change
	does not introduce new ambiquities.

	I left "_exit" untouched for now, but the same points stand for it too:
	some architectures use "exit" and no one complains. So why many
	arches are using "_exit"?

	* linux/*/syscallent.h: Remove underscores from displayed
	syscall names for _newselect, _llseek, _sysctl.

2012-03-17  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove unused struct tcb::baddr field.
	* defs.h: Remove unused struct tcb::baddr field.

	Remove unused PTRACE_WRITE{TEXT,DATA} constants (they are from SunOS)
	* util.c: Remove unused PTRACE_WRITE{TEXT,DATA} constants.

	Reindent case labels. No code changes.
	* net.c (printsockopt): Reindent case labels.
	* signal.c (sys_signal): Likewise.

	Remove unused constants. No code changes.
	* syscall.c: Remove unused ENOIOCTLCMD constant. Fix indentation.
	* util.c: Remove unused CLONE_STOPPED constant.

	Move change_syscall() to its only user and make it static.
	* defs.h: Remove declaration of change_syscall().
	* process.c (change_syscall): Remove definition of this function.
	* util.c (change_syscall): Add definition of change_syscall().

	MAP_ANON is the same as MAP_ANONYMOUS, no need to have the former.
	* mem.c: Do not allocate string for MAP_ANON if it is the same as
	MAP_ANONYMOUS.

	Indentation and whitespace fixes. No code changes.

	test/threaded_execve: make it also test a case when leader is not in syscall

2012-03-16  Dmitry V. Levin  <ldv@altlinux.org>

	Implement prlimit64 decoding, rewrite [gs]etrlimit decoding.
	* configure.ac: Remove AC_RLIM_T_IS_LONG_LONG call.
	Define SIZEOF_RLIM_T.
	* m4/long_long.m4 (AC_RLIM_T_IS_LONG_LONG): Remove.
	* linux/dummy.h (sys_prlimit64): Remove.
	* linux/syscall.h (sys_prlimit64): New prototype.
	* resource.c (resources): Reindent, add RLIMIT_RTTIME.
	(sprintrlim, print_rlimit32, sys_getrlimit, sys_setrlimit): Remove.
	[HAVE_LONG_LONG_RLIM_T]: Remove dead code.
	[_LFS64_LARGEFILE || HAVE_LONG_LONG_RLIM_T]: Likewise.
	(sprint_rlim64, print_rlimit64, decode_rlimit64, sprint_rlim32,
	print_rlimit32, decode_rlimit, sys_getrlimit, sys_setrlimit,
	sys_prlimit64): New functions.

2012-03-16  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove another "interrupt to quit" message.
	* strace.c (startup_attach): Remove another "interrupt to quit" message.

	Fix "strace -oFILE -ff -p<nonexistant_pid>" behavior.
	* strace.c (newoutf): Set tcp->outf in non-ff mode too.
	(alloctcb): This define is removed.
	(alloc_tcb): Renamed to alloctcb. Does not set tcp->outf anymore.
	Lost 'command_options_parsed' flag parameter.
	(startup_attach): Do not say "interrupt to quit" in attach message -
	^C does not work in all cases, we mislead users.
	Call newoutf(tcp) after successful attach.
	(startup_child): Call newoutf(tcp) after successful attach.
	(trace): Call newoutf(tcp) when we picked up already attached child.

2012-03-16  Denys Vlasenko  <vda.linux@googlemail.com>

	Make alloc_tcb and droptcb static. No code changes.
	The change is trivial. Diff is large because it is confused
	by function definitions being moved around.

	* defs.h: Remove declarations of alloc_tcb and droptcb.
	* strace.c: Make alloc_tcb and droptcb static.
	Shuffle functions around to make compiler happy.

2012-03-16  Denys Vlasenko  <vda.linux@googlemail.com>

	Tidy up includes and copyright notices, fix indentation.
	The files not mentioned in changelog below had only
	copyright notices fixes and indentation fixes.

	* defs.h: Include <stdint.h> and <inttypes.h>.
	* file.c: Do not include <inttypes.h>.
	Move struct kernel_dirent declaration below top include block.
	* block.c: Do not include <stdint.h> and <inttypes.h>.
	* quota.c: Likewise.
	* desc.c: Likewise.
	* signal.c: Likewise.

2012-03-16  Dmitry V. Levin  <ldv@altlinux.org>

	scsi.c: add copyright header.
	* scsi.c: This file was added back in 2007 without a copyright header.
	Add it now.

2012-03-15  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance capget and capset syscalls decoding.
	* system.c (cap_version): New xlat structure.
	(print_cap_header, print_cap_data): New functions.
	(sys_capget, sys_capset): Use them.

	Remove unused code.
	* syscall.c (subcall_style, decode_subcall): Remove.
	[SYS_socket_subcall] (decode_socket_subcall): New function, based on
	decode_subcall in deref_style.
	[SYS_ipc_subcall] (decode_ipc_subcall): New function, based on
	decode_subcall in shift_style.
	(trace_syscall_entering): Use decode_socket_subcall and
	decode_ipc_subcall instead of decode_subcall.

	Fix IPC decoding on alpha and arm.
	* ipc.c (indirect_ipccall): Return 0 on ALPHA and ARM EABI.
	(sys_shmat): Use indirect_ipccall for proper return value decoding.

	arm: fix compilation warnings.
	* configure.ac: Define SIZEOF_LONG.
	* signal.c (sys_rt_sigaction) [SUPPORTED_PERSONALITIES > 1]: Help
	compiler to optimize out unreachable code that is not expected to work
	on platforms where sizeof(long) <= 4.

2012-03-15  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify again buggy shells.
	* tests/init.sh (check_strace): Use "${parameter:-word}" shell syntax
	instead of "${parameter-word}".

	Reported-by: Mike Frysinger <vapier@gentoo.org>

2012-03-15  Mike Frysinger  <vapier@gentoo.org>

	improve ifdef check with decode_subcall.
	Use the same ifdef logic around the call sites of decode_subcall()
	to protect the definition of the func itself.  This fixes warnings
	for targets like hppa which don't use this func.

	* syscall.c (decode_subcall): Wrap in SYS_socket_subcall and
	SYS_ipc_subcall define checks.

2012-03-15  Mike Frysinger  <vapier@gentoo.org>

	alpha: fix decode of osf_sigprocmask.
	The alpha sigprocmask syscall is special in that it comes from OSF rather
	than the style that everyone else uses.

	Tested with this simple code:
	$ cat test.c
	#include <signal.h>
	main() {
		sigset_t set, oldset;
		sigemptyset(&set);
		sigaddset(&set, SIGINT);
		sigaddset(&set, SIGHUP);
		sigprocmask(SIG_SETMASK, &set, &oldset);
		sigprocmask(SIG_UNBLOCK, &oldset, &set);
		sleep(3);
	}
	$ gcc test.c && ./strace ./a.out
	...
	osf_sigprocmask(SIG_SETMASK, [HUP INT]) = 0 (old mask [])
	osf_sigprocmask(SIG_UNBLOCK, [])        = 0x3 (old mask [HUP INT])
	osf_sigprocmask(SIG_BLOCK, [CHLD])      = 0x3 (old mask [HUP INT])
	...

	* linux/alpha/syscallent.h: Call sys_sigprocmask for osf_sigprocmask,
	and change number of arguments to two.
	* signal.c (sys_sigprocmask): Fix decoding of alpha osf sigprocmask.

2012-03-15  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix array size calculation in previous commit.
	* pathtrace.c (getfdpath): Fix array size calculation.

2012-03-15  Denys Vlasenko  <vda.linux@googlemail.com>

	pathtrace_select() is never called with NULL, remove dead code.
	pathtrace_select() is only called for -P FILE options,
	and FILE is never a NULL pointer.

	   text	   data	    bss	    dec	    hex	filename
	 239453	    672	  19012	 259137	  3f441	strace.before
	 239329	    672	  19012	 259013	  3f3c5	strace

	* pathtrace.c (pathtrace_select): Remove "if (path == NULL)...".
	(pathtrace_select): Remove code which only executes if path == NULL.
	The code was also buggy, it can free non-malloced pointer.
	(getfdpath): Simplify snprintf to sprintf.
	(pathmatch): Use strcmp() == 0 idiom for string equality test.
	(pathtrace_match): Likewise.

2012-03-15  Denys Vlasenko  <vda.linux@googlemail.com>

	manpage: remove bugs which are fixed.
	"A traced process ignores SIGSTOP" - fixed, expected to be in linux-3.4.x.
	"A traced process which tries to block SIGTRAP will be sent a SIGSTOP
	in an attempt to force continuation of tracing." - not needed
	and no longer done.
	"On Linux, exciting as it would be, tracing the init process is forbidden"
	- not true anymore.
	"When a traced process receives a SIGTRAP signal not
	associated with tracing, strace will not report that signal correctly."
	- not true anymore.

	Simplify SIGCHLD handler setting.
	* strace.c (init): Set SIGCHLD to SIG_DFL earlier.
	(startup_child): Do not bother restoring SIGCHLD handler.

	When reporting signals, use short signal names (SIGfoo) instead of strerror
	* defs.h: Remove strsignal declaration.
	* signal.c: Better check for SI_FROMUSER define.
	* strace.c (strerror): Remove this function.
	(trace): Use short signal names (SIGfoo) instead of strerror.

	Remove TODO file: it's eleven years old and completely outdated.

	Clean up defs.h order. No code changes.
	* defs.h: Group together related declarations. No code changes.

2012-03-15  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix lame kernel version checking code.
	The code "os_release[0] >= '3'" is not good for any
	finer-grained checks such as "kernel >= 3.2.1".
	Let's proactively fix it.

	* strace.c: Change os_release from string to integer.
	(get_os_release): Parse uname.release to KERNEL_VERSION
	representation.
	(init): Convert kernel version check to KERNEL_VERSION.

2012-03-15  Denys Vlasenko  <vda.linux@googlemail.com>

	Experimental support for "detach on execve" feature.
	* strace.c: Define new detach_on_execve, skip_startup_execve bool variables.
	(init): Set detach_on_execve on -b, set skip_startup_execve if
	"strace PROG" form is used.
	(trace): Detach from process if -b and we see PTRACE_EVENT_EXEC event.

	Simple fixes.
	* strace.c (usage): Document -d; document that -F is deprecated.
	(droptcb): Print "<detached ...>" correctly for non-ff mode too.
	(detach): Suppress a warning.

	Remove an outdated comment.
	* defs.h: Remove an outdated comment.

	Remove extra include directives. No code changes.
	* defs.h: Include <signal.h> unconditionally.
	Other files were doing it unconditionally, so no harm done.
	* bjm.c: Remove system includes which are already included by defs.h.
	* pathtrace.c: Likewise.
	* process.c: Likewise.
	* signal.c: Likewise.
	* strace.c: Likewise.
	* stream.c: Likewise.
	* syscall.c: Likewise.
	* system.c: Likewise.
	* util.c: Likewise.

2012-03-15  Denys Vlasenko  <vda.linux@googlemail.com>

	Tidy up order of includes; make bool variables explicit.
	Bool variables are more compact in data and (on x86) on code too:

	   text	   data	    bss	    dec	    hex	filename
	 237950	    676	  19044	 257670	  3ee86	strace.before
	 237838	    676	  19012	 257526	  3edf6	strace

	* defs.h: Group library includes at the top of the file.
	Rename dtime to Tflag, debug to debug_flag.
	Change debug_flag,Tflag,qflag,not_failing_only,show_fd_path,tracing_paths
	variable declarations from int to bool.
	* strace.c: Change corresponding definitions. Do the same for static
	variables iflag,rflag,print_pid_pfx.
	Rename dtime to Tflag, debug to debug_flag.
	* syscall.c: Rename dtime to Tflag, debug to debug_flag.

2012-03-15  Dmitry V. Levin  <ldv@altlinux.org>

	Fix compiler warnings about breaking strict-aliasing rules.
	* system.c (sys_capget, sys_capset): Use proxy unions to cast long*
	pointers to cap_user_header_t and cap_user_data_t pointers without
	breaking strict-aliasing rules.

	Reported-by: Mike Frysinger <vapier@gentoo.org>

2012-03-15  Mike Frysinger  <vapier@gentoo.org>

	ppc64: drop unused pid variable.
	* syscall.c (get_scno) [POWERPC64]: Delete unused pid variable.

2012-03-15  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: fix compilation warnings.
	* linux/ia64/syscallent.h: Remove improper defines and undefs.

	Reported-by: Mike Frysinger <vapier@gentoo.org>

2012-03-15  Dmitry V. Levin  <ldv@altlinux.org>

	Ensure that SWAP_FLAG_* constants are defined.
	* file.c: Define those of SWAP_FLAG_* constants which are not yet
	provided by <sys/swap.h>.

	Reported-by: Mike Frysinger <vapier@gentoo.org>

2012-03-14  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance *listxattr syscalls decoding.
	* file.c (print_xattr_list): New function.
	(sys_listxattr, sys_flistxattr): Use it.

2012-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	Fix *at syscalls flags decoding.
	Several *at decoders were defining own incomplete *atflags xlat
	structures.  That was error prone, and fchownat decoder actually
	failed to recognize AT_EMPTY_PATH.  Merging these incomplete
	structures into the single at_flags xlat structure will fix
	flags handling in all these decoders altogether.

	* file.c: Define all AT_* constants used by *at decoders.
	(at_flags): New xlat structure, with records for all AT_* constants.
	(fstatatflags, linkat_flags, unlinkatflags): Remove.
	(sys_newfstatat, sys_linkat, sys_unlinkat, sys_fchownat,
	sys_utimensat):  Use at_flags.

2012-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	Fix linkat flags decoding.
	* file.c (linkat_flags): New xlat structure.
	(sys_linkat): Decode flags using linkat_flags.

	Implement sys_rt_tgsigqueueinfo syscall decoder.
	* linux/dummy.h (sys_rt_tgsigqueueinfo): Remove.
	* linux/syscall.h (sys_rt_tgsigqueueinfo): New prototype.
	* signal.c (print_sigqueueinfo): New function, based on
	sys_rt_sigqueueinfo.
	(sys_rt_sigqueueinfo): Use print_sigqueueinfo.
	(sys_rt_tgsigqueueinfo): New function.

	Implement syslog syscall decoder.
	* linux/dummy.h (sys_syslog): Remove.
	* linux/syscall.h (sys_syslog): New prototype.
	* system.c (syslog_action_type): New xlat structure.
	(sys_syslog): New function.

2012-03-13  Denys Vlasenko  <vda.linux@googlemail.com>

	Less ugly debug display of ptrace events.
	* strace.c (trace): Less ugly debug display of ptrace events.

	Make manpage mention that -p "`pidof PROG`" works.

2012-03-13  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix logging for "strace -o FILE -ff test/threaded_execve" test case.
	Our logic which was deciding whether to print "<unfinished ...>"
	thingy wasn't working properly for -ff case.

	* defs.h: Group log generation-related declarations together.
	Add a large comment which explains how it works.
	Add declaration of line_ended() function.
	* strace.c (line_ended): New function which sets up internal data
	to indicate that previous line was finished.
	(printleader): Change logic to fix log generation in -ff mode.
	(newoutf): Make check for -ff mode consistent with other places.
	(droptcb): Print "<detached ...>" if last line for this tcp wasn't finished.
	(cleanup): Remove code to print "<unfinished ...>", printleader()
	or detach() will do it instead.
	(trace): Remove code to print "<unfinished ...>".
	Add code which finishes threaded execve's incomplete line
	with " <pid changed to PID ...>" message. Replace printing_tcp = NULL
	followed by fflush() by line_ended() call.
	* process.c (sys_exit): Call line_ended() to indicate that we finished priting.
	* syscall.c (trace_syscall_exiting): Set printing_tcp to current tcp.
	Call line_ended() to indicate that we finished priting.
	Remove call to fflush(), it is done by line_ended() now.

2012-03-13  Dmitry V. Levin  <ldv@altlinux.org>

	net.c: recognize MSG_WAITFORONE.
	* net.c (msg_flags): Add MSG_WAITFORONE.

2012-03-12  Denys Vlasenko  <vda.linux@googlemail.com>

	Treat -ff without -o FILE as single -f.
	* strace.c (init): Treat -ff without -o FILE as single -f.

	Style fix. No code changes.
	* strace.c (process_opt_p_list): Style fix.

2012-03-12  Denys Vlasenko  <vda.linux@googlemail.com>

	Reduce stack usage by ~0.5k.
	main() uses ~0.5k of stack for local variables and such. When we enter
	main tracing loop, most of these variables are no longer used.
	But they still take up stack for the entire life of strace.
	We can avoid this wastage if we move init code into a separate function.
	(Need to be careful and not allow automatic inlining).

	* strace.c (init): New function. Most of pre-existing code of
	main is now living here.
	(main): Call init() to do initialization.

2012-03-12  Denys Vlasenko  <vda.linux@googlemail.com>

	Preparatory cosmetic changes for the next commit.
	* strace.c (tprintf): Move function up in the source file. No code changes.
	(tprints): Likewise.
	(printleader): Likewise.
	(tabto): Likewise.

2012-03-11  Dmitry V. Levin  <ldv@altlinux.org>

	Implement sendmmsg syscall decoder.
	* linux/dummy.h (sys_sendmmsg): Remove.
	* linux/syscall.h (sys_sendmmsg): New prototype.
	* net.c (printmmsghdr): Add index argument specifying the element in
	mmsghdr array to print.
	(decode_mmsg): New function, prints the whole mmsghdr array, its length
	and message flags.
	(sys_sendmmsg): New function.
	(sys_recvmmsg): Use decode_mmsg to fix mmsghdr array decoding.

	Implement sched_rr_get_interval syscall decoder.
	* linux/dummy.h (sys_sched_rr_get_interval): Remove.
	* linux/syscall.h (sys_sched_rr_get_interval): New prototype.
	* process.c (sys_sched_rr_get_interval): New function.

	Implement migrate_pages syscall decoder.
	* linux/dummy.h (sys_migrate_pages): Remove.
	* linux/syscall.h (sys_migrate_pages): New prototype.
	* mem.c (sys_migrate_pages): New function.

	Implement get_robust_list syscall decoder.
	* linux/dummy.h (sys_get_robust_list): Remove.
	* linux/syscall.h (sys_get_robust_list): New prototype.
	* process.c (sys_get_robust_list): New function.

	Define sys_set_robust_list as an alias to sys_munmap.
	* linux/dummy.h (sys_set_robust_list): Redefine to sys_munmap.

	Implement clock_adjtime syscall decoder.
	* linux/dummy.h (sys_clock_adjtime): Remove.
	* linux/syscall.h (sys_clock_adjtime): New prototype.
	* time.c (do_adjtimex): New function, based on sys_adjtimex.
	(sys_adjtimex): Use it.
	(sys_clock_adjtime): New function.

	Define sys_setns as an alias to sys_inotify_rm_watch.
	* linux/dummy.h (sys_setns): Redefine to sys_inotify_rm_watch.

	Sort definitions of dummy parsers.  No code changes.
	* linux/dummy.h: Sort definitions of parsers implemented as aliases.

	Correct inotify_rm_watch decoder.
	* file.c (sys_inotify_rm_watch): Print second argument as int.

	Alias sys_fsync to sys_close.
	* file.c (sys_fsync): Remove.
	* linux/syscall.h (sys_fsync): Likewise.
	* linux/dummy.h (sys_fsync): Alias to sys_close.
	* linux/m68k/syscallent.h: Add TD flag to fsync entry.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.

2012-03-10  Dmitry V. Levin  <ldv@altlinux.org>

	Update ioctl entries.
	* linux/ioctlent.h.in: Regenerate from v3.3 headers.
	* linux/i386/ioctlent.h.in: Likewise.

	strace-log-merge: cleanup.
	* strace-log-merge: Redirect usage to stderr, make the check
	for numeric suffix simpler.

	Add syscall entries for new linux syscalls.
	* linux/i386/syscallent.h: Update process_vm_writev handler.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Add entries for accept4 and sendmmsg.
	* linux/arm/syscallent.h: Add entries for process_vm_readv and
	process_vm_writev.
	* linux/m68k/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Add entries for process_vm_readv,
	process_vm_writev and accept4.
	* linux/microblaze/syscallent.h: Add entries for sendmmsg,
	process_vm_readv and process_vm_writev.

	Implement process_vm_writev decoder.
	* process.c (sys_process_vm_writev): New function.
	* linux/syscall.h (sys_process_vm_writev): New prototype.

	Output iovec length in vmsplice and process_vm_readv decoders.
	* io.c (sys_vmsplice): Output iovec length.
	* process.c (sys_process_vm_readv): Likewise.

2012-03-09  Dmitry V. Levin  <ldv@altlinux.org>

	swapon: decode swap flags.
	* file.c: Include <sys/swap.h>.
	(swap_flags): New xlat structure.
	(sys_swapon): New function.
	* linux/dummy.h (sys_swapon): Remove.
	* linux/syscall.h (sys_swapon): New declaration.

2012-03-09  Denys Vlasenko  <vda.linux@googlemail.com>

	Trivial simplification.
	* strace.c (detach): Use waitpid instead of wait4.

2012-03-09  Denys Vlasenko  <vda.linux@googlemail.com>

	Don't consider PROG to be our child in "strace -D PROG" case.
	TCB_STRACE_CHILD is used for the case when "strace PROG" is ^C-ed
	or something like that. strace should not just exit - it should
	do something with its child (such as signal it too).

	In -D case, PROG is not really a child of _strace_, it is a child
	of strace's parent. It's ok to handle it exactly as an attached process.

	While we are at it, remove nonsensical special-casing of TCB_STRACE_CHILD
	in printing of "<unfinished ...>" message.

	* strace.c (startup_attach): Don't set TCB_STRACE_CHILD if -D.
	(trace): Print "<unfinished ...>" on error regardless of TCB_STRACE_CHILD.

2012-03-09  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix the case where we try to detach unattached processes.
	Before this change:
	$ strace -D -p1
	strace: -D and -p are mutually exclusive options
	Process 1 detached  <==== WRONG! (and we try to SIGSTOP it!!!)

	* defs.h: Change the meaning of TCB_ATTACHED: now it means "this tracee
	is attached to us". Add TCB_STRACE_CHILD: "this tracee is our child".
	* strace.c (kill_save_errno): Move up. No code changes.
	(process_opt_p_list): Don't set TCB_ATTACHED on new tcb.
	(startup_attach): Change how we work with TCB_ATTACHED.
	Set TCB_STRACE_CHILD on -D.
	(startup_child): Use kill_save_errno instead of kill.
	Set TCB_ATTACHED and TCB_STRACE_CHILD on attached strace child.
	If we are in -D case, don't set TCB_ATTACHED (we aren't attached yet).
	(detach): do not do PTRACE_DETACH if TCB_ATTACHED is not set.
	(cleanup): Check TCB_STRACE_CHILD instead of TCB_ATTACHED.
	(trace): Likewise.

2012-03-09  Denys Vlasenko  <vda.linux@googlemail.com>

	Call PTRACE_CONT with addr=0.
	* strace.c (trace): Call PTRACE_CONT with addr=0.

	install strace-log-merge by "make install"

	strace_log_merge: new file. Helper to merge timestamped strace -ff logs.

2012-03-09  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix PID prefix printing in "strace -oLOG -ff -p1 -p2 -p3" case.
	In this case we were printing PIDs to LOG.* files
	even though it is not necessary.

	The fix is in the addition of "&& followfork < 2" condition.

	* strace.c: Remove pflag_seen variable, add print_pid_pfx one.
	(process_opt_p_list): Do not pflag_seen++.
	(main): Use "nprocs != 0" condition instead of "pflag_seen != 0".
	Set print_pid_pfx before entering main tracing loop.
	(printleader): Use print_pid_pfx to decide whether to print pid prefix.

2012-03-09  Denys Vlasenko  <vda.linux@googlemail.com>

	Allow -p PID to take comma or whitespace-separated list of PIDs.
	* defs.h: Clarify meaning of TCB_ATTACHED. No code changes.
	* strace.c (process_opt_p_list): New function.
	(main): Call process_opt_p_list to process -p PIDs argument.

2012-03-08  Denys Vlasenko  <vda.linux@googlemail.com>

	Pass addr=0 instead of 1 into restarting ptrace calls.
	While we are at it, fold do_ptrace into its lone caller.
	We no longer set tcp->ptrace_errno = ESRCH on ESRC error in upeek.
	Other code paths where ptrace fails wern't doing it, and the code which
	checks tcp->ptrace_errno even assumes it is never set to ESRCH.
	(It was me who added this code sometime ago, so it was my fault
	that it was a bit messy)

	I ran sigkill_rain test and verified that unfinished syscalls are
	still handled correctly.

	* util.c (ptrace_restart): Do not pass addr=1 to ptrace(), pass 0 instead.
	I have no idea why we were passing 1. Ptrace documentation says
	that addr parameter is ignored.
	(do_ptrace): Remove this function.
	(upeek): Use ptrace() instead of do_ptrace().
	* defs.h: Remove do_ptrace() declaration.

2012-03-08  Denys Vlasenko  <vda.linux@googlemail.com>

	Trivial tweaks to error messages.
	* strace.c (test_ptrace_setoptions_followfork): Use kill_save_errno
	instead of kill.
	(trace): Use perror_msg instead of perror.
	* count.c (set_sortby): Use error_msg_and_die instead of fprintf.
	* syscall.c (qualify): Likewise.
	* util.c (ptrace_restart): Expand error message.
	(umoven): Likewise.
	(umovestr): Likewise.
	(upeek): Use perror_msg instead of sprintf + perror.

2012-02-28  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove stray sys_swapon() declaration.
	* linux/syscall.h: Remove stray sys_swapon() declaration.
	* linux/mips/syscallent.h: Include dummy.h with correct relative path.
	* linux/dummy.h: Tweak one place where spaces are used instead of tabs.
	* linux/dummy_check.sh: New script. It helps in finding stray syscall
	handler declarations.

2012-02-27  Denys Vlasenko  <vda.linux@googlemail.com>

	Correct syscall entries for t[g]kill.
	* linux/hppa/syscallent.h: Make tgkill use sys_tgkill, not printargs.
	* linux/sh/syscallent.h: Change tkill type TD -> TS.
	* linux/sh64/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Change tkill type 0 -> TS.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.

2012-02-27  Denys Vlasenko  <vda.linux@googlemail.com>

	Assorted trivial optimizations.
	   text	   data	    bss	    dec	    hex	filename
	 236448	    672	  19044	 256164	  3e8a4	strace.before
	 236360	    672	  19044	 256076	  3e84c	strace

	* file.c (sprintmode): Use smaller static buffer, eliminate strlen call.
	(sprinttime): Use smaller static buffer.
	(printstat_sparc64): Coalesce two printing calls into one.
	(printstat_powerpc32): Likewise.
	(printcompat_statfs6): Likewise.
	(sys_utime): Do not fetch personality_wordsize[current_personality]
	repeatedly - cache it in local variable instead.
	* process.c (printargv): Likewise.
	* resource.c (sprintrlim): Return const char*, not char*. This allows
	to eliminate sprintf(buf, "RLIM_INFINITY"). Use smaller static buffer.
	(sprintrlim64): Likewise.
	* strace.c (strerror): Use smaller static buffer.
	(strsignal): Likewise.

2012-02-27  Denys Vlasenko  <vda.linux@googlemail.com>

	Alias a few more syscall printing functions.
	   text	   data	    bss	    dec	    hex	filename
	 237384	    672	  19044	 257100	  3ec4c	strace.before
	 236448	    672	  19044	 256164	  3e8a4	strace

	* defs.h: Declare new functions printargs_lu(), printargs_ld()
	which simply print syscall all args as unsigned or signed longs.
	* desc.c (sys_epoll_create): Call printargs_ld() instead of open-coding it.
	* linux/syscall.h: Remove declarations of the following functions:
	sys_alarm, sys_getresgid, sys_getsid, sys_nice, sys_setgid, sys_setpgid,
	sys_setpgrp, sys_setregid, sys_setresgid.
	* process.c (sys_setgid): Delete this function: now aliased to sys_setuid().
	(sys_getresgid): Delete this function: now aliased to sys_getresuid().
	(sys_setregid): Delete this function: now aliased to sys_setreuid().
	(sys_setresgid): Delete this function: now aliased to sys_setresuid().
	(sys_setpgrp): Delete this function: now aliased to printargs_lu().
	(sys_getsid): Likewise.
	(sys_setpgid): Likewise.
	(sys_alarm): Likewise.
	(sys_getpgrp): Delete this function: was unused - was already shadowed
	by a define in linux/dummy.h.
	(sys_setsid): Likewise.
	(sys_getpgid): Likewise.
	* resource.c (sys_nice): Delete this function: now aliased to printargs_ld().
	* linux/dummy.h: Define new aliases (see above for the list).
	* syscall.c (printargs_lu): New function.
	(printargs_ld): New function.

2012-02-27  Denys Vlasenko  <vda.linux@googlemail.com>

	Style fixes, no code changes.
	* desc.c (sys_io_getevents): Indentation fix.
	* file.c (sys_xstat): Remove space after function name.
	(decode_mknod): Indentation fix.
	* net.c (printsockopt): Indentation fix.
	* process.c (unalignctl_string): Indentation fix.
	(sys_sched_getscheduler): Remove space after ! operator.

2012-02-25  Dmitry V. Levin  <ldv@altlinux.org>

	Compress blank lines.
	Suppress repeated empty lines left after automated code removal.
	This change was made by filtering every source code file through
	"cat -s".

2012-02-25  Dmitry V. Levin  <ldv@altlinux.org>

	Remove parts of automake machinery which are not needed on Linux.
	This change is a verbatim part of Dmitry's changes to remove support
	for non-Linux architectures.

	* Makefile.am: Don't install PORTING file. Install README-linux-ptrace file.
	Set OS variable to linux unconditionally.
	* configure.ac: Remove code to set opsys variable, and its usage.
	Remove checks for headers which are never present on Linux.
	* m4/stat.m4: Remove 'ifdef LINUX' check.
	* m4/statfs.m4: Likewise.

2012-02-25  Dmitry V. Levin  <ldv@altlinux.org>

	Remove and update documentation.
	This change is a verbatim part of Dmitry's changes to remove support
	for non-Linux architectures.

	* PORTING: Deleted.
	* INSTALL: Modified.
	* README: Modified.
	* strace.1: Modified: bugs should be reported to mailing list, not Debian.
	* strace.spec: do not install PORTING file.

2012-02-25  Denys Vlasenko  <vda.linux@googlemail.com>

	Remove a few more code parts which are unused on Linux.
	This change is abapted from Dmitry's changes to remove support for
	non-Linux architectures.

	* Makefile.am: Remove if LINUX/endif pairs.
	* defs.h: Remove stream_ioctl() declaration.
	* ioctl.c (ioctl_decode): Remove 'ifdef HAVE_SYS_STREAM_H' block.
	* resource.c: Use 'defined(FOO)' instead of 'defined FOO' form.
	* util.c: Likewise.
	* signal.c: Remove conditional includes which are never used on Linux.
	* stream.c: Likewise.
	* file.c: Remove excessive empty lines.

2012-02-25  Denys Vlasenko  <vda.linux@googlemail.com>

	Build fixes after non-Linux code removal.
	* configure.ac: Remove calls to proc-based ptrace checks.
	* proc.c: Remove, it's empty now.
	* Makefile.am: Remove reference to proc.c.
	* net.c: Remove trailing newlines.
	* quota.c: Likewise
	* resource.c: Likewise
	* strace.c: Likewise
	* stream.c: Likewise
	* time.c: Likewise

	Fix defined(FOO) style.
	* file.c: Consistently use defined(FOO) instead of defined (FOO).
	* mem.c: Likewise.
	* net.c: Likewise.
	* signal.c: Likewise.
	* sock.c: Likewise.
	* linux/mips/syscallent.h: Likewise.

	Reindent preprocessor directives in util.c; fix style.
	* util.c: Fix indentation of preprocessor directives broken by
	automatic removal of non-Linux code. Fix style to use consistent
	defined(FOO) instead of defined (FOO).

	Reindent preprocessor directives in syscall.c; fix style.
	* syscall.c: Fix indentation of preprocessor directives broken by
	automatic removal of non-Linux code. Fix style to use consistent
	defined(FOO) instead of defined (FOO).

	Reindent defs.h preprocessor directives.
	* defs.h: Fix indentation of preprocessor directives broken by
	automatic removal of non-Linux code.

	Cleanup after non-Linux code removal.
	Conditions such as defined(LINUX) are always true now,
	defined(FREEBSD) etc are always false.
	When if directive has them as subexpressions, it can be simplified.
	Another trivial changes here are fixes for directive indentation.

2012-02-25  Denys Vlasenko  <vda.linux@googlemail.com>

	Manual removal of non-Linux source, documentation, etc.
	Remove non-Linux source directories: freebsd/, svr4/, sunos4/, svr4/.
	Remove README-freebsd, README-sunos4, README-svr4, m4/procfs.m4.

	linux/sparc/{errnoent1,ioctlent1,signalent1}.h used to point to svr4/ files -
	replace their contents with copies of used (and now deleted) files.
	Make linux/sparc64/{errnoent1,ioctlent1,signalent1}.h include these files
	instead of svr4/* ones.

	Makefile.am: remove references to deleted files.
	configure.ac: Remove a few tests which make no sense on Linux.
	Man page: remove non-Linux quirks information.

2012-02-25  Denys Vlasenko  <vda.linux@googlemail.com>

	Automated removal of non-Linux code.
	This change is generated by running every source through the following command:

	unifdef -DLINUX -Dlinux -USUNOS4 -USVR4 -UUNIXWARE -UFREEBSD
	-USUNOS4_KERNEL_ARCH_KLUDGE -UHAVE_MP_PROCFS
	-UHAVE_POLLABLE_PROCFS -UHAVE_PR_SYSCALL -UUSE_PROCFS file.c

2012-02-24  Denys Vlasenko  <vda.linux@googlemail.com>

	When accessing data blocks, truncate addr to wordsize.
	* util.c (umoven): Truncate addr to wordsize before use.

2012-02-22  Dmitry V. Levin  <ldv@altlinux.org>

	strace.1: fix a typo.
	* strace.1: Fix a typo in example description.
	This fixes Debian bug #653309.

	Fix sockaddr_un.sun_path name in decoded output.
	* net.c (printsock): Show sockaddr_un.sun_path as "sun_path".
	This fixes Debian bug #554946.

	Avoid potential core file clobbering on exit.
	* strace.c (main): Set RLIMIT_CORE to zero before terminating itself
	with a deadly signal.
	This fixes Debian bug #656398.

2012-02-20  Dmitry V. Levin  <ldv@altlinux.org>

	Eliminate native_scno and known_scno.
	* defs.h (known_scno): Remove.
	(sysent): Remove native_scno field.
	* process.c [IA64]: Replace known_scno(tcp) with tcp->scno.
	(internal_fork) [USE_PROCFS || !LINUX]: Likewise.
	* syscall.c: Do not define NR_SYSCALL_BASE.
	(known_scno): Remove.
	(syscall_fixup_on_sysenter) [USE_PROCFS]: Replace known_scno(tcp)
	with tcp->scno.
	(trace_syscall_entering) [SVR4 || FREEBSD || SUNOS4]: Likewise.
	(syscall_fixup_on_sysexit) [SUNOS4]: Likewise.

	Remove initialization of native_scno field.
	* linux/i386/syscallent.h: Remove native_scno initialization for clone,
	fork and vfork.
	* linux/ia64/syscallent.h (sys_fork, sys_vfork): Remove redirections
	to printargs.
	* linux/syscall.h [IA64]: Do not define SYS_fork and SYS_vfork.
	* util.c (printcall) [IA64]: Likewise.
	(setbpt): Use sys_func to check for clone, fork and vfork syscalls.

	Do not use SYS_ipc and SYS_socketcall.
	* linux/dummy.h (sys_ipc, sys_socketcall): Remove redirections to
	printargs.
	* linux/ia64/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Remove native_scno initialization for "ipc"
	and "socketcall".
	* linux/syscall.h (sys_ipc, sys_socketcall): New prototypes.
	(SYS_ipc, SYS_socketcall): Remove no longer used constants.
	[IA64]: Remove undefining of ipc and socket SYS_* constants.
	[SPARC || SPARC64]: Remove unused ipc SYS_* constants.
	* ipc.c (sys_ipc): New function.
	* sock.c (sys_socketcall): Likewise.
	* syscall.c (trace_syscall_entering): Use sys_func to check for ipc and
	socket subcalls.

2012-02-20  Dmitry V. Levin  <ldv@altlinux.org>

	Remove initialization of native_scno field for most of syscalls.
	The native_scno field is not so much used in the code than before.
	In many cases sys_func is checked instead, and for most of syscall
	entries there is no need to initialize native_scno.

	* linux/i386/syscallent.h: Remove native_scno initialization for
	_exit, read, write, waitpid, execve, wait4, sysfs, readv, writev,
	pread64, pwrite64, exit_group, waitid, send, recv, sendto and
	recvfrom syscall entries.
	* linux/syscall.h: Do not define no longer used SYS_waitid and
	SYS_sub_* constants.
	[IA64]: Do not define SYS_waitpid and SYS32_* constants.
	* defs.h: Do not define no longer used  __NR_exit_group constant.
	* strace.c [USE_PROCFS] (proc_open): Use sys_func to check for execve.

2012-02-14  Mike Frysinger  <vapier@gentoo.org>

	util: check for process_vm_readv in C library.
	glibc-2.15 provides process_vm_readv, so trying to provide it ourselves
	with that version fails.

	* configure.ac (AC_CHECK_FUNCS): Add process_vm_readv.
	* util.c: Handle HAVE_PROCESS_VM_READV.

2012-02-09  Denys Vlasenko  <vda.linux@googlemail.com>

	README-linux-ptrace: correct the description of suppressed signals.

2012-02-06  Dmitry V. Levin  <ldv@altlinux.org>

	strace -P: fix handling of invalid syscalls.
	* pathtrace.c (pathtrace_match): Check the given syscall number using
	SCNO_IN_RANGE.

2012-02-06  H.J. Lu  <hongjiu.lu@intel.com>

	Skip the syscall entry if the sys_func field is NULL.
	Avoid NULL dereference when there are holes in sysent tables.
	It can happen with syscall (number, ...) and number is in those holes.
	There are no targets with holey systent tables so far, but at least
	one such a target, x32, is already on the horizon.

	* defs.h (SCNO_IN_RANGE): Also check the sys_func field.

2012-02-06  H.J. Lu  <hongjiu.lu@intel.com>

	Define RLIM64_INFINITY only if not defined.
	* resource.c (RLIM64_INFINITY): Define only if it isn't defined.

2012-02-06  H.J. Lu  <hongjiu.lu@intel.com>

	Cast to long for %l in printf.
	Cast a value to long for %l in printf to avoid compiler warning
	on systems where it may be long long.

	* count.c (call_summary_pers): Cast to long.
	* ipc.c (sys_mq_open, printmqattr): Likewise.
	* quota.c (decode_cmd_data): Likewise.
	* resource.c (sys_sysinfo): Likewise.
	* time.c (tprint_timex): Likewise.

2012-02-06  H.J. Lu  <hongjiu.lu@intel.com>

	Check HAVE_LONG_LONG_OFF_T when printing offset.
	When HAVE_LONG_LONG_OFF_T is defined, we need to use %llu to print
	offset.

	* io.c (sys_sendfile): Check HAVE_LONG_LONG_OFF_T when printing
	offset.

2012-02-06  H.J. Lu  <hongjiu.lu@intel.com>

	Define old stat functions only if needed.
	When HAVE_LONG_LONG_OFF_T is defined, those old stat functions aren't
	used and strace won't link since they use realprintstat which isn't
	defined when HAVE_LONG_LONG_OFF_T is defined.

	* file.c (convertoldstat, sys_oldstat, sys_oldfstat, sys_oldlstat):
	Define only if HAVE_LONG_LONG_OFF_T isn't defined.

2012-02-06  H.J. Lu  <hongjiu.lu@intel.com>

	Print NULL for zero address in sys_mmap64.
	* mem.c (sys_mmap64): Print NULL for zero address so that it is
	consistent with sys_mmap.

2012-02-04  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unused sys_pread64 and sys_pwrite64 parsers on Linux.
	* io.c [HAVE_LONG_LONG_OFF_T]: Remove sys_pread64 and sys_pwrite64
	aliases.
	(sys_pread64, sys_pwrite64): Define these functions only on
	[SVR4 && _LFS64_LARGEFILE] platform.
	* linux/mips/syscallent.h: Use sys_pread and sys_pwrite to handle
	appropriate syscalls.
	* linux/syscall.h (sys_pread64, sys_pwrite64): Remove.
	* syscall.c (dumpio): Check sys_pread64 and sys_pwrite64 only on
	[SVR4 && _LFS64_LARGEFILE] platform.

2012-02-03  Denys Vlasenko  <vda.linux@googlemail.com>

	Trivial changes to help text. No code changes.
	* strace.c (usage): Tweak help text: remove unpaired closing brackets,
	make -V and -h sit on separate lines (hard to see them otherwise).

2012-01-29  Denys Vlasenko  <vda.linux@googlemail.com>

	Simple optimizations.
	   text	   data	    bss	    dec	    hex	filename
	 239474	    672	  20484	 260630	  3fa16	strace.before
	 239234	    668	  19044	 258946	  3f382	strace

	* file.c (sprint_open_modes): Reduce static buffer size.
	Simplify separator printing.
	* signal.c (sprintsigmask): Reduce static buffer size.
	Simplify separator printing and printing of almost full masks.
	Use stpcpy instead of sprintf and strcpy+strlen.
	* strace.c (startup_child): Don't strchr() for ':' twice in a row.
	* util.c (sprintflags): Exit loop early if possible.

2012-01-29  Denys Vlasenko  <vda.linux@googlemail.com>

	Trivial optimization.
	* strace.c (cleanup): Read 'interrupted' volatile variable only once.

2012-01-29  Denys Vlasenko  <vda.linux@googlemail.com>

	Make interactive-ness directly controllable via command line option.
	Defaults are often ok, but when they are not, people get confused.
	"Why can't I kill strace?" and "Why strace dies on ^C when I want
	to _tracee_ to die instead?" are typical complaints.

	* strace.c: Replace 'interactive' variable with 'opt_intr' variable.
	Define INTR_foo constants for its possible values.
	Define 'interactive' as a macro.
	(usage): Document -I n option.
	(main): Parse -I n option, modify signal handling to accomidate new
	-I 1 and -I 4 modes.

2012-01-29  Denys Vlasenko  <vda.linux@googlemail.com>

	Suppress compiler warning.
	* strace.c (trace): Frame potentially unused label with ifdef/endif.

	On Ctrl-C induced detach, send SIGINT to child tracee, not SIGTERM.
	* strace.c (interrupt): Remember signal number.
	(cleanup): If we exiting due to signal, send that signal to child tracee.

2012-01-29  Denys Vlasenko  <vda.linux@googlemail.com>

	Add experimental code to use PTRACE_SEIZE, disabled by default.
	All new code is predicated on "ifdef USE_SEIZE". If it is not defined,
	behavior is not changed.

	If USE_SEIZE is enabled and run-time check shows that PTRACE_SEIZE works, then:
	- All attaching is done with PTRACE_SEIZE + PTRACE_INTERRUPT.
	  This means that we no longer generate (and possibly race with) SIGSTOP.
	- PTRACE_EVENT_STOP will be generated if tracee is group-stopped.
	  When we detect it, we issue PTRACE_LISTEN instead of PTRACE_SYSCALL.
	  This leaves tracee stopped. This fixes the inability to SIGSTOP or ^Z
	  a straced process.

	* defs.h: Add commented-out "define USE_SEIZE 1" and define PTRACE_SEIZE
	and related constants.
	* strace.c: New variable post_attach_sigstop shows whether we age going
	to expect SIGSTOP on attach (IOW: are we going to use PTRACE_SEIZE).
	(ptrace_attach_or_seize): New function. Uses PTRACE_ATTACH or
	PTRACE_SEIZE + PTRACE_INTERRUPT to attach to given pid.
	(startup_attach): Use ptrace_attach_or_seize() instead of ptrace(PTRACE_ATTACH).
	(startup_child): Conditionally use alternative attach method using PTRACE_SEIZE.
	(test_ptrace_setoptions_followfork): More robust parameters to PTRACE_TRACEME.
	(test_ptrace_seize): New function to test whether PTRACE_SEIZE works.
	(main): Call test_ptrace_seize() while initializing.
	(trace): If PTRACE_EVENT_STOP is seen, restart using PTRACE_LISTEN in order
	to not let tracee run.
	* process.c: Decode PTRACE_SEIZE, PTRACE_INTERRUPT, PTRACE_LISTEN.
	* util.c (ptrace_restart): Add "LISTEN" to a possible error message.

2012-01-28  Denys Vlasenko  <vda.linux@googlemail.com>

	process_vm_readv gets EINVAL if process is gone (SIGKILLed). Don't complain.
	* util.c (umoven): Don't complain on EINVAL from process_vm_readv.
	(umovestr): Likewise.

	Revert last change. Add a comment to prevent further misunderstanding.
	* time.c (sys_nanosleep): Display remaining time only on interrupt.

	Fix nanosleep decoding: second argument was not shown after success.
	* time.c (sys_nanosleep): Fix bug - inverted is_restart_error() check.
	* syscall.c (is_restart_error): Remove redundant check.

2012-01-28  Denys Vlasenko  <vda.linux@googlemail.com>

	Use process_vm_readv instead of PTRACE_PEEKDATA to read data blocks.
	Currently, we use PTRACE_PEEKDATA to read things like filenames and
	data passed by I/O syscalls.
	PTRACE_PEEKDATA gets one word per syscall. This is VERY expensive.
	For example, in order to print fstat syscall, we need to perform
	more than twenty trips into kernel to fetch one struct stat!

	Kernel 3.2 got a new syscall, process_vm_readv(), which can be used to
	copy data blocks out of process' address space.

	This change uses it in umoven() and umovestr() functions if possible,
	with fallback to old method if process_vm_readv() fails.
	If it returns ENOSYS, we don't try to use it anymore, eliminating
	overhead of trying it on older kernels.

	Result of "time strace -oLOG ls -l /usr/lib >/dev/null":
	before patch: 0.372s
	After patch:  0.262s

	* util.c (process_vm_readv): Wrapper to call process_vm_readv syscall.
	(umoven): Use process_vm_readv for block reads of tracee memory.
	(umovestr): Likewise.
	* linux/syscall.h: Declare new function sys_process_vm_readv.
	* process.c (sys_process_vm_readv): Decoder for new syscall.
	* linux/i386/syscallent.h: Add process_vm_readv, process_vm_writev syscalls.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.

2012-01-28  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix a case of broken output if last seen syscall was exit.
	* defs.h: Rename tcp_last to printing_tcp. Explain what it means.
	Remove printtrailer() function.
	* process.c (sys_exit): Convert printtrailer() call to "printing_tcp = NULL".
	* strace.c: Add new variable printing_tcp.
	(cleanup): Convert printtrailer() call to "printing_tcp = NULL".
	(trace): Likewise.
	(trace): Fix checks for incomplete line - it was working wrongly if last syscall was exit.
	(printleader): Set printing_tcp.
	(printtrailer): Remove this function.
	* syscall.c: Remove tcp_last variable.
	(trace_syscall_entering): Don't set printing_tcp, printleader call now does it.
	(trace_syscall_exiting): Convert printtrailer() call to "printing_tcp = NULL".

2012-01-28  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix handling of test/threaded_execve.c testcase.
	Since 3.0, Linux has a way to identify which thread execve'ed.
	This patch makes use of it in order to properly dispose
	of disappeared ("superseded") thread leader,
	and replace it with execve'ed thread.

	Before this patch, strace was "leaking" thread which exec'ed.
	It was thinking that it still runs. It would look like this:

	18460 pause( <unfinished ...>     <=== thread leader
	18466 execve("/proc/self/exe", ["exe", "exe"], [/* 47 vars */] <unfinished ...>
	18465 +++ exited with 0 +++       <=== exits from other threads
	18460 <... pause resumed> )             = 0

	The last line is wrong: it's not pause resumed, it's execve resumed.
	If thread leader would do exit instead of pause, it is much worse:
	strace panics because it thinks it sees return from exit syscall!

	And strace isn't aware 18466 (exec'ed thread) is gone.
	It still thinks it's executes execve syscall.

	* strace.c: New variable "static char *os_release".
	(get_os_release): New static function.
	(main): Call get_os_release to retrieve Linux version.
	(trace): If we see PTRACE_EVENT_EXEC, retrieve old pid, and if it
	differs from new one, free one of tcbs and print correct messages.

2012-01-27  Denys Vlasenko  <vda.linux@googlemail.com>

	Fix readlink result display - was printing bogus "..." semi-randomly.
	* file.c (decode_readlink): Use printstr() instead of printpathn().

	Add new test program: test/threaded_execve.c.

	Make pid2tcb static.
	* defs.h: Remove pid2tcb declaration.
	* strace.c (pid2tcb): Make this function static.

2012-01-24  Denys Vlasenko  <vda.linux@googlemail.com>

	Per Dmitry's request, remove paranoid check in verror_msg()
	* strace.c (verror_msg): Remove redundant check for msg != NULL.

	More robust error check for vasprintf.
	* strace.c (verror_msg): More robust error check for vasprintf.

2012-01-24  Denys Vlasenko  <vda.linux@googlemail.com>

	Slightly more compact handling of argv[]
	   text	   data	    bss	    dec	    hex	filename
	 238274	    672	  20484	 259430	  3f566	strace.before
	 238226	    672	  20484	 259382	  3f536	strace

	* strace.c (main): Slightly more compact handling of argv[]

2012-01-24  Denys Vlasenko  <vda.linux@googlemail.com>

	Trivial optimization.
	* strace.c: Set default interactive = 1 statically instead
	of doing it in main().

2012-01-24  Denys Vlasenko  <vda.linux@googlemail.com>

	Allocate -o OUTFILE buffer only if needed.
	   text	   data	    bss	    dec	    hex	filename
	 238258	    668	  28676	 267602	  41552	strace.before
	 238274	    668	  20484	 259426	  3f562	strace

	* strace.c (main): Allocate -o OUTFILE buffer only if needed:
	unused buffer in bss is not entirely free.

2012-01-24  Denys Vlasenko  <vda.linux@googlemail.com>

	Use single fprintf in verror_msg()
	This change partially reverts commit 44d0532.

	In code before commit 44d0532, single fprintf was used on purpose:
	we want to send entire message as one write() call. Since stderr
	is unbuffered, separate fprintf's to it always result in separate
	writes, they are not coalesced. If we aren't the only program
	which writes to this particular stderr, this may result
	in interleaved messages.

	Since this function is not performance critical, I guess
	it's ok to make it less efficient.

	* strace.c (verror_msg): Attempt to print the message in single
	write operation. Use separate fprintfs as a fallback if malloc fails.

2012-01-21  Denys Vlasenko  <vda.linux@googlemail.com>

	Improve code readability (logic is unchanged)
	* util.c (umoven): Move assignment out of function call. Make assignment
	to a flag variable later, closer to the place where it will be used.
	(umovestr): Likewise.
	(uload): Likewise.

2012-01-20  Denys Vlasenko  <vda.linux@googlemail.com>

	Change umovestr API: return > 0 instead of 0 if NUL was seen.
	* pathtrace.c (upathmatch): Adjust umovestr return value check for new API.
	* util.c (printpathn): Use umovestr() > 0 return value for more efficient
	(and robust - we don't depend on "no overwrote past NUL" behavior anymore)
	handling of terminating NUL.
	(printstr): Remove useless NUL placement before umovestr() call.
	Allocate 1 byte more to outstr[] array - for NUL.
	(umovestr): Change to return 1 if NUL was seen.

	umovestr result may have no NUL, use "%.*s" instead of "%s" to print it.
	* system.c (sys_mount): Be careful when printing umovestr result,
	it may have no terminating NUL.
	(sys_sysmips): Likewise.

2012-01-20  Denys Vlasenko  <vda.linux@googlemail.com>

	Eliminate code duplication in time printing, reduce a few static buffers
	   text	   data	    bss	    dec	    hex	filename
	 238454	    664	  28772	 267890	  41672	strace.before
	 238106	    664	  28676	 267446	  414b6	strace

	* defs.h: Add TIMESPEC_TEXT_BUFSIZE and TIMEVAL_TEXT_BUFSIZE defines.
	Add 'int special' parameter to sprinttv().
	* time.c (sprinttv): Add 'int special' parameter, and use it
	similarly to 'int special' parameter of printtv_bitness().
	(printtv_bitness): Use sprinttv() instead of duplicating its code.
	(print_timespec): Use sprint_timespec() instead of duplicating
	its code.
	* desc.c (decode_select): Use TIMEVAL_TEXT_BUFSIZE instead of 128
	when checking remaining buffer size.
	* net.c (sys_recvmsg): Use TIMESPEC_TEXT_BUFSIZE instead of 128
	for static buffer size.
	* stream.c (decode_poll): Use TIMESPEC_TEXT_BUFSIZE instead of 128
	when checking remaining buffer size.

2012-01-19  Denys Vlasenko  <dvlasenk@redhat.com>

	Reduce bss usage and speed up string printing.
	   text	   data	    bss	    dec	    hex	filename
	 237913	    660	  49284	 287857	  46471	strace.before
	 237973	    660	  28772	 267405	  4148d	strace

	This reduces L1 D-cache pressure a bit: instead of dirtying
	20k of bss, we will reuse already dirty stack area.

	* util.c (printpathn): Use on-stack buffers instead of static ones.
	Saves 5*MAXPATHLEN in bss.
	(printstr): Use tprints() instead of tprintf("%s") when printing
	formatted string. May be a bit faster, depending on libc.

2012-01-18  Andreas Schwab  <schwab@linux-m68k.org>

	Add support for compat_statfs64.
	* file.c (struct compat_statfs64, printcompat_statfs64): Define.
	(sys_statfs64, sys_fstatfs64): Use it.

	Add support for statfs64.f_flags.
	* file.c (printstatfs64): Print f_flags if available.

	Fix missing parens.
	* signal.c (sys_sigreturn): Add missing parens.

2012-01-18  Denys Vlasenko  <dvlasenk@redhat.com>

	Get rid of TCB_SIGTRAPPED.
	On attempts to block or set SIGTRAP handler,
	for example, using sigaction syscall, we generate
	an additional SIGSTOP.

	This change gets rid of this SIGSTOP sending/ignoring.
	It appears to work just fine.

	It also works if I force strace to not use PTRACE_O_TRACESYSGOOD,
	which means strace stops will be marked with SIGTRAP,
	not (SIGTRAP | 0x80) - I wondered maybe that's when
	this hack is needed.

	So, why we even have TCB_SIGTRAPPED? No one knows. It predates
	version control: this code was present in the initial commit,
	in 1999. No adequate comments, either.

	Moreover, TCB_SIGTRAPPED is not set in sys_rt_sigaction
	and sys_sigprocmask syscalls - the ones which are most usually
	used to implement signal blocking, it is only set in obsolete
	sys_signal, sys_sigaction, sys_sigsetmask, and in some dead
	non-Linux code.

	I think whatever bug it was fixing is gone long ago -
	at least as long as sys_rt_sigaction is used by glibc.
	Again, since glibc (and uclibc) uses sys_rt_sigaction
	and sys_sigprocmask, modified code paths are not used
	by most programs anyway.

	* defs.h: Remove definition of TCB_SIGTRAPPED.
	* signal.c (sys_sigvec): Don't set TCB_SIGTRAPPED and don't send SIGSTOP.
	(sys_sigsetmask): Likewise.
	(sys_sigaction): Likewise.
	(sys_signal): Likewise.
	* strace.c (trace): Remove code which executes if TCB_SIGTRAPPED is set.

2012-01-18  Denys Vlasenko  <dvlasenk@redhat.com>

	When we write log, flush output buffers in a few more cases.
	I observed a case when signal delivery message was buffered
	by stdio until it was flushed along with the next syscall
	entry message.

	* strace.c (trace): Flush output buffers in a few more cases.

2012-01-18  Denys Vlasenko  <dvlasenk@redhat.com>

	Fix old sigaction display.
	* signal.c (sys_sigaction): Fix display of sigaction with
	SIG_DFL/SIG_IGN handlers.

	Change x86_64_regs struct type from pt_regs to user_regs_struct.
	* syscall.c: Change x86_64_regs struct type from
	pt_regs to user_regs_struct, and explain the change in comment.

2012-01-17  Dmitry V. Levin  <ldv@altlinux.org>

	Fix struct pt_regs declaration on i386 and x86-64.
	* defs.h [I386] (i386_regs): Replace definition with declaration.
	[X86_64] (x86_64_regs): Remove.
	* syscall.c [X86_64] (x86_64_regs): Make static.

2012-01-12  Denys Vlasenko  <dvlasenk@redhat.com>

	Make ERESTARTxyz messages more descriptive.
	There is widespread confusion about exact meaning
	of ERESTARTxyz codes. Before this change, we were showing
	all four of them the same: as "(To be restarted)".

	This change prints better explanations for these codes,
	and contains verbose comments which explain *why* we display
	codes that way - or else someone confused
	is bound to come later and mangle them again.
	New messages are:

	ERESTARTSYS (To be restarted if SA_RESTART is set)
	ERESTARTNOINTR (To be restarted)
	ERESTARTNOHAND (Interrupted by signal)
	ERESTART_RESTARTBLOCK (Interrupted by signal)

	* syscall.c (trace_syscall_exiting): Make ERESTARTxyz messages
	more descriptive.

2012-01-10  Denys Vlasenko  <dvlasenk@redhat.com>

	Fix sigreturn arg count from 1 to 0 on all architectures.
	* linux/alpha/syscallent.h: Change [rt_]sigreturn's arg count to 0.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.

2012-01-10  Denys Vlasenko  <dvlasenk@redhat.com>

	Display mask on enter to sigreturn, not on exit.
	sys_sigreturn() performs ugly manipulations in order to show
	signal mask which is restored by this syscall: on syscall entry,
	fetches it from the stack, saves it in tcp->u_arg[]
	(where it used to overflow this array - fixed sometime ago),
	then retrieves the mask and displays it on syscall exit.

	Apparently, the motivation is to make it slightly more obvious
	to user that signal mask is restored only when this syscall returns.
	IMO, this hardly justifies the necessary hacks. It is much easier
	to display the mask at the point when we fetch it - on syscall entry.

	While at it, I made it so that we do display returned value/errno.
	I see no point in hiding it and showing uninformative "= ?" instead.

	Example of pause() being interrupted by ALRM which has installed handler
	which re-arms ALRM:

	Before the patch:

	rt_sigsuspend([INT])                    = ? ERESTARTNOHAND (To be restarted)
	--- {si_signo=SIGALRM, si_code=SI_KERNEL} (Alarm clock) ---
	alarm(1)                                = 0
	sigreturn()                             = ? (mask now [INT])

	After:

	rt_sigsuspend([INT])                    = ? ERESTARTNOHAND (To be restarted)
	--- {si_signo=SIGALRM, si_code=SI_KERNEL} (Alarm clock) ---
	alarm(1)                                = 0
	sigreturn() (mask [INT])                = -1 EINTR (Interrupted system call)

	* defs.h: Declare struct pt_regs i386_regs and struct pt_regs x86_64_regs.
	* syscall.c: Remove "static" keywork from these structures' definitions.
	* signal.c (sys_sigreturn): Display mask on enter, not on exit.

2012-01-04  Denys Vlasenko  <dvlasenk@redhat.com>

	Do not detach from tracee which experienced ptrace error.
	Before this patch, if a thread got nuked by exit in another thread
	and we happened to poke it at the same time, we print "????(" thingy
	and detach the thread. Since we removed "detach before death" logic,
	this no longer matches the behavior of other threads.
	Before patch:
	[pid  1780] exit_group(1)               = ?
	[pid  1778] ????( <unfinished ...>
	Process 1778 detached
	[pid  5860] +++ exited with 1 +++
	After:
	[pid 17765] exit_group(1)               = ?
	[pid 21680] ????( <unfinished ...>
	[pid 17791] +++ exited with 1 +++
	[pid 21680] +++ exited with 1 +++

	* strace (trace): Do not detach from tracee which experienced ptrace error.

2012-01-04  Denys Vlasenko  <dvlasenk@redhat.com>

	Remove sig parameter from detach()
	* strace.c (detach): Drop sig parameter - it is zero in all calls.
	(cleanup): Don't pass sig = 0 to detach() call.
	(detach): Ditto.

2011-12-26  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance decoding for personalities with small wordsize.
	* util.c (umoven, umovestr) [SUPPORTED_PERSONALITIES > 1]: If current
	personality's wordsize is less than sizeof(long), use only significant
	bits of the given address.

2011-12-23  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance personality switching.
	On syscall entry, save current personality in the tcb structure
	along with scno.
	On syscall exit, restore current personality from the tcb structure.
	* defs.h (struct tcb) [SUPPORTED_PERSONALITIES > 1]: Add currpers
	field.
	* strace.c (alloc_tcb) [SUPPORTED_PERSONALITIES > 1]: Initialize
	tcp->currpers.
	* syscall.c (update_personality) [SUPPORTED_PERSONALITIES > 1]: New
	function.
	(get_scno, trace_syscall_exiting): Use it.

	Reported-by: Michael A Fetterman <mafetter@nvidia.com>

2011-12-01  Dmitry V. Levin  <ldv@altlinux.org>

	* net.c (socktcpoptions): Add more TCP_* constants from linux/tcp.h.
	Reported-by: Rick Jones <rick.jones2@hp.com>

2011-12-01  Heiko Carstens  <heiko.carstens@de.ibm.com>

	Fix sys_ipc/sys_semtimedop decoding on s390.
	The s390 kernel sys_ipc system call only takes five arguments instead of
	six arguments which the common code sys_ipc implementation takes.
	One of the arguments of the sys_semtimedop subcall is therefore passed in
	a different register than in the common code implementation.
	This leads to broken decoding of the timespec argument:

	semtimedop(0, 0x3ffffb43832, 1, {...})  = -1 EAGAIN

	Fixed it looks like this:

	semtimedop(0, 0x3ffffc2c842, 1, {0, 10000000}) = -1 EINTR

	* linux/ipc.c (sys_semtimedop): Fix timespec decoding on s390.

2011-11-29  Dmitry V. Levin  <ldv@altlinux.org>

	strace.c (trace): Fix compilation warning.

2011-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	linux/syscall.h: Remove redundant function declarations.
	Remove 51 function declarations aliased to other declarations in
	linux/dummy.h file.

	linux/syscall.h: Sort function declarations.

	linux/syscall.h: Place one function declaration per line.

	Remove redundant parsers.
	* desc.c (sys_dup): Remove.
	* file.c (sys_pivotroot, sys_rmdir, sys_fchdir, sys_chroot, sys_fchroot,
	sys_unlink, sys_symlink, sys_rename): Remove.
	* linux/syscall.h (sys_chroot, sys_dup, sys_fchdir, sys_pivotroot,
	sys_rename, sys_rmdir, sys_symlink, sys_unlink): Remove.
	* linux/dummy.h: Add aliases for sys_chroot, sys_dup, sys_pivotroot,
	sys_rename, sys_rmdir, sys_symlink, sys_unlink.
	* pathtrace.c (pathtrace_match): Update.
	* sunos4/dummy.h: Add aliases for sys_chroot, sys_dup, sys_fchdir,
	sys_fchroot, sys_rename, sys_rmdir, sys_symlink, sys_unlink.
	* svr4/dummy.h: Likewise.
	* sunos4/syscall.h (sys_chroot, sys_dup, sys_fchdir, sys_fchroot,
	sys_rename, sys_rmdir, sys_symlink, sys_unlink): Remove.
	* svr4/syscall.h (sys_chroot, sys_dup, sys_fchdir, sys_fchroot,
	sys_rename, sys_rmdir, sys_symlink, sys_unlink): Remove.

	Reflect the fact that nfsservctl syscall was removed from linux kernels.
	linux/dummy.h: Move nfsservctl to "unimplemented" section.

2011-11-27  Dmitry V. Levin  <ldv@altlinux.org>

	x86_64: add getcpu syscall entry.
	* linux/x86_64/syscallent.h: Add syscall entry for getcpu.

2011-11-26  Dmitry V. Levin  <ldv@altlinux.org>

	Add syscall entries for new linux syscalls.
	* linux/dummy.h: Add printargs parsers for new syscalls.
	* linux/arm/syscallent.h: Add entries for sys_clock_adjtime,
	sys_name_to_handle_at, sys_open_by_handle_at, sys_sendmmsg, sys_setns
	and sys_syncfs.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Add entries for sys_clock_adjtime,
	sys_name_to_handle_at, sys_open_by_handle_at, sys_setns and sys_syncfs.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Add entry for sys_setns.
	* linux/bfin/syscallent.h: Add entries for sys_sendmmsg and sys_setns.
	* linux/hppa/syscallent.h: Add entries for sys_clock_adjtime,
	fanotify_init, fanotify_mark, sys_name_to_handle_at,
	sys_open_by_handle_at, sys_sendmmsg, sys_setns and sys_syncfs.

	Fix prctl syscall entries.
	* linux/mips/syscallent.h: Fix prctl handler.
	* linux/tile/syscallent.h: Likewise.

	arm: fix io_* syscall entries.
	* linux/arm/syscallent.h: Fix handlers for io_setup, io_destroy,
	io_getevents, io_submit and io_cancel.

	Fix mincore syscall entries.
	* linux/arm/syscallent.h: Fix mincore handler.
	* linux/avr32/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.

2011-11-25  Dmitry V. Levin  <ldv@altlinux.org>

	Fix sendmsg syscall entries.
	* linux/arm/syscallent.h: Fix number of sendmsg arguments.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.

	Fix epoll_wait syscall entries.
	* linux/arm/syscallent.h: Fix epoll_wait flags and handler.
	* linux/m68k/syscallent.h: Fix epoll_wait flags.
	* linux/microblaze/syscallent.h: Fix number of epoll_wait arguments.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.

	Fix epoll_ctl syscall entries.
	* linux/arm/syscallent.h: Fix epoll_ctl flags and handler.
	* linux/m68k/syscallent.h: Fix epoll_ctl flags.
	* linux/x86_64/syscallent.h: Fix number of epoll_ctl arguments.

	arm: fix epoll_create syscall entry.
	* linux/arm/syscallent.h: Fix epoll_create handler.

	Fix mlockall syscall entries.
	* linux/arm/syscallent.h: Fix number of mlockall arguments.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.

	Fix epoll_pwait syscall entries.
	* linux/alpha/syscallent.h: Fix number of epoll_pwait arguments.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.

	Fix reboot syscall entries.
	* linux/alpha/syscallent.h: Fix number of reboot arguments.
	* linux/arm/syscallent.h: Likewise.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.

	Fix swapon syscall entries.
	* linux/arm/syscallent.h: Fix number of swapon arguments.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/alpha/syscallent.h: Fix number of swapon arguments, add TF flag.
	* linux/hppa/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.

	Fix sgetmask and ssetmask syscall entries.
	* linux/hppa/syscallent.h: Fix sgetmask and ssetmask entries.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/tile/syscallent.h: Likewise.

	Rename siggetmask to sgetmask and sigsetmask to ssetmask.
	* linux/arm/syscallent.h: Rename siggetmask to sgetmask and
	sigsetmask to ssetmask.
	* linux/bfin/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Rename sys_sgetmask to sys_siggetmask,
	sys_ssetmask to sys_sigsetmask.

	Add TRACE_IPC flag to sys_ipc syscall entries.
	* linux/arm/syscallent.h: Add TI flag to sys_ipc entry.
	* linux/avr32/syscallent.h: Likewise.
	* linux/bfin/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.

2011-11-05  Dmitry V. Levin  <ldv@altlinux.org>

	gitlog-to-changelog: update from gnulib.
	* gitlog-to-changelog: Update from gnulib.
	* Makefile.am: Add --append-dot to gitlog-to-changelog invocation.

2011-10-22  Denys Vlasenko  <dvlasenk@redhat.com>

	Decode TIOCSCTTY's third parameter.
	* term.c (term_ioctl): Decode TIOCSCTTY's third parameter.

2011-10-14  Dmitry V. Levin  <ldv@altlinux.org>

	Remove useless and obsolete "#if DONE" sections.  No code changes.
	* linux/dummy.h: Remove "#if DONE" section.
	* linux/sparc/dummy2.h: Likewise.
	* linux/sparc64/dummy2.h: Likewise.
	* sunos4/dummy.h: Likewise.
	* svr4/dummy.h: Likewise.

	Add names for dummy parsers.  No code changes.
	* linux/dummy.h: Add aliases to printargs() for those of dummy parsers
	that had no own names before.
	* linux/*/syscallent.h: Use these new names instead of printargs.

	Sort definitions of dummy parsers.  No code changes.
	* linux/dummy.h: Sort definitions of parsers implemented as aliases
	to printargs().

2011-10-14  Mike Frysinger  <vapier@gentoo.org>

	sys_epoll_create1: decode flag arguments correctly.
	* desc.c (epollflags): Define.
	(sys_epoll_create1): Use epollflags to printflags. Change "O" to "EPOLL".

	Reported-by: Марк Коренберг <socketpair@gmail.com>

2011-10-11  Dmitry V. Levin  <ldv@altlinux.org>

	Implement decoding of splice, tee and vmsplice(2) syscalls.
	* io.c (print_loff_t): New function.
	(sys_sendfile64): Use it.
	(splice_flags): New xlat structure.
	(sys_tee, sys_splice, sys_vmsplice): New functions.
	* linux/syscall.h (sys_tee, sys_splice, sys_vmsplice): Declare them.
	* linux/*/syscallent.h: Use them.

2011-10-11  Dmitry V. Levin  <ldv@altlinux.org>

	Fix epoll_wait and epoll_pwait decoding.
	* desc.c (epoll_wait_common): Print "maxevents" and "timeout" arguments
	as integers.

	Reported-by: Марк Коренберг <socketpair@gmail.com>

2011-10-11  Dmitry V. Levin  <ldv@altlinux.org>

	Decode EPOLLRDHUP.
	* desc.c (epollevents): Add EPOLLRDHUP.

	Reported-by: Марк Коренберг <socketpair@gmail.com>

2011-10-11  Dmitry V. Levin  <ldv@altlinux.org>

	Remove unreachable code in umoven() and umovestr().
	* util.c (umoven, umovestr): Remove unreachable code.

	Reported-by: Weichuan Yan <wchyan@marvell.com>

2011-09-05  Denys Vlasenko  <dvlasenk@redhat.com>

	Do post-attach initialization earlier; fix "we ignore SIGSTOP on NOMMU" bug
	We set ptrace options when we see post-attach SIGSTOP.
	This is wrong: it's better to set them right away on the very first
	stop (whichever it will be). It also will make adding SEIZE support easier,
	since SEIZE has no post-attach SIGSTOP.

	We do it by adding a new bit, TCB_IGNORE_ONE_SIGSTOP, and treating
	TCB_STARTUP and TCB_IGNORE_ONE_SIGSTOP as two slightly different things.

	* defs.h: Add a new flag bit, TCB_IGNORE_ONE_SIGSTOP.
	* process.c (internal_fork): Set TCB_IGNORE_ONE_SIGSTOP on a newly added child.
	* strace.c (startup_attach): Set TCB_IGNORE_ONE_SIGSTOP after attach.
	Fix a case when "strace -p PID" found PID dead but sone other of its threads
	still alive.
	(startup_child): Set TCB_IGNORE_ONE_SIGSTOP after attach, _if needed_.
	This fixes a bogus case where we can ignore a _real_ SIGSTOP on NOMMU.
	(detach): Perform anti-SIGSTOP dance only if TCB_IGNORE_ONE_SIGSTOP is set,
	not if TCB_STARTUP is set.
	(trace): Set TCB_IGNORE_ONE_SIGSTOP after attach.
	Clear TCB_STARTUP and initialize tracee on the very first tracee stop.
	Clear TCB_IGNORE_ONE_SIGSTOP when SIGSTOP is seen.

2011-09-05  Denys Vlasenko  <dvlasenk@redhat.com>

	Get rid of TCB_ATTACH_DONE.
	* defs.h: Remove TCB_ATTACH_DONE constant.
	* strace.c (startup_attach): Use TCB_STARTUP instead of TCB_ATTACH_DONE
	to distinquish attached from not-yet-attached threads.

2011-09-05  Denys Vlasenko  <dvlasenk@redhat.com>

	Set TCB_STARTUP only _after_ we attached.
	This fixes logic in detach() which thinks that TCB_STARTUP
	means that we are already attached, but did not see SIGSTOP yet.
	This also allows to get rid of TCB_ATTACH_DONE flag.

	* process.c (internal_fork): Set TCB_STARTUP after attach.
	* strace.c (startup_attach): Likewise.
	(startup_child): Likewise.
	(alloc_tcb): Do not set TCB_STARTUP on tcb allocation - we are
	not attached yet.
	(trace): Set TCB_STARTUP when we detech an auto-attached child.

2011-09-02  Denys Vlasenko  <dvlasenk@redhat.com>

	Simple optimizations in trace()
	* strace.c (trace): Calculate WSTOPSIG(status) once,
	unify code paths to ptrace(PTRACE_SYSCALL).

	Trivial fixes on error paths.
	* strace.c (startup_attach): Emit message on fork() failure.
	(startup_child): Remove non-informative comment.
	* util.c (ptrace_restart): use perror_msg() on error instead of fprintf().

2011-09-01  Denys Vlasenko  <dvlasenk@redhat.com>

	Fix compile failure introduced by last commit.
	* desc.c (decode_select): Fix double definition of nfds.

2011-09-01  Denys Vlasenko  <dvlasenk@redhat.com>

	Roll back "die on malloc failure" behaviour a bit.
	After recent change, select(2^31-1, NULL, NULL, NULL)
	would make strace exit. This change caps fdsize so that
	it is always in [0, 1025*1024], IOW: we will try to allocate at most
	1 megabyte, which in practice will almost always work,
	unlike malloc(2Gig).

	* desc.c (decode_select): Cap fdsize to 1024*1024.
	* pathtrace.c (pathtrace_match): Cap fdsize to 1024*1024.
	* file.c (sys_getdents): Cap len to 1024*1024.
	(sys_getdents64): Cap len to 1024*1024.
	* util.c (dumpiov): Refuse to process iov with more than 1024*1024
	elements. Don't die on malloc failure.
	(dumpstr): Don't die on malloc failure.

2011-09-01  Denys Vlasenko  <dvlasenk@redhat.com>

	Add stpcpy to autoconf machinery.
	* configure.ac: Add stpcpy to AC_CHECK_FUNCS.
	* defs.h: Frame stpcpy with "if !defined HAVE_STPCPY".
	* util.c: Likewise.

	Simplify sprinttv()
	* time.c (sprinttv): Trivial simplifications.

	* desc.c (decode_select): Set tcp->auxstr as late as possible.

2011-09-01  Denys Vlasenko  <dvlasenk@redhat.com>

	Reformat setuid-ing code in startup_child()
	New code does the same as old one, but is more readable (I hope).

	* strace.c (startup_child): Reformat setuid-ing code.

2011-09-01  Denys Vlasenko  <dvlasenk@redhat.com>

	Minor tweaks in startup_child(). Logic isn't changed (but code is)
	* strace.c (startup_attach): Tweak comment.
	(startup_child): Move common code out of ifdef.
	Indent nested ifdefs. Tweak comments. Remove two
	unnecessary calls to getpid().

	Use tprints with literal strings, it may be faster than tprintf.
	* bjm.c: Replace tprintf("str") with tprints("str").
	* block.c: Likewise.
	* desc.c: Likewise.
	* file.c: Likewise.
	* io.c: Likewise.
	* ipc.c: Likewise.
	* mem.c: Likewise.
	* net.c: Likewise.
	* proc.c: Likewise.
	* process.c: Likewise.
	* quota.c: Likewise.
	* resource.c: Likewise.
	* scsi.c: Likewise.
	* signal.c: Likewise.
	* sock.c: Likewise.
	* strace.c: Likewise.
	* stream.c: Likewise.
	* syscall.c: Likewise.
	* system.c: Likewise.
	* term.c: Likewise.
	* time.c: Likewise.
	* util.c: Likewise.

	Fix "format not a string literal" warning caused by tprintf(str)
	* defs.h: Declare tprints().
	* strace.c: Define tprints().
	(tabto): Use tprints(str), since tprintf(str) was throwing a warning.
	* desc.c: Use tprints(str) instead of tprintf("%s", str).
	* file.c: Likewise.
	* io.c: Likewise.
	* net.c: Likewise.
	* process.c: Likewise.
	* signal.c: Likewise.
	* syscall.c: Likewise.
	* util.c: Likewise.

2011-08-31  Denys Vlasenko  <dvlasenk@redhat.com>

	Add README-linux-ptrace file.
	I tried to push this doc to Michael Kerrisk <mtk.manpages@gmail.com>,
	but got no reply. To avoid losing the document, let it live
	in strace tree for now.

2011-08-31  Denys Vlasenko  <dvlasenk@redhat.com>

	Make out-of-memory handling more uniform.
	This fixes one real bug in dumpstr().

	* defs.h: Declare die_out_of_memory().
	* strace.c (die_out_of_memory): New function.
	(strace_popen): If allocation fails, call die_out_of_memory().
	(main): Likewise.
	(expand_tcbtab): Likewise.
	(rebuild_pollv): Likewise.
	* count.c (count_syscall): Likewise.
	(call_summary_pers): Likewise.
	* desc.c (decode_select): Likewise.
	* file.c (sys_getdents): Likewise.
	(sys_getdents64): Likewise.
	(sys_getdirentries): Likewise.
	* pathtrace.c (pathtrace_match): Likewise.
	* syscall.c (qualify): Likewise.
	* util.c (printstr): Likewise.
	(dumpiov): Likewise.
	(dumpstr): Likewise.
	(fixvfork): Likewise.
	* mem.c (sys_mincore): Don't check free() parameter for NULL.

2011-08-31  Denys Vlasenko  <dvlasenk@redhat.com>

	Optimization: eliminate all remaining usages of strcat()
	After this change, we don't use strcat() anywhere.

	* defs.h: Change sprinttv() return type to char *.
	* time.c (sprinttv): Return pointer past last stored char.
	* desc.c (decode_select): Change printing logic in order to eliminate
	usage of strcat() - use stpcpy(), *outptr++ = ch, sprintf() instead.
	Also reduce usage of strlen().
	* stream.c (decode_poll): Likewise.

2011-08-31  Denys Vlasenko  <dvlasenk@redhat.com>

	Optimize string_quote() for speed.
	* util.c (string_quote): Speed up check for terminating NUL.
	Replace strintf() with open-coded binary to hex/oct conversions -
	we potentially do them for every single byte, need to be fast.

	Optimization: eliminate some usages of strcat()
	* defs.h: Declare stpcpy().
	* util.c: Define stpcpy().
	* file.c: Remove static str_append().
	(sprint_open_modes): Use stpcpy() instead of str_append().
	(sprintflags): Use stpcpy() instead of strcat().
	(printpathn): Eliminate usage of strcat().
	(printstr): Eliminate usage of strcat().

2011-08-30  Denys Vlasenko  <dvlasenk@redhat.com>

	Small optimization on AVR32.
	* syscall.c (syscall_enter): Optimize tcp->u_arg[i] setting
	from regs.FOO for AVR32.

2011-08-30  Denys Vlasenko  <dvlasenk@redhat.com>

	On X86_64 and I386, use PTRACE_GETREGS to fetch all registers.
	Before this change, registers were read with PTRACE_PEEKUSER
	ptrace operation, one per register. This is slower than
	fetching them all in one ptrace operation.

	* defs.h: include asm/ptrace.h on X86_64 and I386.
	* syscall.c: New static variables i386_regs and x86_64_regs.
	Remove static eax/rax variables.
	(get_scno): Fetch all registers with single PTRACE_GETREGS operation.
	(get_syscall_result): Likewise.
	(syscall_fixup_on_sysenter): Use PTRACE_GETREGS results in i386/x86_64_regs.
	(syscall_enter): Set tcp->u_arg[i] from PTRACE_GETREGS results.
	(get_error): Set tcp->u_rval, tcp->u_error from PTRACE_GETREGS results.

2011-08-30  Dmitry V. Levin  <ldv@altlinux.org>

	Do not include <limits.h>
	* strace.c: Do not include <limits.h> explicitly, it is already included
	implicitly by <sys/param.h>.

2011-08-30  Dmitry V. Levin  <ldv@altlinux.org>

	Include <sys/param.h> to get PATH_MAX definition.
	* pathtrace.c: Include <sys/param.h> instead of <limits.h> to get
	PATH_MAX definition.

	Reported-by: Steve Bennett <steveb@workware.net.au>

2011-08-26  Denys Vlasenko  <dvlasenk@redhat.com>

	Indent a large set of nested ifdefs/endifs. No code changes.
	* defs.h: Indent a large set of nested ifdefs/endifs

	Rename syscall_fixup to syscall_fixup_on_sysenter.
	* defs.h: Tweak comment.
	* syscall.c: Rename syscall_fixup to syscall_fixup_on_sysenter.
	(trace_syscall_entering): Use new finction name.

	Make syscall result reading more consistent among different arches.
	* syscall.c: Eliminate static flags variable for POWERPC.
	(syscall_fixup): Don't fetch syscall results. Affected arches:
	POWERPC, BFIN, HPPA.
	(syscall_fixup_on_sysexit): Move syscall results fetching code
	for this function to get_syscall_result. Affected arches:
	S390X, POWERPC, BFIN, M68K, HPPA, CRIS, MICROBLAZE.
	(get_syscall_result): Add syscall results fetching.

2011-08-25  Denys Vlasenko  <dvlasenk@redhat.com>

	Simplify syscall_fixup[_on_sysexit]
	* syscall.c (syscall_fixup): Remove checks for entering(tcp).
	Remove code which executes if exiting(tcp).
	(syscall_fixup_on_sysexit): Remove code which executes
	if entering(tcp). Remove checks for exiting(tcp).

	Split syscall_fixup into enter/exit pair of functions.
	* syscall.c: Create syscall_fixup_on_sysexit() which is a copy of
	syscall_fixup().
	(trace_syscall_exiting): Call syscall_fixup_on_sysexit() instead of
	syscall_fixup().

	Remove stray commas in struct initializers. No code changes.
	* process.c: Remove stray commas in struct initializers.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

	Optimize tabto()
	tabto is used in many lines of strace output.
	On glibc, tprintf("%*s", col - curcol, "") is noticeably slow
	compared to tprintf("                 "). Use the latter.
	Observed ~15% reduction of time spent in userspace.

	* defs.h: Drop extern declaration of acolumn. Make tabto()
	take no parameters.
	* process.c (sys_exit): Call tabto() with no parameters.
	* syscall.c (trace_syscall_exiting): Call tabto() with no parameters.
	* strace.c: Make acolumn static, add static char *acolumn_spaces.
	(main): Allocate acolumn_spaces as a string of spaces.
	(printleader): Call tabto() with no parameters.
	(tabto): Use simpler method to print lots of spaces.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

	* syscall.c (sys_indir): Use %ld for printing long, not %u.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

	Opotimize "scno >= 0 && scno < nsyscalls" check.
	gcc can't figure out on its own that this check can be done with
	single compare, and does two compares. We can help it by casting
	scno to unsigned long: ((unsigned long)(scno) < nsyscalls)

	* defs.h: New macro SCNO_IN_RANGE(long_var).
	* count.c (count_syscall): Use SCNO_IN_RANGE() instead of open-coded check.
	* syscall.c (getrval2): Use SCNO_IN_RANGE() instead of open-coded check.
	This fixes a bug: missing check for scno < 0 and scno > nsyscalls
	instead of scno >= nsyscalls.
	(get_scno): Use SCNO_IN_RANGE() instead of open-coded check.
	This fixes a bug: scno > nsyscalls instead of scno >= nsyscalls.
	(known_scno): Use SCNO_IN_RANGE() instead of open-coded check.
	(internal_syscall): Likewise.
	(syscall_enter): Likewise.
	(trace_syscall_entering): Likewise.
	(get_error): Likewise.
	(trace_syscall_exiting): Likewise.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

	Remove scno_good logic in syscall exit.
	* syscall.c (trace_syscall_exiting): Remove scno_good logic,
	it can't trigger in syscall exit.

	Remove redundant assignments.
	* syscall.c (get_error): Remove redundant "u_error = 0" and redundant
	and unclear comments.

	Group int-sized fields together in struct tcb.
	* defs.h: Group int-sized fields together in struct tcb.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

	Reorder functions in syscall.c. No code changes.
	Old order (basically "in no particular order"):
	    dumpio
	    decode_subcall
	    internal_syscall
	    get_scno
	    get_syscall_result
	    known_scno
	    syscall_fixup
	    is_negated_errno
	    get_error
	    syscall_enter
	    trace_syscall_entering
	    trace_syscall_exiting
	    trace_syscall
	    printargs
	    getrval2
	    sys_indir
	    is_restart_error

	New order:
	various utility functions:
	    decode_subcall
	    printargs
	    getrval2
	    sys_indir
	    is_restart_error
	syscall enter handling functions:
	    get_scno
	    known_scno
	    syscall_fixup (also used in syscall exit code)
	    internal_syscall (also used in syscall exit code)
	    syscall_enter
	    trace_syscall_entering
	syscall exit handling functions:
	    get_syscall_result
	    is_negated_errno
	    get_error
	    dumpio
	    trace_syscall_exiting
	main syscall enter/exit function:
	    trace_syscall

	* syscall.c: Reorder functions so that related ones are closer
	in the source.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

	Rename some functions, delete unused one. No code changes.
	* defs.h: Rename get_scno_on_sysenter() to get_scno();
	delete force_result() declaration.
	* strace.c (proc_open): Rename get_scno_on_sysenter() to get_scno().
	* syscall.c: Rename get_scno_on_sysenter() to get_scno().
	Rename get_scno_on_sysexit() to get_syscall_result().
	Delete unused force_result().

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

	Unify per-architecture post-execve SIGTRAP check.
	Move post-execve SIGTRAP check from get_scno_on_sysenter
	(multitude of places on many architectures) to a single location
	in trace_syscall_entering. This loosens the logic for some arches,
	since many of them had additional checks such as scno == 0.
	However, on non-ancient Linux kernels we should never have post-execve
	SIGTRAP in the first place, by virtue of using PTRACE_O_TRACEEXEC.

	* syscall.c (get_scno_on_sysenter): Remove tcp->flags & TCB_WAITEXECVE checks.
	(trace_syscall_entering): Do tcp->flags & TCB_WAITEXECVE check here.
	(get_scno_on_sysexit): Tweak comment.
	(syscall_fixup): Likewise.
	(trace_syscall_exiting): Likewise.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

	Speed up x86 by avoiding EAX read on syscall entry.
	on x86, EAX read on syscall entry is not necessary if we know
	that post-execve SIGTRAP is disabled by PTRACE_O_TRACEEXEC ptrace option.
	This patch (a) moves EAX retrieval from syscall_fixup
	to get_scno_on_sysexit, and (b) perform EAX retrieval in syscall_fixup
	only if we are in syscall entry and PTRACE_O_TRACEEXEC option is not on.

	* syscall.c (get_scno_on_sysexit): On I386 and X86_64, read eax/rax
	which contain syscall return value.
	(syscall_fixup): On I386 and X86_64, read eax/rax only on syscall enter
	and only if PTRACE_O_TRACEEXEC is not in effect.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

	Do not read syscall no in get_scno_on_sysexit.
	* syscall.c (get_scno_on_sysexit): Remove scno retrieval code, since
	we don't save it anyway. This is the first real logic change
	which should make strace faster: for example, on x64 ORIG_EAX
	is no longer read in each syscall exit.

	Simplify get_scno_on_sysenter/sysexit.
	* syscall.c (get_scno_on_sysenter): Remove "if (exiting(tcp))" code,
	make "if (entering(tcp))" code unconditional.
	(get_scno_on_sysexit): Remove "if (entering(tcp))" code,
	make "if (exiting(tcp))" code unconditional.

2011-08-24  Denys Vlasenko  <dvlasenk@redhat.com>

	get_scno is an unholy mess, make it less horrible.
	Currently, get_scno does *much* more than "get syscall no".
	It checks for post-execve SIGTRAP. It checks for changes
	in personality. It retrieves params on entry and registers on exit.
	Worse still, it is different in different architectures: for example,
	for AVR32 regs are fetched in get_scno(), while for e.g. I386
	it is done in syscall_enter().

	Another problem is that get_scno() is called on both syscall entry and
	syscall exit, which is stupid: we don't need to know scno on syscall
	exit, it is already known from last syscall entry and stored in
	tcp->scno! In essence, get_scno() does two completely different things
	on syscall entry and on exit, they are just mixed into one bottle, like
	shampoo and conditioner.

	The following patches will try to improve this situation.

	This change duplicates get_scno into identical get_scno_on_sysenter,
	get_scno_on_sysexit functions. Call them in syscall enter and syscall
	exit, correspondingly.

	* defs.h: Rename get_scno to get_scno_on_sysenter; declare it only
	if USE_PROCFS.
	* strace.c (proc_open): Call get_scno_on_sysenter instead of get_scno.
	* syscall.c (get_scno): Split into two (so far identical) functions
	get_scno_on_sysenter and get_scno_on_sysexit.
	(trace_syscall_entering): Call get_scno_on_sysenter instead of get_scno.
	(trace_syscall_exiting): Call get_scno_on_sysexit instead of get_scno.

2011-08-23  Dmitry V. Levin  <ldv@altlinux.org>

	Reduce code redundancy in syscall_enter()
	* syscall.c [LINUX] (syscall_enter): Move tcp->u_nargs initialization
	from arch-specific ifdefs to common code.  Always cache tcp->u_nargs in
	a local variable and use it in for() loops.
	[IA64, AVR32] Rewrite tcp->u_arg[] initialization using a loop.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Define MAX_ARGS to 6 for all Linux arches.
	* defs.h: Define MAX_ARGS to 6 for all Linux arches.
	* linux/ia64/syscallent.h: Change all 8-argument printargs
	to MA (MAX_ARGS).
	linux/mips/syscallent.h: Change all two 7-argument printargs
	to MA (MAX_ARGS).

	Fix argument printing in sys_mmap64.
	* mem.c (sys_mmap64): Fix a bug where we used tcp->u_args[i]
	instead of argument values copied from memory.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Cache tcp->u_nargs in a local variable for for() loops.
	Loops of the form "for (i = 0; i < tcp->u_nargs; i++) ..."
	need to fetch tcp->u_nargs from memory on every iteration
	if "..." part has a function call (gcc doesn't know that
	tcp->u_nargs won't change). This can be sped up
	by putting tcp->u_nargs in a local variable, which might
	go into a CPU register.

	* syscall.c (decode_subcall): Cache tcp->u_nargs in a local variable
	as for() loop limit value.
	(syscall_enter): Likewise.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Drop checks for sysent[i].nargs == -1.
	* defs.h: Declare nsyscalls, nerrnos, nioctlents, nsignals as unsigned.
	* syscall.c: Define nsyscalls, nerrnos, nioctlents, nsignals as unsigned.
	(decode_subcall): Drop checks for sysent[i].nargs == -1.
	(syscall_enter): Likewise.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Stop using nargs == -1 in syscallent tables.
	Usage -1 as argument count in syscallent tables
	necessitates the check for it, a-la:
	if (sysent[tcp->scno].nargs != -1)
	    tcp->u_nargs = sysent[tcp->scno].nargs;
	else
	    tcp->u_nargs = MAX_ARGS;
	which is stupid: we waste cycles checking something which
	is constant and known at compile time.

	* defs.h: Make struct sysent::nargs unsigned.
	* freebsd/i386/syscallent.h: Replace nargs of -1 with MA.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* svr4/syscallent.h: Likewise.
	* freebsd/syscalls.pl: Likewise in generator script.
	* syscallent.sh: Likewise in generator script.
	* syscall.c: Add define MA MAX_ARGS / undef MA around includes
	of syscallent[N].h.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Move trace_syscall_exiting below trace_syscall_entering. No code changes.
	Syscall enter happens before syscall exit. Having functions
	in opposite order in the source is confusing.

	* syscall.c: Move trace_syscall_exiting below trace_syscall_entering.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Fix -z display.
	Before this patch, the following:
	    open("qwerty", O_RDONLY)    = -1 ENOENT
	    write(2, "wc: qwerty: No such file or dire"..., 38) = 38
	was shown totally wrongly with -z:
	    open("qwerty", O_RDONLY)    = 38
	(yes, that's right, write syscall is lost!)
	Now it is shown "less wrongly" as:
	    open("qwerty", O_RDONLY <unfinished ...>
	    write(2, "wc: qwerty: No such file or dire"..., 38) = 38

	* syscall.c (trace_syscall_exiting): Use common TCB_INSYSCALL clearing
	via "goto ret". This fixes totally broken display of -z, but even now
	it is not working as intended. Add a comment about that.
	(trace_syscall_entering): Use common TCB_INSYSCALL setting
	via "goto ret".

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Straighten up confused comments/messages about post-execve SIGTRAP handling
	* defs.h: Explain TCB_INSYSCALL and TCB_WAITEXECVE bits in detail.
	* strace.c (choose_pfd): Use entering/exiting macros instead of direct check
	for TCB_INSYSCALL.
	* syscall.c (get_scno): Use entering/exiting macros instead of direct check
	for TCB_INSYSCALL. Fix comments about post-execve SIGTRAP.
	(syscall_fixup): Use entering/exiting instead of direct check
	for TCB_INSYSCALL. Add a comment what "not a syscall entry" message
	usually means. Change wrong "stray syscall exit" messages into
	"not a syscall entry" ones.

	count_syscall() always returns 0, optimize it.
	* defs.h (count_syscall): Change return type from int to void.
	* count.c (count_syscall): Change return type from int to void.
	* syscall.c (trace_syscall_exiting): Change code around call
	to count_syscall accordingly.

	Optimize out dummy PC printing on signal delivery.
	* strace.c (trace): Optimize out dummy PC printing on signal delivery.
	While at it, tweak comments.

	Conditionally optimize out unused code.
	* syscall.c (internal_syscall): Call internal_exec only if
	SUNOS4 || (LINUX && TCB_WAITEXECVE).
	* process.c (internal_exec): Define this function only if
	SUNOS4 || (LINUX && TCB_WAITEXECVE).
	(printwaitn): Don't check wordsize if SUPPORTED_PERSONALITIES == 1.
	* signal.c (sys_kill): Likewise.
	* syscall.c (is_negated_errno): Likewise.
	(trace_syscall_exiting): Fold a tprintf into tprintfs which follow it.

	Cosmetic improvement in ifdefs. No code changes.
	* strace.c (proc_open): Change ifdefs so that braces are properly paired.

	Exclude tcp->pfd from non-procfs systems.
	* defs.h: Make struct tcb::pfd fields conditional on USE_PROCFS.
	* strace.c (alloc_tcb): Use tcp->pfd only if USE_PROCFS.
	(droptcb): Likewise.

	Small optimizations related to memory allocation.
	* strace (expand_tcbtab): Shorten "out of memory" message.
	(rebuild_pollv): Remove unnecessary NULL check before free().
	* util.c (dumpstr): Add a comment about likely bug.

	Improve code readability by avoiding assignments inside if()
	* desc.c (decode_select): Move assignment out of if() condition.
	* file.c (sprinttime): Likewise.
	(sys_getdirentries): Likewise.
	* io.c (sys_ioctl): Likewise.
	* strace.c (test_ptrace_setoptions_followfork): Likewise.
	(main): Likewise.
	(proc_open): Likewise.
	(detach): Likewise.
	(proc_poll): Likewise.
	(trace): Likewise.
	* syscall.c (qualify): Likewise.
	(sys_indir): Likewise.
	* test/procpollable.c (main): Likewise.
	* test/sfd.c (main): Likewise.
	* time.c (printtv_bitness): Likewise.
	(sprinttv): Likewise.
	(print_timespec): Likewise.
	(void sprint_timespec): Likewise.
	(printitv_bitness): Likewise.
	* util.c (dumpstr): Likewise.
	(umovestr): Likewise.
	(fixvfork): Likewise.

	Convert ioctl_next_match() to new-style C function definition.
	* ioctl.c (ioctl_next_match): Convert to new-style C function definition.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Small optimization in signal and ioctl tables.
	Trivial shuffling of data tables puts them all in one file,
	allowing gcc to see their sizes and eliminate variables
	which store these sizes.

	Surprisingly, in C mode gcc does not optimize out static const int
	variables. Help it by using enums instead.

	* defs.h: Stop exporting ioctlent{0,1,2}, nioctlents{0,1,2},
	signalent{0,1,2}, nsignals{0,1,2}.
	* ioctl.c: Remove definitions of ioctlent{,0,1,2} and nioctlents{,0,1,2}.
	* signal.c: Remove definitions of signalent{,0,1,2} and nsignals{,0,1,2}.
	* syscall.c: Move above definitions to this file. Make them static const
	or enums if suitable.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Don't return int from set_personality(), no one checks it.
	* defs.h (set_personality): Change return type to void.
	* syscall.c (set_personality): Change return type to void.

	Remove unused declaration.
	* defs.h: Remove unused declaration of handle_new_child().

	Use natural-sized integer field for tcb::flags.
	* defs: Change struct tcb::flags type from short to int.
	This results in smaller code at least on x86.

	Make needlessly static data local.
	* syscall.c (get_scno): For POWERPC64 and X86-64, variable currpers
	is declared static. But its old data is never used. Convert it
	to ordinary local variable.

	Optimize get_scno function.
	* syscall.c (get_scno): Make gpr_offset[] array static const.

	Optimize iocb_cmd_lookup.
	* desc.c (iocb_cmd_lookup): Make command table constant.
	Reduce size of static char buffer.

	Correct sys_sendfile[64] type and nargs.
	* freebsd/i386/syscallent.h: Correct sys_sendfile nargs 7->8
	* linux/mips/syscallent.h: Correct sys_sendfile64 nargs 5->4
	* linux/sh/syscallent.h: Correct sys_sendfile64 nargs 5->4
	* linux/sh64/syscallent.h: Correct sys_sendfile64 nargs 5->4
	* linux/m68k/syscallent.h: Correct sys_sendfile64 type TF->TD|TN
	* linux/microblaze/syscallent.h: Correct sys_sendfile64 type TF->TD|TN
	* linux/tile/syscallent.h: Correct sys_sendfile and sys_sendfile64 type TD->TD|TN

	Make addflags return void.
	* defs.h (addflags): Change return type from int to void.
	* util.c (addflags): Change return type from int to void.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Set saner MAX_ARGS (6 or 8) for X86_64 and I386.
	I noticed that tcp->u_args[MAX_ARGS] array is way larger than
	I'd expect: for all arches except HPPA it has 32 (!) elements.

	I looked at the code and so far I spotted only one abuser of
	this fact: sys_sigreturn. On several arches, it saves sigset_t
	into tcp->u_args[1...N] on entry and prints it on exit, a-la

	memcpy(&tcp->u_arg[1], &sc.oldmask[0], sizeof(sigset_t))

	The problem here is that in glibc sigset_t is insanely large:
	128 bytes, and using sizeof(sigset_t) in memcpy will overrun
	&tcp->u_args[1] even with MAX_ARGS == 32:
	On 32 bits, sizeof(tcp->u_args) == 32*4 == 128 bytes!
	We may already have a bug there!

	This commit changes the code to save NSIG / 8 bytes only.
	NSIG can't ever be > 256, and in practice is <= 129,
	thus NSIG / 8 is <= 16 bytes == 4 32-bit words,
	and even MAX_ARGS == 5 should be enough for saving signal masks.

	* defs.h: Reduce MAX_ARGS for X86_64 and I386 from 32 to 8
	for FreeBSD and to 6 for everyone else. Add comment about current
	state of needed MAX_ARGS.
	* signal.c: Add comment about size of sigset_t.
	(sprintsigmask): Reduce static string buffer from 8k to 2k.
	(sys_sigreturn): Fix sigset saving to save only NSIG / 8 bytes,
	not sizeof(sigset_t) bytes.
	* linux/mips/syscallent.h: Reduce nargs of printargs-type syscall to 7.
	* linux/arm/syscallent.h: Reduce nargs of printargs-type syscall to 6.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Optimize sys_old_mmap.
	* mem.c (sys_old_mmap): For Ia64 and 32-bit personality of x86-64,
	copy narrow parameters from userspace by single umove, not by six
	separate ones; then assign them to long u_arg[i]. For SH[64],
	avoid copying of tcp->u_arg.
	(sys_mmap): Add FIXME comment - SH64 and i386 seem to be handled
	differently for no apparent reason.
	* test/mmap_offset_decode.c: New test program, illustrates FIXME.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Untangle ifdef forest in sys_mmap64. No code changes.
	After careful analysis, it looks like !LINUX and ALPHA
	pass all seven parameters in registers; and in all other cases
	parameters are on stack (pointed to by tcp->u_arg[0]).
	In light of this, reorganize ifdefs, making them simpler,
	without changing any logic.
	After this, it's apparent we use tcp->u_arg[4,5,6] and possibly
	[7] without checking that it's valid to do so.
	So far, just add a comment about this.

	* mem.c (sys_mmap64): Rewrite ifdefs in a much simpler way.
	Add comments about apparent bugs.

2011-08-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Style and comment fixes, no code changes.
	* mem.c: Indent includes to show nesting better.
	  (addtileflags): Fix style of this function definition;
	  correct wrong endif comment, add another endif comment.

	Use simpler rounding up to next multiple of 2.
	* util.c (printllval): simpler rounding up to next multiple of 2.

	Cosmetic fixes, no code changes.
	* defs.h: Add/reformat comments.
	* signal.c: Remove wrong comment. Add warning directive
	when we detect that NSIG is undefined. Add comment about
	NSIG on ARM. Fix typo in comment.
	(signame): Reformat code a bit without changes to logic.
	Shorten static buffer.
	(sys_rt_sigprocmask): Remove stray empty line.
	* syscall.c: Add warning directive when we detect that
	NSIG is undefined. Add comment about NSIG on ARM.

2011-08-23  Dmitry V. Levin  <ldv@altlinux.org>

	Fix PTRACE_SETOPTIONS tests.
	* strace.c [LINUX] (kill_save_errno): New function.
	(test_ptrace_setoptions_followfork): Change return type to void.
	Fix and harden error handling.  Use kill_save_errno() to avoid errno
	clobbering.  Treat EIO from ptrace() the same way as EINVAL.
	(test_ptrace_setoptions_for_all): Use kill_save_errno() to avoid errno
	clobbering.  Treat EIO from ptrace() the same way as EINVAL.
	(main): Update use of test_ptrace_setoptions_followfork().

	Fix compilation on linux 2.4.x.
	* configure.ac: Check for BLKGETSIZE64.
	* block.c (block_ioctl): Check for HAVE_BLKGETSIZE64.

2011-08-17  Denys Vlasenko  <dvlasenk@redhat.com>

	Remove tcp->parent and TCB_CLONE_THREAD.
	tcp->parent is used for only two things:
	(1) to send signal on detach via tgkill (need to know tgid).
	Solution: use tkill, it needs only tid.
	(2) to optimize out ptrace options setting for new tracees.
	Not a big deal if we drop this optimization: "set options" op is fast,
	doing it just one extra time once per each tracee is hardly measurable.

	TCB_CLONE_THREAD is a misnomer. It used only to flag sibling we attached to
	in startup_attach. This is used to prevent infinite recursive rescanning
	of /proc/PID/task.
	Despite the name, there is no guarantee it is set only on non-leader:
	if one would run "strace -f -p THREAD_ID" and THREAD_ID is *not*
	a thread leader, strace will happily attach to it and all siblings
	and will think that THREAD_ID is the leader! Which is a bug, but
	since we no longer detach when we think tracee is going to die,
	this bug no longer matters, because we do not use the knowledge
	about thread group leaders for anything. (We used it to delay
	leader's exit).

	IOW: after this patch strace has no need to know about threads, parents
	and children, and so on. Therefore it does not track that information.
	It treats all tracees as independent entities. Overall,
	this simplifies code a lot.

	* defs.h: Add TCB_ATTACH_DONE flag, remove TCB_CLONE_THREAD flag
	and struct tcb::parent field.
	* process.c (internal_fork): Don't set tcpchild->parent.
	* strace.c (startup_attach): Use TCB_ATTACH_DONE flag instead of
	TCB_CLONE_THREAD to avoid attach attempts on already-attached threads.
	Unlike TCB_CLONE_THREAD, TCB_ATTACH_DONE bit is used only temporarily,
	and only in this function. We clear it on every tcb before we return.
	(detach): Use tkill instead of tgkill.
	(trace): Set ptrace options on new tracees unconditionally,
	not only when tcp->parent == NULL.

2011-08-17  Denys Vlasenko  <dvlasenk@redhat.com>

	Remove TCB_SUSPENDED constant and related code.
	Since we no longer suspend waitpid'ing tracees, we have only one case when
	we suspend tracee: when we pick up a new tracee created by clone/fork/vfork.

	Background: on some other OSes, attach to child is done this way:
	get fork's result (pid), loop ptrace(PTRACE_ATTACH) until you hook up
	new process/thread. This is ugly and not safe, but what matters for us
	is that it doesn't require suspending. Suspending is required
	on Linux only, because on Linux attach to child is done differently.

	On Linux, we use two methods of catching new tracee:
	adding CLONE_THREAD bit to syscall (if needed, we change
	[v]fork into clone before that), or using ptrace options.
	In both cases, it may be so that new tracee appears before one which
	created it returns from syscall. In this case, current code
	suspends new tracee until its creator returns. Only then
	strace can determine who is its parent (it needs child's pid for this,
	which is visible in parent's [v]fork/clone result).
	This is inherently racy. For example, what if SIGKILL kills
	creator after it succeeded creating child, but before it returns?
	Looks like we will have child suspended forever.

	But after previous commit, we DO NOT NEED parent<->child link for anything.
	Therefore we do not need suspending too. Bingo!

	This patch removes suspending code. Now new tracees will be continued
	right away. Next patch will remove tcp->parent member.

	* defs.h: Remove TCB_SUSPENDED constant
	* process.c (handle_new_child): Delete this function.
	  (internal_fork): Do not call handle_new_child on syscall exit.
	* strace.c (handle_ptrace_event): Delete this function.
	  (trace): Do not suspend new child; remove all handling
	  of now impossible TCB_SUSPENDED condition.

2011-08-17  Denys Vlasenko  <dvlasenk@redhat.com>

	Do not detach when we think tracee is going to die.
	Current code plays some ungodly tricks, trying to not detach
	thread group leader until all threads exit.

	Also, it detaches from a tracee when signal delivery is detected
	which will cause tracee to exit.
	This operation is racy (not to mention the determination
	whether signal is set to SIG_DFL is a horrible hack):
	after we determined that this signal is indeed fatal
	but before we detach and let process die,
	*other thread* may set a handler to this signal, and
	we will leak the process, falsely displaying it as killed!

	I need to look in the past to figure out why we even do it.
	First guess is that it's a workaround for old kernel bugs:
	kernel used to deliver exit notifications to the tracer,
	not to real parent. These workarounds are ancient
	(internal_exit is from 1995).

	The patch deletes the hacks. We no longer need tcp->nclone_threads,
	TCB_EXITING and TCB_GROUP_EXITING. We also lose a few rather
	ugly functions.

	I also added a new message: "+++ exited with EXITCODE +++"
	which shows exact moment strace got exit notification.
	It is analogous to existing "+++ killed by SIG +++" message.

	* defs.h: Delete struct tcb::nclone_threads field,
	  TCB_EXITING and TCB_GROUP_EXITING constants,
	  declarations of sigishandled() and internal_exit().
	* process.c (internal_exit): Delete this function.
	  (handle_new_child): Don't ++tcp->nclone_threads.
	* signal.c (parse_sigset_t): Delete this function.
	  (sigishandled): Delete this function.
	* strace.c (startup_attach): Don't tcbtab[tcbi]->nclone_threads++.
	  (droptcb): Don't delay dropping if tcp->nclone_threads > 0,
	  don't drop parent if its nclone_threads reached 0:
	  just drop (only) this tcb unconditionally.
	  (detach): don't drop parent.
	  (handle_group_exit): Delete this function.
	  (handle_ptrace_event): Instead of handle_group_exit, just drop tcb;
	  do not panic if we see WIFEXITED from an attached pid;
	  print "+++ exited with EXITCODE +++" for every WIFEXITED pid.
	* syscall.c (internal_syscall):	Do not treat sys_exit specially -
	  don't call internal_exit on it.

2011-08-16  Sergei Trofimovich  <slyfox@gentoo.org>

	Declare printrusage32() on Alpha.
	* defs.h [ALPHA] (printrusage32): New declaration.

2011-08-15  Denys Vlasenko  <dvlasenk@redhat.com>

	Slight optimization and cleanup in trace()
	* strace.c (trace): Do not recalculate "cflag ? &ru : NULL"
	again and again. Do not clear errno unnecessarily.
	Consistently check wait errors as pid < 0, not pid == -1.
	Indent ifdefs for better readability.
	Remove comments after endif if ifdef/endif block is really tiny.

	Fix compilation on 2.4.20 kernel based system.
	* block.c (block_ioctl): add ifdef/endif around BLKGETSIZE64 usage
	* strace.c (trace): add ifdef/endif around WIFCONTINUED usage

2011-07-19  Dmitry V. Levin  <ldv@altlinux.org>

	Check for additional PTRACE_* constants.
	* configure.ac (AC_CHECK_DECLS): Add PTRACE_O_TRACESYSGOOD,
	PTRACE_O_TRACEEXEC, PTRACE_O_TRACEEXIT, PTRACE_EVENT_EXEC,
	PTRACE_EVENT_VFORK_DONE and PTRACE_EVENT_EXIT.
	* defs.h [LINUX]: Define these PTRACE_* constants when they are not
	provided by <sys/ptrace.h>.

	Reported-by: Douglas Mencken <dougmencken@gmail.com>
	Reported-by: Steve Bennett <steveb@workware.net.au>

2011-07-19  Denys Vlasenko  <dvlasenk@redhat.com>

	Remove superfluous backslash-continuation in configure.ac.
	* configure.ac: remove superfluous backslash continuation
	in AC_CHECK_DECLS

2011-06-24  Denys Vlasenko  <dvlasenk@redhat.com>

	Make IOCTL_WSTOP more readable.
	* defs.h: Make IOCTL_WSTOP more readable

	Trivial cleanups.
	* strace.c (trace): Change ifdef LINUX to make a bit more sense,
	  remove wrong comment at its endif. Slightly optimize
	  "+++ killed by SIG +++" message for systems without WCOREDUMP macro.

	Remove redundant include <stdarg.h>
	* strace.c: Remove redundant include <stdarg.h>

	Clean up two old comments.
	* strace.c (startup_attach): Remove misplaced comment.
	  (trace) Remove incomplete part of a comment.

	Make a few variables static.
	* defs.h: Remove tcbtab declaration.
	* strace.c: Make run_uid, run_gid, outf, tcbtab, progname
	  global variables static

	Add debug output in initial attachment code.
	* strace.c (startup_attach): If -d, report pid and success/failure
	  of every attach attempt.

	Better debug logging of allocations and waitpit results.
	* strace.c (alloc_tcb): Print number of allocated tcb's if -d.
	  (droptcb): Likewise.
	  (handle_ptrace_event): Remove PTRACE_EVENT_EXEC debug message.
	  (trace): Improve logging of waitpid: show WIFxxx, exitcode/signal,
	  ptrace event name, WCOREDUMP - all on one line.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Optimize arrays of register indexes in syscall_enter.
	* syscall.c (syscall_enter) [BFIN]: Make register no array "static const".
	  [SH]: Make register no array "const", pre-multiply it by 4.
	  [SH64]: Make register no array "const".
	  [X86_64]: Make register no array "const", pre-multiply it by 8.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Deindent syscall_enter by removing unnecessary braces. No code changes.
	syscall_enter has many long (>80 columns) lines.
	It is aggravated by the fact that it has a lot of {} blocks
	which are not necessary (the code is the same without them).
	This patch removes {}s and deindents affected lines.
	While at it, it indents ifdefs so that nesting is easier to track,
	and adds a few spaces in the expressions, such as
	"tcp->u_nargs*sizeof..." -> "tcp->u_nargs * sizeof...".
	There is no actual changes to the code here.

	* syscall.c (syscall_enter): Remove unnecessary {} blocks.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Remove dead "ifndef CLONE_PTRACE" branch.
	process.c defines CLONE_PTRACE for Linux, so it can't be undefined.
	Therefore ifndef CLONE_PTRACE code is dead (since at least 2004).
	This patch removes it.

	* process.c (handle_new_child): Remove ifdef CLONE_PTRACE/endif (but not
	  the code inside) and entire ifndef CLONE_PTRACE/endif block.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Add a comment about setbpt. No code changes.
	* defs.h: Add a comment about setbpt().

	Untangle a particularly badly obfuscated bit of code. No logic changes.
	* util.c (setbpt): Calculate new arg0 in more readable way.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Remove TCB_FOLLOWFORK.
	TCB_FOLLOWFORK flag seems to be unnecessary, because we either follow
	all [v]forks/clones or don't follow any, therefore global variable
	followfork is an already existing indicator of what we want to do.
	This patch drops all setting/clearing of TCB_FOLLOWFORK bit,
	and replaces checks for this bit by checks of followfork value.
	In internal_fork, check is moved to in front of if(), since
	the check is needed on both "entering" and "exiting" branch.

	* defs.h: Remove TCB_FOLLOWFORK define.
	* process.c (internal_fork): Do not set/clear TCB_FOLLOWFORK,
	  test followfork instead of tcp->flags & TCB_FOLLOWFORK.
	  (handle_new_child): Likewise.
	* strace.c (startup_attach): Likewise.

2011-06-23  Dmitry V. Levin  <ldv@altlinux.org>

	* system.c (sys_capget, sys_capset): Fix pointer arithmetics.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Make initial tcb allocation more readable. No logic changes.
	* strace.c (main): Make initial tcb allocation more readable.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Do not allocate tiny cap_user_header/data structures, place them on stack.
	This allows us to avoid having code to malloc them, and code to check
	for malloc failure. Resulting code decrease:
	   text	   data	    bss	    dec	    hex	filename
	  10175	      0	     16	  10191	   27cf	system.o.old
	   9797	      0	      0	   9797	   2645	system.o

	* system.c (sys_capget): Put cap_user_header_t and cap_user_data_t
	  on stack, rather than allocating them in heap. These structures
	  are very small (a few integer fields), stack is a better place
	  for them.
	  (sys_capset): Likewise.

2011-06-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Use [p]error_msg[_and_die] where appropriate. No logic changes.
	Resulting size changes:
	   text    data     bss     dec     hex filename
	  17445      16    8572   26033    65b1 strace.o.old
	  16850      16    8572   25438    635e strace.o

	* strace.c: Replace fprintf[+cleanup]+exit with [p]error_msg_and_die,
	  fprintf("progname: ...") with [p]error_msg where appropriate.

2011-06-22  Denys Vlasenko  <dvlasenk@redhat.com>

	Whitespace cleanups. No code changes.
	* count.c: Place opening curly brace after if (),
	  not on the next line. Almost all strace code alredy
	  uses this style.
	* desc.c: Likewise.
	* file.c: Likewise.
	* net.c: Likewise.
	* pathtrace.c: Likewise.
	* process.c: Likewise.
	* quota.c: Likewise.
	* signal.c: Likewise.
	* strace.c: Likewise.
	* syscall.c: Likewise.
	* time.c: Likewise.

2011-06-22  Denys Vlasenko  <dvlasenk@redhat.com>

	Make strace_fopen abort on error.
	Error from strace_fopen in main results in call to exit(1).
	Error from strace_fopen in newoutf is propagated to newoutf
	callers: startup_attach (where it results in exit(1))
	and alloc_tcb (where error is ignored). In second case,
	the behavior doesn't seem to be right: it means with -ff
	on open error for new LOGFILE.PID the output will continue
	to go into *the same file as the previous process* - which
	would be confusing. Moreover, on droptcb outf may be closed
	and the output of other, still running process outputting
	to the same outf will be lost. I don't think this is sane.
	IOW: in all cases, error in strace_fopen should be fatal.

	* strace.c (strace_fopen): Abort on error instead of returning NULL.
	  (newoutf): Change return type to void.
	  (startup_attach): Remove error check on newoutf return value.
	  (main): Remove error check on strace_fopen return value.

2011-06-22  Denys Vlasenko  <dvlasenk@redhat.com>

	Make set_cloexec_flag abort on error.
	set_cloexec_flag() may fail only if we pass it a bad fd,
	such as -1 or non-opened one. If we do, we have a bug
	in the caller. It makes no sense to try to continue
	running when we detect such a blatant bug in our own code.

	* strace (set_cloexec_flag): Abort instead of returning error
	  indicator. Change function to return void.
	  (strace_fopen): Remove error check on set_cloexec_flag return value.
	  (proc_open): Likewise.
	  (proc_poll_open): Likewise.

2011-06-22  Denys Vlasenko  <dvlasenk@redhat.com>

	Make strace_popen abort on error.
	It makes no sense to postpone abort on strace_popen error
	unti it returns. Moreover, out-of-memory error was exiting
	without any message.
	While at it, use 0 as "none" for popen_pid, as optimization.

	* strace: Initialize popen_pid to 0 - this puts it in bss.
	  (trace): Reset popen_pid to 0 instead of -1.
	  (strace_popen): Never return NULL as error indicator,
	  abort with good error message instead.
	  (main): Remove NULL check of strace_popen result.

2011-06-22  Denys Vlasenko  <dvlasenk@redhat.com>

	Delete fork_tcb()
	Get rid of fork_tcb() function. It used to do what the comment
	above it says, but now it doesn't do much:
	it only sets tcp->flags |= TCB_FOLLOWFORK and maybe calls
	expand_tcbtab(). The second operation is not necessary, since
	alloc_tcp() will do it itself when needed.
	This patch deletes fork_tcb(), open-coding tcp->flags |= TCB_FOLLOWFORK
	where it was formerly called. It also makes nprocs, tcbtabsize and
	expand_tcbtab() static. (While at it, I nuked redundant
	extern char **environ declaration: strace.c had *two* of them...)

	* defs.h: Remove declarations of nprocs, tcbtabsize and
	  expand_tcbtab.
	* process.c (fork_tcb): Remove this function.
	  (internal_fork): Open-code fork_tcb.
	  (handle_new_child): Likewise.
	* strace.c: Remove redundant "extern char **environ". Declare
	  nprocs and tcbtabsize static.
	  (expand_tcbtab): Make it static.

2011-06-22  Denys Vlasenko  <dvlasenk@redhat.com>

	Simplify expand_tcbtab and alloc_tcb.
	Get rid of a few intermediate variables, simplifies a few expressions,
	and uses error_msg_and_die instead of more verbose
	fprintf+cleanup+exit sequence.
	In alloc_tcp, I use memset to clear entire new tcp.
	This not only saves a few bytes of code, but lowers the chances
	of future bugs where some data "leaks out" into new tcb's
	from old ones because we forgot to re-initialize it.

	* strace.c (expand_tcbtab): Simplify this function. No logic changes.
	  (alloc_tcb): Likewise.

2011-06-21  Denys Vlasenko  <dvlasenk@redhat.com>

	Trivial fixes.
	* process.c (internal_fork): Remove conditionals which make no difference
	  (we return 0 on both branches of these ifs).
	* util.c: Fix indentation of an ifdef.

2011-06-21  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build when libaio-devel is not available.
	* desc.c: Do not compile code that uses struct iocb unless
	HAVE_LIBAIO_H is set.

	Reported-by: Denys Vlasenko <dvlasenk@redhat.com>

2011-06-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: finish ptrace_setoptions_* merge.
	* tests/Makefile.am (TESTS): Merge ptrace_setoptions_*.
	* tests/ptrace_setoptions: Check for Linux kernel > 2.6.

2011-06-21  Denys Vlasenko  <dvlasenk@redhat.com>

	Remove write-only nchildren member from struct tcb.
	* defs.h: Remove nchildren member from struct tcb.
	* process.c (handle_new_child): Remove inc/decrements of tcp->nchildren.
	  (internal_fork): Likewise.
	* strace.c (startup_attach): Likewise.
	  (droptcb): Likewise.
	  (alloc_tcb): Remove initialization of tcp->nchildren.

	Fix tests/ptrace_setoptions_* to match last fix in ptrace options code.

	Remove write-only nzombies member from struct tcb.
	* defs.h: Remove nzombies member from struct tcb.
	* strace.c (droptcb): Remove "tcp->parent->nzombies++".
	  (alloc_tcb): Remove "tcp->nzombies = 0".

2011-06-21  Denys Vlasenko  <dvlasenk@redhat.com>

	Fix regression introduced by "Properly handle real SIGTRAPs" change.
	Commit 3454e4b463e6c22c7ea8c5461ef5a077f4650a54
	introduced a bug: sometimes, TRACECLONE/TRACE[V]FORK opts were not set.
	The check (tcp->parent == NULL) in old code was meant to check
	"if we are not a child created by auto-attach" - in this case,
	options need to be set on the child; otherwise they are inherited
	and do not need to be set.
	I misunderstood the check and if tcp->parent is not NULL, I was
	setting only ptrace_setoptions_for_all bits.
	This change fixes the problem. Since the fixed logic makes it
	unnecessary to keep two sets of options in separate variables,
	I merge them back into one variable, ptrace_setoptions.

	* defs.h: Merge ptrace_setoptions_followfork and ptrace_setoptions_for_all
	  into one variable, ptrace_setoptions.
	* strace.c: Likewise.
	  (test_ptrace_setoptions_followfork): Use ptrace_setoptions variable.
	  (test_ptrace_setoptions_for_all): Likewise.
	  (main): Likewise.
	* process.c (internal_fork): Likewise.
	  (internal_exec): Likewise.
	* strace.c (trace): Fix the bug where different options were set
	  depending on "tcp->parent == NULL" condition. Add a comment
	  which makes it more clear why this condition is checked.

2011-06-18  Denys Vlasenko  <dvlasenk@redhat.com>

	Do not suspend waitpid.
	strace used to suspend waitpid until there is a child
	for waitpid'ing process to collect status from.
	Apparently, it was done because in some very old kernels
	(circa 2002 or even earlier) there were ptrace bugs which
	were making waitpid in real parent to not see children.
	This kernel bug is fixed long ago. This change removes the workaround.
	test/wait_must_be_interruptible.c is a test program which
	illustrates why without this change strace changes
	programs's behavior.

	* defs.h: Delete waitpid and nclone_waiting members from from struct tcb.
	  Remove declaration of internal_wait().
	* process.c (internal_wait): Remove this function.
	* strace.c (alloc_tcb): Do not set tcp->nclone_waiting.
	  (resume): Remove this function.
	  (resume_from_tcp): Remove this function.
	  (detach): Do not call resume_from_tcp().
	  (handle_group_exit): Do not call resume_from_tcp().
	* syscall.c (internal_syscall): Do not call internal_wait().

2011-06-13  Andi Kleen  <ak@linux.intel.com>

	Enhance io_submit() decoding.
	strace didn't decode important fields in the iocb passed to io_submit.
	This patch changes the code to dump them all.  Also it prefixes the fields
	with names to make it easier to read.

	* desc.c (iocb_cmd_lookup, print_common_flags): New functions.
	(sys_io_submit): New iocb decoder.

2011-06-13  Dmitry V. Levin  <ldv@altlinux.org>

	Add argument to tprint_iov() specifying whether to decode each iovec.
	* defs.h (tprint_iov): Add decode_iov argument.
	* io.c (tprint_iov): Implement new decode_iov argument.
	(sys_readv, sys_writev, sys_sendfile, sys_preadv, sys_pwritev): Update
	tprint_iov calls.
	* net.c (do_msghdr): Likewise.

	Introduce ARRAY_SIZE() macro.
	* defs.h (ARRAY_SIZE): New macro.
	* ioctl.c: Use it.
	* pathtrace.c (pathmatch, storepath): Likewise.
	* process.c (printpriv): Likewise.
	* signal.c: Likewise.
	* syscall.c: Likewise.

2011-06-13  Andi Kleen  <ak@linux.intel.com>

	Fix decoding of timer id returned by timer_create.
	* time.c (sys_timer_create): The kernel returns a integer, not a
	pointer for the timer id in the memory pointed to by timer_id.

2011-06-09  Dmitry V. Levin  <ldv@altlinux.org>

	Add test for PTRACE_O_TRACESYSGOOD.
	* tests/ptrace_setoptions_for_all: New file.
	* tests/Makefile.am (TESTS): Add ptrace_setoptions_for_all.

	tests: update test for linux kernel version.
	* tests/ptrace_setoptions_followfork: Check for Linux kernel > 2.6.

2011-06-09  Dmitry V. Levin  <ldv@altlinux.org>

	Update ptrace_setoptions test.
	The test have to be adjusted after commit v4.6-5-g3454e4b.

	* ptrace_setoptions: Update grep pattern, rename to
	ptrace_setoptions_followfork.
	* tests/Makefile.am (TESTS): Rename ptrace_setoptions to
	ptrace_setoptions_followfork.

2011-06-09  Dmitry V. Levin  <ldv@altlinux.org>

	* strace.c (verror_msg): Rewrite without use of heap memory allocation.

2011-06-09  Dmitry V. Levin  <ldv@altlinux.org>

	Fix MIPS syscall entries.
	* linux/mips/syscallent.h: Remove duplicate entries for 4336, 4337,
	and 4338 syscall numbers.

	Reported-by: Denys Vlasenko <dvlasenk@redhat.com>

2011-06-08  Denys Vlasenko  <dvlasenk@redhat.com>

	Don't display bogus parameter for sigreturn syscall.
	* linux/*/syscallent.h: For those arches which use sys_sigreturn,
	not printargs, to show [rt_]sigreturn syscall, change number of arguments
	from 1 to 0: sys_sigreturn function doesn't use syscall parameters.
	(I guess kernel doesn't actually _have_ any parameters for this syscall,
	at least on these architectures). Do the same change for I386 and x86-64
	even though they use printargs: I looked at kernel code and syscall
	definitely doesn't have any parameters on these arches.
	(I hesitate to change 1 to 0 params for arches I don't know -
	it is remotely possible some of them do have a parameter for this syscall).

	Optimize sigreturn handling.
	* signal.c (sys_sigreturn): move stack pointer variables,
	and for SPARC and MIPS, stack pointer and sigmask reading code
	into "if (entering) ..." block, because it is only needed
	in this branch; load tcp->u_arg[1] into sigmask for display
	_after_ we know for sure u_arg[1] does contain valid sigmask
	(IOW: perform operation only when we know we will need the result)

	Do not call umoven to fetch parameters if we have zero params.
	* syscall.c [I386] (syscall_enter): Do not call umoven
	to fetch zero bytes. This is just an optimization.

	"Modernize" four old-style function parameter declarations.
	* signal.c (signame, long_to_sigset, printsigmask, printsignal):
	Convert old-style C function definitions to a "modern" form.
	This does not change any actual code.

2011-06-08  Denys Vlasenko  <dvlasenk@redhat.com>

	Fix sigreturn decoding on MIPS.
	The "return 0" line was accidentally deleted circa 2007,
	which made sigreturn on MIPS always display "= 0" return
	instead of more informative " = ? (mask now [MASK])".

	* strace.c (sys_sigreturn): Add wrongly deleted "return 0" line

2011-06-08  Denys Vlasenko  <dvlasenk@redhat.com>

	Print at least one space between SYSCALL(ARGS) and = RESULT if tracee is killed
	We already do it in the normal case, but in rare code path where
	tracee is gone (SIGKILLed?) sometimes we were printing this:
	"SYSCALL(ARGS <unavailable>)= ? <unavailable>" - note jammed together ")=".
	test/sigkill_rain.c can be used to verify the fix.

	* strace.c (printleader): add a space after ")" in " <unavailable>)"

2011-06-08  Denys Vlasenko  <dvlasenk@redhat.com>

	Add fflush after printf in test/sigkill_rain.c.

	Update test/* directory, it seem to be a bit bit-rotted.
	Added README; modified sigkill_rain.c to be more understandable,
	made clone.c compile; added wait_must_be_interruptible.c test;
	updated Makefile and .gitignore.

2011-06-07  Denys Vlasenko  <dvlasenk@redhat.com>

	Whitespace cleanups. no code changes.
	* bjm.c: Fix tabulation (such as extra spaces before tabs),
	convert punctuation where it deviates from prevalent form
	elsewhere in strace code, convert sizeof and offsetof where
	it deviates from from prevalent form, remove space between
	function/macro/array names and (parameters) or [index],
	add space between "if" and (condition), correct non-standard
	or wrong indentaion.
	* defs.h: Likewise
	* desc.c: Likewise
	* file.c: Likewise
	* ipc.c: Likewise
	* linux/arm/syscallent.h: Likewise
	* linux/avr32/syscallent.h: Likewise
	* linux/hppa/syscallent.h: Likewise
	* linux/i386/syscallent.h: Likewise
	* linux/ioctlsort.c: Likewise
	* linux/m68k/syscallent.h: Likewise
	* linux/microblaze/syscallent.h: Likewise
	* linux/powerpc/syscallent.h: Likewise
	* linux/s390/syscallent.h: Likewise
	* linux/s390x/syscallent.h: Likewise
	* linux/sh/syscallent.h: Likewise
	* linux/sh64/syscallent.h: Likewise
	* linux/tile/syscallent.h: Likewise
	* linux/x86_64/syscallent.h: Likewise
	* mem.c: Likewise
	* net.c: Likewise
	* pathtrace.c: Likewise
	* process.c: Likewise
	* signal.c: Likewise
	* sock.c: Likewise
	* strace.c: Likewise
	* stream.c: Likewise
	* sunos4/syscall.h: Likewise
	* sunos4/syscallent.h: Likewise
	* svr4/syscall.h: Likewise
	* svr4/syscallent.h: Likewise
	* syscall.c: Likewise
	* system.c: Likewise
	* test/childthread.c: Likewise
	* test/leaderkill.c: Likewise
	* test/skodic.c: Likewise
	* time.c: Likewise
	* util.c: Likewise

2011-05-30  Dmitry V. Levin  <ldv@altlinux.org>

	ARM EABI: fix 64-bit syscall's arguments decoding.
	ARM OABI and ARM EABI have different function parameters passing rules.
	With EABI, 64-bit function parameters passed in registers are aligned to
	an even-numbered register instead of using the next available pair, see
	http://lkml.org/lkml/2006/1/12/175
	This rule also applies to syscall's arguments.

	* linux/arm/syscallent.h (pread, pwrite, truncate64, ftruncate64,
	readahead, preadv, pwritev): Fix number of arguments.
	* util.c (printllval): Align 64bit argument to 64bit boundary on
	__ARM_EABI__.

	Reported-by: Damir Shayhutdinov <damir@altlinux.org>

2011-05-30  Damir Shayhutdinov  <damir@altlinux.ru>

	Linux: implement decoding of preadv and pwritev syscalls.
	* io.c [LINUX && HAVE_SYS_UIO_H] (sys_preadv, sys_pwritev): New functions.
	* linux/syscall.h (sys_preadv, sys_pwritev): Declare them.
	* linux/*/syscallent.h: Use them.

2011-05-30  Denys Vlasenko  <dvlasenk@redhat.com>

	"Modernize" all old-style function parameter declarations.
	* bjm.c: Convert all remaining old-style C function definitions
	to a "modern" form. This does not change any actual code.
	* io.c: Likewise
	* ioctl.c: Likewise
	* net.c: Likewise
	* proc.c: Likewise
	* process.c: Likewise
	* signal.c: Likewise
	* sock.c: Likewise
	* strace.c: Likewise
	* stream.c: Likewise
	* syscall.c: Likewise
	* system.c: Likewise
	* time.c: Likewise
	* util.c: Likewise

2011-05-27  Denys Vlasenko  <dvlasenk@redhat.com>

	Cleanups on top of "handle SIGTRAP properly" change, based on Dmitry's comments.
	* defs.h ([p]error_msg[_and_die]): Declare new functions.
	* strace.c (SYSCALLTRAP): Rename to syscall_trap_sig.
	([p]error_msg[_and_die]): Define new functions.
	(strace_tracer_pid): New variable, it controls which pid will
	do cleanup on exit via [p]error_msg_and_die.
	(main): Set strace_tracer_pid to our initial pid.
	(startup_attach): Change strace_tracer_pid if we are in -D mode.
	(test_ptrace_setoptions_for_all): Minor changes to logic,
	such as better diagnostic messages.

2011-05-25  Denys Vlasenko  <dvlasenk@redhat.com>

	Identifier "errno" may be a macro, it's unsafe to use it.
	* strace.c (strerror): Rename parameter errno to err_no

2011-05-24  Denys Vlasenko  <dvlasenk@redhat.com>

	Don't perform TCB_WAITEXECVE wait if not needed.
	* defs.h (ptrace_setoptions_for_all): Expose this variable.
	* strace.c (ptrace_setoptions_for_all): Remove "static".
	* process.c (internal_exec): Don't set TCB_WAITEXECVE bit
	if we know that post-execve SIGTRAP is not going to happen.

2011-05-23  Denys Vlasenko  <dvlasenk@redhat.com>

	Properly handle real SIGTRAPs.
	* defs.h (ptrace_setoptions): Variable renamed to ptrace_setoptions_followfork.
	* process.c (internal_fork): Ditto.
	* strace.c (ptrace_setoptions_for_all): New variable.
	(SYSCALLTRAP): New variable.
	(error_msg_and_die): New function.
	(test_ptrace_setoptions_for_all): New function.
	(main): Call test_ptrace_setoptions_for_all() at init.
	(handle_ptrace_event): Handle PTRACE_EVENT_EXEC (by ignoring it).
	(trace): Check events and set ptrace options without -f too.
	Check WSTOPSIG(status) not for SIGTRAP, but for SYSCALLTRAP.

2011-04-24  Mike Frysinger  <vapier@gentoo.org>

	Blackfin: update syscall list.

	* linux/bfin/syscallent.h: Add name_to_handle_at, open_by_handle_at,
	clock_adjtime, and syncfs syscalls.

2011-04-24  Mike Frysinger  <vapier@gentoo.org>

	linux: add new EHWPOISON errno.

	* linux/errnoent.h: Change ERRNO_133 to EHWPOISON.

2011-04-08  Grant Edwards  <grant.b.edwards@gmail.com>

	Add ability to print file descriptor paths and filter by those paths.
	* pathtrace.c: New file, implements matching syscall arguments to
	user-specified file paths.
	* Makefile.am (strace_SOURCES): Add pathtrace.c.
	* defs.h (TCB_FILTERED, filtered): New defines.
	(getfdpath, pathtrace_select, pathtrace_match, show_fd_path,
	tracing_paths): New declarations.
	* strace.c (show_fd_path, tracing_paths): New global variables.
	(usage, main): Implement handling of -y and -P options.
	* strace.1: Add descriptions of -y and -P options.
	* syscall.c (trace_syscall_entering): Add path matching logic to the
	print/noprint decision and set the TCB_FILTERED bit appropriately.
	(trace_syscall_exiting): Use filtered() macro that checks the
	TCB_FILTERED bit to determine print/noprint status.
	* util.c (printfd): Use getfdpath().

2011-04-07  Dmitry V. Levin  <ldv@altlinux.org>

	Fix BLKTRACESTOP definition.
	* block.c: Fix typo in the check for BLKTRACESTOP.
	Reported by Gabor Z. Papp.

2011-03-15  Dmitry V. Levin  <ldv@altlinux.org>

	Ensure that PTRACE_GETSIGINFO et al are always defined on Linux.
	* configure.ac (AC_CHECK_DECLS): Add PTRACE_* constants.
	* defs.h [LINUX]: Define those PTRACE_* constants that are not provided
	by <sys/ptrace.h>.

	* CREDITS.in: Fix typo.

2011-03-14  Dmitry V. Levin  <ldv@altlinux.org>

	Update PTRACE_* constants.
	* process.c (ptrace_cmds): Add PTRACE_GETREGSET and PTRACE_SETREGSET.

	Prepare for 4.6 release.
	* NEWS: Update for 4.6 release.
	* configure.ac: Version 4.6.
	* debian/changelog: 4.6-1.
	* strace.spec: 4.6-1.

2011-03-14  Mike Frysinger  <vapier@gentoo.org>

	linux/ioctlent: unify them all.
	This unifies all the ioctlent.h's in the linux subdir while still
	allowing each arch to maintain its own minor list.

	The basic method is:
	- each arch has linux/<arch>/ioctlent.h.in which defines only the
	arch-specific ioctls;
	- linux/ioctlent.h.in which defines only the common ioctls;
	- at build time, these two headers are combined and sorted to produce
	the linux/ioctlent.h file.

	This also requires a little tweaking of the include files since the
	common ioctlent.h is a built file.

	* linux/ioctlent.h: Split into linux/ioctlent.h.in and
	linux/i386/ioctlent.h.in, remove asm entries from the former, remove
	non-asm entries from the latter.
	* linux/alpha/ioctlent.h: Rename to linux/alpha/ioctlent.h.in, remove
	non-asm entries.
	* linux/bfin/ioctlent.h: Rename to linux/bfin/ioctlent.h.in, remove
	non-asm entries.
	* linux/hppa/ioctlent.h: Rename to linux/hppa/ioctlent.h.in, remove
	non-asm entries.
	* linux/ia64/ioctlent.h: Rename to linux/ia64/ioctlent.h.in, remove
	non-asm entries.
	* linux/mips/ioctlent.h: Rename to linux/mips/ioctlent.h.in, remove
	non-asm entries.
	* linux/powerpc/ioctlent.h: Rename to linux/powerpc/ioctlent.h.in,
	remove non-asm entries.
	* linux/s390/ioctlent.h: Rename to linux/s390/ioctlent.h.in, remove
	non-asm entries.
	* linux/sh/ioctlent.h: Rename to linux/sh/ioctlent.h.in, remove
	non-asm entries.
	* linux/sparc/ioctlent.h: Rename to linux/sparc/ioctlent.h.in, remove
	non-asm entries.
	* linux/arm/ioctlent.h.in: New file.
	* linux/avr32/ioctlent.h.in: Likewise.
	* linux/i386/ioctlent.h.in: Likewise.
	* linux/m68k/ioctlent.h.in: Likewise.
	* linux/microblaze/ioctlent.h.in: Likewise.
	* linux/tile/ioctlent.h.in: Likewise.
	* linux/x86_64/ioctlent.h.in: Likewise.
	* linux/s390x/ioctlent.h.in: Include ioctlent.h.in instead of
	ioctlent.h.
	* linux/sh64/ioctlent.h.in: Likewise.
	* linux/sparc64/ioctlent.h.in: Likewise.
	* linux/arm/ioctlent1.h: Update ioctlent.h include.
	* linux/powerpc/ioctlent1.h: Likewise.
	* linux/sparc/ioctlent1.h: Likewise.
	* linux/sparc64/ioctlent1.h: Likewise.
	* linux/x86_64/ioctlent1.h: Likewise.
	* Makefile.am (AM_CPPFLAGS): Add -I$(builddir)/$(OS).
	(EXTRA_DIST): Update.
	[MAINTAINER_MODE && LINUX]: Convert from ioctlent_h to ioctlent_h_in.
	[LINUX]: Add $(builddir)/$(OS)/ioctlent.h generation rules.
	* .gitignore: Add linux/ioctlent.h.

2011-03-10  Dmitry V. Levin  <ldv@altlinux.org>

	Show more details about signals received by traced processess.
	* strace.c [!USE_PROCFS] (trace): Differentiate output format depending
	on PTRACE_GETSIGINFO success or failure.  In the former case, use
	printsiginfo() to show more details about received signal.

	Get rid of PT_GETSIGINFO.
	* strace.c [!USE_PROCFS] (trace): Assume that PTRACE_GETSIGINFO is
	available.  Replace PT_GETSIGINFO with PTRACE_GETSIGINFO.  Use
	PTRACE_GETSIGINFO for all signals.

	Enhance decoding of kernel-generated signals.
	* signal.c (printsiginfo) [LINUX]: Do not print uninteresting
	zero-initialized fields.

	Fix decoding of user-generated signals.
	* signal.c [LINUX] (SI_FROMUSER): Define.
	[LINUX || SVR4] (printsiginfo) [SI_FROMUSER]: Enhance decoding.

	Recognize SI_KERNEL and SI_ASYNCNL.
	* signal.c [LINUX] (SI_KERNEL, SI_ASYNCNL): Define.
	[LINUX || SVR4] (siginfo_codes): Add entries for SI_KERNEL and
	SI_ASYNCNL, reorder entries.

2011-03-05  Sebastian Pipping  <sebastian@pipping.org>

	Take all git branches into account for generation of CREDITS file.
	* Makefile.am: Make CREDITS target depend on all git branches.

2011-03-04  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of file descriptors.
	* defs.h (printfd): New function prototype.
	* util.c (printfd): New function.
	* file.c (print_dirfd): Update prototype to use printfd().
	(sys_openat, sys_faccessat, sys_newfstatat, sys_mkdirat, sys_linkat,
	sys_unlinkat, sys_readlinkat, sys_renameat, sys_fchownat, sys_fchmodat,
	sys_futimesat, sys_utimensat, sys_mknodat): Update use of print_dirfd().
	(sys_lseek, sys_llseek, sys_readahead, sys_ftruncate, sys_ftruncate64,
	sys_fstat, sys_fstat64, sys_oldfstat, sys_fstatfs, sys_fstatfs64,
	sys_fchdir, sys_fchroot, sys_linkat, sys_fchown, sys_fchmod, sys_fsync,
	sys_readdir, sys_getdents, sys_getdirentries, sys_fsetxattr,
	sys_fgetxattr, sys_flistxattr, sys_fremovexattr, sys_fadvise64,
	sys_fadvise64_64, sys_inotify_add_watch, sys_inotify_rm_watch,
	sys_fallocate): Use printfd() for decoding of file descriptors.
	* desc.c (sys_fcntl, sys_flock, sys_close, sys_dup, do_dup2,
	decode_select, sys_epoll_ctl, epoll_wait_common): Use printfd() for
	decoding of file descriptors.
	* io.c (sys_read, sys_write, sys_readv, sys_writev, sys_pread,
	sys_pwrite, sys_sendfile, sys_sendfile64, sys_pread64, sys_pwrite64,
	sys_ioctl): Likewise.
	* mem.c (print_mmap, sys_mmap64): Likewise.
	* signal.c (do_signalfd): Likewise.
	* stream.c (decode_poll): Likewise.
	* time.c (sys_timerfd_settime, sys_timerfd_gettime): Likewise.
	Based on patch from Grant Edwards <grant.b.edwards@gmail.com>.

2011-03-03  Sebastian Pipping  <sebastian@pipping.org>

	Print shutdown(2) modes as SHUT_* constants.
	* net.c (shutdown_modes): New xlat structure.
	(sys_shutdown): Use shutdown_modes to decode 2nd syscall argument.

	Fix decoding of inotify_init1() flags.
	* file.c (inotify_init_flags): New xlat structure.
	(sys_inotify_init1): Use it instead of open_mode_flags.

2011-03-03  Dmitry V. Levin  <ldv@altlinux.org>

	Fix struct xlat initialization bugs.
	* file.c (inotify_modes): Terminate with NULL entry.
	* net.c (sock_type_flags): Make this array static.
	(socketlayers): Add a comment that this array should remain not
	NULL-terminated.

	tests: avoid SIGPIPE.
	* tests/ptrace_setoptions: Replace "grep -q" with "grep > /dev/null".
	The former may result to strace being killed by SIGPIPE, which in
	certain configuratons may lead to generation of a core file.
	Suggested by Mike Frysinger.

2011-03-01  Mike Frysinger  <vapier@gentoo.org>

	tests: do not make missing /usr/bin/time a failure.
	* tests/init.sh (framework_skip_): New function.
	(check_prog): Use it instead of framework_failure_.

2011-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	Generate an xz tar archive of the distribution.
	* configure.ac (AM_INIT_AUTOMAKE): Replace dist-bzip2 with dist-xz.
	* Makefile.am: Update srpm target.
	* make-dist: Update for dist-xz.
	* strace.spec: Update Source tag.
	* debian/watch: Update regexp.
	* .gitignore: Add strace-*.tar.xz.

	Use "make check" in debian/rules and strace.spec.
	* debian/control: Update Build-Depends.
	* debian/rules: Run "make check".
	* strace.spec: Update BuildRequires. Run "make check" in %check section.

	Implement two basic "strace -f" tests.
	* Makefile.am (SUBDIRS): Add tests.
	* configure.ac (AC_CONFIG_FILES): Add tests/Makefile.
	* tests/.gitignore: New file.
	* tests/Makefile.am: Likewise.
	* tests/init.sh: Likewise.
	* tests/ptrace_setoptions: Likewise.
	* tests/strace-f: Likewise.

2011-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	ppc, s390, sparc: regenerate ioctlent.h files.
	* linux/powerpc/ioctlent.h: Regenerated using Fedora 15 kernel headers.
	* linux/s390/ioctlent.h: Likewise.
	* linux/sparc/ioctlent.h: Likewise.

	Remove redundant ioctlent.h files.
	* linux/s390x/ioctlent.h: Replace old contents with include of
	s390/ioctlent.h file.
	* linux/sparc64/ioctlent.h: Replace old contents with include of
	sparc/ioctlent.h file.

2011-02-25  Dmitry V. Levin  <ldv@altlinux.org>

	ioctlsort: sync with ioctl_lookup()
	* linux/ioctlsort.c (main): Use NR and TYPE bits only, to sync with
	ioctl_lookup() which looks at these bits only.

	Remove obsolete .cvsignore files.
	* test/.cvsignore: Rename to test/.gitignore.
	* */.cvsignore, */*/.cvsignore: Removed.

	Ignore generated intermediate header files.
	* .gitignore: Add ioctls.h and ioctldefs.h.

2011-02-24  Dmitry V. Levin  <ldv@altlinux.org>

	Generate much of the CREDITS file from git log.
	* CREDITS.in: New file, derived from CREDITS, without names of
	those who are listed as git log 'Author:'s.
	* CREDITS: Remove file.
	* Makefile.am [MAINTAINER_MODE] (CREDITS): New rule.
	* .gitignore: Add CREDITS.
	* .mailmap: New file, required to map git author names and email
	addresses to canonical/preferred form.

2011-02-23  Dmitry V. Levin  <ldv@altlinux.org>

	sparc: fix compilation warning.
	* file.c [!HAVE_LONG_LONG_OFF_T] (realprintstat): Cast st_size
	to unsigned long.

	Update the list of files that must be distributed.
	* Makefile.am (EXTRA_DIST): Add debian/source/format, debian/watch,
	linux/ia64/signalent.h, linux/powerpc/ioctlent1.h,
	linux/powerpc/syscallent1.h, linux/powerpc/errnoent1.h,
	linux/powerpc/signalent1.h.

	Fix compilation warning reported by gcc -Wunused-but-set-variable.
	* process.c (printwaitn) [!SUNOS4]: Do not define "exited" variable.

2011-02-22  Mike Frysinger  <vapier@gentoo.org>

	ioctlsort: zero pad ioctl codes to 4 places.
	Zero padding the ioctl number will allow simple sorting via shell scripts.

	* linux/ioctlsort.c (main): Output ioctl codes zero padded.
	* linux/ioctlent.h: Regenerated.

2011-02-22  Mike Frysinger  <vapier@gentoo.org>

	Update mount flags to latest linux.
	* system.c (MS_RELATIME, MS_KERNMOUNT, MS_I_VERSION,
	MS_STRICTATIME, MS_BORN): Define.
	(mount_flags): Add MS_RELATIME, MS_KERNMOUNT, MS_I_VERSION,
	MS_STRICTATIME, MS_BORN.

2011-02-22  Dmitry V. Levin  <ldv@altlinux.org>

	Sync debian/changelog and strace.spec with packages.
	* debian/changelog: Sync with 4.5.20-2.
	* strace.spec: Likewise.

2011-02-20  Dmitry V. Levin  <ldv@altlinux.org>

	Add TRACE_DESC|TRACE_FILE flags to fanotify_* sysentries.
	* linux/*/syscallent.h: Add TD flag to fanotify_init.  Add TD|TF flags
	to fanotify_mark.

	Fix flags of fallocate sysentries.
	* linux/*/syscallent.h: Fix sys_fallocate flags.

	Add TRACE_DESC flag to epoll_create* sysentries.
	* linux/*/syscallent.h: Add TD flag to sys_epoll_create and
	sys_epoll_create1.

	Add TRACE_DESC flag to fgetxattr, flistxattr, and fremovexattr sysentries
	* linux/*/syscallent.h: Add TD flag to sys_fgetxattr, sys_flistxattr,
	and fremovexattr.

	Add TRACE_FILE flag to swapoff sysentries.
	* linux/*/syscallent.h: Add TF flag to sys_swapoff.

	Add TRACE_DESC flag to fadvise64* sysentries.
	* linux/*/syscallent.h: Add TD flag to sys_fadvise64 and
	sys_fadvise64_64.

	Add TRACE_DESC flag to mmap, mmap2, and old_mmap sysentries.
	* linux/*/syscallent.h: Add TD flag to sys_mmap and sys_old_mmap.

	Do not initialize native_scno on platforms with only one personality.
	* linux/bfin/syscallent.h: Remove redundant native_scno initialization.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.

	Add LOOP_* ioctls defined in linux/loop.h.
	* linux/ioctlent.sh: Add LOOP_* ioctls (0x4C..) defined in linux/loop.h
	header file.
	* linux/ioctlent.h: Regenerated.
	Reported by Mike Frysinger.

2011-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	Fix PTRACE_GETEVENTMSG usage and enhance test_ptrace_setoptions()
	* strace.c (handle_ptrace_event): Fix PTRACE_GETEVENTMSG usage.
	(test_ptrace_setoptions): Test that PTRACE_GETEVENTMSG works properly.

2011-02-19  Mike Frysinger  <vapier@gentoo.org>

	linux/sparc: move to common syscall.h.
	Rather than constantly deal with the sparc/syscall.h going stale, merge
	the few sparc-specific pieces into the linux/syscall.h header.

	* linux/syscall.h: Add sparc-specific pieces from sparc/syscall.h.
	* Makefile.am (EXTRA_DIST): Remove linux/sparc/syscall.h and
	linux/sparc64/syscall.h.
	* linux/sparc/syscall.h, linux/sparc64/syscall.h: Deleted.

2011-02-19  Mike Frysinger  <vapier@gentoo.org>

	sparc: add new funcs to syscall.h.
	Sync missing defs from the common syscall.h here.

	* linux/sparc/syscall.h: Add sys_setfsuid, sys_pread64, and
	sys_pwrite64 prototypes.

2011-02-19  Mike Frysinger  <vapier@gentoo.org>

	sparc: punt unused syscall.h.2.
	I can't find any mention of this header actually being used.
	Seems to be a really old copy of the common syscall.h.

	* Makefile.am (EXTRA_DIST): Remove linux/sparc/syscall.h.2.
	* linux/sparc/syscall.h.2: Deleted.

2011-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	Fix raw exit_group(2) decoding.
	* syscall.c (trace_syscall_entering): Check for sys_exit instead of
	SYS_exit to handle exit_group(2) as well as _exit(2).

2011-02-18  Dmitry V. Levin  <ldv@altlinux.org>

	Optimize known_scno()
	* syscall.c (known_scno): Do not check for native_scno field on
	platforms that support only one personality.

	* process.c (internal_exit) [IA64]: Remove redundant check.

2011-02-09  Dmitry V. Levin  <ldv@altlinux.org>

	Fix biarch support in IO dumping.
	* syscall.c (dumpio): Switch on tcp->sys_func instead of tcp->scno
	for more reliable results.

	Simplify tprintf() declaration.
	* defs.h (tprintf): Simplify declaration.

2011-02-05  Dmitry V. Levin  <ldv@altlinux.org>

	* defs.h (SYSCALL_NEVER_FAILS): Fix typo.

2011-01-19  Dmitry V. Levin  <ldv@altlinux.org>

	Fix decoding of get[ug]id, gete[ug]id and setfs[ug]id return values.
	* defs.h (SYSCALL_NEVER_FAILS): New syscall flag.
	* linux/dummy.h: Change redirection for sys_get[ug]id, sys_gete[ug]id
	and setfs[ug]id.
	* linux/*/syscallent.h: Set SYSCALL_NEVER_FAILS flag for get[ug]id,
	gete[ug]id and setfs[ug]id syscalls.
	* process.c [LINUX] (sys_getuid, sys_setfsuid): New functions.
	* syscall.c (NF): New shorthand macro for use in syscallent.h files.
	(get_error): Check SYSCALL_NEVER_FAILS flag.
	Reported by Марк Коренберг <socketpair@gmail.com>.

	* linux/*/syscallent.h: Fix typo in sys_newfstatat syscall flags.

2011-01-18  Mike Frysinger  <vapier@gentoo.org>

	Blackfin: update ioctl list.
	* linux/bfin/ioctlent.h: Sync with latest kernel sources.

2011-01-17  Dmitry V. Levin  <ldv@altlinux.org>

	Fix stat64 decoding on mips.
	* linux/mips/syscallent.h: Use sys_stat64() to decode stat64 syscall.
	This fixes Debian bug #599028.

	Update linux/*/syscallent.h files to match Linux kernel v2.6.37.
	* linux/alpha/syscallent.h: Add hooks for fanotify_init, fanotify_mark,
	and prlimit64.
	* linux/i386/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/microblaze/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/arm/syscallent.h: Add hooks for accept4, fanotify_init,
	fanotify_mark, and prlimit64.
	* linux/hppa/syscallent.h: Add hook for prlimit64.

2011-01-16  Dmitry V. Levin  <ldv@altlinux.org>

	block.c: cleanup.
	* block.c: Include <inttypes.h>.
	(print_blkpg_req): Always decode struct blkpg_ioctl_arg.
	Robustify decoding of strings.
	(block_ioctl): Do not decode return values passed by pointers on exit
	from failed syscalls.
	Use format macros from inttypes.h to print values of type uint64_t.

2011-01-15  Dmitry V. Levin  <ldv@altlinux.org>

	Add block ioctl support.
	* block.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h [LINUX] (block_ioctl): New function.
	* ioctl.c (ioctl_decode) [LINUX]: Use it to decode HDIO_* and BLK*
	ioctls.
	Patch by Jeff Mahoney <jeffm@suse.com>

2011-01-14  Holger Hans Peter Freyther  <zecke@selfish.org>

	Parse SOL_SCTP socket options.
	* configure.ac (AC_CHECK_HEADERS): Add netinet/sctp.h.
	* net.c [HAVE_NETINET_SCTP_H]: Include <netinet/sctp.h>.
	[SOL_SCTP] (socksctpoptions): New xlat structure.
	(sys_getsockopt, printsockopt): Parse SOL_SCTP options.

	* net.c (socketlayers): Add more SOL_* constants from linux/socket.h.

2011-01-14  Dmitry V. Levin  <ldv@altlinux.org>

	strace.1: fix misleading italics.
	* strace.1: Use bold instead of italics for "-e trace=" keywords.
	This fixes Debian bug #589323.

	Update linux/ioctlent.h.
	* linux/ioctlent.h: Regenerate using linux v2.6.37 headers.

	Add HDIO_* ioctls defined in linux/hdreg.h.
	* linux/ioctlent.sh: Add HDIO_* ioctls (0x03..) defined in
	linux/hdreg.h header file.
	This fixes Debian bug #450953.

2011-01-13  Dmitry V. Levin  <ldv@altlinux.org>

	Test PTRACE_O_TRACECLONE and PTRACE_O_TRACEVFORK along with PTRACE_O_TRACEFORK
	* strace.c (test_ptrace_setoptions): Add PTRACE_O_TRACECLONE and
	PTRACE_O_TRACEVFORK to PTRACE_SETOPTIONS call, to test exactly
	the same set of options that is going to be used later in trace().

2011-01-10  Dmitry V. Levin  <ldv@altlinux.org>

	* net.c (protocols): Add more IPPROTO_* constants defined in netinet/in.h

2011-01-10  Holger Hans Peter Freyther  <holger@freyther.de>

	* net.c (protocols): Add IPPROTO_GRE, IPPROTO_SCTP and IPPROTO_UDPLITE.

2011-01-10  Carmelo AMOROSO  <carmelo.amoroso@st.com>

	sh: Add entry for not-multiplexed accept4.
	* linux/sh/syscallent.h: Add specific entry for not-multiplexed accept4
	available in kernel mainline since v2.6.37-rc6, see
	http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=21b6e4c7106b2d68a6710506d8706608272fd78b

2010-12-14  Carmelo AMOROSO  <carmelo.amoroso@st.com>

	sh: Add entries for not-multiplexed socket calls.
	* linux/sh/syscallent.h: Add specific entries for not-multiplexed
	socket calls (available in kernel mainline since v2.6.37-rc1)

	sh: Fix compilation warning in do_pipe due to missing prototype.
	* defs.h [SH]: Make getrval2 prototype visible to do_pipe
	and fix the following compiler warning:
	.../net.c: In function 'do_pipe':
	.../net.c:1632: warning: implicit declaration of function 'getrval2'
	.../net.c:1632: warning: format '%lu' expects type 'long unsigned int',
	but argument 3 has type 'int'

2010-12-14  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build on uClibc.
	* defs.h [LINUX]: Define PTRACE_GETEVENTMSG macro.
	Patch by Douglas Mencken <dougmencken@gmail.com>.

2010-12-07  Dmitry V. Levin  <ldv@altlinux.org>

	Fix strace -f -o '|command' hangup.
	* strace.c (main): Call test_ptrace_setoptions() before parsing
	-o option, otherwise a forked command will cause a hangup inside
	test_ptrace_setoptions().

2010-12-03  Dmitry V. Levin  <ldv@altlinux.org>

	Output diagnostics to stderr.
	* syscall.c (get_scno): Output information about changes in
	personality mode to stderr.  Reported by Pádraig Brady.

	Recognize more clone flags.
	* process.c (CLONE_*): Define more flags from linux v2.6.25.
	(clone_flags): Add entries for them.
	Proposed by <zhangyanfei@cn.fujitsu.com>.

	Decode struct ucred for getsockopt SO_PEERCRED.
	* net.c (sys_getsockopt): Decode SO_PEERCRED.
	Proposed by Arkadiusz Miśkiewicz <arekm@maven.pl>.

2010-12-03  Carmelo AMOROSO  <carmelo.amoroso@st.com>

	sh: Add support for tracing sys_cacheflush system call.
	* linux/sh/syscallent.h: Update sys_cacheflush entry.
	* linux/syscall.h [SH] (sys_cacheflush): New function declaration.
	* system.c [SH] (cacheflush_flags): New xlat structure.
	[SH] (sys_cacheflush): New function.

	Reviewed-by: Angelo Castello <angelo.castello@st.com>

2010-11-30  Dmitry V. Levin  <ldv@altlinux.org>

	Cleanup test_ptrace_setoptions()
	* strace.c (test_ptrace_setoptions): Cleanup.
	(main): Fix test_ptrace_setoptions() error diagnostics message.
	Print ptrace_setoptions value in debug mode.

2010-11-30  Wang Chao  <wang.chao@cn.fujitsu.com>

	Handle followfork using ptrace_setoptions if available.
	If PTRACE_O_TRACECLONE et al options are supported by kernel,
	use them to do followfork rather than the original setbpt
	method that changes registers ourselves.

	* defs.h [LINUX] (handle_new_child): New function prototype.
	* process.c [LINUX] (handle_new_child): New function based on the
	code from internal_fork(), with a trivial change: do reparent only
	for sys_clone.
	[LINUX] (internal_fork): Use handle_new_child().  Do nothing if
	ptrace_setoptions is in effect.
	* strace.c [LINUX] (handle_ptrace_event): New function.
	[LINUX] (trace): If ptrace_setoptions is in effect, then
	call the new function to handle PTRACE_EVENT_* status, and
	set PTRACE_SETOPTIONS when we see the initial stop of tracee.

2010-11-30  Wang Chao  <wang.chao@cn.fujitsu.com>

	Test how PTRACE_SETOPTIONS support works.
	Currently test fork related options only.  Fork a child that uses
	PTRACE_TRACEME at startup and then does a fork so strace can test
	how the PTRACE_SETOPTIONS support works before it handles any real
	tracee.  Since PTRACE_O_TRACECLONE/*FORK were introduced to kernel
	at the same time, this test seems to be enough for these 3 options.

	* defs.h [LINUX]: Define PTRACE_O_TRACECLONE et al macros here.
	(ptrace_setoptions): New variable declaration.
	* strace.c [LINUX] (test_ptrace_setoptions): New function, tests
	whether kernel supports PTRACE_O_CLONE/*FORK, the result is stored
	in the new variable ptrace_setoptions for later use.
	(main): Call test_ptrace_setoptions() if followfork option is set.

2010-09-17  Dmitry V. Levin  <ldv@altlinux.org>

	Enable support for less verbose build rules.
	* configure.ac (AM_INIT_AUTOMAKE): Add silent-rules.

2010-09-17  Wang Chao  <wang.chao@cn.fujitsu.com>

	Do not trace children cloned with CLONE_UNTRACED flag.
	If clone is called with flag CLONE_UNTRACED, to be consistent with
	option PTRACE_O_TRACECLONE, we should not set CLONE_PTRACE flag on
	its arguments.

	* process.c [LINUX] (internal_fork): Check the syscall and arguments.

2010-09-17  Dmitry V. Levin  <ldv@altlinux.org>

	Update the list of CLOCK_* constants to match Linux kernel v2.6.32+
	* time.c (struct xlat clocknames[]): Add more RT clock IDs.
	Reported by Tommi Rantala.

2010-09-16  Dmitry V. Levin  <ldv@altlinux.org>

	Update linux/hppa/syscallent.h to match Linux kernel v2.6.35.
	* linux/hppa/syscallent.h: Add hooks for recvmmsg and accept4.

2010-09-15  Dmitry V. Levin  <ldv@altlinux.org>

	Pass less information to qualify_one and qual_*
	* syscall.c (qualify_one, qual_syscall, qual_signal, qual_fault,
	qual_desc): Take just a bitflag argument instead of pointer to the whole
	qual_options structure.
	(struct qual_options): Update prototype of "qualify" field.
	(qualify): Update use of qualify_one and qual_options->qualify.

2010-09-15  Wang Chao  <wang.chao@cn.fujitsu.com>

	Fix -e option with only one value in qualifier statement.
	Fix regression introduced by commit v4.5.20-19-g30145dd:
	if -e option is used with only one value in qualifier statement,
	e.g. 'strace -e trace=open ls', syscall information would not be
	printed properly.

	* syscall.c (qualify): Remove faulty optimization.

2010-09-15  Mike Frysinger  <vapier@gentoo.org>

	Fix off_t/rlim_t size checks when cross-compiling.
	The current off_t/rlim_t size checks (wrt size of long long) use AC_RUN
	which obviously doesn't work when cross-compiling.  While we don't hit
	any configure errors, the fall back code is pretty dumb (which is to say
	there isn't any).  Considering the code in question though, we can use
	some fun compiler tricks with sizeof and array lengths to turn it into
	a pure build test and avoid the RUN issue completely.

	* m4/long_long.m4 (AC_OFF_T_IS_LONG_LONG, AC_RLIM_T_IS_LONG_LONG):
	Convert from AC_RUN_IFELSE to AC_COMPILE_IFELSE.

2010-09-15  Mike Frysinger  <vapier@gentoo.org>

	Fix long long little endian detection when cross-compiling.
	The long long endian detection code does an AC_TRY_RUN() and since that
	doesn't work when cross-compiling, it sets a fallback value.  However,
	rather than do any sort of default endian detection, the code simply
	sets it to "no".  This probably breaks most little endian systems out
	there when cross-compiling for them.  It certainly breaks Blackfin
	systems.  So use the common endian detection code provided by autoconf
	and key off of that when cross-compiling.

	* configure.ac: Call AC_C_BIGENDIAN.
	* m4/long_long.m4 (AC_LITTLE_ENDIAN_LONG_LONG): Set cross-compiling
	logic based on ac_cv_c_bigendian.

2010-09-15  Mike Frysinger  <vapier@gentoo.org>

	Blackfin: decode new syscalls.
	* linux/bfin/syscallent.h: Add fanotify/prlimit/cacheflush syscalls.
	* linux/syscall.h: Add sys_cacheflush() decl.
	* system.c: Decode Blackfin's cacheflush syscall.

	* linux/ioctlent.sh: Search a few non-exported paths.

2010-09-15  Roland McGrath  <roland@redhat.com>

	Clean up pid2tcb usage.
	* strace.c (pid2tcb): Always match pid.  Fail for argument <= 0.
	[USE_PROCFS] (first_used_tcb): New function.
	[USE_PROCFS] (trace): Use that instead of pid2tcb(0).

2010-09-09  Dmitry V. Levin  <ldv@altlinux.org>

	Turn on more compiler warnings.
	* configure.ac: Enable gcc -Wwrite-strings.

	Import warnings.m4 from gnulib.
	* m4/warnings.m4: Replace with warnings.m4 from gnulib.
	* configure.ac: Use gl_WARN_ADD from new warnings.m4.
	* Makefile.am (AM_CFLAGS): Update for new warnings.m4.

	Split acinclude.m4.
	* Makefile.am (ACLOCAL_AMFLAGS): Add "-I m4".
	* acinclude.m4: Remove.
	* m4/includedir.m4: New file, with definition of AC_INCLUDEDIR from
	acinclude.m4.
	* m4/long_long.m4: New file, with definitions of AC_OFF_T_IS_LONG_LONG,
	AC_RLIM_T_IS_LONG_LONG and AC_LITTLE_ENDIAN_LONG_LONG from acinclude.m4.
	* m4/procfs.m4: New file, with definitions of AC_MP_PROCFS,
	AC_POLLABLE_PROCFS and AC_STRUCT_PR_SYSCALL from acinclude.m4.
	* m4/stat.m4: New file, with definition of AC_STAT64 from acinclude.m4.
	* m4/statfs.m4: New file, with definition of AC_STATFS64 from
	acinclude.m4.
	* m4/warnings.m4: New file, with definition of AC_WARNFLAGS from
	acinclude.m4.

	* process.c (sys_waitid): Remove unused variable.

2010-09-07  Dmitry V. Levin  <ldv@altlinux.org>

	Fix const-correctness issues uncovered by gcc -Wwrite-strings.
	* defs.h (struct xlat): Add const qualifier to the field of
	type "char *".
	(set_sortby, qualify, printnum, printnum_int): Add const qualifier to
	arguments of type "char *".
	* count.c (set_sortby): Add const qualifier to the argument and
	automatic variable of type "char *".
	* desc.c (decode_select): Add const qualifier to automatic variables of
	type "char *".
	* ioctlsort.c (struct ioctlent): Add const qualifier to fields of
	type "char *".
	(main):  Add const qualifier to argv.
	* process.c (printargv): Add const qualifier to the argument and
	automatic variable of type "char *".
	(printargc) Add const qualifier to argument of type "char *".
	* signal.c (sprintsigmask, parse_sigset_t): Add const qualifier to
	arguments of type "char *".
	* strace.c (progname): Add const qualifier.
	(detach): Add const qualifier to automatic variable of type "char *".
	* stream.c (struct strbuf): Add const qualifier to the field of
	type "char *".
	* syscall.c (struct qual_options): Add const qualifier to fields of
	type "char *".
	(qual_syscall, qual_fault, qual_desc, lookup_class): Add const qualifier
	to arguments of type "char *".
	(qual_signal): Add const qualifier to the argument of type "char *",
	avoid modification of constant argument.
	(qualify): Likewise.
	* util.c (printflags): Add const qualifier to automatic variable of
	type "char *".
	(printnum, printnum_int): Add const qualifier to arguments of
	type "char *".

2010-09-04  Wang Chao  <wang.chao@cn.fujitsu.com>

	Fix printing clone flags.
	When we trace clone() syscall with only exit signal as clone
	flags, strace would print an unnecessary OR operator.

	* process.c (sys_clone): Fix this.

2010-08-28  Wang Chao  <wang.chao@cn.fujitsu.com>

	Drop nclone_detached and related flags.
	Remove nclone_detached since CLONE_DETACHED flag was no-op for a very
	long time in kernel.

	* defs.h (struct tcb): Remove nclone_detached field.
	Remove TCB_CLONE_DETACHED flag.
	* process.c: Remove CLONE_DETACHED flag.
	(clone_flags): Remove CLONE_DETACHED entry.
	(internal_fork, internal_wait): Remove code dealing with CLONE_DETACHED
	flag and nclone_detached.
	* strace.c (startup_attach, alloc_tcb, droptcb, handle_group_exit):
	Likewise.

2010-08-09  Neil Campbell  <lists@thebatcave.org.uk>

	Correct get/set_robust_list syscall numbers for powerpc.
	* linux/powerpc/syscallent.h: Swap positions of get_ and set_robust_list.

2010-08-09  Wang Chao  <wang.chao@cn.fujitsu.com>

	Handle CLONE_PARENT flag.
	* process.c (internal_fork): The parent of new cloned process is the
	same of the calling process when CLONE_PARENT is set.

	Fix error when judging if process has children.
	* process.c (internal_wait): Processes counted in tcp->nclone_threads
	are tcp's threads, rather than tcp's children.

2010-08-09  Wang Chao  <wang.chao@cn.fujitsu.com>

	Forbid using mutually exclusive options -D and -p together.
	If we use -D and -p option together to trace a multi-thread program, in
	addition to the main thread, other threads could not be traced even if we
	present -f option. Moreover, when executing 'strace -D -p <non-exist pid>',
	strace could not terminate normally.

	* strace.c (main): Check it.

2010-08-05  David Daney  <ddaney@caviumnetworks.com>

	Update Linux MIPS syscalls to match 2.6.35-rc6+
	* linux/mips/syscallent.h: Add and update 405 hooks.

2010-08-05  Edgar E. Iglesias  <edgar.iglesias@gmail.com>

	Add support for the MicroBlaze architecture.
	* configure.ac: Recognize MicroBlaze.
	* linux/microblaze/syscallent.h: New file.
	* Makefile.am (EXTRA_DIST): Add linux/microblaze/syscallent.h
	* process.c (change_syscall, struct_user_offsets): Add MicroBlaze
	support.
	* signal.c (sys_sigreturn): Likewise.
	* syscall.c (internal_syscall, get_scno, syscall_fixup, get_error,
	syscall_enter): Likewise.

2010-08-05  Frederik Schüler  <fs@debian.org>

	linux/sparc: add missing syscall declarations.
	* linux/sparc/syscall.h: Sync with linux/syscall.h

2010-07-17  Andreas Schwab  <schwab@linux-m68k.org>

	Handle biarch get/setrlimit.
	* resource.c (print_rlimit32) [POWERPC64 || X86_64]: Define.
	(sys_getrlimit, sys_setrlimit) [POWERPC64 || X86_64]: Use it.

2010-07-13  Andreas Schwab  <schwab@linux-m68k.org>

	Add biarch support for powerpc64.
	* acinclude.m4 (AC_LITTLE_ENDIAN_LONG_LONG): Use int instead of
	long.
	* configure.ac [$host_cpu = powerpc*]: Also define POWERPC64 if
	$host_cpu = powerpc64.
	* defs.h (SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE)
	(PERSONALITY1_WORDSIZE) [POWERPC64]: Define.
	* file.c: (struct stat_powerpc32, printstat_powerpc32) [POWERPC64]:
	Define.
	(printstat) [LINUX && POWERPC64]: Use printstat_powerpc32 in
	32-bit personality.
	(sys_newfstatat) [POWERPC64]: Handle personalities.
	* signal.c (sys_sigreturn) [POWERPC64]: Likewise.
	* util.c (printllval) [POWERPC64]: Likewise.
	(printcall) [POWERPC64]: Use wider format for IP prefix.
	* syscall.c (get_scno) [POWERPC64]: Check for 64/32 bit mode.
	* linux/powerpc/errnoent1.h: New file.
	* linux/powerpc/ioctlent1.h: New file.
	* linux/powerpc/signalent1.h: New file.
	* linux/powerpc/syscallent1.h: New file.

2010-07-09  Andreas Schwab  <schwab@redhat.com>

	Balance braces.
	* strace.c (proc_open): Avoid unbalanced braces.
	(trace): Likewise.

2010-07-06  Andreas Schwab  <schwab@linux-m68k.org>

	Remove extern declaration at file scope.
	* defs.h (force_result): Declare.
	* process.c (internal_wait): Don't declare force_result.

2010-06-24  Andreas Schwab  <schwab@redhat.com>

	Document -C/-D.
	* strace.c (usage): Document -C.
	* strace.1: Document -D.

2010-06-13  Roland McGrath  <roland@redhat.com>

	Fix sourceforge download URL.

2010-06-05  Andreas Schwab  <schwab@linux-m68k.org>

	M68K: Fix fetching syscall arguments.
	* syscall.c (syscall_enter) [M68K]: Properly handle more than five
	syscall arguments.

2010-05-28  Andreas Schwab  <schwab@linux-m68k.org>

	Decode TLS syscalls on m68k.
	* linux/m68k/syscallent.h: Add entries for get_thread_area,
	set_thread_area, atomic_comxchg_32, atomic_barrier.
	* linux/dummy.h (sys_get_thread_area, sys_set_thread_area) [M68K]:
	Don't redefine.
	* mem.c (sys_get_thread_area, sys_set_thread_area) [LINUX && M68K]: New.

	Fix warning when compiling for m68k.
	* syscall.c (d0): Define as long.

2010-04-13  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.5.20 release.
	* NEWS: Update for 4.5.20 release.
	* configure.ac: Version 4.5.20.
	* debian/changelog: 4.5.20-1.
	* strace.spec: 4.5.20-1.

2010-04-13  Frederik Schüler  <fs@debian.org>

	Update debian/* files for the upcoming release.
	* debian/control: update standards-version to 3.8.4.
	* debian/rules: allow parallel building.
	* debian/rules: comment out verbose build, only needed for debugging.
	* debian/rules: clean up clean: target, dh_clean does most of the work
	  already.
	* debian/rules: use *-stamp instead of stamp-*, so dh_clean can tidy
	  up for us.

2010-04-13  Heiko Carstens  <heiko.carstens@de.ibm.com>

	Fix s390 system call table list.
	* linux/s390/syscallent.h: Add the missing entries for preadv and
	pwritev to the system call table list.
	* linux/s390x/syscallent.h: Likewise.

2010-04-07  Dmitry V. Levin  <ldv@altlinux.org>

	Update linux/ioctlent.h.
	* linux/ioctlent.sh: Search in asm-generic directory as well.
	* linux/ioctlent.h: Regenerated.

	Update linux/*/syscallent.h files to match Linux kernel v2.6.33.
	* linux/alpha/syscallent.h: Add 47 hooks.
	* linux/arm/syscallent.h: Update hooks for pselect6, ppoll,
	epoll_pwait.  Add 11 hooks.
	* linux/bfin/syscallent.h: Update hooks for prctl, fallocate,
	signalfd4, eventfd2, epoll_create1, dup3, pipe2, perf_event_open.
	Hook up recvmmsg.
	* linux/hppa/syscallent.h: Update hooks for signalfd4, eventfd2,
	epoll_create1, dup3, pipe2, perf_event_open.
	* linux/i386/syscallent.h: Fix syscall name for the kexec_load hook.
	Add 5 hooks.
	* linux/ia64/syscallent.h: Fix syscall name for the kexec_load hook.
	Add 4 hooks.
	* linux/m68k/syscallent.h: Add 50 hooks.
	* linux/powerpc/syscallent.h: Fix hook for timerfd_create.  Fix
	6 syscall names to match the kernel.  Use sys_semop to parse semop.
	Add 14 hooks.
	* linux/s390/syscallent.h: Fix syscall name for the kexec_load hook.
	Add 14 hooks.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Add 13 hooks.
	* linux/sh64/syscallent.h: Add 15 hooks.
	* linux/sparc/syscallent.h: Add 22 hooks.
	* linux/x86_64/syscallent.h: Add 5 hooks.

	Enhance recvmmsg parser.
	* net.c (sys_recvmmsg): Decode mmsghdr structure on exit from the
	syscall.  Decode timespec structure both on entrance and on exit.

2010-04-07  Andreas Schwab  <schwab@linux-m68k.org>

	Decode recvmmsg syscall.
	* net.c (do_msghr): New function to print struct msghdr.
	(printmsghdr): Use it.
	(printmmsghdr, sys_recvmmsg): New.
	* linux/syscall.h: Declare sys_recvmmsg.
	(SYS_sub_recvmmsg): Define.
	(SYS_socket_nsubcalls): Bump.
	* linux/sparc/syscall.h: Likewise.
	* linux/arm/syscallent.h: Add sys_recvmmsg.
	* linux/bfin/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/m68k/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Adjust.

2010-04-07  Dmitry V. Levin  <ldv@altlinux.org>

	* strace.1: Fix quoting of hyphens and formatting of strace options.

	Split trace_syscall() for better readability.
	* syscall.c (trace_syscall): Split into trace_syscall_exiting() and
	trace_syscall_entering().

	Implement -C option to combine regular and -c output.
	* defs.h (cflag_t): New enum.
	* strace.1: Document -C option.
	* strace.c (cflag): Update type.
	(main): Handle -C option.
	(trace): Update use of cflag.
	* count.c (count_syscall): Move clearing of TCB_INSYSCALL to ...
	* syscall.c (trace_syscall): ... here.  Update use of cflag.
	Based on patch by Adrien Kunysz.

	Fix "make dist" regression introduced by commit v4.5.19-12-g5078770.
	* Makefile.am (EXTRA_DIST): Rename linux/syscallent.h to linux/i386/syscallent.h

	* desc.c (sys_epoll_pwait): Fix output formatting bug.

	* desc.c (decode_select): Fix potential stack buffer overflow.

2010-03-31  Dmitry V. Levin  <ldv@altlinux.org>

	Fix msgsnd indirect ipccall decoding.
	This regression was introduced by commit v4.5.18-136-g783f5bc.
	* ipc.c (tprint_msgsnd): Add and use "flags" argument.
	(sys_msgsnd): Pass "flags" argument to tprint_msgsnd().
	Patch by Anton Blanchard.

2010-03-23  Mark Wielaard  <mjw@redhat.com>

	Hook up inotify_init1 open mode flags printer.
	* file.c [LINUX] (sys_inotify_init1): New function.
	* linux/syscall.h: Declare new sys_inotify_init1 handler.
	* linux/bfin/syscallent.h: Hook up new handler.
	* linux/hppa/syscallent.h: Likewise.
	* linux/i386/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.

2010-03-09  Andreas Schwab  <schwab@redhat.com>

	Avoid spurious error when checking for linux/netlink.h.
	* configure.ac: Include <asm/types.h> when checking for
	linux/netlink.h.

2010-02-23  Andreas Schwab  <schwab@linux-m68k.org>

	Fix reporting signal mask by sigreturn on powerpc.
	* signal.c (sys_sigreturn) [POWERPC]: Skip dummy stack frame when
	locating signal context.

2010-02-09  David Daney  <ddaney@caviumnetworks.com>

	Fix MIPS N32/N64 compile error.
	* syscall.c [LINUX_MIPSN32 || LINUX_MIPSN64] (syscall_enter): Pass
	tcp->pid to ptrace().

2010-02-05  Chris Metcalf  <cmetcalf@tilera.com>

	Add support for the TILE architecture.
	* configure.ac: Add TILE to the list of supported architectures.
	* defs.h: Define TCB_WAITEXECVE for TILE.
	* linux/tile/syscallent.h: New file.
	* Makefile.am (EXTRA_DIST): Add linux/tile/syscallent.h
	* process.c (change_syscall, struct_user_offsets): Add TILE support.
	* syscall.c (get_scno, get_error, syscall_enter): Likewise.
	* mem.c (mmap_flags, print_mmap): Add MAP_CACHE_xxx TILE extensions
	support.
	* signal.c (sigact_flags): Add SA_NOPTRACE.
	(sys_sigreturn): Add TILE support.

2010-02-04  Dmitry V. Levin  <ldv@altlinux.org>

	Remove dead code.
	* defs.h (tv_tv): Remove.
	* net.c (sys_xsetsockaddr): Remove commented out dead code.
	* process.c (setarg, sys_execv, sys_execve, struct_user_offsets):
	Likewise.
	* signal.c (sys_sigsuspend): Likewise.
	* strace.c (reaper, trace): Likewise.
	* stream.c (internal_stream_ioctl): Likewise.
	* syscall.c (trace_syscall): Likewise.
	* term.c (term_ioctl): Likewise.
	* util.c (tv_tv, umoven, uload, getpc, fixvfork, setbpt, clearbpt):
	Likewise.

	Merge Linux internal_clone() into internal_fork()
	* defs.h (internal_clone): Remove.
	* process.c (internal_clone): Merge into internal_fork().
	(internal_fork) [!LINUX]: Remove dead code.
	* syscall.c (internal_syscall): Replace internal_clone() with
	internal_fork().

	* Makefile.am (INCLUDES): Remove redundant search directories.

2010-02-04  Frederik Schüler  <fs@debian.org>

	Update debian/* files.
	* debian/control: add sparc64 to the architectures list.
	This closes Debian bug #560062
	* Backport commit f0df31e71a58c6e79ba77c1a9d84b2f38d44bec7 to fix FTBFS.
	This closes Debian bug #560516
	* debian/control: Update standards-version to 3.8.3.
	* debian/control: Lower package priority to optional, matching
	the archive override.
	* debian/control: add ${misc:Depends} to Depends: lines where
	appropriate.
	* debian/watch: new file, allows automatic tracking of new
	upstream versions.
	* debian/source/format: new file, adapt to debian source format "quilt"
	* debian/rules: indentation cleanups; use dh_testroot and dh_prep
	in clean target.

2010-01-25  Andreas Schwab  <schwab@redhat.com>

	Fix spurious failure of AC_STAT64 test.
	* acinclude.m4 (AC_STAT64): Include <sys/types.h> first.

2010-01-12  Andreas Schwab  <schwab@redhat.com>

	Don't kill the process when detaching.
	* strace.c (detach): Call clearbpt when TCB_BPTSET is set.

2009-12-25  Dmitry V. Levin  <ldv@altlinux.org>

	Decode fifth argument of mremap syscall.
	* mem.c (sys_mremap): Decode fifth argument.
	* linux/*/syscallent.h: Update the number of mremap syscall arguments.

2009-12-24  Chris Metcalf  <cmetcalf@tilera.com>

	* mem.c (sys_mbind): Display first argument in hex.

	* mem.c (mremap_flags): Add MREMAP_FIXED.

2009-11-16  Mike Frysinger  <vapier@gentoo.org>

	Move i386-specific files out of common linux dir.
	* linux/syscallent.h: Moved to ...
	* linux/i386/syscallent.h: ... here.
	* linux/ia64/syscallent.h: Update i386 syscallent.h include.
	* linux/sparc/gen.pl: Likewise.
	* linux/x86_64/syscallent1.h: Likewise.

2009-11-16  Andreas Schwab  <schwab@redhat.com>

	Remove support for pre-C89.
	* defs.h: Remove references to __STDC__ and P macros.
	* strace.c: Likewise.

2009-11-13  Dmitry V. Levin  <ldv@altlinux.org>

	Decode more SOL_PACKET socket options.
	* net.c (sockpacketoptions): Add more PACKET_* entries.
	(sys_getsockopt): Decode PACKET_STATISTICS.
	(printsockopt): Decode PACKET_RX_RING and PACKET_TX_RING.
	Patch by Gabor Gombas.

2009-11-11  Andreas Schwab  <schwab@redhat.com>

	Ignore errors if a thread is killed.
	* util.c (clearbpt): Ignore ESRCH error.

2009-11-06  Bernhard Reutner-Fischer  <rep.dot.nop@gmail.com>

	Fix handling of Linux systems without struct statfs64.
	* acinclude.m4 (AC_STATFS64): New macro to check for struct statfs64.
	* configure.ac: Call AC_STATFS64.
	* file.c (printstatfs64, sys_statfs64, sys_fstatfs64): Compile only
	  if struct statfs64 is available.

2009-11-06  Dmitry V. Levin  <ldv@altlinux.org>

	Fix getsockopt decoding on architectures where sizeof(long) > sizeof(int)
	* net.c (sys_getsockopt): Optimize output a bit.
	Decode integer argument using printnum_int(), patch by Gabor Gombas.

	Check umove() return code.
	* bjm.c (sys_query_module): Print input parameters when entering
	syscall.  Fix handling of syscall error.  Handle unlikely umove()
	failures.
	* ipc.c (tprint_msgrcv): New function.  Move part of msgrcv parser code
	here, add check umove() return code.
	(sys_msgsnd): Print msqid parameter as int instead of long.
	(sys_msgrcv): Likewise.  Use tprint_msgrcv().
	* process.c (print_affinitylist): Check umove() return code.
	* sock.c (sock_ioctl): Handle unlikely umove() failure in the
	SIOCGIFCONF parser.

	Fix check for linux/netlink.h on Linux 2.6.32-rc5+
	* configure.ac (AC_CHECK_HEADERS): In check for linux/netlink.h, include
	sys/socket.h instead of linux/socket.h beforehand.

2009-11-04  Andreas Schwab  <schwab@redhat.com>

	Decode fallocate on PowerPC.
	* linux/powerpc/syscallent.h: Decode fallocate.

	Factor out printing of 64bit syscall argument.
	* defs.h (ALIGN64): Remove.
	(printllval): Declare.
	* util.c (printllval): Define.
	* file.c (sys_readahead): Use printllval.
	(sys_lseek64): Likewise.
	(sys_truncate64): Likewise.
	(sys_ftruncate64): Likewise.
	(sys_fadvise64): Likewise.
	(sys_fadvise64_64): Likewise.
	(sys_fallocate): Likewise.
	* io.c (sys_pread): Likewise.
	(sys_pwrite): Likewise.
	(sys_pread64): Likewise.
	(sys_pwrite64): Likewise.
	* mem.c (sys_mmap64): Likewise.

2009-11-03  Andreas Schwab  <schwab@redhat.com>

	Correct decoding of readahead and fadvice64(_64) on PowerPC.
	* file.c (sys_readahead): Align 64bit argument.  Handle PowerPC64
	like other 64bit architectures.
	(sys_fadvise64): Likewise.
	(sys_fadvise64_64): Handle PowerPC like ARM.
	* linux/powerpc/syscallent.h (sys_readahead): Account for 64bit
	argument alignment on PowerPC32.

2009-10-27  Andreas Schwab  <schwab@redhat.com>

	Maintain separate print column for each process.
	* defs.h (struct tcp): Add curcol.
	* strace.c: (alloc_tcb): Initialize it.
	(trace): Use curcol from current process and save it before
	continuing.
	(tprintf): Don't modify curcol on output error.

2009-10-21  Roland McGrath  <roland@redhat.com>

	* strace.spec: 4.5.19-1 release.

2009-10-21  Dmitry V. Levin  <ldv@altlinux.org>

	* file.c (printstat64): Cleanup trailing whitespace.

2009-10-16  Andreas Schwab  <schwab@redhat.com>

	Fix decoding of newfstatat syscall on x86-64.
	* file.c (printstat64) [LINUX && X68_64]: If tracing a 64-bit
	process redirect to printstat.
	Fixes RH#529316 "Field values shown for "newfstatat" system
	call are incorrect"

2009-10-12  Dmitry V. Levin  <ldv@altlinux.org>

	* configure.ac (AC_CHECK_HEADERS): Remove asm/reg.h.

2009-10-12  Mike Frysinger  <vapier@gentoo.org>

	sparc/linux: Rewrite to use asm/ptrace.h.
	The current sparc/linux code uses asm/reg.h, but recent Linux kernels
	dropped that header completely.  So switch over to the ptrace headers
	as those should stick around indefinitely as part of the ABI.

	* defs.h [LINUXSPARC] (U_REG_G1, U_REG_O0, U_REG_O1): Define.
	* process.c: Drop asm/regs.h include.
	[SPARC || SPARC64] (change_syscall): Change struct regs to struct pt_regs.
	* signal.c: Drop asm/regs.h include.
	(m_siginfo_t): Unify [SPARC || SPARC64] and [MIPS].
	[SPARC || SPARC64] (sys_sigreturn): Change struct regs to struct pt_regs.
	* syscall.c: Drop asm/regs.h include.
	[SPARC || SPARC64] (internal_syscall, get_scno, get_error, force_result,
	syscall_enter): Change struct regs to struct pt_regs.
	* util.c: Drop asm/regs.h include.
	(_hack_syscall5, _ptrace): Delete.
	[SPARC || SPARC64] (getpc, printcall, arg_setup_state): Change
	struct regs to struct pt_regs.

2009-10-11  Roland McGrath  <roland@redhat.com>

	* make-dist: Clean up.

	* configure.ac: Use AC_CONFIG_AUX_DIR([.]).

2009-10-09  Dmitry V. Levin  <ldv@altlinux.org>

	* make-dist: New script for preparing release tarballs.

	* git-set-file-times: Import from rsync.

	* Makefile.am [MAINTAINER_MODE]: Define and export TAR_OPTIONS.

2009-10-08  Dmitry V. Levin  <ldv@altlinux.org>

	Enhance msgsnd() parser.
	* ipc.c (tprint_msgsnd): New function.  Move msgsnd parser code here,
	add check for umove() return code.
	(sys_msgsnd): Use tprint_msgsnd().

	* NEWS: Update for 4.5.19 release.

	Enhance semop()/semtimedop() sembuf parser.
	* ipc.c (tprint_sembuf): New function. Move sembuf parser code here,
	add abbrev() support.
	(sys_semop, sys_semtimedop): Use tprint_sembuf().

2009-10-08  Jakub Bogusz  <qboosh@pld-linux.org>

	Add pretty printing of sembuf argument to semop() and semtimedop()
	* ipc.c (semop_flags): New xlat structure.
	(sys_semop, sys_semtimedop): Add pretty printing of sembuf argument.

2009-10-08  Mike Frysinger  <vapier@gentoo.org>

	Add support for Linux/no-mmu with vfork.
	* configure.ac (AC_CHECK_FUNCS): Add fork.
	* strace.c (strace_vforked): Define.
	(startup_child): Do not raise SIGSTOP if vforked.
	(trace): Skip first exec when starting up after vforked.
	* syscall.c [BFIN] (get_scno): Drop waitexec checks.

	Avoid malloc(0) in getdents parsers.
	On end of directory, getdents returns 0.  This return value is used to
	then try and do malloc(0), but on some systems this will always return
	NULL.  Since the code won't read the pointer in question if len is 0,
	then don't bother calling malloc(0) and set the pointer to NULL ourself.
	* file.c (sys_getdents, sys_getdents64): Avoid malloc(0) call.

2009-10-07  Mike Frysinger  <vapier@gentoo.org>

	Add sys_nanosleep() prototype for sparc.
	* linux/sparc/syscall.h (sys_nanosleep): New prototype.
	Reported by Frederik Schüler.

	Silence compiler warnings about implicit cast from pointer to integer.
	* util.c (do_ptrace): Cast ptrace() 4th arg to long.
	(ptrace_restart): Drop void* cast on ptrace() 4th arg.

	Ignore .gdb files from FLAT toolchains.
	* .gitignore: Add /*.gdb.

	* configure.ac (AC_CHECK_FUNCS): Sort and expand.

	Blackfin: Update ioctl/syscall lists.
	* linux/bfin/ioctlent.h: Sync list with latest kernel sources.
	* linux/bfin/syscallent.h: Likewise.

	ioctlsort: Check ppc hosts too.
	* linux/ioctlsort.c: Check for __powerpc__.

2009-10-07  Andreas Schwab  <schwab@redhat.com>

	Fix build on ia64.
	* linux/ia64/syscallent.h: Update for addition of accept4 syscall
	in ../syscallent.h.

2009-10-07  Roland McGrath  <roland@redhat.com>

	* strace.spec (%doc): Add ChangeLog-CVS.

	* Makefile.am (srpm): New phony target.

	* Makefile.am (EXTRA_DIST): Add ChangeLog.
	($(srcdir)/ChangeLog): New target, replaces gen-changelog phony target.
	Put it inside [MAINTAINER_MODE].

2009-10-06  Dmitry V. Levin  <ldv@altlinux.org>

	* NEWS: Update for 4.5.19 release.

2009-10-05  Frederik Schüler  <fs@debian.org>

	Prepare debian/* files for release.
	* debian/rules: Do not ship ChangeLog anymore.
	* debian/control: Update to Debian standards version 3.8.1, and remove
	Roland from the Maintainers list.  This closes Debian bug #521458.
	* debian/changelog: Document changes and prepare for release.

2009-10-05  Dmitry V. Levin  <ldv@altlinux.org>

	* defs.h [HPPA]: Lower MAX_ARGS from 32 to 6.

	* ipc.c [LINUX] (sys_shmat): HPPA does not use an IPC multiplexer.
	Based on patch from Carlos O'Donell.

2009-10-05  Carlos O'Donell  <carlos@systemhalted.org>

	* linux/hppa/syscallent.h: Update syscalls.
	Based on work by Kyle McMartin and Helge Deller.

	Fix SA_HANDLER function pointer comparisons for hppa.
	* signal.c (sys_sigaction): Cast SA_HANDLER function pointers to long.
	(sys_rt_sigaction): Likewise.

2009-10-05  Edgar E. Iglesias  <edgar.iglesias@gmail.com>

	CRIS: Correct first argument to upeek()
	This complements commit ea0e6e80260d2b1b7ad40282012b0e47869bcddf.
	* syscall.c [CRISV10 || CRISV32] (syscall_fixup, syscall_enter): Pass
	tcp pointer instead of pid to upeek().
	* util.c [CRISV10 || CRISV32] (printcall): Likewise.

2009-10-05  Dmitry V. Levin  <ldv@altlinux.org>

	* signal.c (do_signalfd): Fix typo in output format.

2009-09-21  Dmitry V. Levin  <ldv@altlinux.org>

	* Makefile.am (gen_changelog_start_date): Fix date.

2009-09-19  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.5.19 release.
	* NEWS: Update for 4.5.19 release.
	* configure.ac: Version 4.5.19.
	* debian/changelog: 4.5.19-1.
	* strace.spec: 4.5.19-1.

	Update debian/* to 4.5.18-1.
	* debian/changelog: Update to 4.5.18-1.
	* debian/compat: Set compatibility level to 7.
	* debian/control (Build-Depends): Update debhelper requirement.
	(strace, strace64): Add Section and Priority tags.

2009-09-19  Kirill A. Shutemov  <kirill@shutemov.name>

	Fix fadvise64 decoding on ARM.
	* file.c (sys_fadvise64_64) [ARM]: Fix argument ordering.

2009-09-18  Dmitry V. Levin  <ldv@altlinux.org>

	Fix follow fork/vfork on Linux ARM OABI.
	__NR_SYSCALL_BASE eis 0 for EABI and is 0x900000 for OABI.
	* process (change_syscall) [LINUX && ARM]: Mask off the high order bits
	when changing syscall.

	Reviewed-by: Kirill A. Shutemov <kirill@shutemov.name>

2009-09-18  Mike Frysinger  <vapier@gentoo.org>

	Mark shell scripts as executable.

	Ignore ioctlsort helper program.
	* .gitignore: Add ioctlsort.

	linux/errno: Add ERFKILL.
	* linux/errnoent.h: Change ERRNO_132 to ERFKILL according to errno 132
	definition introduced in Linux 2.6.31.

2009-09-01  Paolo Bonzini  <pbonzini@redhat.com>

	Add accept4 socketcall.
	This second patch in the series adds support for accept4 as a socketcall
	sub-call.  Besides the need to renumber all system calls, this poses
	no problem.
	Tested on i686.

	* linux/arm/syscallent.h: Add accept4 socketcall.
	* linux/m68k/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sh/syscallent.h: Likewise.
	* linux/sh64/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/syscallent.h: Likewise.

	* linux/sparc/syscall.h (SYS_sub_accept4): Declare.
	(SYS_socket_nsubcalls): Update.
	* linux/syscall.h: Likewise.

2009-09-01  Paolo Bonzini  <pbonzini@redhat.com>

	Replace x86-64 paccept with accept4.
	This patch changes the paccept syscall to accept4 for x86-64, since
	the former was dropped in Linux kernel commit v2.6.27-rc7-14-g2d4c826.
	At the same time, it adds support for pretty printing its arguments.

	* linux/x86_64/syscallent.h: Replace paccept with accept4,
	hook in sys_accept4.
	* net.c (sys_accept): Leave a small stub calling the new...
	(do_accept): ... function, which also adds a flags_arg argument.
	(sys_accept4): New.

2009-08-28  Andreas Schwab  <schwab@redhat.com>

	Zero-extend 32-bit addresses when printing argv array.
	(printargv): Zero-extend 32-bit addresses.
	Fixes RH#519480 "64-bit strace is lazy on execve of 32-bit
	process".

2009-08-12  Andreas Schwab  <schwab@redhat.com>

	Add more futex decoding.
	* process.c (FUTEX_WAIT_REQUEUE_PI, FUTEX_CMP_REQUEUE_PI)
	(FUTEX_PRIVATE_FLAG, FUTEX_CLOCK_REALTIME): Define.
	(futexops): Add entries for them.
	(sys_futex): Decode FUTEX_CMP_REQUEUE_PI and
	FUTEX_WAIT_REQUEUE_PI.

2009-07-08  Dmitry V. Levin  <ldv@altlinux.org>

	Generate ChangeLog from git log.
	* .gitignore: Add ChangeLog
	* ChangeLog: Rename to ChangeLog-CVS.
	* Makefile.am (gen-changelog): New rule.
	(dist-hook): Depend on it.
	(EXTRA_DIST): Add ChangeLog-CVS.
	* README-hacking: Describe changes.
	* gitlog-to-changelog: Import from gnulib.


See ChangeLog-CVS for older changes.