trinity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Patch : enable  tool as make -p take an arg for seconds
@ 2015-07-29  8:45 Praveen Pandey
  2015-08-04 23:44 ` Dave Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Praveen Pandey @ 2015-07-29  8:45 UTC (permalink / raw
  To: trinity; +Cc: sachinp, Praveen Pandey

Signed-off-by: Praveen Pandey <praveen@linux.vnet.ibm.com>
---
 Documentation/TODO         |  2 +-
 children/random-syscalls.c |  2 +-
 include/params.h           |  1 +
 params.c                   | 16 +++++++++++++---
 4 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/Documentation/TODO b/Documentation/TODO
index 73ea04a..108ee9c 100644
--- a/Documentation/TODO
+++ b/Documentation/TODO
@@ -228,7 +228,7 @@
   - if we find a blocking fd, check if it's a socket, and shutdown() it.
     (tricky: we need to do the shutdown in the main process, and then tell other children)
 
-* make -p take an arg for seconds
+* make -p take an arg for seconds --- DONE
 
 * things to check.
   - execve occasionally returns -ESRCH. Why ?
diff --git a/children/random-syscalls.c b/children/random-syscalls.c
index 807b2ec..e3f87f9 100644
--- a/children/random-syscalls.c
+++ b/children/random-syscalls.c
@@ -171,7 +171,7 @@ retry:
 	output_syscall_postfix(rec);
 
 	if (dopause == TRUE)
-		sleep(1);
+		sleep(userspecified_pausetime);
 
 	handle_syscall_ret(rec);
 
diff --git a/include/params.h b/include/params.h
index 7244a2f..7cbab01 100644
--- a/include/params.h
+++ b/include/params.h
@@ -32,6 +32,7 @@ extern bool do_specific_domain;
 extern char *specific_domain_optarg;
 extern bool no_domains[TRINITY_PF_MAX];
 extern bool dopause;
+extern unsigned int userspecified_pausetime;
 extern bool show_syscall_list;
 extern bool show_ioctl_list;
 extern unsigned char quiet_level;
diff --git a/params.c b/params.c
index 01b4df5..5ca40ae 100644
--- a/params.c
+++ b/params.c
@@ -30,8 +30,11 @@ unsigned int user_specified_children = 0;
 
 bool do_specific_domain = FALSE;
 bool no_domains[TRINITY_PF_MAX];
-
+//variables used for system call pause
 bool dopause = FALSE;
+unsigned int userspecified_pausetime = 0 ;
+
+
 bool show_syscall_list = FALSE;
 bool show_ioctl_list = FALSE;
 unsigned char quiet_level = 0;
@@ -92,12 +95,12 @@ static void usage(void)
 	outputerr("\n");
 	outputerr(" -c#,@: target specific syscall (takes syscall name as parameter and optionally 32 or 64 as bit-width. Default:both).\n");
 	outputerr(" -N#: do # syscalls then exit.\n");
-	outputerr(" -p:  pause after syscall.\n");
+	outputerr(" -p: specify number of second or seconds for  pause after syscall .\n");
 	outputerr(" -s#: use # as random seed.\n");
 	exit(EXIT_SUCCESS);
 }
 
-static const char paramstr[] = "a:b:c:C:dDg:hIl:LN:mP:E:pqr:s:T:SV:vx:X";
+static const char paramstr[] = "a:b:c:C:p:dDg:hIl:LN:mP:E:qr:s:T:SV:vx:X";
 
 static const struct option longopts[] = {
 	{ "arch", required_argument, NULL, 'a' },
@@ -237,6 +240,13 @@ void parse_args(int argc, char *argv[])
 		/* Pause after each syscall */
 		case 'p':
 			dopause = TRUE;
+			userspecified_pausetime=strtoll(optarg, NULL, 10);
+			if (userspecified_pausetime == 0) {
+                outputerr("zero pause time ? WAT?\n");
+                exit(EXIT_FAILURE);
+            }
+
+			outputstd("time pass for pause %ld",userspecified_pausetime);
 			break;
 
 		case 'P':
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Patch : enable  tool as make -p take an arg for seconds
  2015-07-29  8:45 [PATCH] Patch : enable tool as make -p take an arg for seconds Praveen Pandey
@ 2015-08-04 23:44 ` Dave Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Jones @ 2015-08-04 23:44 UTC (permalink / raw
  To: Praveen Pandey; +Cc: trinity, sachinp

On Wed, Jul 29, 2015 at 02:15:49PM +0530, Praveen Pandey wrote:

 > diff --git a/Documentation/TODO b/Documentation/TODO
 > index 73ea04a..108ee9c 100644
 > --- a/Documentation/TODO
 > +++ b/Documentation/TODO
 > @@ -228,7 +228,7 @@
 >    - if we find a blocking fd, check if it's a socket, and shutdown() it.
 >      (tricky: we need to do the shutdown in the main process, and then tell other children)
 >  
 > -* make -p take an arg for seconds
 > +* make -p take an arg for seconds --- DONE

I'm not sure this feature actually adds any value any more.
I don't recall what I was thinking back when I added that TODO item,
but it probably came from a time long before Trinity had multiple child processes.

Unless anyone has a compelling reason for this, I'd say just drop it.

	Dave

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-04 23:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-29  8:45 [PATCH] Patch : enable tool as make -p take an arg for seconds Praveen Pandey
2015-08-04 23:44 ` Dave Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).