Re: [evlog-dev] EVLOG 1.6.1 vs. ARM/XSCALE

Hien Q Nguyen <[email protected]> Wed, 5 Jan 2005 16:41:51 -0800
Newsgroups gmane.linux.kernel.event-logging
Message-ID <OFAACA4300.E00A6487-ON88256F81.0003B780-88256F81.0003D523@us.ibm.com>
This is a multipart message in MIME format.
--=_alternative 0003D49388256F81_=
Content-Type: text/plain; charset="US-ASCII"

Mark,

Thanks for the update. I will look at your patches soon.

Thanks, Hien.

Hien Nguyen
[email protected]
(503) 578-4347



Mark Bellon <[email protected]> 
Sent by: [email protected]
01/05/2005 02:43 PM

To
[email protected]
cc

Subject
[evlog-dev] EVLOG 1.6.1 vs. ARM/XSCALE






Most of the work I did was against the previous version, 1.5.3, with 
checking against 1.6.0 and then submitting patches. Now that 1.6.1 is 
available with everything is integrated I'm verifying the ARM/SXSCALE 
support. This may take me a bit...

I work in a cross and native environment with i386, ARM/XSCALE, PPC and 
X86_64 architectures. Please tell me about your environment - 
distribution, 2.4.x/2.6.x, compiler versions and so forth.

There are a few problems in a cross environment.

Insuring that autoconfig is version 2.58 or later is the first trick. 
This requires that one first update to 2.57b first; install it and then 
build and install 2.58.

I found a bug in the generated ltmain.sh that screwed up my PPC 
environment; since it was already in my fixes I didn't try the 
ARM/XSCALE environment without it. I attach a patch but this really 
isn't an EVLOG issue so YMMV.

I've had some troubles with GCC 3.4.2 with the EVLOG 1.6.1 source. The 
new compiler is notoriously fussy. I attach the patch that I have 
submitted for evaluation and eventual integration.

More later,

mark

--- ltmain-save          2003-11-17 09:27:37.000000000 -0700
+++ ltmain.sh            2003-11-17 09:33:02.000000000 -0700
@@ -1716,6 +1716,7 @@
                       break
                     fi
                   done
+                  found=no
                   if test "$found" != yes; then
                     # deplib doesn't seem to be a libtool library
                     if test "$linkmode,$pass" = "prog,link"; then
diff -Naur evlog-1.6.1-orig/user/include/evlog.h 
evlog-1.6.1/user/include/evlog.h
--- evlog-1.6.1-orig/user/include/evlog.h                2004-12-28 
15:37:31.000000000 -0700
+++ evlog-1.6.1/user/include/evlog.h             2005-01-05 
14:47:09.000000000 -0700
@@ -191,8 +191,6 @@
    char file[128];
 };
 
