Hi all, When I''m reading code of Xen and I can''t find the exact LOG file written by each log-writing code, so I have some trouble with debugging. I have found 8 type of LOG managed by xen-4.0 or later, #define LOG_EMERG 0 #define LOG_ALERT 1 #define LOG_CRIT 2 #define LOG_ERR 3 #define LOG_WARNING 4 #define LOG_NOTICE 5 #define LOG_INFO 6 #define LOG_DEBUG and there are three frequently used macro for logging: #define DPRINTF(_f, _a...) syslog(LOG_INFO, _f, ##_a) #define EPRINTF(_f, _a...) syslog(LOG_ERR, "tap-err:%s: " _f, __func__, ##_a) #define PERROR(_f, _a...) syslog(LOG_ERR, "tap-err:%s: " _f ": %s", __func__, ##_a, \ strerror(errno) Who can tell me which file match these log type above? Thank you. -- Chunqi Li Department of Computer Science School of EECS Peking University Beijing, China _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com lists.xensource.com/xen-devel
On Tue, 2012-02-14 at 07:03 +0000, 李春奇 wrote: [...]> and there are three frequently used macro for logging: > #define DPRINTF(_f, _a...) syslog(LOG_INFO, _f, ##_a)Syslog is a standard Unix function (SUSv2 and/or POSIX IIRC) and not something specific to Xen. Google or "man -k" should be able to find you more details of this and related functions.> Who can tell me which file match these log type above? Thank you.The final location will depend somewhat on your distro's configuration, it's likely to be somewhere under /var/log. A distro specific list or forum would be a more appropriate place to pursue this. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com lists.xensource.com/xen-devel
Well, I have found the wrong code. The macro DPRINTF points to #define DPRINTF(_f, _a...) xc_report(xch, xch->error_handler, XTL_DETAIL, 0, _f, ## -a) So is this Xen''s private log system ? Where messages write via xc_report and xc_report_error function? Thank you. On Tue, Feb 14, 2012 at 5:25 PM, Ian Campbell <Ian.Campbell@citrix.com>wrote:> On Tue, 2012-02-14 at 07:03 +0000, 李春奇 wrote: > [...] > > and there are three frequently used macro for logging: > > #define DPRINTF(_f, _a...) syslog(LOG_INFO, _f, ##_a) > > Syslog is a standard Unix function (SUSv2 and/or POSIX IIRC) and not > something specific to Xen. Google or "man -k" should be able to find you > more details of this and related functions. > > > Who can tell me which file match these log type above? Thank you. > > The final location will depend somewhat on your distro''s configuration, > it''s likely to be somewhere under /var/log. A distro specific list or > forum would be a more appropriate place to pursue this. > > Ian. > > > >-- Chunqi Li Department of Computer Science School of EECS Peking University Beijing, China _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com lists.xensource.com/xen-devel
Please do not top post. wiki.xen.org/wiki/AskingXenDevelQuestions On Wed, 2012-02-15 at 06:40 +0000, 李春奇 wrote:> Well, I have found the wrong code. > The macro DPRINTF points to > #define DPRINTF(_f, _a...) xc_report(xch, xch->error_handler, > XTL_DETAIL, 0, _f, ## -a) > So is this Xen's private log system ? Where messages write via > xc_report and xc_report_error function?You should have been able to find these functions by using "grep" or other similar tools (hint: look under tools/libxc). Had you done so you would have found that they use the xtl logger infrastructure. xch->error_handler is the logger passed to xc_interface_open(), the behaviour of which is documented in the header. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com lists.xensource.com/xen-devel
On Wed, Feb 15, 2012 at 4:32 PM, Ian Campbell <Ian.Campbell@citrix.com>wrote:> Please do not top post. wiki.xen.org/wiki/AskingXenDevelQuestions > > On Wed, 2012-02-15 at 06:40 +0000, 李春奇 wrote: > > Well, I have found the wrong code. > > The macro DPRINTF points to > > #define DPRINTF(_f, _a...) xc_report(xch, xch->error_handler, > > XTL_DETAIL, 0, _f, ## -a) > > So is this Xen''s private log system ? Where messages write via > > xc_report and xc_report_error function? > > You should have been able to find these functions by using "grep" or > other similar tools (hint: look under tools/libxc). > > Had you done so you would have found that they use the xtl logger > infrastructure. xch->error_handler is the logger passed to > xc_interface_open(), the behaviour of which is documented in the header. > > Ian. > > > >I have found these codes. Then how can I change the position of xen tool log or change the log level? I found it may be separated with Xend log. Thanks. -- Chunqi Li Department of Computer Science School of EECS Peking University Beijing, China _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com lists.xensource.com/xen-devel
On Wed, 2012-02-15 at 09:49 +0000, 李春奇 wrote:> > > On Wed, Feb 15, 2012 at 4:32 PM, Ian Campbell > <Ian.Campbell@citrix.com> wrote: > Please do not top post. > wiki.xen.org/wiki/AskingXenDevelQuestions > > On Wed, 2012-02-15 at 06:40 +0000, 李春奇 wrote: > > Well, I have found the wrong code. > > The macro DPRINTF points to > > #define DPRINTF(_f, _a...) xc_report(xch, > xch->error_handler, > > XTL_DETAIL, 0, _f, ## -a) > > So is this Xen's private log system ? Where messages write > via > > xc_report and xc_report_error function? > > > You should have been able to find these functions by using > "grep" or > other similar tools (hint: look under tools/libxc). > > Had you done so you would have found that they use the xtl > logger > infrastructure. xch->error_handler is the logger passed to > xc_interface_open(), the behaviour of which is documented in > the header. > > Ian. > > > > > I have found these codes. Then how can I change the position of xen > tool log or change the log level? I found it may be separated with > Xend log.Note that xend is deprecated. All new development should be based on xl and libxl. You'd have to change the code. If xend is involved then will likely including enhancing the python bindings for libxc (tools/python/.../xc) to support changing these options, or you could just hack the options you want into the C part of bindings and not worry about the python side. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com lists.xensource.com/xen-devel