From bfbbb76e5d0294cc1d44f42ab6c2d91149067b6c Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 1 Mar 2010 15:17:09 -0600 Subject: Fixed PR 11336 by using a wait queue to wait on procfs file availability. * runtime/procfs-probes.c: Removed old kernel 2.6.16 code. Simplified _spp_lock macros. (_stp_proc_open_file): If file is busy, use a wait queue to wait on it being available. (_stp_proc_release_file): Decrease open count. * tapset-procfs.cxx (emit_module_init): Updated procfs probe initialization/shutdown routine names. (emit_module_exit): Ditto. --- tapset-procfs.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tapset-procfs.cxx') diff --git a/tapset-procfs.cxx b/tapset-procfs.cxx index aea01a7a..c888ff74 100644 --- a/tapset-procfs.cxx +++ b/tapset-procfs.cxx @@ -373,7 +373,7 @@ procfs_derived_probe_group::emit_module_init (systemtap_session& s) s.op->newline(1) << "probe_point = spp->write_pp;"; s.op->indent(-1); - s.op->newline() << "_spp_lock_init(spp);"; + s.op->newline() << "_spp_init(spp);"; s.op->newline() << "rc = _stp_create_procfs(spp->path, i, &_stp_proc_fops);"; s.op->newline() << "if (rc) {"; @@ -381,7 +381,7 @@ procfs_derived_probe_group::emit_module_init (systemtap_session& s) s.op->newline() << "for (i = 0; i < " << probes_by_path.size() << "; i++) {"; s.op->newline(1) << "spp = &stap_procfs_probes[i];"; - s.op->newline() << "_spp_lock_shutdown(spp);"; + s.op->newline() << "_spp_shutdown(spp);"; s.op->newline(-1) << "}"; s.op->newline() << "break;"; s.op->newline(-1) << "}"; @@ -400,7 +400,7 @@ procfs_derived_probe_group::emit_module_exit (systemtap_session& s) s.op->newline() << "_stp_close_procfs();"; s.op->newline() << "for (i = 0; i < " << probes_by_path.size() << "; i++) {"; s.op->newline(1) << "struct stap_procfs_probe *spp = &stap_procfs_probes[i];"; - s.op->newline() << "_spp_lock_shutdown(spp);"; + s.op->newline() << "_spp_shutdown(spp);"; s.op->newline(-1) << "}"; } -- cgit