Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QString content=QString::fromLocal8Bit(file.readAll());
- qDebug() << content;
- /*
- catchchallenger (9509, #threads: 1)
- -------------------------------------------------------------------
- se.exec_start : 2684287448.746205
- se.vruntime : 1277095189.518030
- se.sum_exec_runtime : 2.013108
- nr_switches : 4
- nr_voluntary_switches : 3
- nr_involuntary_switches : 1
- se.load.weight : 1024
- se.avg.runnable_avg_sum : 18397
- se.avg.runnable_avg_period : 19082
- se.avg.load_avg_contrib : 987
- se.avg.decay_count : 2559935996
- policy : 0
- prio : 120
- clock-delta : 12
- */
- QRegularExpression regex("^.*se.sum_exec_runtime[ \t]*:[ \t]*([0-9]+).*$");
- if(!regex.isValid())
- abort();
- regex.setPatternOptions(QRegularExpression::CaseInsensitiveOption|QRegularExpression::MultilineOption);
- if(content.contains(regex))
- {
- content.replace(regex,"\\1");
- bool ok;
- qint64 returnedValue=content.toULongLong(&ok);
- if(!ok)
- {
- qDebug() << "File" << file.fileName() << "don't have se.sum_exec_runtime or have bug" << content;
- abort();
- }
- return returnedValue;
- }
- else
- qDebug() << "File" << file.fileName() << "don't have se.sum_exec_runtime" << content;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement