]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Merge branch 'lscpu-json-types' of https://github.com/t-8ch/util-linux
authorKarel Zak <kzak@redhat.com>
Wed, 2 Jun 2021 11:06:10 +0000 (13:06 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 2 Jun 2021 11:06:10 +0000 (13:06 +0200)
* 'lscpu-json-types' of https://github.com/t-8ch/util-linux:
  lscpu: use optional json values
  libsmartcols: add support for optional boolean values
  lscpu: use json types

1  2 
sys-utils/lscpu.c

index 24f59465d9ebf65e4471d6bff373ae225d77d30a,cd7475bd173316199cdaefc1ddc15face5fbc1fe..4224d2ef0bb659a0783ca97de57ae3f1f3dcd9ec
@@@ -148,12 -149,12 +149,12 @@@ static struct lscpu_coldesc coldescs_cp
        [COL_CPU_CACHE]        = { "CACHE", N_("shows how caches are shared between CPUs") },
        [COL_CPU_POLARIZATION] = { "POLARIZATION", N_("CPU dispatching mode on virtual hardware") },
        [COL_CPU_ADDRESS]      = { "ADDRESS", N_("physical address of a CPU") },
-       [COL_CPU_CONFIGURED]   = { "CONFIGURED", N_("shows if the hypervisor has allocated the CPU") },
-       [COL_CPU_ONLINE]       = { "ONLINE", N_("shows if Linux currently makes use of the CPU"), SCOLS_FL_RIGHT },
-       [COL_CPU_MHZ]          = { "MHZ", N_("shows the currently MHz of the CPU"), SCOLS_FL_RIGHT },
-       [COL_CPU_SCALMHZ]      = { "SCALMHZ%", N_("shows scaling percentage of the CPU frequency"), SCOLS_FL_RIGHT },
-       [COL_CPU_MAXMHZ]       = { "MAXMHZ", N_("shows the maximum MHz of the CPU"), SCOLS_FL_RIGHT },
-       [COL_CPU_MINMHZ]       = { "MINMHZ", N_("shows the minimum MHz of the CPU"), SCOLS_FL_RIGHT }
+       [COL_CPU_CONFIGURED]   = { "CONFIGURED", N_("shows if the hypervisor has allocated the CPU"), 0, 0, SCOLS_JSON_BOOLEAN_OPTIONAL },
+       [COL_CPU_ONLINE]       = { "ONLINE", N_("shows if Linux currently makes use of the CPU"), SCOLS_FL_RIGHT, 0, SCOLS_JSON_BOOLEAN_OPTIONAL },
 -      [COL_CPU_MHZ]          = { "MHZ", N_("shows the currently MHz of the CPU"), SCOLS_FL_RIGHT, 0, SCOLS_JSON_NUMBER },
++      [COL_CPU_MHZ]          = { "MHZ", N_("shows the currently MHz of the CPU"), SCOLS_FL_RIGHT, 0, SCOLS_JSON_NUMBER },
+       [COL_CPU_SCALMHZ]      = { "SCALMHZ%", N_("shows scaling percentage of the CPU frequency"), SCOLS_FL_RIGHT, SCOLS_JSON_NUMBER },
+       [COL_CPU_MAXMHZ]       = { "MAXMHZ", N_("shows the maximum MHz of the CPU"), SCOLS_FL_RIGHT, 0, SCOLS_JSON_NUMBER },
+       [COL_CPU_MINMHZ]       = { "MINMHZ", N_("shows the minimum MHz of the CPU"), SCOLS_FL_RIGHT, 0, SCOLS_JSON_NUMBER }
  };
  
  static struct lscpu_coldesc coldescs_cache[] =