15 &GetOptions("skipunnamed"=>\$skipunnamed,
16 "skipgeneral"=>\$skipgeneral,
19 "telemetry"=>\$telemetry,
22 "vcore=i"=>\$targetvcore);
25 $#ARGV==0 or die "v3_info [--skipunnamed] [--skipgeneral] [--debug] [--error]\n".
26 " [--telemetry] [--vcore=num] [--format] [--stream] vmname|_\n\n".
27 "Filter palacios output in dmesg\n".
28 "given a vmname, the default is to show the general output\n".
29 "for that vm, plus any general output from palacios.\n".
30 "the vm name \"_\" means VMs of any name.\n\n".
31 " --skipunnamed : do not show non-VM specific output\n".
32 " --skipgeneral : do not show general output (V3_Print)\n".
33 " --debug : show debug output (PrintDebug)\n".
34 " --error : show error output (PrintError)\n".
35 " --telemetry : show telemetry output\n".
36 " --vcore=num : show only output for specified vcore\n".
37 " --stream : attempt to stream from /proc/kmsg\n".
38 " --format : reformat output into a convenient form\n\n";
51 open(DMESG, "cat /proc/kmsg |");
53 open(DMESG,"dmesg |");
56 while ($line = <DMESG>) {
63 if ($line =~ /^\[(.*)\]\s+(.*)$/) {
69 if ($line =~/^palacios\s+\(pcore\s+(\d+)\)\:\s+(.*)/) {
72 next if ($targetvcore!=-1);
75 } elsif ($line =~/^palacios\s+\(pcore\s+(\d+)\s+vm\s+(\S+)\s+vcore\s+(\d+)\):\s+(.*)$/) {
76 # core-specific output
81 next if (!$any && !($vm eq $vmname));
82 next if ($targetvcore!=-1 && $vcore!=$targetvcore);
83 } elsif ($line =~ /^palacios\s+\(pcore\s+(\d+)\s+vm\s+(\S+)\):\s+(.*)$/) {
87 next if (!$any & !($vm eq $vmname));
88 next if ($targetvcore!=-1);
93 if ($line =~ /^DEBUG:\s+.*$/) {
95 } elsif ($line =~ /^ERROR:\s+.*$/) {
97 } elsif ($line =~ /^telem\.\d+\>.*$/) {
100 next if $skipgeneral;
104 if ($timestamp!=-1) {
105 print "$timestamp\t";