Hello,
I noticed recently that strace puts quotes around the f_type member of
struct statfs:
statfs(".", {f_type="EXT2_SUPER_MAGIC", ...}) = 0
The double-quotes seem to predate git history; ChangeLog-CVS indicates
they were added intentionally in a commit from Rick Sladkey in 1995
("Enclose string result in double quotes"), though I don't see any
reasoning as to why this was done. Given that strace's output format
generally seems to aim for an approximate resemblance to C source code,
it seems like f_type's value would be better off without quotes (since
it's just a macro, not a string). Unless there's some more subtle
reason for the current formatting that I'm not seeing, could the
attached patch be applied to remove them?
Thanks,
Zev Weiss
>From 10a64ba963e65ade2d00c7d0c2d6434e1ec2dc54 Mon Sep 17 00:00:00 2001
From: Zev Weiss <z...@bewilderbeest.net>
Date: Sun, 24 Apr 2016 18:32:33 -0500
Subject: [PATCH] statfs: don't quote f_type macro names
* statfs.c (sprintfstype): remove double-quotes.
* tests/statfs.expected: Likewise.
---
statfs.c | 2 +-
tests/statfs.expected | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/statfs.c b/statfs.c
index bd3c7ba..8289f63 100644
--- a/statfs.c
+++ b/statfs.c
@@ -45,7 +45,7 @@ sprintfstype(const unsigned int magic)
s = xlat_search(fsmagic, ARRAY_SIZE(fsmagic), magic);
if (s) {
- sprintf(buf, "\"%s\"", s);
+ sprintf(buf, "%s", s);
return buf;
}
sprintf(buf, "%#x", magic);
diff --git a/tests/statfs.expected b/tests/statfs.expected
index 93e2b51..f39013b 100644
--- a/tests/statfs.expected
+++ b/tests/statfs.expected
@@ -1 +1 @@
-statfs(64)?\("/proc/self/status"(, [1-9][0-9]*)?, \{f_type="PROC_SUPER_MAGIC", f_bsize=[1-9][0-9]*, f_blocks=[0-9]+, f_bfree=[0-9]+, f_bavail=[0-9]+, f_files=[0-9]+, f_ffree=[0-9]+, f_fsid=\{[0-9]+, [0-9]+\}, f_namelen=[1-9][0-9]*(, f_frsize=[0-9]+)?(, f_flags=[0-9]+)?\}\) += 0
+statfs(64)?\("/proc/self/status"(, [1-9][0-9]*)?, \{f_type=PROC_SUPER_MAGIC, f_bsize=[1-9][0-9]*, f_blocks=[0-9]+, f_bfree=[0-9]+, f_bavail=[0-9]+, f_files=[0-9]+, f_ffree=[0-9]+, f_fsid=\{[0-9]+, [0-9]+\}, f_namelen=[1-9][0-9]*(, f_frsize=[0-9]+)?(, f_flags=[0-9]+)?\}\) += 0
--
2.8.0.rc3
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel