forked from cyring/CoreFreq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcorefreq-cli-json.c
1957 lines (1887 loc) · 73.6 KB
/
corefreq-cli-json.c
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
/*
* CoreFreq (C) 2015-2021 CYRIL INGENIERIE
* Contributors: Andrew Gurinovich ; CyrIng
* Licenses: GPL2
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <time.h>
#include <errno.h>
#include "bitasm.h"
#include "coretypes.h"
#include "corefreq.h"
#include "corefreq-ui.h"
#include "corefreq-cli-rsc.h"
#include "corefreq-cli.h"
#include "corefreq-cli-json.h"
#include "corefreq-cli-extra.h"
double timespecFloat(struct timespec time)
{
return ((double) time.tv_sec + (time.tv_nsec / 1000000000.0));
}
void JsonSysInfo(SHM_STRUCT *Shm, CELL_FUNC OutFunc)
{
signed int i = 0, i2 = 0, i3 = 0;
unsigned int cpu;
enum CRC_MANUFACTURER vendor = Shm->Proc.Features.Info.Vendor.CRC;
struct json_state s = {.depth = 0, .nested_state =
{}, .write = json_writer_stdout};
UNUSED(OutFunc);
json_start_object(&s);
json_key(&s, "Registration");
{
json_start_object(&s);
json_key(&s, "Experimental");
json_literal(&s, "%d", Shm->Registration.Experimental);
json_key(&s, "HotPlug");
json_literal(&s, "%d", Shm->Registration.HotPlug);
json_key(&s, "PCI");
json_literal(&s, "%d", Shm->Registration.PCI);
json_key(&s, "Interrupt");
{
json_start_object(&s);
json_key(&s, "NMI_LOCAL");
json_literal(&s, "%u", BITVAL(Shm->Registration.NMI, BIT_NMI_LOCAL));
json_key(&s, "NMI_UNKNOWN");
json_literal(&s, "%u", BITVAL(Shm->Registration.NMI, BIT_NMI_UNKNOWN));
json_key(&s, "NMI_SERR");
json_literal(&s, "%u", BITVAL(Shm->Registration.NMI, BIT_NMI_SERR));
json_key(&s, "NMI_IO_CHECK");
json_literal(&s, "%u", BITVAL(Shm->Registration.NMI, BIT_NMI_IO_CHECK));
json_end_object(&s);
}
json_key(&s, "CPUidle");
json_literal(&s, "%hu", Shm->Registration.Driver.CPUidle);
json_key(&s, "CPUfreq");
json_literal(&s, "%hu", Shm->Registration.Driver.CPUfreq);
json_key(&s, "Governor");
json_literal(&s, "%hu", Shm->Registration.Driver.Governor);
json_key(&s, "ClockSource");
json_literal(&s, "%hu", Shm->Registration.Driver.CS);
json_end_object(&s);
}
if (BITWISEAND(LOCKLESS, Shm->SysGate.Operation, 0x1))
{
json_key(&s, "SysGate");
{
json_start_object(&s);
json_key(&s, "tickReset");
json_literal(&s, "%u", Shm->SysGate.tickReset);
json_key(&s, "tickStep");
json_literal(&s, "%u", Shm->SysGate.tickStep);
json_key(&s, "trackTask");
json_literal(&s, "%d", Shm->SysGate.trackTask);
json_key(&s, "sortByField");
json_literal(&s, "%d", Shm->SysGate.sortByField);
json_key(&s, "reverseOrder");
json_literal(&s, "%d", Shm->SysGate.reverseOrder);
json_key(&s, "taskCount");
json_literal(&s, "%d", Shm->SysGate.taskCount);
json_key(&s, "taskList");
json_start_arr(&s);
for (i = 0; i < Shm->SysGate.taskCount; i++) {
json_start_object(&s);
json_key(&s, "runtime");
json_literal(&s, "%llu", Shm->SysGate.taskList[i].runtime);
json_key(&s, "usertime");
json_literal(&s, "%llu", Shm->SysGate.taskList[i].usertime);
json_key(&s, "systime");
json_literal(&s, "%llu", Shm->SysGate.taskList[i].systime);
json_key(&s, "pid");
json_literal(&s, "%d", Shm->SysGate.taskList[i].pid);
json_key(&s, "tgid");
json_literal(&s, "%d", Shm->SysGate.taskList[i].tgid);
json_key(&s, "ppid");
json_literal(&s, "%d", Shm->SysGate.taskList[i].ppid);
json_key(&s, "state");
json_literal(&s, "%hu", Shm->SysGate.taskList[i].state);
json_key(&s, "wake_cpu");
json_literal(&s, "%hu", Shm->SysGate.taskList[i].wake_cpu);
json_key(&s, "comm");
json_string(&s, Shm->SysGate.taskList[i].comm);
json_end_object(&s);
}
json_end_arr(&s);
json_key(&s, "memInfo");
{
json_start_object(&s);
json_key(&s, "totalram");
json_literal(&s, "%llu", Shm->SysGate.memInfo.totalram);
json_key(&s, "sharedram");
json_literal(&s, "%llu", Shm->SysGate.memInfo.sharedram);
json_key(&s, "freeram");
json_literal(&s, "%llu", Shm->SysGate.memInfo.freeram);
json_key(&s, "bufferram");
json_literal(&s, "%llu", Shm->SysGate.memInfo.bufferram);
json_key(&s, "totalhigh");
json_literal(&s, "%llu", Shm->SysGate.memInfo.totalhigh);
json_key(&s, "freehigh");
json_literal(&s, "%llu", Shm->SysGate.memInfo.freehigh);
json_end_object(&s);
}
json_key(&s, "kernel");
{
json_start_object(&s);
json_key(&s, "version");
json_literal(&s, "%u", Shm->SysGate.kernel.version);
json_key(&s, "major");
json_literal(&s, "%u", Shm->SysGate.kernel.major);
json_key(&s, "minor");
json_literal(&s, "%u", Shm->SysGate.kernel.minor);
json_end_object(&s);
}
json_key(&s, "sysname");
json_string(&s, Shm->SysGate.sysname);
json_key(&s, "release");
json_string(&s, Shm->SysGate.release);
json_key(&s, "version");
json_string(&s, Shm->SysGate.version);
json_key(&s, "machine");
json_string(&s, Shm->SysGate.machine);
json_key(&s, "SubDriver");
{
json_start_object(&s);
if (strlen(Shm->SysGate.OS.FreqDriver.Name) > 0) {
json_key(&s, "CPU_Freq");
json_string(&s, Shm->SysGate.OS.FreqDriver.Name);
}
if (strlen(Shm->SysGate.OS.FreqDriver.Governor) > 0) {
json_key(&s, "Governor");
json_string(&s, Shm->SysGate.OS.FreqDriver.Governor);
}
if (strlen(Shm->SysGate.OS.IdleDriver.Name) > 0) {
json_key(&s, "CPU_Idle");
json_string(&s, Shm->SysGate.OS.IdleDriver.Name);
}
json_end_object(&s);
}
json_end_object(&s);
}
}
json_key(&s, "Sleep");
{
json_start_object(&s);
json_key(&s, "Interval");
json_literal(&s, "%u", Shm->Sleep.Interval);
json_key(&s, "pollingWait");
json_literal(&s, "%f", timespecFloat(Shm->Sleep.pollingWait));
json_key(&s, "ringWaiting");
json_literal(&s, "%f", timespecFloat(Shm->Sleep.ringWaiting));
json_key(&s, "childWaiting");
json_literal(&s, "%f", timespecFloat(Shm->Sleep.childWaiting));
json_key(&s, "sliceWaiting");
json_literal(&s, "%f", timespecFloat(Shm->Sleep.sliceWaiting));
json_end_object(&s);
}
json_key(&s, "ShmName");
json_string(&s, Shm->ShmName);
json_key(&s, "App");
{
json_start_object(&s);
json_key(&s, "Svr");
json_literal(&s, "%d", Shm->App.Svr);
json_key(&s, "Cli");
json_literal(&s, "%d", Shm->App.Cli);
json_key(&s, "GUI");
json_literal(&s, "%d", Shm->App.GUI);
json_end_object(&s);
}
json_key(&s, "Uncore");
{
json_start_object(&s);
json_key(&s, "Boost");
{
json_start_arr(&s);
for (i = 0; i < UNCORE_RATIO_SIZE; i++) {
json_literal(&s, "%u", Shm->Uncore.Boost[i]);
}
json_end_arr(&s);
}
json_key(&s, "Bus");
{
json_start_object(&s);
json_key(&s, "Speed");
json_literal(&s, "%u", Shm->Uncore.Bus.Speed);
json_key(&s, "Rate");
json_literal(&s, "%u", Shm->Uncore.Bus.Rate);
json_end_object(&s);
}
json_key(&s, "MC");
json_start_arr(&s);
for (i = 0; i < MC_MAX_CTRL; i++) {
{
json_start_object(&s);
json_key(&s, "Channel");
json_start_arr(&s);
{
for (i2 = 0; i2 < MC_MAX_CHA; i2++) {
json_start_object(&s);
json_key(&s, "Timing");
{
json_start_object(&s);
json_key(&s, "tCL");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tCL);
json_key(&s, "tRCD");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tRCD);
json_key(&s, "tRP");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tRP);
json_key(&s, "tRAS");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tRAS);
json_key(&s, "tRRD");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tRRD);
json_key(&s, "tRFC");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tRFC);
json_key(&s, "tWR");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tWR);
json_key(&s, "tRTPr");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tRTPr);
json_key(&s, "tWTPr");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tWTPr);
json_key(&s, "tFAW");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tFAW);
json_key(&s, "B2B");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.B2B);
json_key(&s, "tCWL");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tCWL);
json_key(&s, "CMD_Rate");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.CMD_Rate);
json_key(&s, "tsrRdTRd");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tsrRdTRd);
json_key(&s, "tdrRdTRd");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tdrRdTRd);
json_key(&s, "tddRdTRd");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tddRdTRd);
json_key(&s, "tsrRdTWr");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tsrRdTWr);
json_key(&s, "tdrRdTWr");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tdrRdTWr);
json_key(&s, "tddRdTWr");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tddRdTWr);
json_key(&s, "tsrWrTRd");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tsrWrTRd);
json_key(&s, "tdrWrTRd");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tdrWrTRd);
json_key(&s, "tddWrTRd");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tddWrTRd);
json_key(&s, "tsrWrTWr");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tsrWrTWr);
json_key(&s, "tdrWrTWr");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tdrWrTWr);
json_key(&s, "tddWrTWr");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.tddWrTWr);
json_key(&s, "ECC");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].Timing.ECC);
json_end_object(&s);
}
json_key(&s, "DIMM");
json_start_arr(&s);
for (i3 = 0; i3 < MC_MAX_DIMM; i3++) {
json_start_object(&s);
json_key(&s, "Size");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].DIMM[i3].Size);
json_key(&s, "Rows");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].DIMM[i3].Rows);
json_key(&s, "Cols");
json_literal(&s, "%u", Shm->Uncore.MC[i].Channel[i2].DIMM[i3].Cols);
json_key(&s, "Banks");
json_literal(&s, "%hu", Shm->Uncore.MC[i].Channel[i2].DIMM[i3].Banks);
json_key(&s, "Ranks");
json_literal(&s, "%hu", Shm->Uncore.MC[i].Channel[i2].DIMM[i3].Ranks);
json_end_object(&s);
}
json_end_arr(&s);
json_end_object(&s);
}
}
json_end_arr(&s);
json_key(&s, "SlotCount");
json_literal(&s, "%hu", Shm->Uncore.MC[i].SlotCount);
json_key(&s, "ChannelCount");
json_literal(&s, "%hu", Shm->Uncore.MC[i].ChannelCount);
json_end_object(&s);
}
}
json_end_arr(&s);
json_key(&s, "CtrlSpeed");
json_literal(&s, "%llu", Shm->Uncore.CtrlSpeed);
json_key(&s, "CtrlCount");
json_literal(&s, "%llu", Shm->Uncore.CtrlCount);
json_key(&s, "Unit");
{
json_start_object(&s);
json_key(&s, "Bus_Rate");
json_literal(&s, "%u", (unsigned) Shm->Uncore.Unit.Bus_Rate);
json_key(&s, "BusSpeed");
json_literal(&s, "%u", (unsigned) Shm->Uncore.Unit.BusSpeed);
json_key(&s, "DDR_Rate");
json_literal(&s, "%u", (unsigned) Shm->Uncore.Unit.DDR_Rate);
json_key(&s, "DDRSpeed");
json_literal(&s, "%u", (unsigned) Shm->Uncore.Unit.DDRSpeed);
json_key(&s, "DDR_Ver");
json_literal(&s, "%u", (unsigned) Shm->Uncore.Unit.DDR_Ver);
json_end_object(&s);
}
json_end_object(&s);
}
json_key(&s, "Proc");
{
json_start_object(&s);
json_key(&s, "Features");
{
json_start_object(&s);
json_key(&s, "Info");
{
json_start_object(&s);
json_key(&s, "LargestStdFunc");
json_literal(&s, "%u", Shm->Proc.Features.Info.LargestStdFunc);
json_key(&s, "LargestExtFunc");
json_literal(&s, "%u", Shm->Proc.Features.Info.LargestExtFunc);
json_key(&s, "Vendor");
{
json_start_object(&s);
json_key(&s, "CRC");
json_literal(&s, "%u", Shm->Proc.Features.Info.Vendor.CRC);
json_key(&s, "ID");
json_string(&s, Shm->Proc.Features.Info.Vendor.ID);
json_end_object(&s);
}
json_key(&s, "Hypervisor");
{
json_start_object(&s);
json_key(&s, "LargestHypFunc");
json_literal(&s, "%u", Shm->Proc.Features.Info.LargestHypFunc);
json_key(&s, "CRC");
json_literal(&s, "%u", Shm->Proc.Features.Info.Hypervisor.CRC);
json_key(&s, "ID");
json_string(&s, Shm->Proc.Features.Info.Hypervisor.ID);
json_end_object(&s);
}
json_end_object(&s);
}
json_key(&s, "Std");
{
json_start_object(&s);
json_key(&s, "EAX");
{
json_start_object(&s);
json_key(&s, "Stepping");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EAX.Stepping);
json_key(&s, "Model");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EAX.Model);
json_key(&s, "Family");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EAX.Family);
json_key(&s, "ProcType");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EAX.ProcType);
json_key(&s, "Unused1");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EAX.Unused1);
json_key(&s, "ExtModel");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EAX.ExtModel);
json_key(&s, "ExtFamily");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EAX.ExtFamily);
json_key(&s, "Unused2");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EAX.Unused2);
json_end_object(&s);
}
json_key(&s, "EBX");
{
json_start_object(&s);
json_key(&s, "Brand_ID");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EBX.Brand_ID);
json_key(&s, "CLFSH_Size");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EBX.CLFSH_Size);
json_key(&s, "Max_SMT_ID");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EBX.Max_SMT_ID);
json_key(&s, "Init_APIC_ID");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EBX.Init_APIC_ID);
json_end_object(&s);
}
json_key(&s, "EСX");
{
json_start_object(&s);
json_key(&s, "SSE3");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.SSE3);
json_key(&s, "PCLMULQDQ");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.PCLMULDQ);
json_key(&s, "DTES64");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.DTES64);
json_key(&s, "MONITOR");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.MONITOR);
json_key(&s, "DS_CPL");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.DS_CPL);
json_key(&s, "VMX");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.VMX);
json_key(&s, "SMX");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.SMX);
json_key(&s, "EIST");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.EIST);
json_key(&s, "TM2");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.TM2);
json_key(&s, "SSSE3");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.SSSE3);
json_key(&s, "CNXT_ID");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.CNXT_ID);
json_key(&s, "SDBG");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.SDBG);
json_key(&s, "FMA");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.FMA);
json_key(&s, "CMPXCHG16B");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.CMPXCHG16);
json_key(&s, "xTPR");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.xTPR);
json_key(&s, "PDCM");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.PDCM);
json_key(&s, "Unused1");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.Unused1);
json_key(&s, "PCID");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.PCID);
json_key(&s, "DCA");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.DCA);
json_key(&s, "SSE41");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.SSE41);
json_key(&s, "SSE42");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.SSE42);
json_key(&s, "x2APIC");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.x2APIC);
json_key(&s, "MOVBE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.MOVBE);
json_key(&s, "POPCNT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.POPCNT);
json_key(&s, "TSCDEAD");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.TSCDEAD);
json_key(&s, "XSAVE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.XSAVE);
json_key(&s, "OSXSAVE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.OSXSAVE);
json_key(&s, "AVX");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.AVX);
json_key(&s, "F16C");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.F16C);
json_key(&s, "RDRAND");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.RDRAND);
json_key(&s, "Hyperv");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.ECX.Hyperv);
json_end_object(&s);
}
json_key(&s, "EDX");
{
json_start_object(&s);
json_key(&s, "FPU");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.FPU);
json_key(&s, "VME");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.VME);
json_key(&s, "DE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.DE);
json_key(&s, "PSE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.PSE);
json_key(&s, "TSC");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.TSC);
json_key(&s, "MSR");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.MSR);
json_key(&s, "PAE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.PAE);
json_key(&s, "MCE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.MCE);
json_key(&s, "CMPXCHG8B");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.CMPXCHG8);
json_key(&s, "APIC");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.APIC);
json_key(&s, "Unused1");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.Unused1);
json_key(&s, "SEP");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.SEP);
json_key(&s, "MTRR");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.MTRR);
json_key(&s, "PGE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.PGE);
json_key(&s, "MCA");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.MCA);
json_key(&s, "CMOV");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.CMOV);
json_key(&s, "PAT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.PAT);
json_key(&s, "PSE36");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.PSE36);
json_key(&s, "PSN");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.PSN);
json_key(&s, "CLFLUSH");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.CLFLUSH);
json_key(&s, "Unused2");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.Unused2);
json_key(&s, "DS_PEBS");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.DS_PEBS);
json_key(&s, "ACPI");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.ACPI);
json_key(&s, "MMX");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.MMX);
json_key(&s, "FXSR");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.FXSR);
json_key(&s, "SSE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.SSE);
json_key(&s, "SSE2");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.SSE2);
json_key(&s, "SS");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.SS);
json_key(&s, "HTT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.HTT);
json_key(&s, "TM1");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.TM1);
json_key(&s, "Unused3");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.Unused3);
json_key(&s, "PBE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Std.EDX.PBE);
json_end_object(&s);
}
json_end_object(&s);
}
json_key(&s, "MWait");
{
json_start_object(&s);
json_key(&s, "EAX");
{
json_start_object(&s);
json_key(&s, "SmallestSize");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.EAX.SmallestSize);
json_key(&s, "ReservedBits");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.EAX.ReservedBits);
json_end_object(&s);
}
json_key(&s, "EBX");
{
json_start_object(&s);
json_key(&s, "LargestSize");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.EBX.LargestSize);
json_key(&s, "ReservedBits");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.EBX.ReservedBits);
json_end_object(&s);
}
json_key(&s, "ECX");
{
json_start_object(&s);
json_key(&s, "EMX_MWAIT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.ECX.EMX_MWAIT);
json_key(&s, "IBE_MWAIT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.ECX.IBE_MWAIT);
json_key(&s, "ReservedBits");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.ECX.ReservedBits);
json_end_object(&s);
}
json_key(&s, "EDX");
{
json_start_object(&s);
json_key(&s, "SubCstate_C0_MWAIT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.EDX.SubCstate_MWAIT0);
json_key(&s, "SubCstate_C1_MWAIT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.EDX.SubCstate_MWAIT1);
json_key(&s, "SubCstate_C2_MWAIT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.EDX.SubCstate_MWAIT2);
json_key(&s, "SubCstate_C3_MWAIT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.EDX.SubCstate_MWAIT3);
json_key(&s, "SubCstate_C4_MWAIT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.EDX.SubCstate_MWAIT4);
json_key(&s, "SubCstate_C5_MWAIT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.EDX.SubCstate_MWAIT5);
json_key(&s, "SubCstate_C6_MWAIT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.EDX.SubCstate_MWAIT6);
json_key(&s, "SubCstate_C7_MWAIT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.MWait.EDX.SubCstate_MWAIT7);
json_end_object(&s);
}
json_end_object(&s);
}
json_key(&s, "Power");
{
json_start_object(&s);
json_key(&s, "EAX");
{
json_start_object(&s);
json_key(&s, "DTS");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.DTS);
json_key(&s, "TurboIDA");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.TurboIDA);
json_key(&s, "ARAT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.ARAT);
json_key(&s, "PLN");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.PLN);
json_key(&s, "ECMD");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.ECMD);
json_key(&s, "PTM");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.PTM);
json_key(&s, "HWP_Registers");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.HWP_Reg);
json_key(&s, "HWP_Interrupt");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.HWP_Int);
json_key(&s, "HWP_Activity");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.HWP_Act);
json_key(&s, "HWP_EPP");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.HWP_EPP);
json_key(&s, "HWP_Package");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.HWP_Pkg);
json_key(&s, "HDC_Registers");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.HDC_Reg);
json_key(&s, "Turbo_V3");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.Turbo_V3);
json_key(&s, "HWP_Highest_Pref_Cap");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.HWP_HPrf);
json_key(&s, "HWP_PECI");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.HWP_PECI);
json_key(&s, "HWP_Flex");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.HWP_Flex);
json_key(&s, "HWP_Fast");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.HWP_Fast);
json_key(&s, "HWFB_Cap");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.HWFB_Cap);
json_key(&s, "HWP_Idle_SMT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EAX.HWP_Idle);
json_end_object(&s);
}
json_key(&s, "ECX");
{
json_start_object(&s);
if (vendor == CRC_INTEL) {
json_key(&s, "HCF_Cap");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.ECX.HCF_Cap);
json_key(&s, "ACNT_Cap");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.ECX.ACNT_Cap);
json_key(&s, "Unused1");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.ECX.Unused1);
json_key(&s, "SETBH");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.ECX.SETBH);
json_key(&s, "Unused2");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.ECX.Unused2);
} else if ((vendor == CRC_AMD) || (vendor == CRC_HYGON)) {
json_key(&s, "EffFreq");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.ECX.EffFreq);
json_key(&s, "NotUsed");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.ECX.NotUsed);
} else {
fprintf(stderr, "Unknown vendor");
}
json_end_object(&s);
}
json_key(&s, "EDX");
{
json_start_object(&s);
json_key(&s, "Unused1");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.Power.EDX.Unused1);
json_end_object(&s);
}
json_end_object(&s);
}
json_key(&s, "ExtFeature");
{
json_start_object(&s);
json_key(&s, "EAX");
{
json_start_object(&s);
json_key(&s, "MaxSubLeaf");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EAX.MaxSubLeaf);
json_end_object(&s);
}
json_key(&s, "EBX");
{
json_start_object(&s);
json_key(&s, "FSGSBASE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.FSGSBASE);
json_key(&s, "TSC_ADJUST");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.TSC_ADJUST);
if ( (vendor == CRC_AMD) || (vendor == CRC_HYGON) ) {
json_key(&s, "UMIP");
} else {
json_key(&s, "SGX");
}
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.SGX_UMIP);
json_key(&s, "BMI1");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.BMI1);
json_key(&s, "HLE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.HLE);
json_key(&s, "AVX2");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.AVX2);
json_key(&s, "FDP_EXCPTN_x87");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.FDP_EXCPTN_x87);
json_key(&s, "SMEP");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.SMEP);
json_key(&s, "BMI2");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.BMI2);
json_key(&s, "FastStrings");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.FastStrings);
json_key(&s, "INVPCID");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.INVPCID);
json_key(&s, "RTM");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.RTM);
json_key(&s, "PQM");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.PQM);
json_key(&s, "FPU_CS_DS");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.FPU_CS_DS);
json_key(&s, "MPX");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.MPX);
json_key(&s, "PQE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.PQE);
json_key(&s, "AVX_512F");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.AVX_512F);
json_key(&s, "AVX_512DQ");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.AVX_512DQ);
json_key(&s, "RDSEED");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.RDSEED);
json_key(&s, "ADX");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.ADX);
json_key(&s, "SMAP_CLAC_STAC");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.SMAP_CLAC_STAC);
json_key(&s, "AVX512_IFMA");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.AVX512_IFMA);
json_key(&s, "CLFLUSHOPT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.CLFLUSHOPT);
json_key(&s, "CLWB");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.CLWB);
json_key(&s, "ProcessorTrace");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.ProcessorTrace);
json_key(&s, "AVX512PF");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.AVX512PF);
json_key(&s, "AVX512ER");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.AVX512ER);
json_key(&s, "AVX512CD");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.AVX512CD);
json_key(&s, "SHA");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.SHA);
json_key(&s, "AVX512BW");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.AVX512BW);
json_key(&s, "AVX512VL");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EBX.AVX512VL);
json_key(&s, "AVX512_BF16");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature_Leaf1.EAX.AVX512_BF16);
json_end_object(&s);
}
json_key(&s, "ECX");
{
json_start_object(&s);
json_key(&s, "PREFETCHWT1");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.PREFETCHWT1);
json_key(&s, "AVX512_VBMI");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.AVX512_VBMI);
json_key(&s, "UMIP");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.UMIP);
json_key(&s, "PKU");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.PKU);
json_key(&s, "OSPKE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.OSPKE);
json_key(&s, "WAITPKG");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.WAITPKG);
json_key(&s, "AVX512_VBMI2");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.AVX512_VBMI2);
json_key(&s, "GFNI");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.GFNI);
json_key(&s, "VAES");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.VAES);
json_key(&s, "VPCLMULQDQ");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.VPCLMULQDQ);
json_key(&s, "AVX512_VNNI");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.AVX512_VNNI);
json_key(&s, "AVX512_BITALG");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.AVX512_BITALG);
json_key(&s, "AVX512_VPOPCNTDQ");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.AVX512_VPOPCNTDQ);
json_key(&s, "MAWAU");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.MAWAU);
json_key(&s, "RDPID");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.RDPID);
json_key(&s, "CLDEMOTE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.CLDEMOTE);
json_key(&s, "MOVDIRI");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.MOVDIRI);
json_key(&s, "MOVDIR64B");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.MOVDIR64B);
json_key(&s, "ENQCMD");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.ENQCMD);
json_key(&s, "SGX_LC");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.ECX.SGX_LC);
json_end_object(&s);
}
json_key(&s, "EDX");
{
json_start_object(&s);
json_key(&s, "AVX512_4VNNIW");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.AVX512_4VNNIW);
json_key(&s, "AVX512_4FMAPS");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.AVX512_4FMAPS);
json_key(&s, "Fast_Short_REP_MOV");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.FShort_REP_MOV);
json_key(&s, "AVX512_VP2INTERSECT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.AVX512_VP2INTER);
json_key(&s, "MD_CLEAR");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.MD_CLEAR_Cap);
json_key(&s, "SERIALIZE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.SERIALIZE);
json_key(&s, "Hybrid");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.Hybrid);
json_key(&s, "TSX_FORCE_ABORT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.TSX_FORCE_ABORT);
json_key(&s, "TSXLDTRK");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.TSXLDTRK);
json_key(&s, "PCONFIG");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.PCONFIG);
json_key(&s, "IBRS_IBPB");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.IBRS_IBPB_Cap);
json_key(&s, "STIBP");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.STIBP_Cap);
json_key(&s, "L1D_FLUSH");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.L1D_FLUSH_Cap);
json_key(&s, "IA32_ARCH_CAPABILITIES");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.IA32_ARCH_CAP);
json_key(&s, "IA32_CORE_CAPABILITIES");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.IA32_CORE_CAP);
json_key(&s, "SSBD");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtFeature.EDX.SSBD_Cap);
json_end_object(&s);
}
json_end_object(&s);
}
json_key(&s, "PerfMon");
{
json_start_object(&s);
json_key(&s, "EAX");
{
json_start_object(&s);
json_key(&s, "Version");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EAX.Version);
json_key(&s, "MonCtrs");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EAX.MonCtrs);
json_key(&s, "MonWidth");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EAX.MonWidth);
json_key(&s, "VectorSz");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EAX.VectorSz);
json_end_object(&s);
}
json_key(&s, "EBX");
{
json_start_object(&s);
json_key(&s, "CoreCycles");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EBX.CoreCycles);
json_key(&s, "InstrRetired");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EBX.InstrRetired);
json_key(&s, "RefCycles");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EBX.RefCycles);
json_key(&s, "LLC_Ref");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EBX.LLC_Ref);
json_key(&s, "LLC_Misses");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EBX.LLC_Misses);
json_key(&s, "BranchRetired");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EBX.BranchRetired);
json_key(&s, "BranchMispred");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EBX.BranchMispred);
json_key(&s, "TopdownSlots");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EBX.TopdownSlots);
json_key(&s, "ReservedBits");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EBX.ReservedBits);
json_end_object(&s);
}
json_key(&s, "ECX");
{
json_start_object(&s);
json_key(&s, "Unused1");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.ECX.Unused1);
json_end_object(&s);
}
json_key(&s, "EDX");
{
json_start_object(&s);
json_key(&s, "FixCtrs");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EDX.FixCtrs);
json_key(&s, "FixWidth");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EDX.FixWidth);
json_key(&s, "AnyThread_Deprecation");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.PerfMon.EDX.AnyThread_Dprec);
json_end_object(&s);
}
json_end_object(&s);
}
json_key(&s, "ExtInfo");
{
json_start_object(&s);
json_key(&s, "ECX");
{
json_start_object(&s);
if (vendor == CRC_INTEL) {
json_key(&s, "LahfSahf");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.LAHFSAHF);
json_key(&s, "LZCNT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.LZCNT);
json_key(&s, "PREFETCHW");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.PREFETCHW);
} else if ((vendor == CRC_AMD) || (vendor == CRC_HYGON)) {
json_key(&s, "LahfSahf");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.LahfSahf);
json_key(&s, "MP_Mode");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.MP_Mode);
json_key(&s, "SVM");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.SVM);
json_key(&s, "Ext_APIC_Space");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.xApicSpace);
json_key(&s, "AltMov");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.AltMov);
json_key(&s, "ABM");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.ABM);
json_key(&s, "SSE4A");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.SSE4A);
json_key(&s, "AlignSSE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.AlignSSE);
json_key(&s, "PREFETCH");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.PREFETCH);
json_key(&s, "OSVW");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.OSVW);
json_key(&s, "IBS");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.IBS);
json_key(&s, "XOP");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.XOP);
json_key(&s, "SKINIT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.SKINIT);
json_key(&s, "WDT");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.WDT);
json_key(&s, "NotUsed1");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.NotUsed1);
json_key(&s, "LWP");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.LWP);
json_key(&s, "FMA4");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.FMA4);
json_key(&s, "TCE");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.TCE);
json_key(&s, "NotUsed2");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.NotUsed2);
json_key(&s, "NodeId");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.NodeId);
json_key(&s, "NotUsed3");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.NotUsed3);
json_key(&s, "TBM");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.TBM);
json_key(&s, "TopoExt");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.ExtApicId);
json_key(&s, "PerfCore");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.PerfCore);
json_key(&s, "PerfNB");
json_literal(&s, "%u", (unsigned) Shm->Proc.Features.ExtInfo.ECX.PerfNB);
json_key(&s, "NotUsed4");