KVM: Create debugfs dir and stat files for each VM
This patch adds a kvm debugfs subdirectory for each VM, which is named after its pid and file descriptor. The directories contain the same kind of files that are already in the kvm debugfs directory, but the data exported through them is now VM specific. This makes the debugfs kvm data a convenient alternative to the tracepoints which already have per VM data. The debugfs data is easy to read and low overhead. CC: Dan Carpenter <dan.carpenter@oracle.com> [includes fixes by Dan Carpenter] Signed-off-by: Janosch Frank <frankja@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:

committed by
Paolo Bonzini

parent
6d0a1a61e7
commit
536a6f88c4
@@ -412,6 +412,8 @@ struct kvm {
|
||||
#endif
|
||||
long tlbs_dirty;
|
||||
struct list_head devices;
|
||||
struct dentry *debugfs_dentry;
|
||||
struct kvm_stat_data **debugfs_stat_data;
|
||||
};
|
||||
|
||||
#define kvm_err(fmt, ...) \
|
||||
@@ -991,6 +993,11 @@ enum kvm_stat_kind {
|
||||
KVM_STAT_VCPU,
|
||||
};
|
||||
|
||||
struct kvm_stat_data {
|
||||
int offset;
|
||||
struct kvm *kvm;
|
||||
};
|
||||
|
||||
struct kvm_stats_debugfs_item {
|
||||
const char *name;
|
||||
int offset;
|
||||
|
Reference in New Issue
Block a user