From: George Dunlap <george.dunlap@eu.citrix.com>
To: M A <vip2442@gmail.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: how to make xenalyze continuously reading from xentrace file ?
Date: Mon, 10 Dec 2012 14:19:09 +0000 [thread overview]
Message-ID: <50C5EF5D.5050307@eu.citrix.com> (raw)
In-Reply-To: <CAPm+FyWYQ39m-ByTRLmph6e4HpoPe_TwjfDyK7FDrEng8pfqqg@mail.gmail.com>
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
parent reply other threads:[~2012-12-10 14:19 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <CAPm+FyWYQ39m-ByTRLmph6e4HpoPe_TwjfDyK7FDrEng8pfqqg@mail.gmail.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50C5EF5D.5050307@eu.citrix.com \
--to=george.dunlap@eu.citrix.com \
--cc=vip2442@gmail.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).