Emilio G. Cota
7266ae91a1
qht: do not segfault when gathering stats from an uninitialized qht
...
So far, QHT functions assume that the passed qht has previously been
initialized--otherwise they segfault.
This patch makes an exception for qht_statistics_init, with the goal
of simplifying calling code. For instance, qht_statistics_init is
called from the 'info jit' dump, and given that under KVM the TB qht
is never initialized, we get a segfault. Thus, instead of complicating
the 'info jit' code with additional checks, let's allow passing an
uninitialized qht to qht_statistics_init.
While at it, add a test for this to test-qht.
Before the patch (for $ qemu -enable-kvm [...]):
(qemu) info jit
[...]
direct jump count 0 (0%) (2 jumps=0 0%)
Program received signal SIGSEGV, Segmentation fault.
After the patch the "TB hash buckets", "TB hash occupancy"
and "TB hash avg chain" lines are omitted.
(qemu) info jit
[...]
direct jump count 0 (0%) (2 jumps=0 0%)
TB hash buckets 0/0 (-nan% head buckets used)
TB hash occupancy nan% avg chain occ. Histogram: (null)
TB hash avg chain nan buckets. Histogram: (null)
[...]
Reported by: Changlong Xie <xiecl.fnst@cn.fujitsu.com >
Signed-off-by: Emilio G. Cota <cota@braap.org >
Message-Id: <1469205390-14369-1-git-send-email-cota@braap.org >
[Extract printing statistics to an entirely separate function. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2016-08-02 12:03:58 +02:00
..
2016-07-04 19:43:33 +03:00
2016-07-25 13:23:18 -05:00
2016-07-20 19:19:43 +08:00
2015-12-17 13:37:15 +00:00
2016-02-08 17:29:54 +01:00
2016-07-12 16:20:46 +02:00
2016-07-22 13:23:39 +05:30
2016-07-19 13:21:08 +02:00
2016-07-26 18:28:40 +02:00
2016-07-12 16:19:16 +02:00
2016-07-06 10:52:04 +02:00
2016-06-07 18:19:24 +03:00
2016-07-18 18:19:01 -04:00
2016-07-04 16:49:34 +03:00
2016-06-07 18:19:24 +03:00
2016-02-23 12:43:05 +00:00
2016-07-12 16:20:46 +02:00
2016-01-07 21:30:16 +01:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-07-06 10:52:03 +02:00
2016-06-07 18:19:24 +03:00
2016-07-06 10:52:04 +02:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-02-16 14:29:27 +00:00
2015-09-15 15:05:09 +01:00
2016-06-07 18:19:24 +03:00
2016-06-20 16:38:13 +02:00
2016-07-29 14:14:15 +10:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-16 18:39:03 +02:00
2016-06-07 18:19:24 +03:00
2016-06-20 16:38:13 +02:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-20 16:38:13 +02:00
2016-06-07 18:19:24 +03:00
2016-07-18 18:19:01 -04:00
2016-06-20 16:38:13 +02:00
2016-03-22 22:20:15 +01:00
2015-12-18 12:18:31 +00:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-16 18:39:03 +02:00
2016-06-16 09:50:07 +05:30
2016-02-23 12:43:05 +00:00
2016-06-07 18:19:24 +03:00
2016-07-29 14:14:15 +10:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-02-16 14:29:27 +00:00
2016-07-29 12:02:31 +10:00
2016-07-20 19:30:26 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-16 18:39:03 +02:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-17 15:23:51 +01:00
2016-07-13 13:26:02 +02:00
2016-07-06 10:52:04 +02:00
2016-07-13 13:26:02 +02:00
2016-03-22 22:20:15 +01:00
2016-03-22 22:20:15 +01:00
2016-06-07 18:19:24 +03:00
2016-07-04 15:52:36 +01:00
2016-03-22 22:20:15 +01:00
2016-03-22 22:20:15 +01:00
2016-06-13 12:41:17 +01:00
2016-03-22 22:20:15 +01:00
2016-03-22 22:20:15 +01:00
2016-07-04 10:46:59 +01:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-20 16:38:13 +02:00
2016-06-07 18:19:25 +03:00
2016-06-07 18:19:24 +03:00
2016-02-16 14:29:27 +00:00
2016-03-22 22:20:15 +01:00
2016-03-22 22:20:15 +01:00
2016-06-29 16:49:41 +02:00
2016-02-16 14:29:27 +00:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-07-04 16:49:33 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-07-06 10:52:04 +02:00
2016-06-07 18:19:24 +03:00
2016-06-16 18:39:03 +02:00
2016-06-07 18:19:24 +03:00
2016-07-25 13:23:18 -05:00
2016-06-16 18:39:03 +02:00
2016-08-02 12:03:58 +02:00
2016-07-19 13:21:08 +02:00
2016-06-07 18:19:24 +03:00
2016-07-06 10:52:04 +02:00
2016-07-06 10:52:04 +02:00
2016-07-06 10:52:04 +02:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-07-06 10:52:04 +02:00
2016-07-06 10:52:04 +02:00
2016-07-13 13:26:02 +02:00
2016-06-07 16:34:45 +01:00
2016-06-07 18:19:24 +03:00
2016-07-06 10:52:04 +02:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-03-22 22:20:17 +01:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-07-12 16:19:16 +02:00
2016-07-29 00:33:49 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-20 16:19:18 +01:00
2016-06-20 16:38:13 +02:00
2016-07-29 00:33:49 +03:00
2016-06-07 18:19:24 +03:00
2016-06-20 16:19:18 +01:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-20 16:38:13 +02:00