xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Re: how to make xenalyze continuously reading from xentrace file ?
       [not found] <CAPm+FyWYQ39m-ByTRLmph6e4HpoPe_TwjfDyK7FDrEng8pfqqg@mail.gmail.com>
@ 2012-12-10 14:19 ` George Dunlap
  0 siblings, 0 replies; only message in thread
From: George Dunlap @ 2012-12-10 14:19 UTC (permalink / raw)
  To: M A, xen-devel

On 08/12/12 06:02, M A wrote:
> Hi There,
>
> I'm a student at NYIT, New York and I have project on xen hypervisor.
> Currently i'm working on xentrace and xenalyze to monitor the runstate
> events. What i'm trying do now is:  While i'm capturing  by xentrace I
> want to display the result on the screen using xenalyze.  I tried to use
> loop in the main function but I got errors and when I tried to solve
> these errors I got more errors.
>
> int main(int argc, char *argv[]) {
>      /* Start with warn at stderr. */
>
>      warn = stderr;
>
>      argp_parse(&parser_def, argc, argv, 0, NULL, NULL);
>
>      if (G.trace_file == NULL)
>          exit(1);
>
>      if ( (G.fd = open(G.trace_file, O_RDONLY|O_LARGEFILE)) < 0) {
>          perror("open");
>          error(ERR_SYSTEM, NULL);
>      } else {
>          struct stat64 s;
>          fstat64(G.fd, &s);
>          G.file_size = s.st_size;
>      }
>
>      if ( (G.mh = mread_init(G.fd)) == NULL )
>          perror("mread");
>
>      if (G.symbol_file != NULL)
>          parse_symbol_file(G.symbol_file);
>
>      if(opt.dump_all)
>          warn = stdout;
>
> for (int i=0;i<=1000;i++){
>      init_pcpus();
>
>
>      if(opt.progress)
>          progress_init();
>
>      process_records();
>
>      if(opt.interval_mode)
>          interval_tail();
>
>      if(opt.summary)
>          summary();
>
>      if(opt.report_pcpu)
>          report_pcpu();
> sleep(2);
>
> }
>      if(opt.progress)
>          progress_finish();
>
>      return 0;
> }
>
>
> *Error: vcpu_next_update: FATAL: p->current not NULL! (d32768v0,
> runstate running)*
>
>
> How can I can make xenalyze to continuously read from xentrace output file ?

(Adding xen-devel, since this is definitely a coding question)

So I take it what you're doing is this:
1. Start xentrace:
  # xentrace -e all /tmp/foo.trace &
2. Running your "looping" xenalyze on it:
  # xenalyze -s /tmp/foo.trace

Is that correct?

I don't know what your exact problem is here, but one problem you'll run 
into eventually is that xenalyze expects a certain "finished" file 
format, but there's nothing here to synchronize xenalyze reading the 
file with xentrace writing the file.  The result is that you're bound at 
some point to read a file of which the end is only half-written.

In any case, what you're doing here is functionally not really that 
different from just doing it in bash:
  # while xenalyze -s /tmp/foo.trace && sleep 2 ; true; done

  -George

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-12-10 14:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAPm+FyWYQ39m-ByTRLmph6e4HpoPe_TwjfDyK7FDrEng8pfqqg@mail.gmail.com>
2012-12-10 14:19 ` how to make xenalyze continuously reading from xentrace file ? George Dunlap

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 NNTP newsgroup(s).