-#define _EVLOG_POS { __LINE__, __FUNCTION__, __FILE__ }
-
 struct evlog_info {
    char format[128+64];
    char facility[64];
@@ -201,9 +199,13 @@
 
 #define syslogat(priority, fmt, ...) \
     do { \
-                static struct evlog_info 
__attribute__((section(".log"),unused)) ___ \
-                                = { fmt, __stringify(EVL_FACILITY_NAME), 
_EVLOG_POS }; \
+                static struct evlog_info 
__attribute__((section(".log"),unused)) ___; \
                 char *unbraced_fmt = _evl_unbrace(fmt); \
+                (void) strncpy(___.format, fmt, sizeof(___.format)); \
+                (void) strncpy(___.facility, 
__stringify(EVL_FACILITY_NAME), sizeof(___.facility)); \
+                ___.pos.line = __LINE__; \
+                (void) strncpy(___.pos.function, __FUNCTION__, 
sizeof(___.pos.function)); \
+                (void) strncpy(___.pos.file, __FILE__, 
sizeof(___.pos.file)); \
                 if (_evl_syslogat(priority, 
__stringify(EVL_FACILITY_NAME), \
                     evl_gen_event_type(__FILE__, __FUNCTION__, fmt), \
                     fmt, unbraced_fmt, ##__VA_ARGS__) != 1) \
diff -Naur evlog-1.6.1-orig/user/lib/template/convert.c 
evlog-1.6.1/user/lib/template/convert.c
--- evlog-1.6.1-orig/user/lib/template/convert.c 2004-12-15 
10:05:46.000000000 -0700
+++ evlog-1.6.1/user/lib/template/convert.c              2005-01-05 
14:47:37.000000000 -0700
@@ -244,7 +244,7 @@
 memcpy(data, tmp, dest_size);
                                                 }
                                                 break;
-    default:
+                                default: /* make gcc happy */ ;
                 }
 }
 
diff -Naur evlog-1.6.1-orig/user/lib/util/format.c 
evlog-1.6.1/user/lib/util/format.c
--- evlog-1.6.1-orig/user/lib/util/format.c              2004-04-29 
17:27:56.000000000 -0700
+++ evlog-1.6.1/user/lib/util/format.c           2005-01-05 
14:56:06.000000000 -0700
@@ -286,7 +286,7 @@
                                 seg->u.fs_attname = nsaName;
                                 seg->u2.fs_attribute = NULL;
                                 break;
-  default:
+                default: /* make gcc happy */ ;
                 }
                 seg->fs_userfmt = attrFmt;
                 if (attrFmt
@@ -475,7 +475,7 @@
                                                  */
                                                 size += 
_evlGetMaxDumpLen();
                                                 break;
-    default:
+                                default: /* make gcc happy */ ;
                                 }
                                 p = p->li_next;
                 } while (p != head);
@@ -667,7 +667,7 @@
                 case TY_INT:                            return TY_UINT;
                 case TY_LONG:                           return TY_ULONG;
                 case TY_LONGLONG:               return TY_ULONGLONG;
-  default:
+                default: /* make gcc happy */ ;
                 }
                 return ty;
 }


--=_alternative 0003D49388256F81_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Mark,</font>
<br>
<br><font size=2 face="sans-serif">Thanks for the update. I will look at
your patches soon.</font>
<br>
<br><font size=2 face="sans-serif">Thanks, Hien.</font>
<br><font size=2 face="sans-serif"><br>
Hien Nguyen<br>
[email protected]<br>
(503) 578-4347</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Mark Bellon &lt;[email protected]&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: [email protected]</font>
<p><font size=1 face="sans-serif">01/05/2005 02:43 PM</font>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">[email protected]</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">[evlog-dev] EVLOG 1.6.1 vs.
ARM/XSCALE</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>Most of the work I did was against the previous version,
1.5.3, with <br>
checking against 1.6.0 and then submitting patches. Now that 1.6.1 is <br>
available with everything is integrated I'm verifying the ARM/SXSCALE <br>
support. This may take me a bit...<br>
<br>
I work in a cross and native environment with i386, ARM/XSCALE, PPC and
<br>
X86_64 architectures. Please tell me about your environment - <br>
distribution, 2.4.x/2.6.x, compiler versions and so forth.<br>
<br>
There are a few problems in a cross environment.<br>
<br>
Insuring that autoconfig is version 2.58 or later is the first trick. <br>
This requires that one first update to 2.57b first; install it and then
<br>
build and install 2.58.<br>
<br>
I found a bug in the generated ltmain.sh that screwed up my PPC <br>
environment; since it was already in my fixes I didn't try the <br>
ARM/XSCALE environment without it. I attach a patch but this really <br>
isn't an EVLOG issue so YMMV.<br>
<br>
I've had some troubles with GCC 3.4.2 with the EVLOG 1.6.1 source. The
<br>
new compiler is notoriously fussy. I attach the patch that I have <br>
submitted for evaluation and eventual integration.<br>
<br>
More later,<br>
<br>
mark<br>
<br>
--- ltmain-save &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; 2003-11-17 09:27:37.000000000 -0700<br>
+++ ltmain.sh &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; 2003-11-17 09:33:02.000000000 -0700<br>
@@ -1716,6 +1716,7 @@<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;break<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;fi<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;done<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; found=no<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;if test &quot;$found&quot; != yes; then<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;# deplib doesn't seem to be a libtool library<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;if test &quot;$linkmode,$pass&quot; = &quot;prog,link&quot;;
then<br>
diff -Naur evlog-1.6.1-orig/user/include/evlog.h evlog-1.6.1/user/include/evlog.h<br>
--- evlog-1.6.1-orig/user/include/evlog.h &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 2004-12-28 15:37:31.000000000 -0700<br>
+++ evlog-1.6.1/user/include/evlog.h &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 2005-01-05 14:47:09.000000000 -0700<br>
@@ -191,8 +191,6 @@<br>
 &nbsp; &nbsp;char file[128];<br>
 };<br>
 <br>
