xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Questions about LOG system
@ 2012-02-14  7:03 李春奇 <Chunqi Li>
  2012-02-14  9:25 ` Ian Campbell
  0 siblings, 1 reply; 6+ messages in thread
From: 李春奇 <Chunqi Li> @ 2012-02-14  7:03 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 814 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 1185 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* Re: Questions about LOG system
  2012-02-14  7:03 Questions about LOG system 李春奇 <Chunqi Li>
@ 2012-02-14  9:25 ` Ian Campbell
  2012-02-15  6:40   ` 李春奇 <Chunqi Li>
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2012-02-14  9:25 UTC (permalink / raw)
  To: 李春奇 <Chunqi Li>; +Cc: xen-devel@lists.xensource.com

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
http://lists.xensource.com/xen-devel

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

* Re: Questions about LOG system
  2012-02-14  9:25 ` Ian Campbell
@ 2012-02-15  6:40   ` 李春奇 <Chunqi Li>
  2012-02-15  8:32     ` Ian Campbell
  0 siblings, 1 reply; 6+ messages in thread
From: 李春奇 <Chunqi Li> @ 2012-02-15  6:40 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel@lists.xensource.com


[-- Attachment #1.1: Type: text/plain, Size: 1149 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 1650 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* Re: Questions about LOG system
  2012-02-15  6:40   ` 李春奇 <Chunqi Li>
@ 2012-02-15  8:32     ` Ian Campbell
  2012-02-15  9:49       ` 李春奇 <Chunqi Li>
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2012-02-15  8:32 UTC (permalink / raw)
  To: 李春奇 <Chunqi Li>; +Cc: xen-devel@lists.xensource.com

Please do not top post. http://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
http://lists.xensource.com/xen-devel

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

* Re: Questions about LOG system
  2012-02-15  8:32     ` Ian Campbell
@ 2012-02-15  9:49       ` 李春奇 <Chunqi Li>
  2012-02-15 10:07         ` Ian Campbell
  0 siblings, 1 reply; 6+ messages in thread
From: 李春奇 <Chunqi Li> @ 2012-02-15  9:49 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel@lists.xensource.com


[-- Attachment #1.1: Type: text/plain, Size: 1122 bytes --]

On Wed, Feb 15, 2012 at 4:32 PM, Ian Campbell <Ian.Campbell@citrix.com>wrote:

> Please do not top post. http://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

[-- Attachment #1.2: Type: text/html, Size: 1668 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* Re: Questions about LOG system
  2012-02-15  9:49       ` 李春奇 <Chunqi Li>
@ 2012-02-15 10:07         ` Ian Campbell
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2012-02-15 10:07 UTC (permalink / raw)
  To: 李春奇 <Chunqi Li>; +Cc: xen-devel@lists.xensource.com

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.
>         http://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
http://lists.xensource.com/xen-devel

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

end of thread, other threads:[~2012-02-15 10:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-14  7:03 Questions about LOG system 李春奇 <Chunqi Li>
2012-02-14  9:25 ` Ian Campbell
2012-02-15  6:40   ` 李春奇 <Chunqi Li>
2012-02-15  8:32     ` Ian Campbell
2012-02-15  9:49       ` 李春奇 <Chunqi Li>
2012-02-15 10:07         ` Ian Campbell

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).