]>
Commit | Line | Data |
---|---|---|
e2012a7a | 1 | // session functions |
73f52eb4 | 2 | // Copyright (C) 2010-2012 Red Hat Inc. |
e2012a7a DB |
3 | // |
4 | // This file is part of systemtap, and is free software. You can | |
5 | // redistribute it and/or modify it under the terms of the GNU General | |
6 | // Public License (GPL); either version 2, or (at your option) any | |
7 | // later version. | |
8 | ||
9 | #include "config.h" | |
10 | #include "session.h" | |
11 | #include "cache.h" | |
12 | #include "elaborate.h" | |
aa4d21c0 DB |
13 | #include "translate.h" |
14 | #include "buildrun.h" | |
15 | #include "coveragedb.h" | |
e2012a7a DB |
16 | #include "hash.h" |
17 | #include "task_finder.h" | |
aa4d21c0 DB |
18 | #include "csclient.h" |
19 | #include "rpm_finder.h" | |
e2012a7a | 20 | #include "util.h" |
73f52eb4 | 21 | #include "cmdline.h" |
e2012a7a | 22 | #include "git_version.h" |
e587f6ca | 23 | #include "version.h" |
e2012a7a | 24 | |
85007c04 DB |
25 | #include <cerrno> |
26 | #include <cstdlib> | |
27 | ||
e2012a7a | 28 | extern "C" { |
e2012a7a DB |
29 | #include <getopt.h> |
30 | #include <limits.h> | |
a83cc46b | 31 | #include <grp.h> |
2dce8c42 | 32 | #include <sys/stat.h> |
e2012a7a | 33 | #include <sys/utsname.h> |
878b2f3f | 34 | #include <sys/resource.h> |
e2012a7a | 35 | #include <elfutils/libdwfl.h> |
47caa991 | 36 | #include <unistd.h> |
e2012a7a DB |
37 | } |
38 | ||
b0e5fa85 DB |
39 | #if HAVE_NSS |
40 | extern "C" { | |
41 | #include <nspr.h> | |
42 | } | |
43 | #endif | |
44 | ||
e2012a7a DB |
45 | #include <string> |
46 | ||
47 | using namespace std; | |
48 | ||
49 | /* getopt variables */ | |
50 | extern int optind; | |
51 | ||
52 | #define PATH_TBD string("__TBD__") | |
53 | ||
48e74294 | 54 | #if HAVE_NSS |
44edbcd6 | 55 | bool systemtap_session::NSPR_Initialized = false; |
48e74294 | 56 | #endif |
44edbcd6 | 57 | |
e2012a7a DB |
58 | systemtap_session::systemtap_session (): |
59 | // NB: pointer members must be manually initialized! | |
abc15290 | 60 | // NB: don't forget the copy constructor too! |
4441e344 | 61 | runtime_mode(kernel_runtime), |
e2012a7a DB |
62 | base_hash(0), |
63 | pattern_root(new match_node), | |
64 | user_file (0), | |
65 | be_derived_probes(0), | |
66 | dwarf_derived_probes(0), | |
67 | kprobe_derived_probes(0), | |
68 | hwbkpt_derived_probes(0), | |
69 | perf_derived_probes(0), | |
70 | uprobe_derived_probes(0), | |
71 | utrace_derived_probes(0), | |
72 | itrace_derived_probes(0), | |
73 | task_finder_derived_probes(0), | |
74 | timer_derived_probes(0), | |
8d9609f5 | 75 | netfilter_derived_probes(0), |
e2012a7a DB |
76 | profile_derived_probes(0), |
77 | mark_derived_probes(0), | |
78 | tracepoint_derived_probes(0), | |
79 | hrtimer_derived_probes(0), | |
80 | procfs_derived_probes(0), | |
81 | op (0), up (0), | |
82 | sym_kprobes_text_start (0), | |
83 | sym_kprobes_text_end (0), | |
84 | sym_stext (0), | |
85 | module_cache (0), | |
86 | last_token (0) | |
e2012a7a DB |
87 | { |
88 | struct utsname buf; | |
89 | (void) uname (& buf); | |
90 | kernel_release = string (buf.release); | |
91 | release = kernel_release; | |
92 | kernel_build_tree = "/lib/modules/" + kernel_release + "/build"; | |
daa75206 | 93 | architecture = machine = normalize_machine(buf.machine); |
e2012a7a DB |
94 | |
95 | for (unsigned i=0; i<5; i++) perpass_verbose[i]=0; | |
2dce8c42 | 96 | verbose = 0; |
e2012a7a DB |
97 | |
98 | have_script = false; | |
2fad97fd DB |
99 | runtime_specified = false; |
100 | include_arg_start = -1; | |
e2012a7a DB |
101 | timing = false; |
102 | guru_mode = false; | |
103 | bulk_mode = false; | |
104 | unoptimized = false; | |
105 | suppress_warnings = false; | |
106 | panic_warnings = false; | |
107 | listing_mode = false; | |
108 | listing_mode_vars = false; | |
b82d77b4 | 109 | dump_probe_types = false; |
e2012a7a DB |
110 | |
111 | #ifdef ENABLE_PROLOGUES | |
112 | prologue_searching = true; | |
113 | #else | |
114 | prologue_searching = false; | |
115 | #endif | |
116 | ||
117 | buffer_size = 0; | |
118 | last_pass = 5; | |
119 | module_name = "stap_" + lex_cast(getpid()); | |
120 | stapconf_name = "stapconf_" + lex_cast(getpid()) + ".h"; | |
121 | output_file = ""; // -o FILE | |
305fac7d | 122 | tmpdir_opt_set = false; |
e2012a7a | 123 | save_module = false; |
5c854d7c | 124 | modname_given = false; |
e2012a7a DB |
125 | keep_tmpdir = false; |
126 | cmd = ""; | |
127 | target_pid = 0; | |
e2012a7a DB |
128 | use_cache = true; |
129 | use_script_cache = true; | |
130 | poison_cache = false; | |
131 | tapset_compile_coverage = false; | |
132 | need_uprobes = false; | |
08badca8 | 133 | need_unwind = false; |
8af41ec2 | 134 | need_symbols = false; |
474d17ad | 135 | uprobes_path = ""; |
e2012a7a DB |
136 | consult_symtab = false; |
137 | ignore_vmlinux = false; | |
138 | ignore_dwarf = false; | |
139 | load_only = false; | |
140 | skip_badvars = false; | |
42e38653 | 141 | privilege = pr_stapdev; |
73f52eb4 | 142 | privilege_set = false; |
e2012a7a DB |
143 | omit_werror = false; |
144 | compatible = VERSION; // XXX: perhaps also process GIT_SHAID if available? | |
145 | unwindsym_ldd = false; | |
146 | client_options = false; | |
eff14db3 | 147 | server_cache = NULL; |
a46f9abe | 148 | automatic_server_mode = false; |
3e1ec884 | 149 | use_server_on_error = false; |
44edbcd6 | 150 | try_server_status = try_server_unset; |
756cfd49 | 151 | use_remote_prefix = false; |
a07a2c28 | 152 | systemtap_v_check = false; |
ea60076d | 153 | download_dbinfo = 0; |
7baf48e9 | 154 | suppress_handler_errors = false; |
50f2545f | 155 | native_build = true; // presumed |
05fb3e0c WF |
156 | sysroot = ""; |
157 | update_release_sysroot = false; | |
e2012a7a | 158 | |
6ac63adf | 159 | /* adding in the XDG_DATA_DIRS variable path, |
2dce8c42 DB |
160 | * this searches in conjunction with SYSTEMTAP_TAPSET |
161 | * to locate stap scripts, either can be disabled if | |
162 | * needed using env $PATH=/dev/null where $PATH is the | |
163 | * path you want disabled | |
164 | */ | |
6ac63adf LB |
165 | const char* s_p1 = getenv ("XDG_DATA_DIRS"); |
166 | if ( s_p1 != NULL ) | |
167 | { | |
168 | vector<string> dirs; | |
169 | tokenize(s_p1, dirs, ":"); | |
170 | for(vector<string>::iterator i = dirs.begin(); i != dirs.end(); ++i) | |
171 | { | |
172 | include_path.push_back(*i + "/systemtap/tapset"); | |
173 | } | |
174 | } | |
e2012a7a DB |
175 | |
176 | const char* s_p = getenv ("SYSTEMTAP_TAPSET"); | |
177 | if (s_p != NULL) | |
178 | { | |
179 | include_path.push_back (s_p); | |
180 | } | |
181 | else | |
182 | { | |
183 | include_path.push_back (string(PKGDATADIR) + "/tapset"); | |
184 | } | |
185 | ||
186 | const char* s_r = getenv ("SYSTEMTAP_RUNTIME"); | |
187 | if (s_r != NULL) | |
188 | runtime_path = s_r; | |
189 | else | |
190 | runtime_path = string(PKGDATADIR) + "/runtime"; | |
191 | ||
192 | const char* s_d = getenv ("SYSTEMTAP_DIR"); | |
193 | if (s_d != NULL) | |
194 | data_path = s_d; | |
195 | else | |
196 | data_path = get_home_directory() + string("/.systemtap"); | |
197 | if (create_dir(data_path.c_str()) == 1) | |
198 | { | |
199 | const char* e = strerror (errno); | |
2713ea24 | 200 | print_warning("failed to create systemtap data directory \"" + data_path + "\" " + e + ", disabling cache support."); |
e2012a7a DB |
201 | use_cache = use_script_cache = false; |
202 | } | |
203 | ||
204 | if (use_cache) | |
205 | { | |
206 | cache_path = data_path + "/cache"; | |
207 | if (create_dir(cache_path.c_str()) == 1) | |
208 | { | |
209 | const char* e = strerror (errno); | |
2713ea24 | 210 | print_warning("failed to create cache directory (\" " + cache_path + " \") " + e + ", disabling cache support."); |
e2012a7a DB |
211 | use_cache = use_script_cache = false; |
212 | } | |
213 | } | |
214 | ||
e2012a7a DB |
215 | const char* s_tc = getenv ("SYSTEMTAP_COVERAGE"); |
216 | if (s_tc != NULL) | |
217 | tapset_compile_coverage = true; | |
218 | ||
219 | const char* s_kr = getenv ("SYSTEMTAP_RELEASE"); | |
220 | if (s_kr != NULL) { | |
221 | setup_kernel_release(s_kr); | |
222 | } | |
b96901b7 | 223 | create_tmp_dir(); |
e2012a7a DB |
224 | } |
225 | ||
abc15290 JS |
226 | systemtap_session::systemtap_session (const systemtap_session& other, |
227 | const string& arch, | |
228 | const string& kern): | |
229 | // NB: pointer members must be manually initialized! | |
230 | // NB: this needs to consider everything that the base ctor does, | |
231 | // plus copying any wanted implicit fields (strings, vectors, etc.) | |
4441e344 | 232 | runtime_mode(other.runtime_mode), |
abc15290 JS |
233 | base_hash(0), |
234 | pattern_root(new match_node), | |
235 | user_file (other.user_file), | |
236 | be_derived_probes(0), | |
237 | dwarf_derived_probes(0), | |
238 | kprobe_derived_probes(0), | |
239 | hwbkpt_derived_probes(0), | |
240 | perf_derived_probes(0), | |
241 | uprobe_derived_probes(0), | |
242 | utrace_derived_probes(0), | |
243 | itrace_derived_probes(0), | |
244 | task_finder_derived_probes(0), | |
245 | timer_derived_probes(0), | |
8d9609f5 | 246 | netfilter_derived_probes(0), |
abc15290 JS |
247 | profile_derived_probes(0), |
248 | mark_derived_probes(0), | |
249 | tracepoint_derived_probes(0), | |
250 | hrtimer_derived_probes(0), | |
251 | procfs_derived_probes(0), | |
252 | op (0), up (0), | |
253 | sym_kprobes_text_start (0), | |
254 | sym_kprobes_text_end (0), | |
255 | sym_stext (0), | |
256 | module_cache (0), | |
257 | last_token (0) | |
258 | { | |
259 | release = kernel_release = kern; | |
260 | kernel_build_tree = "/lib/modules/" + kernel_release + "/build"; | |
261 | architecture = machine = normalize_machine(arch); | |
262 | setup_kernel_release(kern.c_str()); | |
50f2545f | 263 | native_build = false; // assumed; XXX: could be computed as in check_options() |
abc15290 JS |
264 | |
265 | // These are all copied in the same order as the default ctor did above. | |
266 | ||
267 | copy(other.perpass_verbose, other.perpass_verbose + 5, perpass_verbose); | |
268 | verbose = other.verbose; | |
269 | ||
270 | have_script = other.have_script; | |
271 | runtime_specified = other.runtime_specified; | |
272 | include_arg_start = other.include_arg_start; | |
273 | timing = other.timing; | |
274 | guru_mode = other.guru_mode; | |
275 | bulk_mode = other.bulk_mode; | |
276 | unoptimized = other.unoptimized; | |
277 | suppress_warnings = other.suppress_warnings; | |
278 | panic_warnings = other.panic_warnings; | |
279 | listing_mode = other.listing_mode; | |
280 | listing_mode_vars = other.listing_mode_vars; | |
b82d77b4 | 281 | dump_probe_types = other.dump_probe_types; |
abc15290 JS |
282 | |
283 | prologue_searching = other.prologue_searching; | |
284 | ||
285 | buffer_size = other.buffer_size; | |
286 | last_pass = other.last_pass; | |
287 | module_name = other.module_name; | |
288 | stapconf_name = other.stapconf_name; | |
289 | output_file = other.output_file; // XXX how should multiple remotes work? | |
305fac7d | 290 | tmpdir_opt_set = false; |
abc15290 | 291 | save_module = other.save_module; |
5c854d7c | 292 | modname_given = other.modname_given; |
abc15290 JS |
293 | keep_tmpdir = other.keep_tmpdir; |
294 | cmd = other.cmd; | |
295 | target_pid = other.target_pid; // XXX almost surely nonsense for multiremote | |
296 | use_cache = other.use_cache; | |
297 | use_script_cache = other.use_script_cache; | |
298 | poison_cache = other.poison_cache; | |
299 | tapset_compile_coverage = other.tapset_compile_coverage; | |
300 | need_uprobes = false; | |
08badca8 | 301 | need_unwind = false; |
8af41ec2 | 302 | need_symbols = false; |
abc15290 JS |
303 | uprobes_path = ""; |
304 | consult_symtab = other.consult_symtab; | |
305 | ignore_vmlinux = other.ignore_vmlinux; | |
306 | ignore_dwarf = other.ignore_dwarf; | |
307 | load_only = other.load_only; | |
308 | skip_badvars = other.skip_badvars; | |
42e38653 | 309 | privilege = other.privilege; |
73f52eb4 | 310 | privilege_set = other.privilege_set; |
abc15290 JS |
311 | omit_werror = other.omit_werror; |
312 | compatible = other.compatible; | |
313 | unwindsym_ldd = other.unwindsym_ldd; | |
314 | client_options = other.client_options; | |
eff14db3 | 315 | server_cache = NULL; |
abc15290 JS |
316 | use_server_on_error = other.use_server_on_error; |
317 | try_server_status = other.try_server_status; | |
756cfd49 | 318 | use_remote_prefix = other.use_remote_prefix; |
abc15290 | 319 | systemtap_v_check = other.systemtap_v_check; |
ea60076d | 320 | download_dbinfo = other.download_dbinfo; |
7baf48e9 | 321 | suppress_handler_errors = other.suppress_handler_errors; |
05fb3e0c WF |
322 | sysroot = other.sysroot; |
323 | update_release_sysroot = other.update_release_sysroot; | |
324 | sysenv = other.sysenv; | |
abc15290 JS |
325 | |
326 | include_path = other.include_path; | |
327 | runtime_path = other.runtime_path; | |
328 | ||
329 | // NB: assuming that "other" created these already | |
330 | data_path = other.data_path; | |
331 | cache_path = other.cache_path; | |
332 | ||
333 | tapset_compile_coverage = other.tapset_compile_coverage; | |
334 | ||
335 | ||
336 | // These are fields that were left to their default ctor, but now we want to | |
337 | // copy them from "other". In the same order as declared... | |
338 | script_file = other.script_file; | |
339 | cmdline_script = other.cmdline_script; | |
08fce398 | 340 | c_macros = other.c_macros; |
abc15290 JS |
341 | args = other.args; |
342 | kbuildflags = other.kbuildflags; | |
343 | globalopts = other.globalopts; | |
633e5ca7 | 344 | modinfos = other.modinfos; |
abc15290 | 345 | |
372c6458 | 346 | client_options_disallowed_for_unprivileged = other.client_options_disallowed_for_unprivileged; |
abc15290 JS |
347 | server_status_strings = other.server_status_strings; |
348 | specified_servers = other.specified_servers; | |
349 | server_trust_spec = other.server_trust_spec; | |
350 | server_args = other.server_args; | |
351 | ||
352 | unwindsym_modules = other.unwindsym_modules; | |
74fe61bc | 353 | automatic_server_mode = other.automatic_server_mode; |
b96901b7 CM |
354 | |
355 | create_tmp_dir(); | |
abc15290 JS |
356 | } |
357 | ||
b0e5fa85 DB |
358 | systemtap_session::~systemtap_session () |
359 | { | |
b96901b7 | 360 | remove_tmp_dir(); |
ebff2ed0 | 361 | delete_map(subsessions); |
08b61232 | 362 | delete pattern_root; |
b0e5fa85 DB |
363 | } |
364 | ||
4441e344 JS |
365 | const string |
366 | systemtap_session::module_filename() const | |
367 | { | |
ac3af990 | 368 | if (runtime_usermode_p()) |
4441e344 JS |
369 | return module_name + ".so"; |
370 | return module_name + ".ko"; | |
371 | } | |
372 | ||
48e74294 | 373 | #if HAVE_NSS |
b0e5fa85 DB |
374 | void |
375 | systemtap_session::NSPR_init () | |
376 | { | |
377 | if (! NSPR_Initialized) | |
378 | { | |
379 | PR_Init (PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1); | |
380 | NSPR_Initialized = true; | |
381 | } | |
3d9dfde6 | 382 | } |
48e74294 | 383 | #endif // HAVE_NSS |
e2012a7a | 384 | |
ebff2ed0 JS |
385 | systemtap_session* |
386 | systemtap_session::clone(const string& arch, const string& release) | |
387 | { | |
ba0bd1be JS |
388 | const string norm_arch = normalize_machine(arch); |
389 | if (this->architecture == norm_arch && this->kernel_release == release) | |
ebff2ed0 JS |
390 | return this; |
391 | ||
ba0bd1be | 392 | systemtap_session*& s = subsessions[make_pair(norm_arch, release)]; |
ebff2ed0 | 393 | if (!s) |
ba0bd1be | 394 | s = new systemtap_session(*this, norm_arch, release); |
ebff2ed0 JS |
395 | return s; |
396 | } | |
397 | ||
e2012a7a DB |
398 | void |
399 | systemtap_session::version () | |
400 | { | |
e587f6ca | 401 | clog << _F("Systemtap translator/driver (version %s/%s, %s)\n" |
e64c7f38 | 402 | "Copyright (C) 2005-2012 Red Hat, Inc. and others\n" |
ce0f6648 | 403 | "This is free software; see the source for copying conditions.", |
e587f6ca | 404 | VERSION, dwfl_version(NULL), STAP_EXTENDED_VERSION) << endl; |
79bc39ab | 405 | clog << _("enabled features:") |
1ef0423a FCE |
406 | #ifdef HAVE_AVAHI |
407 | << " AVAHI" | |
408 | #endif | |
409 | #ifdef HAVE_LIBRPM | |
410 | << " LIBRPM" | |
411 | #endif | |
412 | #ifdef HAVE_LIBSQLITE3 | |
413 | << " LIBSQLITE3" | |
414 | #endif | |
415 | #ifdef HAVE_NSS | |
416 | << " NSS" | |
417 | #endif | |
418 | #ifdef HAVE_BOOST_SHARED_PTR_HPP | |
419 | << " BOOST_SHARED_PTR" | |
420 | #endif | |
421 | #ifdef HAVE_TR1_UNORDERED_MAP | |
422 | << " TR1_UNORDERED_MAP" | |
423 | #endif | |
424 | #ifdef ENABLE_PROLOGUES | |
425 | << " PROLOGUES" | |
f8e53f3a FCE |
426 | #endif |
427 | #ifdef ENABLE_NLS | |
428 | << " NLS" | |
a3524565 JS |
429 | #endif |
430 | #ifdef HAVE_DYNINST | |
431 | << " DYNINST" | |
1ef0423a FCE |
432 | #endif |
433 | << endl; | |
e2012a7a DB |
434 | } |
435 | ||
0d70f9d8 JS |
436 | void |
437 | systemtap_session::usage (int exitcode) | |
438 | { | |
5ec722e1 JS |
439 | // For error cases, just suggest --help, so we don't obscure |
440 | // the actual error message with all the help text. | |
441 | if (exitcode != EXIT_SUCCESS) | |
442 | { | |
443 | clog << _("Try '--help' for more information.") << endl; | |
444 | throw exit_exception(exitcode); | |
445 | } | |
446 | ||
0d70f9d8 JS |
447 | version (); |
448 | clog | |
449 | << endl | |
6073c3fc LB |
450 | << _F("Usage: stap [options] FILE Run script in file.\n" |
451 | " or: stap [options] - Run script on stdin.\n" | |
452 | " or: stap [options] -e SCRIPT Run given script.\n" | |
453 | " or: stap [options] -l PROBE List matching probes.\n" | |
454 | " or: stap [options] -L PROBE List matching probes and local variables.\n\n" | |
222e16ed | 455 | "Options (in %s/rc and on command line):\n" |
6073c3fc LB |
456 | " -- end of translator options, script options follow\n" |
457 | " -h --help show help\n" | |
458 | " -V --version show version\n" | |
459 | " -p NUM stop after pass NUM 1-5, instead of %d\n" | |
460 | " (parse, elaborate, translate, compile, run)\n" | |
461 | " -v add verbosity to all passes\n" | |
222e16ed | 462 | " --vp {N}+ add per-pass verbosity [", data_path.c_str(), last_pass); |
0d70f9d8 JS |
463 | for (unsigned i=0; i<5; i++) |
464 | clog << (perpass_verbose[i] <= 9 ? perpass_verbose[i] : 9); | |
465 | clog | |
6073c3fc LB |
466 | << "]" << endl; |
467 | clog << _F(" -k keep temporary directory\n" | |
468 | " -u unoptimized translation %s\n" | |
469 | " -w suppress warnings %s\n" | |
470 | " -W turn warnings into errors %s\n" | |
471 | " -g guru mode %s\n" | |
472 | " -P prologue-searching for function probes %s\n" | |
473 | " -b bulk (percpu file) mode %s\n" | |
474 | " -s NUM buffer size in megabytes, instead of %d\n" | |
475 | " -I DIR look in DIR for additional .stp script files", (unoptimized ? _(" [set]") : ""), | |
476 | (suppress_warnings ? _(" [set]") : ""), (panic_warnings ? _(" [set]") : ""), | |
477 | (guru_mode ? _(" [set]") : ""), (prologue_searching ? _(" [set]") : ""), | |
478 | (bulk_mode ? _(" [set]") : ""), buffer_size); | |
0d70f9d8 JS |
479 | if (include_path.size() == 0) |
480 | clog << endl; | |
481 | else | |
482 | clog << _(", in addition to") << endl; | |
483 | for (unsigned i=0; i<include_path.size(); i++) | |
ce0f6648 | 484 | clog << " " << include_path[i].c_str() << endl; |
0d70f9d8 | 485 | clog |
6073c3fc LB |
486 | << _F(" -D NM=VAL emit macro definition into generated C code\n" |
487 | " -B NM=VAL pass option to kbuild make\n" | |
633e5ca7 FCE |
488 | " --modinfo NM=VAL\n" |
489 | " include a MODULE_INFO(NM,VAL) in the generated C code\n" | |
6073c3fc | 490 | " -G VAR=VAL set global variable to value\n" |
ce0f6648 | 491 | //TRANSLATORS: translating 'runtime' is not advised |
6073c3fc LB |
492 | " -R DIR look in DIR for runtime, instead of\n" |
493 | " %s\n" | |
494 | " -r DIR cross-compile to kernel with given build tree; or else\n" | |
495 | " -r RELEASE cross-compile to kernel /lib/modules/RELEASE/build, instead of\n" | |
496 | " %s\n" | |
497 | " -a ARCH cross-compile to given architecture, instead of %s\n" | |
498 | " -m MODULE set probe module name, instead of \n" | |
499 | " %s\n" | |
500 | " -o FILE send script output to file, instead of stdout. This supports\n" | |
501 | " strftime(3) formats for FILE\n" | |
502 | " -c CMD start the probes, run CMD, and exit when it finishes\n" | |
503 | " -x PID sets target() to PID\n" | |
504 | " -F run as on-file flight recorder with -o.\n" | |
505 | " run as on-memory flight recorder without -o.\n" | |
506 | " -S size[,n] set maximum of the size and the number of files.\n" | |
507 | " -d OBJECT add unwind/symbol data for OBJECT file", runtime_path.c_str(), kernel_build_tree.c_str(), architecture.c_str(), module_name.c_str()); | |
0d70f9d8 JS |
508 | if (unwindsym_modules.size() == 0) |
509 | clog << endl; | |
510 | else | |
511 | clog << _(", in addition to") << endl; | |
e2012a7a | 512 | { |
0d70f9d8 JS |
513 | vector<string> syms (unwindsym_modules.begin(), unwindsym_modules.end()); |
514 | for (unsigned i=0; i<syms.size(); i++) | |
ce0f6648 | 515 | clog << " " << syms[i].c_str() << endl; |
0d70f9d8 JS |
516 | } |
517 | clog | |
6073c3fc LB |
518 | << _F(" --ldd add unwind/symbol data for all referenced object files.\n" |
519 | " --all-modules\n" | |
520 | " add unwind/symbol data for all loaded kernel objects.\n" | |
521 | " -t collect probe timing information\n" | |
0d70f9d8 | 522 | #ifdef HAVE_LIBSQLITE3 |
6073c3fc | 523 | " -q generate information on tapset coverage\n" |
0d70f9d8 | 524 | #endif /* HAVE_LIBSQLITE3 */ |
4441e344 JS |
525 | " --runtime=MODE\n" |
526 | " set the pass-5 runtime mode, instead of kernel\n" | |
f66bb29a DB |
527 | " --privilege=PRIVILEGE_LEVEL\n" |
528 | " check the script for constructs not allowed at the given privilege level\n" | |
6073c3fc | 529 | " --unprivileged\n" |
42e38653 | 530 | " equivalent to --privilege=stapusr\n" |
0d70f9d8 | 531 | #if 0 /* PR6864: disable temporarily; should merge with -d somehow */ |
6073c3fc LB |
532 | " --kelf make do with symbol table from vmlinux\n" |
533 | " --kmap[=FILE]\n" | |
534 | " make do with symbol table from nm listing\n" | |
0d70f9d8 JS |
535 | #endif |
536 | // Formerly present --ignore-{vmlinux,dwarf} options are for testsuite use | |
537 | // only, and don't belong in the eyesight of a plain user. | |
6073c3fc LB |
538 | " --compatible=VERSION\n" |
539 | " suppress incompatible language/tapset changes beyond VERSION,\n" | |
540 | " instead of %s\n" | |
541 | " --check-version\n" | |
542 | " displays warnings where a syntax element may be \n" | |
543 | " version dependent\n" | |
544 | " --skip-badvars\n" | |
545 | " substitute zero for bad context $variables\n" | |
7baf48e9 FCE |
546 | " --suppress-handler-errors\n" |
547 | " catch all runtime errors, quietly skip probe handlers\n" | |
6073c3fc LB |
548 | " --use-server[=SERVER-SPEC]\n" |
549 | " specify systemtap compile-servers\n" | |
550 | " --list-servers[=PROPERTIES]\n" | |
4830b335 FCE |
551 | " report on the status of the specified compile-servers:\n" |
552 | " all,specified,online,trusted,signer,compatible\n" | |
0d70f9d8 | 553 | #if HAVE_NSS |
6073c3fc | 554 | " --trust-servers[=TRUST-SPEC]\n" |
4830b335 FCE |
555 | " add/revoke trust of specified compile-servers:\n" |
556 | " ssl,signer,all-users,revoke,no-prompt\n" | |
6073c3fc LB |
557 | " --use-server-on-error[=yes/no]\n" |
558 | " retry compilation using a compile server upon compilation error\n" | |
0d70f9d8 | 559 | #endif |
6073c3fc LB |
560 | " --remote=HOSTNAME\n" |
561 | " run pass 5 on the specified ssh host.\n" | |
756cfd49 JS |
562 | " may be repeated for targeting multiple hosts.\n" |
563 | " --remote-prefix\n" | |
715c8369 | 564 | " prefix each line of remote output with a host index.\n" |
305fac7d | 565 | " --tmpdir=NAME\n" |
d1242dfa | 566 | " specify name of temporary directory to be used.\n" |
ea60076d | 567 | " --download-debuginfo[=OPTION]\n" |
d1242dfa | 568 | " automatically download debuginfo using ABRT.\n" |
ea60076d | 569 | " yes,no,ask,<timeout value>\n" |
b82d77b4 DB |
570 | " --dump-probe-types\n" |
571 | " show a list of available probe types.\n" | |
05fb3e0c WF |
572 | " --sysroot=DIR\n" |
573 | " specify sysroot directory where target files (executables,\n" " libraries, etc.) are located.\n" | |
574 | " --sysenv=VAR=VALUE\n" | |
575 | " provide an alternate value for an environment variable\n" | |
576 | " where the value on a remote system differs. Path\n" | |
577 | " variables (e.g. PATH, LD_LIBRARY_PATH) are assumed to be\n" | |
578 | " relative to the sysroot.\n" | |
756cfd49 | 579 | , compatible.c_str()) << endl |
0d70f9d8 | 580 | ; |
e2012a7a DB |
581 | |
582 | time_t now; | |
583 | time (& now); | |
584 | struct tm* t = localtime (& now); | |
585 | if (t && t->tm_mon*3 + t->tm_mday*173 == 0xb6) | |
586 | clog << morehelp << endl; | |
587 | ||
e2d0f787 | 588 | throw exit_exception (exitcode); |
e2012a7a DB |
589 | } |
590 | ||
591 | int | |
592 | systemtap_session::parse_cmdline (int argc, char * const argv []) | |
593 | { | |
372c6458 | 594 | client_options_disallowed_for_unprivileged = ""; |
878b2f3f | 595 | struct rlimit our_rlimit; |
e2012a7a DB |
596 | while (true) |
597 | { | |
e2012a7a | 598 | char * num_endptr; |
73f52eb4 | 599 | int grc = getopt_long (argc, argv, STAP_SHORT_OPTIONS, stap_long_options, NULL); |
e2012a7a DB |
600 | |
601 | // NB: when adding new options, consider very carefully whether they | |
17874af3 | 602 | // should be restricted from stap clients (after --client-options)! |
e2012a7a DB |
603 | |
604 | if (grc < 0) | |
605 | break; | |
606 | switch (grc) | |
607 | { | |
608 | case 'V': | |
609 | version (); | |
e2d0f787 | 610 | throw exit_exception (EXIT_SUCCESS); |
e2012a7a DB |
611 | |
612 | case 'v': | |
372c6458 | 613 | server_args.push_back (string ("-") + (char)grc); |
e2012a7a DB |
614 | for (unsigned i=0; i<5; i++) |
615 | perpass_verbose[i] ++; | |
2dce8c42 | 616 | verbose ++; |
e2012a7a DB |
617 | break; |
618 | ||
2b7d9d84 RH |
619 | case 'G': |
620 | // Make sure the global option is only composed of the | |
621 | // following chars: [_=a-zA-Z0-9] | |
7a583298 | 622 | assert_regexp_match("-G parameter", optarg, "^[a-z_][a-z0-9_]*=[a-z0-9_-]+$"); |
2b7d9d84 | 623 | globalopts.push_back (string(optarg)); |
bb25d08f RH |
624 | break; |
625 | ||
e2012a7a | 626 | case 't': |
372c6458 | 627 | server_args.push_back (string ("-") + (char)grc); |
e2012a7a DB |
628 | timing = true; |
629 | break; | |
630 | ||
631 | case 'w': | |
372c6458 | 632 | server_args.push_back (string ("-") + (char)grc); |
e2012a7a DB |
633 | suppress_warnings = true; |
634 | break; | |
635 | ||
636 | case 'W': | |
372c6458 | 637 | server_args.push_back (string ("-") + (char)grc); |
e2012a7a DB |
638 | panic_warnings = true; |
639 | break; | |
640 | ||
641 | case 'p': | |
642 | last_pass = (int)strtoul(optarg, &num_endptr, 10); | |
643 | if (*num_endptr != '\0' || last_pass < 1 || last_pass > 5) | |
644 | { | |
79bc39ab | 645 | cerr << _("Invalid pass number (should be 1-5).") << endl; |
e2012a7a DB |
646 | return 1; |
647 | } | |
648 | if (listing_mode && last_pass != 2) | |
649 | { | |
79bc39ab | 650 | cerr << _("Listing (-l) mode implies pass 2.") << endl; |
e2012a7a DB |
651 | return 1; |
652 | } | |
372c6458 | 653 | server_args.push_back (string ("-") + (char)grc + optarg); |
e2012a7a DB |
654 | break; |
655 | ||
656 | case 'I': | |
657 | if (client_options) | |
372c6458 | 658 | client_options_disallowed_for_unprivileged += client_options_disallowed_for_unprivileged.empty () ? "-I" : ", -I"; |
2fad97fd DB |
659 | if (include_arg_start == -1) |
660 | include_arg_start = include_path.size (); | |
e2012a7a DB |
661 | include_path.push_back (string (optarg)); |
662 | break; | |
663 | ||
664 | case 'd': | |
372c6458 | 665 | server_args.push_back (string ("-") + (char)grc + optarg); |
e2012a7a DB |
666 | { |
667 | // At runtime user module names are resolved through their | |
668 | // canonical (absolute) path. | |
669 | const char *mpath = canonicalize_file_name (optarg); | |
670 | if (mpath == NULL) // Must be a kernel module name | |
671 | mpath = optarg; | |
672 | unwindsym_modules.insert (string (mpath)); | |
a057c85c MW |
673 | // PR10228: trigger vma tracker logic early if -d /USER-MODULE/ |
674 | // given. XXX This is actually too early. Having a user module | |
675 | // is a good indicator that something will need vma tracking. | |
676 | // But it is not 100%, this really should only trigger through | |
677 | // a user mode tapset /* pragma:vma */ or a probe doing a | |
678 | // variable lookup through a dynamic module. | |
e2012a7a | 679 | if (mpath[0] == '/') |
a057c85c | 680 | enable_vma_tracker (*this); |
e2012a7a DB |
681 | break; |
682 | } | |
683 | ||
684 | case 'e': | |
685 | if (have_script) | |
686 | { | |
79bc39ab | 687 | cerr << _("Only one script can be given on the command line.") |
e2012a7a DB |
688 | << endl; |
689 | return 1; | |
690 | } | |
372c6458 | 691 | server_args.push_back (string ("-") + (char)grc + optarg); |
e2012a7a DB |
692 | cmdline_script = string (optarg); |
693 | have_script = true; | |
694 | break; | |
695 | ||
696 | case 'o': | |
697 | // NB: client_options not a problem, since pass 1-4 does not use output_file. | |
372c6458 | 698 | server_args.push_back (string ("-") + (char)grc + optarg); |
e2012a7a DB |
699 | output_file = string (optarg); |
700 | break; | |
701 | ||
702 | case 'R': | |
ce0f6648 | 703 | if (client_options) { cerr << _F("ERROR: %s invalid with %s", "-R", "--client-options") << endl; return 1; } |
2fad97fd | 704 | runtime_specified = true; |
e2012a7a DB |
705 | runtime_path = string (optarg); |
706 | break; | |
707 | ||
708 | case 'm': | |
709 | if (client_options) | |
372c6458 | 710 | client_options_disallowed_for_unprivileged += client_options_disallowed_for_unprivileged.empty () ? "-m" : ", -m"; |
e2012a7a DB |
711 | module_name = string (optarg); |
712 | save_module = true; | |
5c854d7c | 713 | modname_given = true; |
e2012a7a DB |
714 | { |
715 | // If the module name ends with '.ko', chop it off since | |
716 | // modutils doesn't like modules named 'foo.ko.ko'. | |
4441e344 | 717 | if (endswith(module_name, ".ko") || endswith(module_name, ".so")) |
e2012a7a DB |
718 | { |
719 | module_name.erase(module_name.size() - 3); | |
46a1a151 | 720 | cerr << _F("Truncating module name to '%s'", module_name.c_str()) << endl; |
e2012a7a DB |
721 | } |
722 | ||
723 | // Make sure an empty module name wasn't specified (-m "") | |
724 | if (module_name.empty()) | |
725 | { | |
79bc39ab | 726 | cerr << _("Module name cannot be empty.") << endl; |
e2012a7a DB |
727 | return 1; |
728 | } | |
729 | ||
730 | // Make sure the module name is only composed of the | |
2b7d9d84 RH |
731 | // following chars: [a-z0-9_] |
732 | assert_regexp_match("-m parameter", module_name, "^[a-z0-9_]+$"); | |
e2012a7a DB |
733 | |
734 | // Make sure module name isn't too long. | |
735 | if (module_name.size() >= (MODULE_NAME_LEN - 1)) | |
736 | { | |
737 | module_name.resize(MODULE_NAME_LEN - 1); | |
46a1a151 | 738 | cerr << _F("Truncating module name to '%s'", module_name.c_str()) << endl; |
e2012a7a DB |
739 | } |
740 | } | |
741 | ||
372c6458 | 742 | server_args.push_back (string ("-") + (char)grc + optarg); |
e2012a7a DB |
743 | use_script_cache = false; |
744 | break; | |
745 | ||
746 | case 'r': | |
747 | if (client_options) // NB: no paths! | |
748 | assert_regexp_match("-r parameter from client", optarg, "^[a-z0-9_.-]+$"); | |
372c6458 | 749 | server_args.push_back (string ("-") + (char)grc + optarg); |
e2012a7a DB |
750 | setup_kernel_release(optarg); |
751 | break; | |
752 | ||
753 | case 'a': | |
754 | assert_regexp_match("-a parameter", optarg, "^[a-z0-9_-]+$"); | |
372c6458 | 755 | server_args.push_back (string ("-") + (char)grc + optarg); |
e2012a7a DB |
756 | architecture = string(optarg); |
757 | break; | |
758 | ||
759 | case 'k': | |
71a522b5 | 760 | if (client_options) { cerr << _F("ERROR: %s invalid with %s", "-k", "--client-options") << endl; return 1; } |
e2012a7a DB |
761 | keep_tmpdir = true; |
762 | use_script_cache = false; /* User wants to keep a usable build tree. */ | |
763 | break; | |
764 | ||
765 | case 'g': | |
372c6458 | 766 | server_args.push_back (string ("-") + (char)grc); |
e2012a7a DB |
767 | guru_mode = true; |
768 | break; | |
769 | ||
770 | case 'P': | |
372c6458 | 771 | server_args.push_back (string ("-") + (char)grc); |
e2012a7a DB |
772 | prologue_searching = true; |
773 | break; | |
774 | ||
775 | case 'b': | |
372c6458 | 776 | server_args.push_back (string ("-") + (char)grc); |
e2012a7a DB |
777 | bulk_mode = true; |
778 | break; | |
779 | ||
780 | case 'u': | |
372c6458 | 781 | server_args.push_back (string ("-") + (char)grc); |
e2012a7a DB |
782 | unoptimized = true; |
783 | break; | |
784 | ||
785 | case 's': | |
786 | buffer_size = (int) strtoul (optarg, &num_endptr, 10); | |
787 | if (*num_endptr != '\0' || buffer_size < 1 || buffer_size > 4095) | |
788 | { | |
79bc39ab | 789 | cerr << _("Invalid buffer size (should be 1-4095).") << endl; |
e2012a7a DB |
790 | return 1; |
791 | } | |
372c6458 | 792 | server_args.push_back (string ("-") + (char)grc + optarg); |
e2012a7a DB |
793 | break; |
794 | ||
795 | case 'c': | |
796 | cmd = string (optarg); | |
2d363b75 FCE |
797 | if (cmd == "") |
798 | { | |
799 | // This would mess with later code deciding to pass -c | |
800 | // through to staprun | |
79bc39ab | 801 | cerr << _("Empty CMD string invalid.") << endl; |
2d363b75 FCE |
802 | return 1; |
803 | } | |
372c6458 | 804 | server_args.push_back (string ("-") + (char)grc + optarg); |
e2012a7a DB |
805 | break; |
806 | ||
807 | case 'x': | |
808 | target_pid = (int) strtoul(optarg, &num_endptr, 10); | |
809 | if (*num_endptr != '\0') | |
810 | { | |
79bc39ab | 811 | cerr << _("Invalid target process ID number.") << endl; |
e2012a7a DB |
812 | return 1; |
813 | } | |
372c6458 | 814 | server_args.push_back (string ("-") + (char)grc + optarg); |
e2012a7a DB |
815 | break; |
816 | ||
817 | case 'D': | |
818 | assert_regexp_match ("-D parameter", optarg, "^[a-z_][a-z_0-9]*(=-?[a-z_0-9]+)?$"); | |
819 | if (client_options) | |
372c6458 DB |
820 | client_options_disallowed_for_unprivileged += client_options_disallowed_for_unprivileged.empty () ? "-D" : ", -D"; |
821 | server_args.push_back (string ("-") + (char)grc + optarg); | |
08fce398 | 822 | c_macros.push_back (string (optarg)); |
e2012a7a DB |
823 | break; |
824 | ||
825 | case 'S': | |
826 | assert_regexp_match ("-S parameter", optarg, "^[0-9]+(,[0-9]+)?$"); | |
372c6458 | 827 | server_args.push_back (string ("-") + (char)grc + optarg); |
e2012a7a DB |
828 | size_option = string (optarg); |
829 | break; | |
830 | ||
831 | case 'q': | |
ce0f6648 | 832 | if (client_options) { cerr << _F("ERROR: %s invalid with %s", "-q", "--client-options") << endl; return 1; } |
372c6458 | 833 | server_args.push_back (string ("-") + (char)grc); |
e2012a7a DB |
834 | tapset_compile_coverage = true; |
835 | break; | |
836 | ||
837 | case 'h': | |
838 | usage (0); | |
839 | break; | |
840 | ||
841 | case 'L': | |
842 | listing_mode_vars = true; | |
843 | unoptimized = true; // This causes retention of variables for listing_mode | |
68ac5d0e | 844 | // fallthrough |
e2012a7a DB |
845 | case 'l': |
846 | suppress_warnings = true; | |
847 | listing_mode = true; | |
848 | last_pass = 2; | |
849 | if (have_script) | |
850 | { | |
79bc39ab | 851 | cerr << _("Only one script can be given on the command line.") |
e2012a7a DB |
852 | << endl; |
853 | return 1; | |
854 | } | |
372c6458 | 855 | server_args.push_back (string ("-") + (char)grc + optarg); |
e2012a7a DB |
856 | cmdline_script = string("probe ") + string(optarg) + " {}"; |
857 | have_script = true; | |
858 | break; | |
859 | ||
860 | case 'F': | |
372c6458 | 861 | server_args.push_back (string ("-") + (char)grc); |
e2012a7a DB |
862 | load_only = true; |
863 | break; | |
864 | ||
865 | case 'B': | |
ce0f6648 | 866 | if (client_options) { cerr << _F("ERROR: %s invalid with %s", "-B", "--client-options") << endl; return 1; } |
372c6458 | 867 | server_args.push_back (string ("-") + (char)grc + optarg); |
e2012a7a DB |
868 | kbuildflags.push_back (string (optarg)); |
869 | break; | |
870 | ||
372c6458 DB |
871 | case LONG_OPT_VERSION: |
872 | version (); | |
e2d0f787 | 873 | throw exit_exception (EXIT_SUCCESS); |
372c6458 DB |
874 | |
875 | case LONG_OPT_KELF: | |
876 | server_args.push_back ("--kelf"); | |
877 | consult_symtab = true; | |
878 | break; | |
879 | ||
880 | case LONG_OPT_KMAP: | |
881 | // Leave consult_symtab unset for now, to ease error checking. | |
882 | if (!kernel_symtab_path.empty()) | |
883 | { | |
884 | cerr << _("You can't specify multiple --kmap options.") << endl; | |
885 | return 1; | |
886 | } | |
887 | if (optarg) { | |
888 | kernel_symtab_path = optarg; | |
889 | server_args.push_back ("--kmap=" + string(optarg)); | |
890 | } | |
891 | else { | |
892 | kernel_symtab_path = PATH_TBD; | |
893 | server_args.push_back ("--kmap"); | |
894 | } | |
895 | break; | |
896 | ||
897 | case LONG_OPT_IGNORE_VMLINUX: | |
898 | server_args.push_back ("--ignore-vmlinux"); | |
899 | ignore_vmlinux = true; | |
900 | break; | |
901 | ||
902 | case LONG_OPT_IGNORE_DWARF: | |
903 | server_args.push_back ("--ignore-dwarf"); | |
904 | ignore_dwarf = true; | |
905 | break; | |
906 | ||
907 | case LONG_OPT_VERBOSE_PASS: | |
908 | { | |
909 | bool ok = true; | |
910 | if (strlen(optarg) < 1 || strlen(optarg) > 5) | |
911 | ok = false; | |
912 | if (ok) | |
913 | for (unsigned i=0; i<strlen(optarg); i++) | |
914 | if (isdigit (optarg[i])) | |
915 | perpass_verbose[i] += optarg[i]-'0'; | |
916 | else | |
917 | ok = false; | |
e2012a7a | 918 | |
372c6458 | 919 | if (! ok) |
73f52eb4 | 920 | { |
372c6458 DB |
921 | cerr << _("Invalid --vp argument: it takes 1 to 5 digits.") << endl; |
922 | return 1; | |
73f52eb4 | 923 | } |
372c6458 DB |
924 | // NB: we don't do this: last_pass = strlen(optarg); |
925 | server_args.push_back ("--vp=" + string(optarg)); | |
926 | break; | |
927 | } | |
928 | ||
929 | case LONG_OPT_SKIP_BADVARS: | |
930 | server_args.push_back ("--skip-badvars"); | |
931 | skip_badvars = true; | |
932 | break; | |
933 | ||
934 | case LONG_OPT_PRIVILEGE: | |
935 | { | |
936 | // We allow only multiple privilege-setting options if they all specify the same | |
937 | // privilege level. The server also expects and depends on this behaviour when | |
938 | // examining the client-side options passed to it. | |
939 | privilege_t newPrivilege; | |
940 | if (strcmp (optarg, "stapdev") == 0) | |
941 | newPrivilege = pr_stapdev; | |
942 | else if (strcmp (optarg, "stapsys") == 0) | |
943 | newPrivilege = pr_stapsys; | |
944 | else if (strcmp (optarg, "stapusr") == 0) | |
945 | newPrivilege = pr_stapusr; | |
946 | else | |
947 | { | |
948 | cerr << _F("Invalid argument '%s' for --privilege.", optarg) << endl; | |
949 | return 1; | |
950 | } | |
951 | if (privilege_set && newPrivilege != privilege) | |
952 | { | |
953 | cerr << _("Privilege level may be set only once.") << endl; | |
954 | return 1; | |
955 | } | |
956 | privilege = newPrivilege; | |
957 | privilege_set = true; | |
958 | server_args.push_back ("--privilege=" + string(optarg)); | |
959 | } | |
960 | /* NB: for server security, it is essential that once this flag is | |
961 | set, no future flag be able to unset it. */ | |
962 | break; | |
963 | ||
964 | case LONG_OPT_UNPRIVILEGED: | |
965 | // We allow only multiple privilege-setting options if they all specify the same | |
966 | // privilege level. The server also expects and depends on this behaviour when | |
967 | // examining the client-side options passed to it. | |
968 | if (privilege_set && pr_unprivileged != privilege) | |
969 | { | |
970 | cerr << _("Privilege level may be set only once.") << endl; | |
971 | return 1; | |
972 | } | |
973 | privilege = pr_unprivileged; | |
974 | privilege_set = true; | |
975 | server_args.push_back ("--unprivileged"); | |
976 | /* NB: for server security, it is essential that once this flag is | |
977 | set, no future flag be able to unset it. */ | |
978 | break; | |
979 | ||
980 | case LONG_OPT_OMIT_WERROR: | |
981 | server_args.push_back (OMIT_WERROR_NAME); | |
982 | omit_werror = true; | |
983 | break; | |
984 | ||
985 | case LONG_OPT_CLIENT_OPTIONS: | |
986 | client_options = true; | |
987 | break; | |
988 | ||
989 | case LONG_OPT_TMPDIR: | |
990 | if (client_options) { | |
991 | cerr << _F("ERROR: %s is invalid with %s", "--tmpdir", "--client-options") << endl; | |
992 | return 1; | |
993 | } | |
994 | tmpdir_opt_set = true; | |
995 | tmpdir = optarg; | |
996 | break; | |
997 | ||
998 | case LONG_OPT_DOWNLOAD_DEBUGINFO: | |
999 | if(optarg) | |
1000 | { | |
1001 | if(strcmp(optarg, "no") == 0) | |
1002 | download_dbinfo = 0; //Disable feature | |
1003 | else if (strcmp(optarg, "yes") == 0) | |
1004 | download_dbinfo = INT_MAX; //Enable, No Timeout | |
1005 | /* NOTE: Timeout and Asking for Confirmation features below are not supported yet by abrt | |
1006 | * in version abrt-2.0.3-1.fc15.x86_64, Bugzilla: BZ730107 (timeout), BZ726192 ('-y') */ | |
1007 | else if(atoi(optarg) > 0) | |
1008 | download_dbinfo = atoi(optarg); //Enable, Set timeout to optarg | |
1009 | else if (strcmp(optarg, "ask") == 0) | |
1010 | download_dbinfo = -1; //Enable, Ask for confirmation | |
2dce8c42 | 1011 | else |
44edbcd6 | 1012 | { |
372c6458 DB |
1013 | cerr << _F("ERROR: %s is not a valid value. Use 'yes', 'no', 'ask' or a timeout value.", optarg) << endl; |
1014 | return 1; | |
44edbcd6 | 1015 | } |
372c6458 DB |
1016 | } |
1017 | else | |
1018 | download_dbinfo = INT_MAX; //Enable, No Timeout | |
1019 | break; | |
1020 | ||
1021 | case LONG_OPT_USE_SERVER: | |
1022 | if (client_options) { | |
1023 | cerr << _F("ERROR: %s is invalid with %s", "--use-server", "--client-options") << endl; | |
1024 | return 1; | |
1025 | } | |
1026 | if (optarg) | |
1027 | specified_servers.push_back (optarg); | |
1028 | else | |
1029 | specified_servers.push_back (""); | |
1030 | break; | |
1031 | ||
1032 | case LONG_OPT_USE_SERVER_ON_ERROR: | |
1033 | if (client_options) { | |
1034 | cerr << _F("ERROR: %s is invalid with %s", "--use-server-on-error", "--client-options") << endl; | |
1035 | return 1; | |
1036 | } | |
1037 | if (optarg) | |
1038 | { | |
1039 | string arg = optarg; | |
1040 | for (unsigned i = 0; i < arg.size (); ++i) | |
1041 | arg[i] = tolower (arg[i]); | |
1042 | if (arg == "yes" || arg == "ye" || arg == "y") | |
44edbcd6 | 1043 | use_server_on_error = true; |
372c6458 DB |
1044 | else if (arg == "no" || arg == "n") |
1045 | use_server_on_error = false; | |
2dce8c42 | 1046 | else |
372c6458 DB |
1047 | cerr << _F("Invalid argument '%s' for --use-server-on-error.", optarg) << endl; |
1048 | } | |
1049 | else | |
1050 | use_server_on_error = true; | |
1051 | break; | |
1052 | ||
1053 | case LONG_OPT_LIST_SERVERS: | |
1054 | if (client_options) { | |
1055 | cerr << _F("ERROR: %s is invalid with %s", "--list-servers", "--client-options") << endl; | |
1056 | return 1; | |
1057 | } | |
1058 | if (optarg) | |
1059 | server_status_strings.push_back (optarg); | |
1060 | else | |
1061 | server_status_strings.push_back (""); | |
1062 | break; | |
1063 | ||
1064 | case LONG_OPT_TRUST_SERVERS: | |
1065 | if (client_options) { | |
1066 | cerr << _F("ERROR: %s is invalid with %s", "--trust-servers", "--client-options") << endl; | |
1067 | return 1; | |
1068 | } | |
1069 | if (optarg) | |
1070 | server_trust_spec = optarg; | |
1071 | else | |
1072 | server_trust_spec = "ssl"; | |
1073 | break; | |
1074 | ||
1075 | case LONG_OPT_HELP: | |
1076 | usage (0); | |
1077 | break; | |
1078 | ||
1079 | // The caching options should not be available to server clients | |
1080 | case LONG_OPT_DISABLE_CACHE: | |
1081 | if (client_options) { | |
1082 | cerr << _F("ERROR: %s is invalid with %s", "--disable-cache", "--client-options") << endl; | |
1083 | return 1; | |
1084 | } | |
1085 | use_cache = use_script_cache = false; | |
1086 | break; | |
1087 | ||
1088 | case LONG_OPT_POISON_CACHE: | |
1089 | if (client_options) { | |
1090 | cerr << _F("ERROR: %s is invalid with %s", "--poison-cache", "--client-options") << endl; | |
1091 | return 1; | |
1092 | } | |
1093 | poison_cache = true; | |
1094 | break; | |
1095 | ||
1096 | case LONG_OPT_CLEAN_CACHE: | |
1097 | if (client_options) { | |
1098 | cerr << _F("ERROR: %s is invalid with %s", "--clean-cache", "--client-options") << endl; | |
1099 | return 1; | |
1100 | } | |
1101 | clean_cache(*this); | |
e2d0f787 | 1102 | throw exit_exception(EXIT_SUCCESS); |
372c6458 DB |
1103 | |
1104 | case LONG_OPT_COMPATIBLE: | |
1105 | server_args.push_back ("--compatible=" + string(optarg)); | |
1106 | compatible = optarg; | |
1107 | break; | |
1108 | ||
1109 | case LONG_OPT_LDD: | |
1110 | if (client_options) { | |
1111 | cerr << _F("ERROR: %s is invalid with %s", "--ldd", "--client-options") << endl; | |
1112 | return 1; | |
1113 | } | |
1114 | unwindsym_ldd = true; | |
1115 | break; | |
1116 | ||
1117 | case LONG_OPT_ALL_MODULES: | |
1118 | if (client_options) { | |
1119 | cerr << _F("ERROR: %s is invalid with %s", "--all-modules", "--client-options") << endl; | |
1120 | return 1; | |
1121 | } | |
1122 | insert_loaded_modules(); | |
1123 | break; | |
1124 | ||
1125 | case LONG_OPT_REMOTE: | |
1126 | if (client_options) { | |
1127 | cerr << _F("ERROR: %s is invalid with %s", "--remote", "--client-options") << endl; | |
1128 | return 1; | |
1129 | } | |
1130 | ||
1131 | remote_uris.push_back(optarg); | |
1132 | break; | |
1133 | ||
1134 | case LONG_OPT_REMOTE_PREFIX: | |
1135 | if (client_options) { | |
1136 | cerr << _F("ERROR: %s is invalid with %s", "--remote-prefix", "--client-options") << endl; | |
1137 | return 1; | |
1138 | } | |
1139 | ||
1140 | use_remote_prefix = true; | |
1141 | break; | |
1142 | ||
1143 | case LONG_OPT_CHECK_VERSION: | |
1144 | server_args.push_back ("--check-version"); | |
1145 | systemtap_v_check = true; | |
1146 | break; | |
1147 | ||
1148 | case LONG_OPT_DUMP_PROBE_TYPES: | |
1149 | server_args.push_back ("--dump-probe-types"); | |
1150 | dump_probe_types = true; | |
1151 | break; | |
1152 | ||
1153 | case LONG_OPT_SUPPRESS_HANDLER_ERRORS: | |
1154 | suppress_handler_errors = true; | |
1155 | break; | |
1156 | ||
1157 | case LONG_OPT_MODINFO: | |
1158 | // Make sure the global option is only composed of the | |
1159 | // following chars: [_=a-zA-Z0-9] | |
1160 | if (client_options) { | |
1161 | cerr << _F("ERROR: %s is invalid with %s", "--modinfo", "--client-options") << endl; | |
1162 | return 1; | |
1163 | } | |
1164 | assert_regexp_match("--modinfo parameter", optarg, "^[a-z_][a-z0-9_]*=.+$"); | |
1165 | modinfos.push_back (string(optarg)); | |
1166 | break; | |
e2012a7a | 1167 | |
ea7e1c17 DB |
1168 | case LONG_OPT_RLIMIT_AS: |
1169 | if(getrlimit(RLIMIT_AS, & our_rlimit)) | |
1170 | cerr << _F("Unable to obtain resource limits for rlimit_as : %s", strerror (errno)) << endl; | |
6ae64991 | 1171 | our_rlimit.rlim_max = our_rlimit.rlim_cur = strtoul (optarg, &num_endptr, 0); |
ea7e1c17 DB |
1172 | if(*num_endptr || setrlimit (RLIMIT_AS, & our_rlimit)) |
1173 | cerr << _F("Unable to set resource limits for rlimit_as : %s", strerror (errno)) << endl; | |
ca369a09 FCE |
1174 | /* Disable core dumps, since exhaustion results in uncaught bad_alloc etc. exceptions */ |
1175 | our_rlimit.rlim_max = our_rlimit.rlim_cur = 0; | |
1176 | (void) setrlimit (RLIMIT_CORE, & our_rlimit); | |
ea7e1c17 DB |
1177 | break; |
1178 | ||
1179 | case LONG_OPT_RLIMIT_CPU: | |
1180 | if(getrlimit(RLIMIT_CPU, & our_rlimit)) | |
1181 | cerr << _F("Unable to obtain resource limits for rlimit_cpu : %s", strerror (errno)) << endl; | |
6ae64991 | 1182 | our_rlimit.rlim_max = our_rlimit.rlim_cur = strtoul (optarg, &num_endptr, 0); |
ea7e1c17 DB |
1183 | if(*num_endptr || setrlimit (RLIMIT_CPU, & our_rlimit)) |
1184 | cerr << _F("Unable to set resource limits for rlimit_cpu : %s", strerror (errno)) << endl; | |
1185 | break; | |
1186 | ||
1187 | case LONG_OPT_RLIMIT_NPROC: | |
1188 | if(getrlimit(RLIMIT_NPROC, & our_rlimit)) | |
1189 | cerr << _F("Unable to obtain resource limits for rlimit_nproc : %s", strerror (errno)) << endl; | |
6ae64991 | 1190 | our_rlimit.rlim_max = our_rlimit.rlim_cur = strtoul (optarg, &num_endptr, 0); |
ea7e1c17 DB |
1191 | if(*num_endptr || setrlimit (RLIMIT_NPROC, & our_rlimit)) |
1192 | cerr << _F("Unable to set resource limits for rlimit_nproc : %s", strerror (errno)) << endl; | |
1193 | break; | |
1194 | ||
1195 | case LONG_OPT_RLIMIT_STACK: | |
1196 | if(getrlimit(RLIMIT_STACK, & our_rlimit)) | |
1197 | cerr << _F("Unable to obtain resource limits for rlimit_stack : %s", strerror (errno)) << endl; | |
6ae64991 | 1198 | our_rlimit.rlim_max = our_rlimit.rlim_cur = strtoul (optarg, &num_endptr, 0); |
ea7e1c17 DB |
1199 | if(*num_endptr || setrlimit (RLIMIT_STACK, & our_rlimit)) |
1200 | cerr << _F("Unable to set resource limits for rlimit_stack : %s", strerror (errno)) << endl; | |
ca369a09 FCE |
1201 | /* Disable core dumps, since exhaustion results in SIGSEGV */ |
1202 | our_rlimit.rlim_max = our_rlimit.rlim_cur = 0; | |
1203 | (void) setrlimit (RLIMIT_CORE, & our_rlimit); | |
ea7e1c17 DB |
1204 | break; |
1205 | ||
1206 | case LONG_OPT_RLIMIT_FSIZE: | |
1207 | if(getrlimit(RLIMIT_FSIZE, & our_rlimit)) | |
1208 | cerr << _F("Unable to obtain resource limits for rlimit_fsize : %s", strerror (errno)) << endl; | |
6ae64991 | 1209 | our_rlimit.rlim_max = our_rlimit.rlim_cur = strtoul (optarg, &num_endptr, 0); |
ea7e1c17 DB |
1210 | if(*num_endptr || setrlimit (RLIMIT_FSIZE, & our_rlimit)) |
1211 | cerr << _F("Unable to set resource limits for rlimit_fsize : %s", strerror (errno)) << endl; | |
1212 | break; | |
e2012a7a | 1213 | |
4bf09a21 JS |
1214 | case LONG_OPT_SYSROOT: |
1215 | if (client_options) { | |
1216 | cerr << _F("ERROR: %s invalid with %s", "--sysroot", "--client-options") << endl; | |
1217 | return 1; | |
1218 | } else if (!sysroot.empty()) { | |
1219 | cerr << "ERROR: multiple --sysroot options not supported" << endl; | |
1220 | return 1; | |
1221 | } else { | |
1222 | const char *spath = canonicalize_file_name (optarg); | |
1223 | if (spath == NULL) { | |
1224 | cerr << _F("ERROR: %s is an invalid directory for --sysroot", optarg) << endl; | |
1225 | return 1; | |
1226 | } | |
1227 | ||
1228 | sysroot = string(spath); | |
1229 | if (sysroot[sysroot.size() - 1] != '/') | |
1230 | sysroot.append("/"); | |
b82d77b4 | 1231 | |
7baf48e9 | 1232 | break; |
4bf09a21 | 1233 | } |
7baf48e9 | 1234 | |
4bf09a21 JS |
1235 | case LONG_OPT_SYSENV: |
1236 | if (client_options) { | |
1237 | cerr << _F("ERROR: %s invalid with %s", "--sysenv", "--client-options") << endl; | |
1238 | return 1; | |
1239 | } else { | |
1240 | string sysenv_str = optarg; | |
1241 | string value; | |
1242 | size_t pos; | |
1243 | if (sysroot.empty()) { | |
1244 | cerr << "ERROR: --sysenv must follow --sysroot" << endl; | |
1245 | return 1; | |
1246 | } | |
1247 | ||
1248 | pos = sysenv_str.find("="); | |
1249 | if (pos == string::npos) { | |
1250 | cerr << _F("ERROR: %s is an invalid argument for --sysenv", optarg) << endl; | |
1251 | return 1; | |
1252 | } | |
1253 | ||
1254 | value = sysenv_str.substr(pos + 1); | |
1255 | sysenv[sysenv_str.substr(0, pos)] = value; | |
1256 | ||
1257 | break; | |
1258 | } | |
e2012a7a | 1259 | |
4441e344 JS |
1260 | case LONG_OPT_RUNTIME: |
1261 | if (optarg == string("kernel")) | |
1262 | runtime_mode = kernel_runtime; | |
1263 | else if (optarg == string("dyninst")) | |
3e784e8b JS |
1264 | { |
1265 | if (privilege_set && pr_unprivileged != privilege) | |
1266 | { | |
1267 | cerr << _("ERROR: --runtime=dyninst implies unprivileged mode only") << endl; | |
1268 | return 1; | |
1269 | } | |
1270 | privilege = pr_unprivileged; | |
1271 | privilege_set = true; | |
1272 | runtime_mode = dyninst_runtime; | |
1273 | } | |
4441e344 JS |
1274 | else |
1275 | { | |
1276 | cerr << _F("ERROR: %s is an invalid argument for --runtime", optarg) << endl; | |
1277 | return 1; | |
1278 | } | |
1279 | ||
1280 | break; | |
1281 | ||
36222574 MW |
1282 | case '?': |
1283 | // Invalid/unrecognized option given or argument required, but | |
1284 | // not given. In both cases getopt_long() will have printed the | |
1285 | // appropriate error message to stderr already. | |
5ec722e1 | 1286 | usage(1); |
36222574 MW |
1287 | break; |
1288 | ||
e2012a7a | 1289 | default: |
372c6458 | 1290 | // NOTREACHED unless one added a getopt option but not a corresponding case: |
46a1a151 | 1291 | cerr << _F("Unhandled argument code %d", (char)grc) << endl; |
e2012a7a DB |
1292 | return 1; |
1293 | break; | |
1294 | } | |
1295 | } | |
1296 | ||
1297 | return 0; | |
1298 | } | |
1299 | ||
1300 | void | |
1301 | systemtap_session::check_options (int argc, char * const argv []) | |
1302 | { | |
a83cc46b DB |
1303 | for (int i = optind; i < argc; i++) |
1304 | { | |
1305 | if (! have_script) | |
1306 | { | |
1307 | script_file = string (argv[i]); | |
1308 | have_script = true; | |
1309 | } | |
1310 | else | |
1311 | args.push_back (string (argv[i])); | |
1312 | } | |
1313 | ||
1314 | // need a user file | |
1315 | // NB: this is also triggered if stap is invoked with no arguments at all | |
1316 | if (! have_script) | |
1317 | { | |
b82d77b4 DB |
1318 | // We don't need a script if --list-servers, --trust-servers or --dump-probe-types was |
1319 | // specified. | |
1320 | if (server_status_strings.empty () && server_trust_spec.empty () && ! dump_probe_types) | |
a83cc46b | 1321 | { |
79bc39ab | 1322 | cerr << _("A script must be specified.") << endl; |
a83cc46b DB |
1323 | usage(1); |
1324 | } | |
1325 | } | |
1326 | ||
2dce8c42 DB |
1327 | #if ! HAVE_NSS |
1328 | if (client_options) | |
2713ea24 | 1329 | print_warning("--client-options is not supported by this version of systemtap"); |
2dce8c42 | 1330 | |
c4fd15b4 DB |
1331 | if (! server_status_strings.empty ()) |
1332 | { | |
1333 | print_warning("--list-servers is not supported by this version of systemtap"); | |
1334 | server_status_strings.clear (); | |
1335 | } | |
1336 | ||
c77af0d0 DB |
1337 | if (! server_trust_spec.empty ()) |
1338 | { | |
2713ea24 | 1339 | print_warning("--trust-servers is not supported by this version of systemtap"); |
c77af0d0 DB |
1340 | server_trust_spec.clear (); |
1341 | } | |
1342 | #endif | |
2dce8c42 | 1343 | |
2fad97fd DB |
1344 | if (runtime_specified && ! specified_servers.empty ()) |
1345 | { | |
2713ea24 | 1346 | print_warning("Ignoring --use-server due to the use of -R"); |
2fad97fd DB |
1347 | specified_servers.clear (); |
1348 | } | |
1349 | ||
e2012a7a DB |
1350 | if (client_options && last_pass > 4) |
1351 | { | |
1352 | last_pass = 4; /* Quietly downgrade. Server passed through -p5 naively. */ | |
1353 | } | |
f6be7c06 DB |
1354 | |
1355 | // If phase 5 has been requested, automatically adjust the --privilege setting to match the | |
1356 | // user's actual privilege level and add --use-server, if necessary. | |
73f52eb4 | 1357 | // Do this only if we have a script and we are not the server. |
b30aefff | 1358 | // Also do this only if we're running in the kernel (e.g. not --runtime=dyninst) |
dbf065b9 | 1359 | // XXX Eventually we could check remote hosts, but disable that case for now. |
b30aefff JS |
1360 | if (last_pass > 4 && have_script && ! client_options && |
1361 | runtime_mode == kernel_runtime && remote_uris.empty()) | |
a83cc46b | 1362 | { |
f6be7c06 DB |
1363 | // What is the user's privilege level? |
1364 | privilege_t credentials = get_privilege_credentials (); | |
73f52eb4 DB |
1365 | // Don't alter specifically-requested privilege levels |
1366 | if (! privilege_set && ! pr_contains (credentials, privilege)) | |
a83cc46b | 1367 | { |
73f52eb4 | 1368 | // We do not have the default privilege credentials (stapdev). Lower |
bb4470ca DB |
1369 | // the privilege level to match our credentials. |
1370 | if (pr_contains (credentials, pr_stapsys)) | |
a83cc46b | 1371 | { |
bb4470ca DB |
1372 | if (perpass_verbose[0] > 1) |
1373 | cerr << _("Using --privilege=stapsys for member of the group stapsys") << endl; | |
1374 | privilege = pr_stapsys; | |
1375 | server_args.push_back ("--privilege=stapsys"); | |
a83cc46b | 1376 | } |
bb4470ca DB |
1377 | else if (pr_contains (credentials, pr_stapusr)) |
1378 | { | |
1379 | if (perpass_verbose[0] > 1) | |
1380 | cerr << _("Using --privilege=stapusr for member of the group stapusr") << endl; | |
1381 | privilege = pr_stapusr; | |
1382 | server_args.push_back ("--privilege=stapusr"); | |
1383 | } | |
1384 | else | |
1385 | { | |
1386 | // Completely unprivileged user. | |
1387 | cerr << _("You are trying to run systemtap as a normal user.\n" | |
1388 | "You should either be root, or be part of " | |
1389 | "the group \"stapusr\" and possibly one of the groups \"stapsys\" or \"stapdev\".\n"); | |
1390 | usage (1); // does not return. | |
1391 | } | |
1392 | } | |
bb4470ca DB |
1393 | // Add --use-server if not already specified and the user's (lack of) credentials require |
1394 | // it for pass 5. | |
1395 | if (! pr_contains (credentials, pr_stapdev)) | |
1396 | { | |
f6be7c06 DB |
1397 | if (specified_servers.empty ()) |
1398 | { | |
1399 | if (perpass_verbose[0] > 1) | |
1400 | cerr << _F("Using --use-server for user with privilege level %s", | |
1401 | pr_name (privilege)) | |
1402 | << endl; | |
1403 | specified_servers.push_back (""); | |
1404 | } | |
a83cc46b DB |
1405 | } |
1406 | } | |
1407 | ||
372c6458 | 1408 | if (client_options && ! pr_contains (privilege, pr_stapdev) && ! client_options_disallowed_for_unprivileged.empty ()) |
e2012a7a | 1409 | { |
f66bb29a | 1410 | cerr << _F("You can't specify %s when --privilege=%s is specified.", |
372c6458 | 1411 | client_options_disallowed_for_unprivileged.c_str(), |
f66bb29a DB |
1412 | pr_name (privilege)) |
1413 | << endl; | |
e2012a7a DB |
1414 | usage (1); |
1415 | } | |
1416 | if ((cmd != "") && (target_pid)) | |
1417 | { | |
ce0f6648 | 1418 | cerr << _F("You can't specify %s and %s together.", "-c", "-x") << endl; |
e2012a7a DB |
1419 | usage (1); |
1420 | } | |
3e784e8b JS |
1421 | |
1422 | // NB: In user-mode runtimes (dyninst), we can allow guru mode any time, but we | |
1423 | // need to restrict guru by privilege level in the kernel runtime. | |
ac3af990 | 1424 | if (! runtime_usermode_p () && ! pr_contains (privilege, pr_stapdev) && guru_mode) |
e2012a7a | 1425 | { |
f66bb29a DB |
1426 | cerr << _F("You can't specify %s and --privilege=%s together.", "-g", pr_name (privilege)) |
1427 | << endl; | |
e2012a7a DB |
1428 | usage (1); |
1429 | } | |
3e784e8b | 1430 | |
e2012a7a DB |
1431 | if (!kernel_symtab_path.empty()) |
1432 | { | |
1433 | if (consult_symtab) | |
1434 | { | |
ce0f6648 | 1435 | cerr << _F("You can't specify %s and %s together.", "--kelf", "--kmap") << endl; |
e2012a7a DB |
1436 | usage (1); |
1437 | } | |
1438 | consult_symtab = true; | |
1439 | if (kernel_symtab_path == PATH_TBD) | |
1440 | kernel_symtab_path = string("/boot/System.map-") + kernel_release; | |
1441 | } | |
305fac7d CM |
1442 | // Can't use --remote and --tmpdir together because with --remote, |
1443 | // there may be more than one tmpdir needed. | |
1444 | if (!remote_uris.empty() && tmpdir_opt_set) | |
1445 | { | |
1446 | cerr << _F("You can't specify %s and %s together.", "--remote", "--tmpdir") << endl; | |
1447 | usage(1); | |
1448 | } | |
e2012a7a | 1449 | // Warn in case the target kernel release doesn't match the running one. |
50f2545f FCE |
1450 | native_build = (release == kernel_release && |
1451 | machine == architecture); // NB: squashed ARCH by PR4186 logic | |
1452 | ||
19da0351 JS |
1453 | // Non-native builds can't be loaded locally, but may still work on remotes |
1454 | if (last_pass > 4 && !native_build && remote_uris.empty()) | |
50f2545f | 1455 | { |
2713ea24 | 1456 | print_warning("kernel release/architecture mismatch with host forces last-pass 4."); |
50f2545f FCE |
1457 | last_pass = 4; |
1458 | } | |
0ba354fe CM |
1459 | if(download_dbinfo != 0 && access ("/usr/bin/abrt-action-install-debuginfo-to-abrt-cache", X_OK) < 0 |
1460 | && access ("/usr/libexec/abrt-action-install-debuginfo-to-abrt-cache", X_OK) < 0) | |
ea60076d | 1461 | { |
0ba354fe | 1462 | print_warning("abrt-action-install-debuginfo-to-abrt-cache is not installed. Continuing without downloading debuginfo."); |
ea60076d CM |
1463 | download_dbinfo = 0; |
1464 | } | |
e2012a7a | 1465 | |
e2012a7a DB |
1466 | // translate path of runtime to absolute path |
1467 | if (runtime_path[0] != '/') | |
1468 | { | |
1469 | char cwd[PATH_MAX]; | |
1470 | if (getcwd(cwd, sizeof(cwd))) | |
1471 | { | |
1472 | runtime_path = string(cwd) + "/" + runtime_path; | |
1473 | } | |
1474 | } | |
44edbcd6 JS |
1475 | |
1476 | // Abnormal characters in our temp path can break us, including parts out | |
1477 | // of our control like Kbuild. Let's enforce nice, safe characters only. | |
1478 | const char *tmpdir = getenv("TMPDIR"); | |
fc4cb088 | 1479 | if (tmpdir != NULL) |
44edbcd6 | 1480 | assert_regexp_match("TMPDIR", tmpdir, "^[-/._0-9a-z]+$"); |
ce286ff0 DB |
1481 | } |
1482 | ||
44edbcd6 JS |
1483 | |
1484 | void | |
1485 | systemtap_session::init_try_server () | |
1486 | { | |
1487 | #if HAVE_NSS | |
1488 | // If the option is disabled or we are a server or we are already using a | |
1489 | // server, then never retry compilation using a server. | |
1490 | if (! use_server_on_error || client_options || ! specified_servers.empty ()) | |
1491 | try_server_status = dont_try_server; | |
1492 | else | |
1493 | try_server_status = try_server_unset; | |
1494 | #else | |
1495 | // No client, so don't bother. | |
1496 | try_server_status = dont_try_server; | |
1497 | #endif | |
1498 | } | |
1499 | ||
1500 | void | |
1501 | systemtap_session::set_try_server (int t) | |
1502 | { | |
1503 | if (try_server_status != dont_try_server) | |
1504 | try_server_status = t; | |
1505 | } | |
1506 | ||
1507 | ||
c1743705 AK |
1508 | void systemtap_session::insert_loaded_modules() |
1509 | { | |
1510 | char line[1024]; | |
1511 | ifstream procmods ("/proc/modules"); | |
1512 | while (procmods.good()) { | |
1513 | procmods.getline (line, sizeof(line)); | |
1514 | strtok(line, " \t"); | |
1515 | if (line[0] == '\0') | |
1516 | break; // maybe print a warning? | |
1517 | unwindsym_modules.insert (string (line)); | |
1518 | } | |
1519 | procmods.close(); | |
eebd081d | 1520 | unwindsym_modules.insert ("kernel"); |
c1743705 AK |
1521 | } |
1522 | ||
e2012a7a DB |
1523 | void |
1524 | systemtap_session::setup_kernel_release (const char* kstr) | |
1525 | { | |
4f747a64 JS |
1526 | // Sometimes we may get dupes here... e.g. a server may have a full |
1527 | // -r /path/to/kernel followed by a client's -r kernel. | |
1528 | if (kernel_release == kstr) | |
1529 | return; // nothing new here... | |
1530 | ||
504d2b61 | 1531 | kernel_release = kernel_build_tree = kernel_source_tree = ""; |
e2012a7a DB |
1532 | if (kstr[0] == '/') // fully specified path |
1533 | { | |
1534 | kernel_build_tree = kstr; | |
aeb9cc10 | 1535 | kernel_release = kernel_release_from_build_tree (kernel_build_tree, verbose); |
61f1a63b FCE |
1536 | |
1537 | // PR10745 | |
1538 | // Maybe it's a full kernel source tree, for purposes of PR10745. | |
1539 | // In case CONFIG_DEBUG_INFO was set, we'd find it anyway with the | |
1540 | // normal search in tapsets.cxx. Without CONFIG_DEBUG_INFO, we'd | |
1541 | // need heuristics such as this one: | |
1542 | ||
1543 | string some_random_source_only_file = kernel_build_tree + "/COPYING"; | |
1544 | ifstream epic (some_random_source_only_file.c_str()); | |
1545 | if (! epic.fail()) | |
1546 | { | |
1547 | kernel_source_tree = kernel_build_tree; | |
1548 | if (verbose > 2) | |
46a1a151 | 1549 | clog << _F("Located kernel source tree (COPYING) at '%s'", kernel_source_tree.c_str()) << endl; |
61f1a63b | 1550 | } |
e2012a7a DB |
1551 | } |
1552 | else | |
1553 | { | |
05fb3e0c | 1554 | update_release_sysroot = true; |
e2012a7a | 1555 | kernel_release = string (kstr); |
504d2b61 JS |
1556 | if (!kernel_release.empty()) |
1557 | kernel_build_tree = "/lib/modules/" + kernel_release + "/build"; | |
61f1a63b FCE |
1558 | |
1559 | // PR10745 | |
1560 | // Let's not look for the kernel_source_tree; it's definitely | |
1561 | // not THERE. tapsets.cxx might try to find it later if tracepoints | |
1562 | // need it. | |
e2012a7a DB |
1563 | } |
1564 | } | |
1565 | ||
1566 | ||
1567 | // Register all the aliases we've seen in library files, and the user | |
1568 | // file, as patterns. | |
1569 | void | |
1570 | systemtap_session::register_library_aliases() | |
1571 | { | |
1572 | vector<stapfile*> files(library_files); | |
1573 | files.push_back(user_file); | |
1574 | ||
1575 | for (unsigned f = 0; f < files.size(); ++f) | |
1576 | { | |
1577 | stapfile * file = files[f]; | |
1578 | for (unsigned a = 0; a < file->aliases.size(); ++a) | |
1579 | { | |
1580 | probe_alias * alias = file->aliases[a]; | |
1581 | try | |
1582 | { | |
1583 | for (unsigned n = 0; n < alias->alias_names.size(); ++n) | |
1584 | { | |
1585 | probe_point * name = alias->alias_names[n]; | |
6f58d8ae | 1586 | match_node * mn = pattern_root; |
e2012a7a DB |
1587 | for (unsigned c = 0; c < name->components.size(); ++c) |
1588 | { | |
1589 | probe_point::component * comp = name->components[c]; | |
1590 | // XXX: alias parameters | |
1591 | if (comp->arg) | |
46a1a151 JS |
1592 | throw semantic_error(_F("alias component %s contains illegal parameter", |
1593 | comp->functor.c_str())); | |
6f58d8ae | 1594 | mn = mn->bind(comp->functor); |
e2012a7a | 1595 | } |
f66bb29a | 1596 | // PR 12916: All probe aliases are OK for all users. The actual |
373027ba | 1597 | // referenced probe points will be checked when the alias is resolved. |
f66bb29a | 1598 | mn->bind_privilege (pr_all); |
6f58d8ae | 1599 | mn->bind(new alias_expansion_builder(alias)); |
e2012a7a DB |
1600 | } |
1601 | } | |
1602 | catch (const semantic_error& e) | |
1603 | { | |
e26c2f83 FCE |
1604 | semantic_error* er = new semantic_error (_("while registering probe alias"), |
1605 | alias->tok); | |
1606 | er->chain = & e; | |
e2012a7a DB |
1607 | print_error (* er); |
1608 | delete er; | |
1609 | } | |
1610 | } | |
1611 | } | |
1612 | } | |
1613 | ||
1614 | ||
1615 | // Print this given token, but abbreviate it if the last one had the | |
1616 | // same file name. | |
1617 | void | |
1618 | systemtap_session::print_token (ostream& o, const token* tok) | |
1619 | { | |
1620 | assert (tok); | |
1621 | ||
1622 | if (last_token && last_token->location.file == tok->location.file) | |
1623 | { | |
1624 | stringstream tmpo; | |
1625 | tmpo << *tok; | |
1626 | string ts = tmpo.str(); | |
1627 | // search & replace the file name with nothing | |
1628 | size_t idx = ts.find (tok->location.file->name); | |
1629 | if (idx != string::npos) | |
1630 | ts.replace (idx, tok->location.file->name.size(), ""); | |
1631 | ||
1632 | o << ts; | |
1633 | } | |
1634 | else | |
1635 | o << *tok; | |
1636 | ||
1637 | last_token = tok; | |
1638 | } | |
1639 | ||
1640 | ||
1641 | ||
1642 | void | |
1643 | systemtap_session::print_error (const semantic_error& e) | |
1644 | { | |
1645 | string message_str[2]; | |
1646 | string align_semantic_error (" "); | |
1647 | ||
1648 | // We generate two messages. The second one ([1]) is printed | |
1649 | // without token compression, for purposes of duplicate elimination. | |
1650 | // This way, the same message that may be generated once with a | |
1651 | // compressed and once with an uncompressed token still only gets | |
1652 | // printed once. | |
1653 | for (int i=0; i<2; i++) | |
1654 | { | |
1655 | stringstream message; | |
1656 | ||
46a1a151 | 1657 | message << _F("semantic error: %s", e.what ()); |
e2012a7a DB |
1658 | if (e.tok1 || e.tok2) |
1659 | message << ": "; | |
1660 | if (e.tok1) | |
1661 | { | |
e26c2f83 FCE |
1662 | if (i == 0) |
1663 | { | |
1664 | print_token (message, e.tok1); | |
1665 | message << endl; | |
1666 | print_error_source (message, align_semantic_error, e.tok1); | |
1667 | } | |
e2012a7a DB |
1668 | else message << *e.tok1; |
1669 | } | |
e2012a7a DB |
1670 | if (e.tok2) |
1671 | { | |
e26c2f83 FCE |
1672 | if (i == 0) |
1673 | { | |
1674 | print_token (message, e.tok2); | |
1675 | message << endl; | |
1676 | print_error_source (message, align_semantic_error, e.tok2); | |
1677 | } | |
e2012a7a DB |
1678 | else message << *e.tok2; |
1679 | } | |
1680 | message << endl; | |
1681 | message_str[i] = message.str(); | |
1682 | } | |
1683 | ||
1684 | // Duplicate elimination | |
1685 | if (seen_errors.find (message_str[1]) == seen_errors.end()) | |
1686 | { | |
1687 | seen_errors.insert (message_str[1]); | |
1688 | cerr << message_str[0]; | |
e2012a7a DB |
1689 | } |
1690 | ||
1691 | if (e.chain) | |
1692 | print_error (* e.chain); | |
1693 | } | |
1694 | ||
1695 | void | |
1696 | systemtap_session::print_error_source (std::ostream& message, | |
1697 | std::string& align, const token* tok) | |
1698 | { | |
1699 | unsigned i = 0; | |
1700 | ||
1701 | assert (tok); | |
1702 | if (!tok->location.file) | |
1703 | //No source to print, silently exit | |
1704 | return; | |
1705 | ||
1706 | unsigned line = tok->location.line; | |
1707 | unsigned col = tok->location.column; | |
1708 | const string &file_contents = tok->location.file->file_contents; | |
1709 | ||
1710 | size_t start_pos = 0, end_pos = 0; | |
1711 | //Navigate to the appropriate line | |
1712 | while (i != line && end_pos != std::string::npos) | |
1713 | { | |
1714 | start_pos = end_pos; | |
1715 | end_pos = file_contents.find ('\n', start_pos) + 1; | |
1716 | i++; | |
1717 | } | |
efee9a98 LB |
1718 | //TRANSLATORS: Here were are printing the source string of the error |
1719 | message << align << _("source: ") << file_contents.substr (start_pos, end_pos-start_pos-1) << endl; | |
e2012a7a DB |
1720 | message << align << " "; |
1721 | //Navigate to the appropriate column | |
1722 | for (i=start_pos; i<start_pos+col-1; i++) | |
1723 | { | |
1724 | if(isspace(file_contents[i])) | |
1725 | message << file_contents[i]; | |
1726 | else | |
1727 | message << ' '; | |
1728 | } | |
1729 | message << "^" << endl; | |
1730 | } | |
1731 | ||
1732 | void | |
1733 | systemtap_session::print_warning (const string& message_str, const token* tok) | |
1734 | { | |
2713ea24 CM |
1735 | if(suppress_warnings) |
1736 | return; | |
1737 | ||
e2012a7a DB |
1738 | // Duplicate elimination |
1739 | string align_warning (" "); | |
1740 | if (seen_warnings.find (message_str) == seen_warnings.end()) | |
1741 | { | |
1742 | seen_warnings.insert (message_str); | |
79bc39ab | 1743 | clog << _("WARNING: ") << message_str; |
e2012a7a DB |
1744 | if (tok) { clog << ": "; print_token (clog, tok); } |
1745 | clog << endl; | |
1746 | if (tok) { print_error_source (clog, align_warning, tok); } | |
1747 | } | |
1748 | } | |
1749 | ||
b96901b7 CM |
1750 | void |
1751 | systemtap_session::create_tmp_dir() | |
1752 | { | |
1753 | if (!tmpdir.empty()) | |
1754 | return; | |
1755 | ||
1756 | // Create the temp directory | |
1757 | const char * tmpdir_env = getenv("TMPDIR"); | |
1758 | if (!tmpdir_env) | |
1759 | tmpdir_env = "/tmp"; | |
1760 | ||
1761 | string stapdir = "/stapXXXXXX"; | |
1762 | string tmpdirt = tmpdir_env + stapdir; | |
1763 | const char *tmpdir_name = mkdtemp((char *)tmpdirt.c_str()); | |
1764 | if (! tmpdir_name) | |
1765 | { | |
1766 | const char* e = strerror(errno); | |
1767 | //TRANSLATORS: we can't make the directory due to the error | |
1768 | throw runtime_error(_F("cannot create temporary directory (\" %s \"): %s", tmpdirt.c_str(), e)); | |
1769 | } | |
1770 | else | |
1771 | tmpdir = tmpdir_name; | |
1772 | } | |
1773 | ||
1774 | void | |
1775 | systemtap_session::remove_tmp_dir() | |
1776 | { | |
1777 | if(tmpdir.empty()) | |
1778 | return; | |
1779 | ||
1780 | // Remove temporary directory | |
1781 | if (keep_tmpdir && !tmpdir_opt_set) | |
1782 | clog << _F("Keeping temporary directory \"%s\"", tmpdir.c_str()) << endl; | |
1783 | else if (!tmpdir_opt_set) | |
1784 | { | |
1785 | // Mask signals while we're deleting the temporary directory. | |
1786 | stap_sigmasker masked; | |
1787 | ||
1788 | // Remove the temporary directory. | |
1789 | vector<string> cleanupcmd; | |
1790 | cleanupcmd.push_back("rm"); | |
1791 | cleanupcmd.push_back("-rf"); | |
1792 | cleanupcmd.push_back(tmpdir); | |
1793 | ||
1794 | (void) stap_system(verbose, cleanupcmd); | |
1795 | if (verbose>1) | |
1796 | clog << _F("Removed temporary directory \"%s\"", tmpdir.c_str()) << endl; | |
1797 | tmpdir.clear(); | |
1798 | ||
1799 | } | |
1800 | } | |
1801 | ||
1802 | void | |
1803 | systemtap_session::reset_tmp_dir() | |
1804 | { | |
1805 | remove_tmp_dir(); | |
1806 | create_tmp_dir(); | |
1807 | } | |
a4b9c3b3 FCE |
1808 | |
1809 | translator_output* systemtap_session::op_create_auxiliary() | |
1810 | { | |
1811 | static int counter = 0; | |
1812 | string tmpname = this->tmpdir + "/" + this->module_name + "_aux_" + lex_cast(counter++) + ".c"; | |
1813 | translator_output* n = new translator_output (tmpname); | |
1814 | auxiliary_outputs.push_back (n); | |
1815 | return n; | |
1816 | } | |
1817 | ||
e19ebcf7 CM |
1818 | // Wrapper for checking if there are pending interrupts |
1819 | void | |
e2d0f787 JS |
1820 | assert_no_interrupts() |
1821 | { | |
1822 | if (pending_interrupts) | |
1823 | throw interrupt_exception(); | |
1824 | } | |
a4b9c3b3 | 1825 | |
2dce8c42 DB |
1826 | // -------------------------------------------------------------------------- |
1827 | ||
e2012a7a DB |
1828 | /* |
1829 | Perngrq sebz fzvyrlgnc.fit, rkcbegrq gb n 1484k1110 fzvyrlgnc.cat, | |
1830 | gurapr catgbcnz | cazfpnyr -jvqgu 160 | | |
1831 | cczqvgure -qvz 4 -erq 2 -terra 2 -oyhr 2 | cczgbnafv -2k4 | bq -i -j19 -g k1 | | |
1832 | phg -s2- -q' ' | frq -r 'f,^,\\k,' -r 'f, ,\\k,t' -r 'f,^,",' -r 'f,$,",' | |
1833 | */ | |
1834 | const char* | |
1835 | systemtap_session::morehelp = | |
1836 | "\x1b\x5b\x30\x6d\x1b\x5b\x33\x37\x6d\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1837 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1838 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1839 | "\x20\x20\x20\x60\x20\x20\x2e\x60\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1840 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20" | |
1841 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1842 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1843 | "\x20\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x1b\x5b" | |
1844 | "\x33\x33\x6d\x20\x1b\x5b\x33\x37\x6d\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1845 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1846 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1847 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x1b\x5b\x33\x33\x6d\x20\x60" | |
1848 | "\x2e\x60\x1b\x5b\x33\x37\x6d\x20\x3a\x2c\x3a\x2e\x60\x20\x60\x20\x60\x20\x60" | |
1849 | "\x2c\x3b\x2c\x3a\x20\x1b\x5b\x33\x33\x6d\x60\x2e\x60\x20\x1b\x5b\x33\x37\x6d" | |
1850 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20" | |
1851 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1852 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x1b\x5b\x33" | |
1853 | "\x33\x6d\x20\x60\x20\x60\x20\x3a\x27\x60\x1b\x5b\x33\x37\x6d\x20\x60\x60\x60" | |
1854 | "\x20\x20\x20\x60\x20\x60\x60\x60\x20\x1b\x5b\x33\x33\x6d\x60\x3a\x60\x20\x60" | |
1855 | "\x20\x60\x20\x1b\x5b\x33\x37\x6d\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1856 | "\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1857 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1858 | "\x20\x2e\x1b\x5b\x33\x33\x6d\x60\x2e\x60\x20\x60\x20\x60\x20\x20\x1b\x5b\x33" | |
1859 | "\x37\x6d\x20\x3a\x20\x20\x20\x60\x20\x20\x20\x60\x20\x20\x2e\x1b\x5b\x33\x33" | |
1860 | "\x6d\x60\x20\x60\x2e\x60\x20\x60\x2e\x60\x20\x1b\x5b\x33\x37\x6d\x20\x20\x20" | |
1861 | "\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x2e\x3a\x20\x20" | |
1862 | "\x20\x20\x20\x20\x20\x20\x2e\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1863 | "\x20\x20\x2e\x76\x53\x1b\x5b\x33\x34\x6d\x53\x1b\x5b\x33\x37\x6d\x53\x1b\x5b" | |
1864 | "\x33\x31\x6d\x2b\x1b\x5b\x33\x33\x6d\x60\x20\x60\x20\x60\x20\x20\x20\x20\x1b" | |
1865 | "\x5b\x33\x31\x6d\x3f\x1b\x5b\x33\x30\x6d\x53\x1b\x5b\x33\x33\x6d\x2b\x1b\x5b" | |
1866 | "\x33\x37\x6d\x20\x20\x20\x20\x20\x20\x20\x2e\x1b\x5b\x33\x30\x6d\x24\x1b\x5b" | |
1867 | "\x33\x37\x6d\x3b\x1b\x5b\x33\x31\x6d\x7c\x1b\x5b\x33\x33\x6d\x20\x60\x20\x60" | |
1868 | "\x20\x60\x20\x60\x1b\x5b\x33\x31\x6d\x2c\x1b\x5b\x33\x32\x6d\x53\x1b\x5b\x33" | |
1869 | "\x37\x6d\x53\x53\x3e\x2c\x2e\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x2e" | |
1870 | "\x3b\x27\x20\x20\x20\x20\x20\x20\x20\x20\x20\x60\x3c\x20\x20\x20\x20\x20\x20" | |
1871 | "\x20\x20\x20\x2e\x2e\x3a\x1b\x5b\x33\x30\x6d\x26\x46\x46\x46\x48\x46\x1b\x5b" | |
1872 | "\x33\x33\x6d\x60\x2e\x60\x20\x60\x20\x60\x20\x60\x1b\x5b\x33\x30\x6d\x4d\x4d" | |
1873 | "\x46\x1b\x5b\x33\x33\x6d\x20\x20\x1b\x5b\x33\x37\x6d\x20\x20\x20\x20\x1b\x5b" | |
1874 | "\x33\x33\x6d\x20\x3a\x1b\x5b\x33\x30\x6d\x4d\x4d\x46\x1b\x5b\x33\x33\x6d\x20" | |
1875 | "\x20\x20\x60\x20\x60\x2e\x60\x1b\x5b\x33\x31\x6d\x3c\x1b\x5b\x33\x30\x6d\x46" | |
1876 | "\x46\x46\x24\x53\x46\x1b\x5b\x33\x37\x6d\x20\x20\x20\x20\x20\x0a\x20\x20\x20" | |
1877 | "\x20\x2e\x3c\x3a\x60\x20\x20\x20\x20\x2e\x3a\x2e\x3a\x2e\x2e\x3b\x27\x20\x20" | |
1878 | "\x20\x20\x20\x20\x2e\x60\x2e\x3a\x60\x60\x3c\x27\x1b\x5b\x33\x31\x6d\x3c\x27" | |
1879 | "\x1b\x5b\x33\x33\x6d\x20\x60\x20\x60\x20\x60\x20\x20\x20\x60\x3c\x1b\x5b\x33" | |
1880 | "\x30\x6d\x26\x1b\x5b\x33\x31\x6d\x3f\x1b\x5b\x33\x33\x6d\x20\x1b\x5b\x33\x37" | |
1881 | "\x6d\x20\x1b\x5b\x33\x33\x6d\x20\x20\x20\x20\x20\x1b\x5b\x33\x37\x6d\x60\x1b" | |
1882 | "\x5b\x33\x30\x6d\x2a\x46\x1b\x5b\x33\x37\x6d\x27\x1b\x5b\x33\x33\x6d\x20\x60" | |
1883 | "\x20\x60\x20\x60\x20\x60\x20\x1b\x5b\x33\x31\x6d\x60\x3a\x1b\x5b\x33\x37\x6d" | |
1884 | "\x27\x3c\x1b\x5b\x33\x30\x6d\x23\x1b\x5b\x33\x37\x6d\x3c\x60\x3a\x20\x20\x20" | |
1885 | "\x0a\x20\x20\x20\x20\x3a\x60\x3a\x60\x20\x20\x20\x60\x3a\x2e\x2e\x2e\x2e\x3c" | |
1886 | "\x3c\x20\x20\x20\x20\x20\x20\x3a\x2e\x60\x3a\x60\x20\x20\x20\x60\x1b\x5b\x33" | |
1887 | "\x33\x6d\x3a\x1b\x5b\x33\x31\x6d\x60\x1b\x5b\x33\x33\x6d\x20\x60\x2e\x60\x20" | |
1888 | "\x60\x20\x60\x20\x60\x20\x60\x1b\x5b\x33\x37\x6d\x20\x20\x1b\x5b\x33\x33\x6d" | |
1889 | "\x20\x60\x20\x20\x20\x60\x1b\x5b\x33\x37\x6d\x20\x60\x20\x60\x1b\x5b\x33\x33" | |
1890 | "\x6d\x20\x60\x2e\x60\x20\x60\x2e\x60\x20\x60\x3a\x1b\x5b\x33\x37\x6d\x20\x20" | |
1891 | "\x20\x60\x3a\x2e\x60\x2e\x20\x0a\x20\x20\x20\x60\x3a\x60\x3a\x60\x20\x20\x20" | |
1892 | "\x20\x20\x60\x60\x60\x60\x20\x3a\x2d\x20\x20\x20\x20\x20\x60\x20\x60\x20\x20" | |
1893 | "\x20\x20\x20\x60\x1b\x5b\x33\x33\x6d\x3a\x60\x2e\x60\x20\x60\x20\x60\x20\x60" | |
1894 | "\x20\x60\x20\x20\x2e\x3b\x1b\x5b\x33\x31\x6d\x76\x1b\x5b\x33\x30\x6d\x24\x24" | |
1895 | "\x24\x1b\x5b\x33\x31\x6d\x2b\x53\x1b\x5b\x33\x33\x6d\x2c\x60\x20\x60\x20\x60" | |
1896 | "\x20\x60\x20\x60\x20\x60\x2e\x1b\x5b\x33\x31\x6d\x60\x1b\x5b\x33\x33\x6d\x3a" | |
1897 | "\x1b\x5b\x33\x37\x6d\x20\x20\x20\x20\x60\x2e\x60\x20\x20\x0a\x20\x20\x20\x60" | |
1898 | "\x3a\x3a\x3a\x3a\x20\x20\x20\x20\x3a\x60\x60\x60\x60\x3a\x53\x20\x20\x20\x20" | |
1899 | "\x20\x20\x3a\x2e\x60\x2e\x20\x20\x20\x20\x20\x1b\x5b\x33\x33\x6d\x3a\x1b\x5b" | |
1900 | "\x33\x31\x6d\x3a\x1b\x5b\x33\x33\x6d\x2e\x60\x2e\x60\x20\x60\x2e\x60\x20\x60" | |
1901 | "\x20\x3a\x1b\x5b\x33\x30\x6d\x24\x46\x46\x48\x46\x46\x46\x46\x46\x1b\x5b\x33" | |
1902 | "\x31\x6d\x53\x1b\x5b\x33\x33\x6d\x2e\x60\x20\x60\x2e\x60\x20\x60\x2e\x60\x2e" | |
1903 | "\x1b\x5b\x33\x31\x6d\x3a\x1b\x5b\x33\x33\x6d\x3a\x1b\x5b\x33\x37\x6d\x20\x20" | |
1904 | "\x20\x2e\x60\x2e\x3a\x20\x20\x0a\x20\x20\x20\x60\x3a\x3a\x3a\x60\x20\x20\x20" | |
1905 | "\x60\x3a\x20\x2e\x20\x3b\x27\x3a\x20\x20\x20\x20\x20\x20\x3a\x2e\x60\x3a\x20" | |
1906 | "\x20\x20\x20\x20\x3a\x1b\x5b\x33\x33\x6d\x3c\x3a\x1b\x5b\x33\x31\x6d\x60\x1b" | |
1907 | "\x5b\x33\x33\x6d\x2e\x60\x20\x60\x20\x60\x20\x60\x2e\x1b\x5b\x33\x30\x6d\x53" | |
1908 | "\x46\x46\x46\x53\x46\x46\x46\x53\x46\x46\x1b\x5b\x33\x33\x6d\x20\x60\x20\x60" | |
1909 | "\x20\x60\x2e\x60\x2e\x60\x3a\x1b\x5b\x33\x31\x6d\x3c\x1b\x5b\x33\x37\x6d\x20" | |
1910 | "\x20\x20\x20\x3a\x60\x3a\x60\x20\x20\x0a\x20\x20\x20\x20\x60\x3c\x3b\x3c\x20" | |
1911 | "\x20\x20\x20\x20\x60\x60\x60\x20\x3a\x3a\x20\x20\x20\x20\x20\x20\x20\x3a\x3a" | |
1912 | "\x2e\x60\x20\x20\x20\x20\x20\x3a\x1b\x5b\x33\x33\x6d\x3b\x1b\x5b\x33\x31\x6d" | |
1913 | "\x3c\x3a\x60\x1b\x5b\x33\x33\x6d\x2e\x60\x2e\x60\x20\x60\x3a\x1b\x5b\x33\x30" | |
1914 | "\x6d\x53\x46\x53\x46\x46\x46\x53\x46\x46\x46\x53\x1b\x5b\x33\x33\x6d\x2e\x60" | |
1915 | "\x20\x60\x2e\x60\x2e\x60\x3a\x1b\x5b\x33\x31\x6d\x3c\x1b\x5b\x33\x33\x6d\x3b" | |
1916 | "\x1b\x5b\x33\x37\x6d\x27\x20\x20\x20\x60\x3a\x3a\x60\x20\x20\x20\x0a\x20\x20" | |
1917 | "\x20\x20\x20\x60\x3b\x3c\x20\x20\x20\x20\x20\x20\x20\x3a\x3b\x60\x20\x20\x20" | |
1918 | "\x20\x20\x20\x20\x20\x20\x60\x3a\x60\x2e\x20\x20\x20\x20\x20\x3a\x1b\x5b\x33" | |
1919 | "\x33\x6d\x3c\x3b\x1b\x5b\x33\x31\x6d\x3c\x1b\x5b\x33\x33\x6d\x3a\x1b\x5b\x33" | |
1920 | "\x31\x6d\x3a\x1b\x5b\x33\x33\x6d\x2e\x60\x2e\x60\x20\x1b\x5b\x33\x31\x6d\x3a" | |
1921 | "\x1b\x5b\x33\x30\x6d\x46\x53\x46\x53\x46\x53\x46\x53\x46\x1b\x5b\x33\x31\x6d" | |
1922 | "\x3f\x1b\x5b\x33\x33\x6d\x20\x60\x2e\x60\x2e\x3a\x3a\x1b\x5b\x33\x31\x6d\x3c" | |
1923 | "\x1b\x5b\x33\x33\x6d\x3b\x1b\x5b\x33\x31\x6d\x3c\x1b\x5b\x33\x37\x6d\x60\x20" | |
1924 | "\x20\x20\x3a\x3a\x3a\x60\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x53\x3c" | |
1925 | "\x20\x20\x20\x20\x20\x20\x3a\x53\x3a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1926 | "\x20\x60\x3a\x3a\x60\x2e\x20\x20\x20\x20\x60\x3a\x1b\x5b\x33\x31\x6d\x3c\x1b" | |
1927 | "\x5b\x33\x33\x6d\x3b\x1b\x5b\x33\x31\x6d\x3c\x3b\x3c\x1b\x5b\x33\x33\x6d\x3a" | |
1928 | "\x60\x2e\x60\x3c\x1b\x5b\x33\x30\x6d\x53\x46\x53\x24\x53\x46\x53\x24\x1b\x5b" | |
1929 | "\x33\x33\x6d\x60\x3a\x1b\x5b\x33\x31\x6d\x3a\x1b\x5b\x33\x33\x6d\x3a\x1b\x5b" | |
1930 | "\x33\x31\x6d\x3a\x3b\x3c\x1b\x5b\x33\x33\x6d\x3b\x1b\x5b\x33\x31\x6d\x3c\x1b" | |
1931 | "\x5b\x33\x33\x6d\x3a\x1b\x5b\x33\x37\x6d\x60\x20\x20\x2e\x60\x3a\x3a\x60\x20" | |
1932 | "\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x3b\x3c\x2e\x2e\x2c\x2e\x2e\x20" | |
1933 | "\x3a\x3c\x3b\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x60\x3a\x3a\x3a" | |
1934 | "\x60\x20\x20\x20\x20\x20\x60\x3a\x1b\x5b\x33\x33\x6d\x3c\x3b\x1b\x5b\x33\x31" | |
1935 | "\x6d\x3c\x3b\x3c\x1b\x5b\x33\x33\x6d\x3b\x1b\x5b\x33\x31\x6d\x3c\x1b\x5b\x33" | |
1936 | "\x33\x6d\x3b\x1b\x5b\x33\x31\x6d\x3c\x3c\x1b\x5b\x33\x30\x6d\x53\x24\x53\x1b" | |
1937 | "\x5b\x33\x31\x6d\x53\x1b\x5b\x33\x37\x6d\x27\x1b\x5b\x33\x33\x6d\x2e\x3a\x3b" | |
1938 | "\x1b\x5b\x33\x31\x6d\x3c\x3b\x3c\x1b\x5b\x33\x33\x6d\x3a\x1b\x5b\x33\x31\x6d" | |
1939 | "\x3c\x1b\x5b\x33\x33\x6d\x3a\x1b\x5b\x33\x37\x6d\x60\x20\x20\x20\x60\x2e\x3a" | |
1940 | "\x3a\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x2e\x3a\x3a\x3c\x53\x3c\x3a\x60" | |
1941 | "\x3a\x3a\x3a\x3a\x53\x1b\x5b\x33\x32\x6d\x53\x1b\x5b\x33\x37\x6d\x3b\x27\x3a" | |
1942 | "\x3c\x2c\x2e\x20\x20\x20\x20\x20\x20\x20\x20\x20\x60\x3a\x3a\x3a\x3a\x2e\x60" | |
1943 | "\x2e\x60\x2e\x60\x3a\x1b\x5b\x33\x33\x6d\x3c\x3a\x1b\x5b\x33\x31\x6d\x3c\x1b" | |
1944 | "\x5b\x33\x33\x6d\x53\x1b\x5b\x33\x31\x6d\x3c\x1b\x5b\x33\x33\x6d\x3b\x1b\x5b" | |
1945 | "\x33\x31\x6d\x3c\x2c\x1b\x5b\x33\x33\x6d\x3c\x3b\x3a\x1b\x5b\x33\x31\x6d\x2c" | |
1946 | "\x1b\x5b\x33\x33\x6d\x3c\x3b\x1b\x5b\x33\x31\x6d\x3c\x1b\x5b\x33\x33\x6d\x53" | |
1947 | "\x1b\x5b\x33\x31\x6d\x3c\x1b\x5b\x33\x33\x6d\x3b\x3c\x1b\x5b\x33\x37\x6d\x3a" | |
1948 | "\x60\x2e\x60\x2e\x3b\x1b\x5b\x33\x34\x6d\x53\x1b\x5b\x33\x37\x6d\x53\x3f\x27" | |
1949 | "\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x2e\x60\x3a\x60\x3a\x3c\x53\x53\x3b\x3c" | |
1950 | "\x3a\x60\x3a\x3a\x53\x53\x53\x3c\x3a\x60\x3a\x1b\x5b\x33\x30\x6d\x53\x1b\x5b" | |
1951 | "\x33\x37\x6d\x2b\x20\x20\x20\x20\x20\x20\x60\x20\x20\x20\x3a\x1b\x5b\x33\x34" | |
1952 | "\x6d\x53\x1b\x5b\x33\x30\x6d\x53\x46\x24\x1b\x5b\x33\x37\x6d\x2c\x60\x3a\x3a" | |
1953 | "\x3a\x3c\x3a\x3c\x1b\x5b\x33\x33\x6d\x53\x1b\x5b\x33\x37\x6d\x3c\x1b\x5b\x33" | |
1954 | "\x33\x6d\x53\x1b\x5b\x33\x31\x6d\x53\x1b\x5b\x33\x33\x6d\x3b\x1b\x5b\x33\x31" | |
1955 | "\x6d\x53\x3b\x53\x1b\x5b\x33\x33\x6d\x3b\x1b\x5b\x33\x31\x6d\x53\x1b\x5b\x33" | |
1956 | "\x33\x6d\x53\x1b\x5b\x33\x37\x6d\x3c\x1b\x5b\x33\x33\x6d\x53\x1b\x5b\x33\x37" | |
1957 | "\x6d\x3c\x53\x3c\x3a\x3a\x3a\x3a\x3f\x1b\x5b\x33\x30\x6d\x53\x24\x48\x1b\x5b" | |
1958 | "\x33\x37\x6d\x27\x60\x20\x60\x20\x20\x20\x20\x20\x20\x0a\x2e\x60\x3a\x60\x2e" | |
1959 | "\x60\x3a\x60\x2e\x60\x3a\x60\x2e\x60\x3a\x60\x2e\x60\x3a\x60\x2e\x1b\x5b\x33" | |
1960 | "\x30\x6d\x53\x46\x1b\x5b\x33\x37\x6d\x20\x20\x20\x20\x60\x20\x20\x20\x60\x20" | |
1961 | "\x60\x3a\x1b\x5b\x33\x30\x6d\x3c\x46\x46\x46\x1b\x5b\x33\x37\x6d\x3f\x2e\x60" | |
1962 | "\x3a\x60\x3a\x60\x3a\x60\x3a\x60\x3a\x3c\x3a\x60\x3a\x27\x3a\x60\x3a\x60\x3a" | |
1963 | "\x60\x3a\x60\x3b\x1b\x5b\x33\x30\x6d\x53\x46\x48\x46\x1b\x5b\x33\x37\x6d\x27" | |
1964 | "\x20\x60\x20\x60\x20\x60\x20\x20\x20\x20\x0a\x20\x3c\x3b\x3a\x2e\x60\x20\x60" | |
1965 | "\x2e\x60\x20\x60\x2e\x60\x20\x60\x2e\x60\x2c\x53\x1b\x5b\x33\x32\x6d\x53\x1b" | |
1966 | "\x5b\x33\x30\x6d\x53\x1b\x5b\x33\x37\x6d\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1967 | "\x20\x20\x60\x20\x60\x3c\x1b\x5b\x33\x30\x6d\x46\x46\x46\x1b\x5b\x33\x34\x6d" | |
1968 | "\x2b\x1b\x5b\x33\x37\x6d\x3a\x20\x60\x20\x60\x20\x60\x2e\x60\x20\x60\x2e\x60" | |
1969 | "\x20\x60\x2e\x60\x20\x60\x20\x60\x2c\x1b\x5b\x33\x30\x6d\x24\x46\x48\x46\x1b" | |
1970 | "\x5b\x33\x37\x6d\x27\x20\x60\x20\x20\x20\x60\x20\x20\x20\x20\x20\x20\x0a\x20" | |
1971 | "\x60\x3a\x1b\x5b\x33\x30\x6d\x53\x24\x1b\x5b\x33\x37\x6d\x53\x53\x53\x3b\x3c" | |
1972 | "\x2c\x60\x2c\x3b\x3b\x53\x3f\x53\x1b\x5b\x33\x30\x6d\x24\x46\x3c\x1b\x5b\x33" | |
1973 | "\x37\x6d\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x60\x20\x60" | |
1974 | "\x3c\x1b\x5b\x33\x30\x6d\x48\x46\x46\x46\x1b\x5b\x33\x37\x6d\x3f\x2e\x60\x20" | |
1975 | "\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x3b\x76\x1b\x5b\x33\x30\x6d" | |
1976 | "\x48\x46\x48\x46\x1b\x5b\x33\x37\x6d\x27\x20\x60\x20\x20\x20\x60\x20\x20\x20" | |
1977 | "\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x60\x3c\x1b\x5b\x33\x30\x6d\x46\x24\x1b" | |
1978 | "\x5b\x33\x37\x6d\x53\x53\x53\x53\x53\x53\x1b\x5b\x33\x30\x6d\x53\x24\x53\x46" | |
1979 | "\x46\x46\x1b\x5b\x33\x37\x6d\x27\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
1980 | "\x20\x20\x20\x20\x20\x20\x20\x20\x60\x3c\x1b\x5b\x33\x30\x6d\x23\x46\x46\x46" | |
1981 | "\x24\x1b\x5b\x33\x37\x6d\x76\x2c\x2c\x20\x2e\x20\x2e\x20\x2c\x2c\x76\x1b\x5b" | |
1982 | "\x33\x30\x6d\x26\x24\x46\x46\x48\x3c\x1b\x5b\x33\x37\x6d\x27\x20\x20\x20\x20" | |
1983 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x60" | |
1984 | "\x3c\x1b\x5b\x33\x30\x6d\x53\x46\x46\x24\x46\x24\x46\x46\x48\x46\x53\x1b\x5b" | |
1985 | "\x33\x37\x6d\x20\x20\x20\x20\x20\x20\x20\x20\x2e\x60\x20\x60\x2e\x60\x2e\x60" | |
1986 | "\x2e\x60\x2e\x60\x3a\x3a\x3a\x3a\x3a\x1b\x5b\x33\x30\x6d\x2a\x46\x46\x46\x48" | |
1987 | "\x46\x48\x46\x48\x46\x46\x46\x48\x46\x48\x46\x48\x1b\x5b\x33\x37\x6d\x3c\x22" | |
1988 | "\x2e\x60\x2e\x60\x2e\x60\x2e\x60\x2e\x60\x20\x20\x20\x20\x20\x20\x20\x20\x0a" | |
1989 | "\x20\x20\x20\x20\x20\x20\x20\x60\x3a\x1b\x5b\x33\x30\x6d\x48\x46\x46\x46\x48" | |
1990 | "\x46\x46\x46\x1b\x5b\x33\x37\x6d\x27\x20\x20\x20\x60\x20\x60\x2e\x60\x20\x60" | |
1991 | "\x2e\x60\x2e\x60\x3a\x60\x3a\x60\x3a\x60\x3a\x60\x3a\x3a\x3a\x60\x3a\x3c\x3c" | |
1992 | "\x1b\x5b\x33\x30\x6d\x3c\x46\x48\x46\x46\x46\x48\x46\x46\x46\x1b\x5b\x33\x37" | |
1993 | "\x6d\x27\x3a\x60\x3a\x60\x3a\x60\x3a\x60\x2e\x60\x2e\x60\x20\x60\x2e\x60\x20" | |
1994 | "\x60\x20\x60\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x60\x22\x1b\x5b" | |
1995 | "\x33\x30\x6d\x2a\x46\x48\x46\x1b\x5b\x33\x37\x6d\x3f\x20\x20\x20\x60\x20\x60" | |
1996 | "\x2e\x60\x20\x60\x2e\x60\x2e\x60\x3a\x60\x2e\x60\x3a\x60\x3a\x60\x3a\x60\x3a" | |
1997 | "\x60\x3a\x60\x3a\x60\x3a\x60\x3a\x1b\x5b\x33\x30\x6d\x46\x46\x48\x46\x48\x46" | |
1998 | "\x1b\x5b\x33\x37\x6d\x27\x3a\x60\x3a\x60\x3a\x60\x3a\x60\x2e\x60\x3a\x60\x2e" | |
1999 | "\x60\x2e\x60\x20\x60\x2e\x60\x20\x60\x20\x60\x0a\x20\x20\x20\x20\x20\x20\x20" | |
2000 | "\x20\x20\x20\x20\x60\x3c\x1b\x5b\x33\x30\x6d\x48\x46\x46\x1b\x5b\x33\x37\x6d" | |
2001 | "\x2b\x60\x20\x20\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x2e\x60\x20" | |
2002 | "\x60\x2e\x60\x20\x60\x2e\x60\x20\x60\x3a\x60\x2e\x60\x3b\x1b\x5b\x33\x30\x6d" | |
2003 | "\x48\x46\x46\x46\x1b\x5b\x33\x37\x6d\x27\x2e\x60\x2e\x60\x20\x60\x2e\x60\x20" | |
2004 | "\x60\x2e\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x20\x20\x60\x20\x20\x0a\x20" | |
2005 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22\x1b\x5b\x33\x30\x6d\x3c" | |
2006 | "\x48\x46\x53\x1b\x5b\x33\x37\x6d\x2b\x3a\x20\x20\x20\x60\x20\x60\x20\x60\x20" | |
2007 | "\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x2c\x1b" | |
2008 | "\x5b\x33\x30\x6d\x24\x46\x48\x46\x1b\x5b\x33\x37\x6d\x3f\x20\x60\x20\x60\x20" | |
2009 | "\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x60\x20\x20\x20\x60" | |
2010 | "\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
2011 | "\x60\x22\x3c\x1b\x5b\x33\x30\x6d\x48\x24\x46\x46\x1b\x5b\x33\x37\x6d\x3e\x2c" | |
2012 | "\x2e\x2e\x20\x20\x20\x20\x20\x20\x20\x20\x60\x20\x20\x20\x60\x20\x20\x20\x3b" | |
2013 | "\x2c\x2c\x1b\x5b\x33\x30\x6d\x24\x53\x46\x46\x46\x1b\x5b\x33\x37\x6d\x27\x22" | |
2014 | "\x20\x20\x60\x20\x20\x20\x60\x20\x20\x20\x60\x20\x20\x20\x20\x20\x20\x20\x20" | |
2015 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20" | |
2016 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x60\x22\x1b\x5b\x33\x30\x6d\x2a\x3c\x48" | |
2017 | "\x46\x46\x24\x53\x24\x1b\x5b\x33\x37\x6d\x53\x53\x53\x3e\x3e\x3e\x3e\x3e\x53" | |
2018 | "\x3e\x53\x1b\x5b\x33\x30\x6d\x24\x53\x24\x46\x24\x48\x46\x23\x1b\x5b\x33\x37" | |
2019 | "\x6d\x27\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
2020 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20" | |
2021 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
2022 | "\x60\x60\x22\x3c\x1b\x5b\x33\x30\x6d\x2a\x3c\x3c\x3c\x48\x46\x46\x46\x48\x46" | |
2023 | "\x46\x46\x23\x3c\x1b\x5b\x33\x36\x6d\x3c\x1b\x5b\x33\x37\x6d\x3c\x27\x22\x22" | |
2024 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" | |
2025 | "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x1b" | |
2026 | "\x5b\x30\x6d"; | |
ebff2ed0 JS |
2027 | |
2028 | /* vim: set sw=2 ts=8 cino=>4,n-2,{2,^-2,t0,(0,u0,w1,M1 : */ |