MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / SWITCH

Function SWITCH

src/arguments.cpp:60–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 if (value != NULL) *value++ = 0;
59
60 SWITCH (arg) {
61 // Actions
62 CASE("start")
63 _action = ACTION_START;
64
65 CASE("resume")
66 _action = ACTION_RESUME;
67
68 CASE("stop")
69 _action = ACTION_STOP;
70
71 CASE("dump")
72 _action = ACTION_DUMP;
73
74 CASE("status")
75 _action = ACTION_STATUS;
76
77 CASE("metrics")
78 _action = ACTION_METRICS;
79
80 CASE("list")
81 _action = ACTION_LIST;
82
83 CASE("version")
84 _action = ACTION_VERSION;
85
86 // Output formats
87 CASE("collapsed")
88 _output = OUTPUT_COLLAPSED;
89
90 CASE("flamegraph")
91 _output = OUTPUT_FLAMEGRAPH;
92
93 CASE("tree")
94 _output = OUTPUT_TREE;
95
96 CASE("jfr")
97 _output = OUTPUT_JFR;
98
99 CASE("jfropts")
100 _output = OUTPUT_JFR;
101 if (value == NULL) {
102 msg = "Invalid jfropts";
103 } else if (value[0] >= '0' && value[0] <= '9') {
104 _jfr_options = (int)strtol(value, NULL, 0);
105 } else if (strstr(value, "mem")) {
106 _jfr_options |= IN_MEMORY;
107 }
108
109 CASE("jfrsync")
110 _output = OUTPUT_JFR;
111 _jfr_options |= JFR_SYNC_OPTS;
112 _jfr_sync = value == NULL ? "default" : value;
113
114 CASE("traces")
115 _output = OUTPUT_TEXT;
116 _dump_traces = value == NULL ? INT_MAX : atoi(value);
117

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected