Hi,
+
+The STATS_FS_HIDDEN attribute won't affect the aggregation, it will only
+block the creation of the files.
Why does HIDDEN block the creation of files? instead of their visibility?
The file itself is used to allow the user to view the content of a
value. In order to make it hidden,
In order to run them, the kernel .config must set CONFIG_KUNIT=y
and a new .kunitconfig file must be created with CONFIG_STATS_FS=y
and CONFIG_STATS_FS_TEST=y
It looks like CONFIG_STATS_FS is built-in, but it exports
much of the functionality you are testing. However could the
tests also be
The file system is mounted on /sys/kernel/stats and would be already used
by kvm. Statsfs was initially introduced by Paolo Bonzini [1].
What's the direct motivation for this work? Moving KVM stats out of
debugfs?
There's many reasons: one of these is not using debugfs for statistics,
but
Hi Andrew
How do you atomically get and display a group of statistics?
If you look at how the netlink socket works, you will see code like:
do {
start = u64_stats_fetch_begin_irq(&cpu_stats->syncp);
rx_packets = cpu_stats->rx
Apply stats_fs on the networking statistics subsystem.
Currently it only works with disabled network namespace
(CONFIG_NET_NS=n), because multiple namespaces will have the same
device name under the same root source that will cause a conflict in
stats_fs.
Signed-off-by: Emanuele Giuseppe
the kvm//vcpu/mp_state file
Signed-off-by: Emanuele Giuseppe Esposito
---
arch/x86/kvm/stats_fs.c | 54 +
1 file changed, 54 insertions(+)
diff --git a/arch/x86/kvm/stats_fs.c b/arch/x86/kvm/stats_fs.c
index f6edebb9c559..902be18562da 100644
--- a/arch
/debugfs/kvm is left for backward compatibility.
Signed-off-by: Emanuele Giuseppe Esposito
---
arch/arm64/kvm/Kconfig | 1 +
arch/arm64/kvm/guest.c | 2 +-
arch/mips/kvm/Kconfig | 1 +
arch/mips/kvm/mips.c| 2 +-
arch/powerpc/kvm/Kconfig| 1
: Emanuele Giuseppe Esposito
---
fs/stats_fs/Makefile | 2 +-
fs/stats_fs/inode.c| 461 +
fs/stats_fs/internal.h | 15 ++
fs/stats_fs/stats_fs.c | 92 +++-
include/linux/stats_fs.h | 18 ++
include/uapi/linux/magic.h | 1 +
tools
root
directory of the linux kernel source tree:
./tools/testing/kunit/kunit.py run --timeout=30 --jobs=`nproc --all`
Signed-off-by: Emanuele Giuseppe Esposito
---
fs/Kconfig |6 +
fs/stats_fs/Makefile |2 +
fs/stats_fs/stats_fs-tests.c | 1097
Html docs for a complete documentation of the stats_fs API,
filesystem and usage.
Signed-off-by: Emanuele Giuseppe Esposito
---
Documentation/filesystems/index.rst| 1 +
Documentation/filesystems/stats_fs.rst | 222 +
2 files changed, 223 insertions(+)
create mode
former calling it when it needs to
display and clear statistics, the latter to add values and sources.
Signed-off-by: Emanuele Giuseppe Esposito
---
MAINTAINERS | 7 +
fs/Kconfig | 14 +
fs/Makefile | 1 +
fs/stats_fs/Makefile | 5 +
fs/stats_fs
ttps://lore.kernel.org/kvm/5d6cdcb1-d8ad-7ae6-7351-3544e2fa3...@redhat.com/?fbclid=IwAR18LHJ0PBcXcDaLzILFhHsl3qpT3z2vlG60RnqgbpGYhDv7L43n0ZXJY8M
Signed-off-by: Emanuele Giuseppe Esposito
v2 -> v3 move kconfig entry in the pseudo filesystem menu, add
documentation, get/clear function for value ty
On 5/8/20 11:44 AM, Paolo Bonzini wrote:
> So in general I'd say the sources/values model holds up. We certainly
> want to:
>
> - switch immediately to callbacks instead of the type constants (so that
> core statsfs code only does signed/unsigned)
>
> - add a field to distinguish cumulative an
On 5/4/20 11:37 PM, David Rientjes wrote:
On Mon, 4 May 2020, Emanuele Giuseppe Esposito wrote:
In this patch series I introduce statsfs, a synthetic ram-based virtual
filesystem that takes care of gathering and displaying statistics for the
Linux kernel subsystems.
This is exciting, we
/debugfs/kvm is left for backward compatibility.
Signed-off-by: Emanuele Giuseppe Esposito
---
arch/arm64/kvm/Kconfig | 1 +
arch/arm64/kvm/guest.c | 2 +-
arch/mips/kvm/Kconfig | 1 +
arch/mips/kvm/mips.c| 2 +-
arch/powerpc/kvm/Kconfig| 1
, with the exception that the API is only
composed by stats_fs_create_file, stats_fs_create_dir and stats_fs_remove.
Signed-off-by: Emanuele Giuseppe Esposito
---
fs/stats_fs/Makefile | 2 +-
fs/stats_fs/inode.c| 337 +
fs/stats_fs/internal.h
root
directory of the linux kernel source tree:
./tools/testing/kunit/kunit.py run --timeout=30 --jobs=`nproc --all`
Signed-off-by: Emanuele Giuseppe Esposito
---
fs/Kconfig |6 +
fs/stats_fs/Makefile |2 +
fs/stats_fs/stats_fs-tests.c | 1088
FhHsl3qpT3z2vlG60RnqgbpGYhDv7L43n0ZXJY8M
Signed-off-by: Emanuele Giuseppe Esposito
v1->v2 remove unnecessary list_foreach_safe loops, fix wrong indentation,
change statsfs in stats_fs
Emanuele Giuseppe Esposito (5):
refcount, kref: add dec-and-test wrappers for rw_semaphores
stats_fs API:
by a virtual file system in patch 4.
Its usage will be shared between the stats_fs file system
and the end-users like kvm, the former calling it when it needs to
display and clear statistics, the latter to add values and sources.
Signed-off-by: Emanuele Giuseppe Esposito
---
MAINTAINERS
stats_fs_source data structures, which are
protected by an rw_semaphore to allow concurrent sysfs reads.
Signed-off-by: Emanuele Giuseppe Esposito
---
include/linux/kref.h | 11 +++
include/linux/refcount.h | 2 ++
lib/refcount.c | 32
3 files
There is no semantic change intended; the code in the libfs.c
functions in fact was derived from debugfs and tracefs code.
Signed-off-by: Emanuele Giuseppe Esposito
---
fs/tracefs/inode.c | 86 --
1 file changed, 7 insertions(+), 79 deletions(-)
diff
The only difference, compared to the pre-existing code, is that symlink
creation now triggers fsnotify_create. This was a bug in the debugfs
code, since for example vfs_symlink does call fsnotify_create.
Signed-off-by: Emanuele Giuseppe Esposito
---
fs/debugfs/inode.c | 144
parameter to the
creation functions, but pushes all error recovery into fs/libfs.c.
Signed-off-by: Emanuele Giuseppe Esposito
---
fs/libfs.c | 226 +
include/linux/fs.h | 18
2 files changed, 244 insertions(+)
diff --git a/fs/libfs.c b/fs
libfs.c has many functions that are useful to implement dentry and inode
operations, but not many at the filesystem level. Start adding file
creation wrappers, the simplest returns an anonymous inode.
There is no functional change intended.
Signed-off-by: Emanuele Giuseppe Esposito
---
drivers
It is a common special case for new_inode to initialize the
time to the current time and the inode to get_next_ino().
Introduce a core function that does it.
Signed-off-by: Emanuele Giuseppe Esposito
---
fs/libfs.c | 20
include/linux/fs.h | 1 +
2 files changed
Simplify passing the count and mount to simple_pin_fs and
simple_release_fs by wrapping them in the simple_fs struct,
in preparation for adding more high level operations to
fs/libfs.c
There is no functional change intended.
Signed-off-by: Emanuele Giuseppe Esposito
---
drivers/gpu/drm
0 on entry and on exit).
There is no functional change intended.
Signed-off-by: Emanuele Giuseppe Esposito
---
security/apparmor/apparmorfs.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index
duces the dentry and inode creation functions. Patch 6-7 can then
adopt them in debugfs and tracefs.
Signed-off-by: Emanuele Giuseppe Esposito
v1->v2: rename simple_new_inode in new_inode_current_time,
more detailed explanations, put all common code in fs/libfs.c
Emanuele Giuseppe Esposito (7
On 4/21/20 1:19 PM, Frederic Barrat wrote:
diff --git a/drivers/misc/cxl/Kconfig b/drivers/misc/cxl/Kconfig
index 39eec9031487..a62795079d9c 100644
--- a/drivers/misc/cxl/Kconfig
+++ b/drivers/misc/cxl/Kconfig
@@ -19,6 +19,7 @@ config CXL
select CXL_BASE
select CXL_AFU_DRIVER_OP
On 4/16/20 8:59 AM, Luis Chamberlain wrote:
On Tue, Apr 14, 2020 at 02:42:54PM +0200, Emanuele Giuseppe Esposito wrote:
This series of patches introduce wrappers for functions,
arguments simplification in functions calls and most importantly
groups duplicated code in a single header
On 4/16/20 8:44 AM, Luis Chamberlain wrote:
On Tue, Apr 14, 2020 at 02:42:55PM +0200, Emanuele Giuseppe Esposito wrote:
aa_mk_null_file is using simple_pin_fs/simple_release_fs with local
variables as arguments, for what would amount to a simple
vfs_kern_mount/mntput pair if everything was
On 4/14/20 3:01 PM, Greg Kroah-Hartman wrote:
On Tue, Apr 14, 2020 at 02:42:58PM +0200, Emanuele Giuseppe Esposito wrote:
It is a common special case for new_inode to initialize the
time to the current time and the inode to get_next_ino().
Introduce a core function that does it and use it
On 4/14/20 2:56 PM, Greg Kroah-Hartman wrote:
On Tue, Apr 14, 2020 at 02:43:00PM +0200, Emanuele Giuseppe Esposito wrote:
A bunch of code is duplicated between debugfs and tracefs, unify it to the
simplefs library.
The code is very similar, except that dentry and inode creation are unified
On 4/14/20 10:18 AM, Paolo Bonzini wrote:
On 13/04/20 23:34, Philippe Mathieu-Daudé wrote:
+#define VM_STAT(x, ...) offsetof(struct kvm, stat.x), KVM_STAT_VM, ##
__VA_ARGS__
+#define VCPU_STAT(x, ...) offsetof(struct kvm_vcpu, stat.x), KVM_STAT_VCPU, ##
__VA_ARGS__
I find this macro expand
There is no semantic change intended; the code in the simplefs.c functions in
fact was derived from debugfs and tracefs code.
Signed-off-by: Emanuele Giuseppe Esposito
---
fs/tracefs/inode.c | 86 --
1 file changed, 7 insertions(+), 79 deletions
The only difference, compared to the pre-existing code, is that symlink
creation now triggers fsnotify_create. This was a bug in the debugfs
code, since for example vfs_symlink does call fsnotify_create.
Signed-off-by: Emanuele Giuseppe Esposito
---
fs/debugfs/inode.c | 144
parameter to the creation
functions, but pushes all error recovery into fs/simplefs.c.
Signed-off-by: Emanuele Giuseppe Esposito
---
fs/simplefs.c| 150 +++
include/linux/simplefs.h | 19 +
2 files changed, 169 insertions(+)
diff --git a/fs
Start adding file creation wrappers, the simplest returns an anonymous
inode.
Signed-off-by: Emanuele Giuseppe Esposito
---
drivers/gpu/drm/drm_drv.c | 2 +-
drivers/misc/cxl/api.c | 2 +-
drivers/scsi/cxlflash/ocxl_hw.c | 2 +-
fs/simplefs.c | 6 ++
include
It is a common special case for new_inode to initialize the
time to the current time and the inode to get_next_ino().
Introduce a core function that does it and use it throughout
Linux.
Signed-off-by: Emanuele Giuseppe Esposito
---
arch/powerpc/platforms/cell/spufs/inode.c | 4 +---
arch/s390
Simplify passing the count and mount to simple_pin_fs and simple_release_fs,
in preparation for adding more high level operations to the simplefs API.
Signed-off-by: Emanuele Giuseppe Esposito
---
drivers/gpu/drm/drm_drv.c | 11 +--
drivers/misc/cxl/api.c | 13
We will augment this family of functions with inode management. To avoid
littering include/linux/fs.h and fs/libfs.c, move them to a separate header,
with a Kconfig symbol to enable them.
Signed-off-by: Emanuele Giuseppe Esposito
---
drivers/gpu/drm/Kconfig | 1 +
drivers/gpu/drm
aa_mk_null_file is using simple_pin_fs/simple_release_fs with local
variables as arguments, for what would amount to a simple
vfs_kern_mount/mntput pair if everything was inlined. Just use
the normal filesystem API since the reference counting is not needed
here.
Signed-off-by: Emanuele Giuseppe
This series of patches introduce wrappers for functions,
arguments simplification in functions calls and most importantly
groups duplicated code in a single header, simplefs, to avoid redundancy
in the linux fs, especially debugfs and tracefs.
Signed-off-by: Emanuele Giuseppe Esposito
Emanuele
: Emanuele Giuseppe Esposito
---
arch/arm64/kvm/guest.c| 23 +++
arch/mips/kvm/mips.c | 61 +++
arch/powerpc/kvm/book3s.c | 3 --
arch/powerpc/kvm/booke.c | 3 --
arch/s390/kvm/kvm-s390.c | 3 --
arch/x86/kvm/x86.c| 3
44 matches
Mail list logo