remove dead strace table code

This commit is contained in:
Timothy Stack 2014-11-02 19:41:58 -08:00
parent 2d23f8e809
commit c5f5ee5624

View File

@ -3774,152 +3774,6 @@ static void looper(void)
}
}
class strace_log_table : public log_vtab_impl {
public:
strace_log_table()
: log_vtab_impl("strace_log") {};
void get_columns(vector<vtab_column> &cols)
{
cols.push_back(vtab_column("funcname", SQLITE_TEXT));
cols.push_back(vtab_column("args", SQLITE_TEXT));
cols.push_back(vtab_column("result", SQLITE_TEXT));
cols.push_back(vtab_column("duration", SQLITE_TEXT));
#if 0
cols.push_back(vtab_column("arg0", SQLITE_TEXT));
cols.push_back(vtab_column("arg1", SQLITE_TEXT));
cols.push_back(vtab_column("arg2", SQLITE_TEXT));
cols.push_back(vtab_column("arg3", SQLITE_TEXT));
cols.push_back(vtab_column("arg4", SQLITE_TEXT));
cols.push_back(vtab_column("arg5", SQLITE_TEXT));
cols.push_back(vtab_column("arg6", SQLITE_TEXT));
cols.push_back(vtab_column("arg7", SQLITE_TEXT));
cols.push_back(vtab_column("arg8", SQLITE_TEXT));
cols.push_back(vtab_column("arg9", SQLITE_TEXT));
#endif
};
#if 0
void extract(logfile *lf,
const std::string &line,
int column,
sqlite3_context *ctx)
{
string function, args, result, duration = "0";
if (!this->slt_regex.FullMatch(line,
&function,
&args,
&result,
&duration)) {
fprintf(stderr, "bad match! %s\n", line.c_str());
}
switch (column) {
case 0:
sqlite3_result_text(ctx,
function.c_str(),
function.length(),
SQLITE_TRANSIENT);
break;
case 1:
sqlite3_result_text(ctx,
result.c_str(),
result.length(),
SQLITE_TRANSIENT);
break;
case 2:
sqlite3_result_text(ctx,
duration.c_str(),
duration.length(),
SQLITE_TRANSIENT);
break;
default:
{
const char *arg_start = args.c_str();
int in_struct = 0, in_list = 0;
int lpc, argnum, curarg = 0;
bool in_quote = false;
argnum = column - 3;
for (lpc = 0; lpc < (int)args.length(); lpc++) {
switch (args[lpc]) {
case '{':
if (!in_quote) {
in_struct += 1;
}
break;
case '}':
if (!in_quote) {
in_struct -= 1;
}
break;
case '[':
if (!in_quote) {
in_list += 1;
}
break;
case ']':
if (!in_quote) {
in_list -= 1;
}
break;
case '"':
if (!in_quote) {
in_quote = true;
}
else if (lpc > 0 && args[lpc - 1] != '\\') {
in_quote = false;
}
break;
case ',':
if (!in_quote && !in_struct && !in_list) {
if (curarg == argnum) {
sqlite3_result_text(ctx,
arg_start,
&(args.c_str()[lpc]) -
arg_start,
SQLITE_TRANSIENT);
return;
}
curarg += 1;
arg_start = &(args.c_str()[lpc + 1]);
}
break;
}
}
if (curarg == argnum) {
sqlite3_result_text(ctx,
arg_start,
&(args.c_str()[lpc]) -
arg_start,
SQLITE_TRANSIENT);
}
else {
sqlite3_result_text(ctx,
"",
0,
SQLITE_TRANSIENT);
}
}
break;
}
};
private:
pcrecpp::RE slt_regex;
#endif
};
static void setup_highlights(textview_curses::highlight_map_t &hm)
{
hm["$kw"] = textview_curses::highlighter(xpcre_compile(
@ -4277,7 +4131,6 @@ int main(int argc, char *argv[])
}
lnav_data.ld_vtab_manager->register_vtab(new log_vtab_impl("generic_log"));
lnav_data.ld_vtab_manager->register_vtab(new strace_log_table());
for (std::vector<log_format *>::iterator iter = log_format::get_root_formats().begin();
iter != log_format::get_root_formats().end();