-#define _EVLOG_POS { __LINE__, __FUNCTION__, __FILE__ }<br>
-<br>
 struct evlog_info {<br>
 &nbsp; &nbsp;char format[128+64];<br>
 &nbsp; &nbsp;char facility[64];<br>
@@ -201,9 +199,13 @@<br>
 <br>
 #define syslogat(priority, fmt, ...) \<br>
 &nbsp; &nbsp; do { \<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
static struct evlog_info __attribute__((section(&quot;.log&quot;),unused))
___ \<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
{ fmt, __stringify(EVL_FACILITY_NAME), _EVLOG_POS }; \<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
static struct evlog_info __attribute__((section(&quot;.log&quot;),unused))
___; \<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;char
*unbraced_fmt = _evl_unbrace(fmt); \<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
(void) strncpy(___.format, fmt, sizeof(___.format)); \<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
(void) strncpy(___.facility, __stringify(EVL_FACILITY_NAME), sizeof(___.facility));
\<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
___.pos.line = __LINE__; \<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
(void) strncpy(___.pos.function, __FUNCTION__, sizeof(___.pos.function));
\<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
(void) strncpy(___.pos.file, __FILE__, sizeof(___.pos.file)); \<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if
(_evl_syslogat(priority, __stringify(EVL_FACILITY_NAME), \<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;evl_gen_event_type(__FILE__, __FUNCTION__, fmt), \<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;fmt, unbraced_fmt, ##__VA_ARGS__) != 1) \<br>
diff -Naur evlog-1.6.1-orig/user/lib/template/convert.c evlog-1.6.1/user/lib/template/convert.c<br>
--- evlog-1.6.1-orig/user/lib/template/convert.c &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 2004-12-15 10:05:46.000000000 -0700<br>
+++ evlog-1.6.1/user/lib/template/convert.c &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 2005-01-05 14:47:37.000000000 -0700<br>
@@ -244,7 +244,7 @@<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
memcpy(data, tmp, dest_size);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br>
- &nbsp; &nbsp;default:<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;default:
/* make gcc happy */ ;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 }<br>
 <br>
diff -Naur evlog-1.6.1-orig/user/lib/util/format.c evlog-1.6.1/user/lib/util/format.c<br>
--- evlog-1.6.1-orig/user/lib/util/format.c &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 2004-04-29 17:27:56.000000000 -0700<br>
+++ evlog-1.6.1/user/lib/util/format.c &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 2005-01-05 14:56:06.000000000 -0700<br>
@@ -286,7 +286,7 @@<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
seg-&gt;u.fs_attname = nsaName;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
seg-&gt;u2.fs_attribute = NULL;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
break;<br>
- &nbsp;default:<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
default: /* make gcc happy */ ;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;seg-&gt;fs_userfmt
= attrFmt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if
(attrFmt<br>
@@ -475,7 +475,7 @@<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
*/<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;size
+= _evlGetMaxDumpLen();<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br>
- &nbsp; &nbsp;default:<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;default:
/* make gcc happy */ ;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
}<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
p = p-&gt;li_next;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}
while (p != head);<br>
@@ -667,7 +667,7 @@<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case
TY_INT: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return
TY_UINT;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case
TY_LONG: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return
TY_ULONG;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case
TY_LONGLONG: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
return TY_ULONGLONG;<br>
- &nbsp;default:<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
default: /* make gcc happy */ ;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return
ty;<br>
 }<br>
</tt></font>
<br>
--=_alternative 0003D49388256F81_=--


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt