From: Adel Amani Subject: Re: function snprintf() in xen_save_domain.c for debugged Date: Thu, 20 Feb 2014 23:18:39 -0800 (PST) Message-ID: <1392967119.28200.YahooMailNeo@web161805.mail.bf1.yahoo.com> References: <20140202100044.GA5898@aepfle.de> <1391432170.33697.YahooMailNeo@web161806.mail.bf1.yahoo.com> <20140203131144.GA31275@aepfle.de> <1391583040.24823.YahooMailNeo@web161802.mail.bf1.yahoo.com> <20140205123908.GA1198@aepfle.de> <1391689706.75705.YahooMailNeo@web161806.mail.bf1.yahoo.com> <20140206214018.GA14658@aepfle.de> <1391807749.53657.YahooMailNeo@web161801.mail.bf1.yahoo.com> <20140207222247.GA23234@aepfle.de> <1392796739.73315.YahooMailNeo@web161801.mail.bf1.yahoo.com> <20140219141207.GA9631@aepfle.de> Reply-To: Adel Amani Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8624475629277257537==" Return-path: In-Reply-To: <20140219141207.GA9631@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: Xen List-Id: xen-devel@lists.xenproject.org --===============8624475629277257537== Content-Type: multipart/alternative; boundary="-337026386-468065670-1392967119=:28200" ---337026386-468065670-1392967119=:28200 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable i change code xc_save.c as follows:=0A=0A=A0int=A0=0A=A0main(int argc, char= **argv)=A0=0A=A0{=A0=0A- =A0 =A0unsigned int maxit, max_f;=A0=0A+ =A0 =A0u= nsigned int maxit, max_f, lflags;=A0=0A=A0 =A0 =A0int io_fd, ret, port;=A0= =0A=A0 =A0 =A0struct save_callbacks callbacks;=A0=0A+ =A0 =A0xentoollog_lev= el lvl;=A0=0A+ =A0 =A0xentoollog_logger *l;=A0=0A=A0=A0=0A=A0 =A0 =A0if (ar= gc !=3D 6)=A0=0A=A0 =A0 =A0 =A0 =A0errx(1, "usage: %s iofd domid maxit maxf= flags", argv[0]);=A0=0A=A0=A0=0A- =A0 =A0si.xch =3D xc_interface_open(0,0,= 0);=A0=0A- =A0 =A0if (!si.xch)=A0=0A- =A0 =A0 =A0 =A0errx(1, "failed to ope= n control interface");=A0=0A-=A0=0A=A0 =A0 =A0io_fd =3D atoi(argv[1]);=A0= =0A=A0 =A0 =A0si.domid =3D atoi(argv[2]);=A0=0A=A0 =A0 =A0maxit =3D atoi(ar= gv[3]);=A0=0A@@ -185,6 +183,13 @@ main(int argc, char **argv)=A0=0A=A0=A0= =0A=A0 =A0 =A0si.suspend_evtchn=A0=3D -1;=A0=0A=A0=A0=0A+ =A0 =A0lvl =3D si= .flags & XCFLAGS_DEBUG ? XTL_DEBUG: XTL_DETAIL;=A0=0A+ =A0=A0=A0lflags =3D = XTL_STDIOSTREAM_HIDE_PROGRESS;=A0=0A+ =A0 =A0l =3D (xentoollog_logger *)xtl= _createlogger_stdiostream(stderr, lvl, lflags);=A0=0A+ =A0 =A0si.xch =3D xc= _interface_open(l, 0, 0);=A0=0A+ =A0 =A0if (!si.xch)=A0=0A+ =A0 =A0 =A0 =A0= errx(1, "failed to open control interface");=A0=0A+=A0=0A=A0 =A0 =A0si.xce = =3D xc_evtchn_open(NULL, 0);=A0=0A=A0 =A0 =A0if (si.xce =3D=3D NULL)=A0=0A= =A0 =A0 =A0 =A0 =A0warnx("failed to open event channel handle");=A0=0A=0A= =0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0Ain this code change lflags to=A0= =A0lflags =3D XTL_STDIOSTREAM_HIDE_PROGRESS;=A0and=A0i don't know what mean= 's=A0@@ -185,6 +183,13 @@ main(int argc, char **argv) =A0 =A0?!!=0A=0A=A0so= i delete=A0@@ -185,6 +183,13 @@ main(int argc, char **argv)=A0from code an= d test logger (to live migration of=A0=A0VM) But again result output in xen= d.log don't change.=0A=A0=0A=A0=0AAdel Amani=0AM.Sc. Candidate@Computer Eng= ineering Department, University of Isfahan=0AEmail: A.Amani@eng.ui.ac.ir=0A= =0A=0A=0AOn Wednesday, February 19, 2014 5:42 PM, Olaf Hering wrote:=0A =0AOn Tue, Feb 18, Adel Amani wrote:=0A=0A> Hi=0A> i know bec= ause a lot of product output in xen-4.1, no logger in xc_save.c=0A> i chang= e code again according to "http://xen.1045712.n5.nabble.com/=0A> xen-unstab= le-tools-xc-restore-logging-in-xc-save-td5714324.html"=0A> But i don't know= purpose Mr "patchbot" of =0A> @@ -185,6 +183,13 @@ main(int argc, char **a= rgv)=0A> i test again to code Mr "patchbot" without Consideration =0A> @@ -= 185,6 +183,13 @@ main(int argc, char **argv)=0A> and result again no messag= e :-( ....=0A=0A=0AAll that is very imprecise, so we can not help.=0AAlso r= ead what I wrote: dont drop xen-devel@lists.xen.org=0A=0AOlaf=0A=0A=0A=0A= =0A> On Saturday, February 8, 2014 1:52 AM, Olaf Hering wr= ote:=0A> Please keep xen-devel@lists.xen.org in CC list.=0A> =0A> On Fri, F= eb 07, Adel Amani wrote:=0A> =0A> > yes, for print data, function print_sta= ts() in xc_domain_save.c should run=0A> and=0A> > work. I read in function = and check.... But i don't know really why this don't=0A> > work!!! :-|... I= test 'fprintf(stderr,"STDERR\n"); fprintf(stdout,"STDOUT\=0A> n");'=0A> > = But again not answer :'(.....=0A> =0A> Please make sure the self-compiled b= inary is actually used. Try this to=0A> verify: grep STDERR /usr/lib/xen/bi= n/xc_save (assuming the fprintf above=0A> is actually in the compiled code.= )=0A> =0A> > how boot the domU with 'initcall_debug'?! Are affect on total = time?!=0A> =0A> This is a kernel cmdline option. Please check the documenta= tion about=0A> how to pass additional kernel parameters to a domU.=0A> =0A>= =0A> Olaf=0A> =0A> ---337026386-468065670-1392967119=:28200 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
i change code xc_save.c as follows:
=
 int 
 main(int argc, char **= argv) 
 { 
-    unsigned in= t maxit, max_f; 
+    unsigned int maxi= t, max_f, lflags; 
     int io_fd,= ret, port; 
     struct save_call= backs callbacks; 
+    xentoollog_level lvl; 
+    xentoollog_logger *l; =
  
     = ;if (argc !=3D 6) 
        &n= bsp;errx(1, "usage: %s iofd domid maxit maxf flags", argv[0]); =
&nbs= p; 
-    si.xch =3D xc_interface_open(0= ,0,0); 
-    if (!si.xch) <= br clear=3D"none" style=3D"font-family: Verdana, Geneva, Helvetica, Arial, = sans-serif;">-        errx(1, "failed to open control = interface"); 
- 
     io_fd= =3D atoi(argv[1]); 
     si.domid= =3D atoi(argv[2]); 
     maxit = =3D atoi(argv[3]); 
@@ -185,6 +183,13 @@ main(int= argc, char **argv) 
  
     = si.suspend_evtc= hn =3D -1; 
  
+    lvl =3D si.flags & XCFLAGS_DEBUG ? XTL_DEBUG: X= TL_DETAIL; 
+    lflags= =3D XTL_STDIOSTREAM_HIDE_PROGRESS; 
+ &nb= sp;  l =3D (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, l= vl, lflags); 
+    si.xch =3D xc_interf= ace_open(l, 0, 0); 
+    if (!si.xch)&n= bsp;
+        errx(1, "failed to open control = interface"); 
+ 
 =    si.xce =3D xc_evtchn_open(NULL, 0); 
&n= bsp;        warnx("failed to open event channel handle"= ); 

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
in this code change lflags to&n= bsp; lflags =3D XT= L_STDIOSTREAM_HIDE_PROGRESS; a= nd i don't know = what mean's @@ -185,6 +183,13 @@ main(int argc, char **argv)  =  ?!!

 so i= delete @@ -185,6 +183,13 @@ main(int argc, char **argv)=  from code and test logger (to live m= igration of  VM) But= again result output in xend.log don't change.
 
 
Adel Amani
M.Sc. Candidate@Computer Engineering Departm= ent, University of Isfahan
Email: A.Amani@eng.ui.ac.ir


<= font size=3D"2" face=3D"Arial"> On Wednesday, February 19, 2014 5:42 PM, Ol= af Hering <olaf@aepfle.de> wrote:
On Tue, Feb 18, Adel Amani wrote:

> Hi
> i know because a lot of product output in xen-4.1, no = logger in xc_save.c
> i change code again according to= "http://xen.1045712.n5.nabble.com/
> xen-unst= able-tools-xc-restore-logging-in-xc-save-td5714324.html"
= > But i don't know purpose Mr "patchbot" of
> @@ -= 185,6 +183,13 @@ main(int argc, char **argv)
> i test = again to code Mr "patchbot" without Consideration
> @= @ -185,6 +183,13 @@ main(int argc, char **argv)
> and = result again no message :-( ....


All that is very imprecise, so we can not help.
Also read what I wrote: dont drop xen-devel@= lists.xen.org

Olaf




> On Saturday, February 8, 2014 1:52 AM, Olaf Hering <olaf@aepfle.de> wrote:
> Please keep xen-devel@lists.xen.org in CC list.
>
> On Fri, Feb 07, Adel Amani wrote:
>
> > yes, for print data, function p= rint_stats() in xc_domain_save.c should run
> and
> > work. I read in function and check.... But i don't = know really why this don't
> > work!!! :-|... I tes= t 'fprintf(stderr,"STDERR\n"); fprintf(stdout,"STDOUT\
&g= t; n");'
> > But again not answer :'(.....
>
> P= lease make sure the self-compiled binary is actually used. Try this to
> verify: grep STDERR /usr/lib/xen/bin/xc_save (assuming t= he fprintf above
> is actually in the compiled code.)<= br clear=3D"none">>
> > how boot the domU with = 'initcall_debug'?! Are affect on total time?!
>
> This is a kernel cmdline option. Please check the documen= tation about
> how to pass additional kernel parameter= s to a domU.
>
>
> Olaf
>
>


---337026386-468065670-1392967119=:28200-- --===============8624475629277257537== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============8624475629277257537==--