execution(NULL),
print_always(false),
print_buggy(true),
+ print_nonsc(false),
time(false),
stats((struct sc_statistics *)model_calloc(1, sizeof(struct sc_statistics)))
{
void SCAnalysis::finish() {
if (time)
model_print("Elapsed time in usec %llu\n", stats->elapsedtime);
+ model_print("SC count: %u\n", stats->sccount);
+ model_print("Non-SC count: %u\n", stats->nonsccount);
}
bool SCAnalysis::option(char * opt) {
} else if (strcmp(opt, "quiet")==0) {
print_buggy=false;
return false;
+ } else if (strcmp(opt, "nonsc")==0) {
+ print_nonsc=true;
+ return false;
} else if (strcmp(opt, "time")==0) {
time=true;
return false;
model_print("SC Analysis options\n");
model_print("verbose -- print all feasible executions\n");
model_print("buggy -- print only buggy executions (default)\n");
+ model_print("nonsc -- print non-sc execution\n");
model_print("quiet -- print nothing\n");
model_print("time -- time execution of scanalysis\n");
model_print("\n");
gettimeofday(&start, NULL);
action_list_t *list = generateSC(actions);
check_rf(list);
- if (print_always || (print_buggy && execution->have_bug_reports()))
+ if (print_always || (print_buggy && execution->have_bug_reports())|| (print_nonsc && cyclic))
print_list(list);
if (time) {
gettimeofday(&finish, NULL);
stats->elapsedtime+=((finish.tv_sec*1000000+finish.tv_usec)-(start.tv_sec*1000000+start.tv_usec));
}
+ update_stats();
+}
+
+void SCAnalysis::update_stats() {
+ if (cyclic) {
+ stats->nonsccount++;
+ } else {
+ stats->sccount++;
+ }
}
void SCAnalysis::check_rf(action_list_t *list) {
struct sc_statistics {
unsigned long long elapsedtime;
+ unsigned int sccount;
+ unsigned int nonsccount;
};
class SCAnalysis : public TraceAnalysis {
SNAPSHOTALLOC
private:
+ void update_stats();
void print_list(action_list_t *list);
int buildVectors(action_list_t *);
bool updateConstraints(ModelAction *act);
ModelExecution *execution;
bool print_always;
bool print_buggy;
+ bool print_nonsc;
bool time;
struct sc_statistics *stats;
};