DM: add interface to set intr storm monitor params

modify and add interface to set interrupt monitor params;
it can be set by acrn-dm input arguments like following:
--intr_monitor 10000,10,1,100

the 4 params order is:
    interrupt storm theshold per second,
    probe period to get interrupt data,
    pass-through devices' interrupt injection delay time,
    delay duration, after it, stop injection & restore to normal

Tracked-On: #1724
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
Minggui Cao
2018-10-29 14:24:54 +08:00
committed by lijinxia
parent 1902d725a0
commit ad1cbb7623
3 changed files with 75 additions and 19 deletions

View File

@@ -157,7 +157,9 @@ usage(int code)
" --part_info: guest partition info file path\n"
" --enable_trusty: enable trusty for guest\n"
" --ptdev_no_reset: disable reset check for ptdev\n"
" --debugexit: enable debug exit function\n",
" --debugexit: enable debug exit function\n"
" --intr_monitor: enable interrupt storm monitor\n"
"............its params: threshold/s,probe-period(s),delay_time(ms),delay_duration(ms)\n",
progname, (int)strlen(progname), "", (int)strlen(progname), "",
(int)strlen(progname), "");
@@ -701,6 +703,7 @@ enum {
CMD_OPT_DEBUGEXIT,
CMD_OPT_VMCFG,
CMD_OPT_DUMP,
CMD_OPT_INTR_MONITOR,
};
static struct option long_options[] = {
@@ -734,6 +737,7 @@ static struct option long_options[] = {
{"ptdev_no_reset", no_argument, 0,
CMD_OPT_PTDEV_NO_RESET},
{"debugexit", no_argument, 0, CMD_OPT_DEBUGEXIT},
{"intr_monitor", required_argument, 0, CMD_OPT_INTR_MONITOR},
{0, 0, 0, 0 },
};
@@ -859,6 +863,12 @@ dm_run(int argc, char *argv[])
case CMD_OPT_DEBUGEXIT:
debugexit_enabled = true;
break;
case CMD_OPT_INTR_MONITOR:
if (acrn_parse_intr_monitor(optarg) != 0) {
errx(EX_USAGE, "invalid intr-monitor params %s", optarg);
exit(1);
}
break;
case 'h':
usage(0);
default: