~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/builtin-version.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/perf/builtin-version.c (Version linux-6.12-rc7) and /tools/perf/builtin-version.c (Version linux-4.12.14)


  1 // SPDX-License-Identifier: GPL-2.0            << 
  2 #include "builtin.h"                                1 #include "builtin.h"
  3 #include "color.h"                             !!   2 #include "perf.h"
  4 #include "util/debug.h"                        !!   3 #include <linux/compiler.h>
  5 #include "util/header.h"                       << 
  6 #include <tools/config.h>                      << 
  7 #include <stdbool.h>                           << 
  8 #include <stdio.h>                                  4 #include <stdio.h>
  9 #include <string.h>                            << 
 10 #include <subcmd/parse-options.h>              << 
 11                                                     5 
 12 struct version {                               !!   6 int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused)
 13         bool    build_options;                 << 
 14 };                                             << 
 15                                                << 
 16 static struct version version;                 << 
 17                                                << 
 18 static struct option version_options[] = {     << 
 19         OPT_BOOLEAN(0, "build-options", &versi << 
 20                     "display the build options << 
 21         OPT_END(),                             << 
 22 };                                             << 
 23                                                << 
 24 static const char * const version_usage[] = {  << 
 25         "perf version [<options>]",            << 
 26         NULL                                   << 
 27 };                                             << 
 28                                                << 
 29 static void on_off_print(const char *status)   << 
 30 {                                              << 
 31         printf("[ ");                          << 
 32                                                << 
 33         if (!strcmp(status, "OFF"))            << 
 34                 color_fprintf(stdout, PERF_COL << 
 35         else                                   << 
 36                 color_fprintf(stdout, PERF_COL << 
 37                                                << 
 38         printf(" ]");                          << 
 39 }                                              << 
 40                                                << 
 41 static void status_print(const char *name, con << 
 42                          const char *status)   << 
 43 {                                                   7 {
 44         printf("%22s: ", name);                << 
 45         on_off_print(status);                  << 
 46         printf("  # %s\n", macro);             << 
 47 }                                              << 
 48                                                << 
 49 #define STATUS(feature)                        << 
 50 do {                                           << 
 51         if (feature.is_builtin)                << 
 52                 status_print(feature.name, fea << 
 53         else                                   << 
 54                 status_print(feature.name, fea << 
 55 } while (0)                                    << 
 56                                                << 
 57 static void library_status(void)               << 
 58 {                                              << 
 59         for (int i = 0; supported_features[i]. << 
 60                 STATUS(supported_features[i]); << 
 61 }                                              << 
 62                                                << 
 63 int cmd_version(int argc, const char **argv)   << 
 64 {                                              << 
 65         argc = parse_options(argc, argv, versi << 
 66                              PARSE_OPT_STOP_AT << 
 67                                                << 
 68         printf("perf version %s\n", perf_versi      8         printf("perf version %s\n", perf_version_string);
 69                                                << 
 70         if (version.build_options || verbose > << 
 71                 library_status();              << 
 72                                                << 
 73         return 0;                                   9         return 0;
 74 }                                                  10 }
 75                                                    11 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php