summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2010-02-25 16:29:50 -0600
committerDavid Smith <dsmith@redhat.com>2010-02-25 16:29:50 -0600
commit38975255091d0c6bc33ae3c6907bb7886b70598d (patch)
treeb92dae620c94754b2828b7d92a51c29684a00085 /runtime
parente3d5f49468872aeec7f1f05a8afe40677859cf0f (diff)
downloadsystemtap-steved-38975255091d0c6bc33ae3c6907bb7886b70598d.tar.gz
systemtap-steved-38975255091d0c6bc33ae3c6907bb7886b70598d.tar.xz
systemtap-steved-38975255091d0c6bc33ae3c6907bb7886b70598d.zip
Fixed pr 10690 by adding '.maxsize(NNN)' procfs read probe parameter.
* tapset-procfs.cxx (procfs_derived_probe::procfs_derived_probe): Added 'maxsize_val' initialization. (procfs_derived_probe::join_group): Updated '_stp_procfs_data' definition and added STP_PROCFS_BUFSIZE. (procfs_derived_probe_group::emit_module_decls): Emits structure to contain procfs file buffers. Initializes '.bufsize' structure member. (procfs_var_expanding_visitor::visit_target_symbol): Uses 'bufsize' for maximum buffer size instead of using MAXSTRINGLEN. (procfs_builder::build): Looks for '.maxsize(NNN)' parameter. (register_tapset_procfs): Added '.maxsize(NNN)' parameter binding. * runtime/procfs-probes.c (stap_procfs_probe): Converted 'buffer' to a pointer and added 'bufsize' member. * testsuite/semko/procfs13.stp: New testcase. * testsuite/semko/procfs14.stp: Ditto. * testsuite/semko/procfs15.stp: Ditto. * testsuite/systemtap.base/procfs_maxsize.exp: Ditto. * testsuite/systemtap.base/procfs.exp: Minor fix. * stapprobes.3stap.in: Added '.maxsize(NNN)' documentation. * stap.1.in: Added STP_PROCFS_BUFSIZE documentation.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/procfs-probes.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/runtime/procfs-probes.c b/runtime/procfs-probes.c
index 73aa7e5f..8f9ff113 100644
--- a/runtime/procfs-probes.c
+++ b/runtime/procfs-probes.c
@@ -9,7 +9,8 @@
// translation process. It really should go here.
struct _stp_procfs_data {
char *buffer;
- unsigned long count;
+ size_t bufsize;
+ size_t count;
};
#endif
@@ -20,10 +21,8 @@ struct stap_procfs_probe {
const char *write_pp;
void (*write_ph) (struct context*);
- // FIXME: Eventually, this could get bigger than MAXSTRINGLEN
- // when we support 'probe procfs("file").read.maxbuf(8192)'
- // (bug 10690).
- string_t buffer;
+ char *buffer;
+ const size_t bufsize;
size_t count;
int needs_fill;