scripting_ops
static struct scripting_ops *scripting_ops;
if (scripting_ops && scripting_ops->process_stat)
scripting_ops->process_stat(&stat_config, counter, tstamp);
if (scripting_ops && scripting_ops->process_stat_interval)
scripting_ops->process_stat_interval(tstamp);
return scripting_ops ? scripting_ops->flush_script() : 0;
return scripting_ops ? scripting_ops->stop_script() : 0;
if (scripting_ops) {
scripting_ops->process_event(event, sample, evsel, &al, addr_al_ptr);
if (scripting_ops && scripting_ops->process_switch && !filter_cpu(sample))
scripting_ops->process_switch(event, sample, machine);
if (scripting_ops && scripting_ops->process_auxtrace_error) {
scripting_ops->process_auxtrace_error(session, event);
if (scripting_ops && scripting_ops->process_throttle)
scripting_ops->process_throttle(event, sample, machine);
if (script->show_switch_events || (scripting_ops && scripting_ops->process_switch))
if (scripting_ops && scripting_ops->process_auxtrace_error)
static int list_available_languages_cb(struct scripting_ops *ops, const char *spec)
if (!scripting_ops) {
scripting_ops = script_spec__lookup(++ext);
if (!scripting_ops)
exec_path, scripting_ops->dirname, script);
scripting_ops = script_spec__lookup(spec);
if (!scripting_ops) {
scripting_ops = script_spec__lookup(++ext);
if (!scripting_ops) {
scripting_ops = script_spec__lookup(generate_script_lang);
if (!scripting_ops && ends_with(generate_script_lang, ".py")) {
scripting_ops = script_spec__lookup("python");
} else if (!scripting_ops && ends_with(generate_script_lang, ".pl")) {
scripting_ops = script_spec__lookup("perl");
if (!scripting_ops) {
err = scripting_ops->generate_script(session->tevent.pevent, filename);
err = scripting_ops->generate_script(NULL, filename);
err = scripting_ops->start_script(script_name, argc, argv, session);
struct scripting_ops perl_scripting_ops = {
struct scripting_ops python_scripting_ops = {
struct scripting_ops python_scripting_unsupported_ops = {
static void register_python_scripting(struct scripting_ops *scripting_ops)
script_spec_register("Python", scripting_ops) ||
script_spec_register("py", scripting_ops)) {
extern struct scripting_ops python_scripting_ops;
struct scripting_ops perl_scripting_unsupported_ops = {
static void register_perl_scripting(struct scripting_ops *scripting_ops)
script_spec_register("Perl", scripting_ops) ||
script_spec_register("pl", scripting_ops)) {
extern struct scripting_ops perl_scripting_ops;
struct scripting_ops *ops;
struct scripting_ops *ops)
static int script_spec_register(const char *spec, struct scripting_ops *ops)
struct scripting_ops *script_spec__lookup(const char *spec)
int script_spec__for_each(int (*cb)(struct scripting_ops *ops, const char *spec))
struct scripting_ops *script_spec__lookup(const char *spec);
int script_spec__for_each(int (*cb)(struct scripting_ops *ops, const char *spec));