diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c index 590a91e091..a897223592 100644 --- a/tools/xentrace/xentrace.c +++ b/tools/xentrace/xentrace.c @@ -489,7 +489,11 @@ static struct t_struct *map_tbufs(unsigned long tbufs_mfn, unsigned int num, exit(EXIT_FAILURE); } - /* Map per-cpu buffers */ + /* + * Map per-cpu buffers. NB that if a cpus is offline, it may have + * no trace buffers. In this case, the the respective mfn_offset + * will be 0, and the index should be ignored. + */ tbufs.meta = (struct t_buf **)calloc(num, sizeof(struct t_buf *)); tbufs.data = (unsigned char **)calloc(num, sizeof(unsigned char *)); if ( tbufs.meta == NULL || tbufs.data == NULL )