dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/engine dumpconfig.c, NONE, 1.1 Makefile.


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/engine dumpconfig.c, NONE, 1.1 Makefile.am, 1.62, 1.63 ilrun.c, 1.38, 1.39 cvm_config.h, 1.7, 1.8
Date: Tue, 22 Jul 2003 07:10:33 -0400

Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv756/engine

Modified Files:
        Makefile.am ilrun.c cvm_config.h 
Added Files:
        dumpconfig.c 
Log Message:
Add the -D or --dump-config option to ilrun for easier bug reporting


--- NEW FILE ---
#include "il_config.h"
#include <stdio.h>
#ifdef HAVE_STRING_H
        #include <string.h>
#endif
#ifdef HAVE_SYS_UTSNAME_H
        #include <sys/utsname.h>
#endif
#include "engine_private.h"
#include "lib_defs.h"
#include "cvm.h"
#include "cvm_config.h"

#ifndef IL_CONFIG_REDUCE_CODE

static void PrintFormatted(FILE *stream, const char* left, const char * right)
{
        const int columnWidth=30;
        int spaces=columnWidth-strlen(left);
        fprintf(stream,left);
        while((spaces-- >= 0)) fputc(' ',stream);
        if(right)
        {
                fputs(": ",stream);
                /* Note: Ugly hack to capitalize first word of const string */
                if((right[0] >='a') && (right[0]<='z'))
                {
                        fputc(right[0]-'a'+'A',stream);
                        right++;
                }
                fprintf(stream,"%s\n",right);
        }
        else
        {
                fprintf(stream,":");
        }
}

int _ILDumpConfig(FILE *stream,int level)
{
#ifdef HAVE_UNAME
        struct utsname buf;
#endif
        PrintFormatted(stream,"Engine Version",VERSION);
        PrintFormatted(stream,"Engine Flavour",IL_CVM_FLAVOUR);

#ifdef HAVE_UNAME
        if(uname(&buf)==0)
        {
                PrintFormatted(stream,"Platform Info", NULL);
                fprintf(stream, " %s %s %s\n", buf.sysname, buf.release, 
buf.machine);
        }
#endif

#ifdef __DATE__
        #ifdef __TIME__
                PrintFormatted(stream,"Compiled On",NULL);
                fprintf(stream," %s %s (local)\n",__DATE__,__TIME__);
        #else
                PrintFormatted(stream,"Compiled On",__DATE__);
        #endif
#endif

#ifdef HAVE_COMPUTED_GOTO
        #ifdef HAVE_PIC_COMPUTED_GOTO
                PrintFormatted(stream,"Computed Goto","Yes (PIC)");
        #else
                PrintFormatted(stream,"Computed Goto","Yes");
        #endif
#else
        PrintFormatted(stream,"Computed Goto","No");
#endif

#ifdef CVM_LITTLE_ENDIAN
        PrintFormatted(stream,"Endian-ness","Little Endian");
#else
        PrintFormatted(stream,"Endian-ness","Big Endian");
#endif

        if(level > 1)
        {
                PrintFormatted(stream,"Fast Moves",NULL);
        #if defined(CVM_LONGS_ALIGNED_WORD) || defined(CVM_REALS_ALIGNED_WORD) 
|| \
                defined(CVM_DOUBLES_ALIGNED_WORD) 
                                
                #ifdef CVM_LONGS_ALIGNED_WORD
                        fprintf(stream," longs");
                #endif
                #ifdef CVM_REALS_ALIGNED_WORD
                        fprintf(stream," floats");
                #endif
                #ifdef CVM_DOUBLES_ALIGNED_WORD
                        fprintf(stream," doubles");
                #endif
                fprintf(stream,"\n");
        #else
                fprintf(stream," None\n");
        #endif

        /* There was no way I could put that in cvm_config.h */
        #if defined(CVM_X86) || defined(CVM_ARM) || defined(CVM_PPC)
                #if defined(CVM_X86) && defined(__GNUC__) && !defined(IL_NO_ASM)
                        PrintFormatted(stream,"Manual Register Allocation",
                                                                                
"Yes (esi,edi,ebx)");
                #endif
                        
                #if defined(CVM_ARM) && defined(__GNUC__) && !defined(IL_NO_ASM)
                        PrintFormatted(stream,"Manual Register Allocation",
                                                                                
"Yes (r4,r5,r6)");
                #endif
                
                #if defined(CVM_PPC) && defined(__GNUC__) && !defined(IL_NO_ASM)
                        PrintFormatted(stream,"Manual Register Allocation",
                                                                                
"Yes (r18,r19,r20)");
                #endif
                #if !defined(__GNUC__) || defined(IL_NO_ASM)
                        PrintFormatted(stream,"Manual Register 
Allocation","No");
                #endif
        #else 
                PrintFormatted(stream,"Manual Register Allocation","No");
        #endif
        }

#ifdef HAVE_LIBGC
        PrintFormatted(stream,"Garbage Collector","Boehm");
#else
        PrintFormatted(stream,"Garbage Collector","No");
#endif

#ifdef HAVE_LIBFFI
        PrintFormatted(stream, "Libffi", "Yes");
#else
        PrintFormatted(stream, "Libffi", "No");
#endif

#if defined(GC_LINUX_THREADS) || defined(GC_WIN32_THREADS) \
 || defined(GC_HPUX_THREADS) || defined (GC_FREEBSD_THREADS) \
 || defined(GC_SOLARIS_THREADS)
        PrintFormatted(stream, "Threading",  "Enabled");
#else
        PrintFormatted(stream, "Threading",  "Disabled");
#endif

        if(level>1)
        {
        #ifdef USE_HASHING_MONITORS
                PrintFormatted(stream,"Monitor Implementation","Thin-locks");
        #else
                PrintFormatted(stream,"Monitor Implementation","Standard");
        #endif
        }

#ifdef BUILD_PROFILE_NAME
        PrintFormatted(stream,"Build Profile", ""BUILD_PROFILE_NAME"");
#endif

        if(level>1)
        {
        /* Profile options */
        
        #ifdef IL_CONFIG_FP_SUPPORTED
                PrintFormatted(stream, "Floating Points", "Enabled");
        #else
                PrintFormatted(stream, "Floating Points", "Disabled");
        #endif
        
        #ifdef IL_CONFIG_EXTENDED_NUMERICS
                PrintFormatted(stream, "Extended Numerics", "Enabled");
        #else
                PrintFormatted(stream, "Extended Numerics", "Disabled");
        #endif
        
        #ifdef IL_CONFIG_NON_VECTOR_ARRAYS
                PrintFormatted(stream, "Multi-Dimensional Arrays", "Enabled");
        #else
                PrintFormatted(stream, "Multi-Dimensional Arrays", "Disabled");
        #endif
                
        #ifdef IL_CONFIG_FILESYSTEM
                PrintFormatted(stream, "Filesystem Access", "Enabled");
        #else
                PrintFormatted(stream, "Filesystem Access", "Disabled");
        #endif
        
        #ifdef IL_CONFIG_NETWORKING
                PrintFormatted(stream, "Networking", "Enabled");
        #else
                PrintFormatted(stream, "Networking", "Disabled");
        #endif
        
        #ifdef IL_CONFIG_LATIN1
                PrintFormatted(stream, "Internationlization", "Disabled");
        #else
                PrintFormatted(stream, "Internationlization", "Enabled");
        #endif
        
        #ifdef IL_CONFIG_DEBUG_LINES
                PrintFormatted(stream,"Debug Support","Enabled");
        #else
                PrintFormatted(stream,"Debug Support","Disabled");
        #endif
        
        #ifdef IL_CONFIG_PINVOKE
                PrintFormatted(stream, "PInvoke Support", "Enabled");
        #else
                PrintFormatted(stream, "PInvoke Support", "Disabled");
        #endif
                
        #ifdef IL_CONFIG_REFLECTION
                PrintFormatted(stream, "Reflection Support", "Enabled");
        #else
                PrintFormatted(stream, "Reflection Support", "Disabled");
        #endif
        
        #ifdef IL_CONFIG_APPDOMAINS
                PrintFormatted(stream, "Appdomain Support", "Enabled");
        #else
                PrintFormatted(stream, "Appdomain Support", "Disabled");
        #endif
                
        #ifdef IL_CONFIG_REMOTING
                PrintFormatted(stream, "Remoting Support", "Enabled");
        #else
                PrintFormatted(stream, "Remoting Support", "Disabled");
        #endif
        }
        return 0;
}
#endif

Index: Makefile.am
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/Makefile.am,v
retrieving revision 1.62
retrieving revision 1.63
diff -C2 -r1.62 -r1.63
*** Makefile.am 12 Jul 2003 10:52:38 -0000      1.62
--- Makefile.am 22 Jul 2003 11:10:31 -0000      1.63
***************
*** 11,14 ****
--- 11,15 ----
                                                cvm_lengths.c \
                                                cvmc.c \
+                                               dumpconfig.c \
                                                heap.c \
                                                internal.c \
***************
*** 74,78 ****
  ## 'ffi.h' is autogenerated; thus, goes into build tree.
  AM_CFLAGS = -I$(top_srcdir)/libffi/include $(NO_GCSE) $(NO_INLINE_FUNCTIONS) \
!                       -I$(top_srcdir)/include -I../libffi/include -I.
  
  else
--- 75,79 ----
  ## 'ffi.h' is autogenerated; thus, goes into build tree.
  AM_CFLAGS = -I$(top_srcdir)/libffi/include $(NO_GCSE) $(NO_INLINE_FUNCTIONS) \
!                       -I$(top_srcdir)/include -I../libffi/include -I. 
-DBUILD_PROFILE_NAME="\"$(PROFILE_NAME)\""
  
  else

Index: ilrun.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/ilrun.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** ilrun.c     21 Jul 2003 07:31:56 -0000      1.38
--- ilrun.c     22 Jul 2003 11:10:31 -0000      1.39
***************
*** 52,55 ****
--- 52,60 ----
  int _ILDumpMethodProfile(FILE *stream, ILExecProcess *process);
  
+ /*
+  * Imports from "dumpconfig.c"
+  */
+ void _ILDumpConfig(FILE *stream,int level);
+ 
  #endif
  
***************
*** 105,108 ****
--- 110,115 ----
        {"-P", 'P', 0, 0, 0},
        {"--dump-params", 'P', 0, 0, 0},
+       {"-D", 'D', 0, 0, 0},
+       {"--dump-config", 'D', 0, 0, 0},
  #endif
  
***************
*** 161,164 ****
--- 168,172 ----
        int dumpMethodProfile = 0;
        int dumpParams = 0;
+       int dumpConfig = 0;
  #endif
  
***************
*** 253,256 ****
--- 261,270 ----
                        }
                        break;
+ 
+                       case 'D':
+                       {
+                               dumpConfig+=1;
+                       }
+                       break;
                #endif
  
***************
*** 286,289 ****
--- 300,309 ----
        {
                return _ILUnregisterFromKernel();
+       }
+ 
+       if(dumpConfig!=0)
+       {
+               _ILDumpConfig(stdout,dumpConfig);
+               return 0;
        }
  

Index: cvm_config.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cvm_config.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** cvm_config.h        13 Jul 2003 01:53:55 -0000      1.7
--- cvm_config.h        22 Jul 2003 11:10:31 -0000      1.8
***************
*** 102,105 ****
--- 102,106 ----
        #ifdef IL_CVM_DIRECT_ALLOWED
                #define IL_CVM_DIRECT
+               #define IL_CVM_FLAVOUR "Direct Threaded"
                #if defined(PIC) && defined(HAVE_PIC_COMPUTED_GOTO)
                        #define IL_CVM_PIC_DIRECT
***************
*** 107,110 ****
--- 108,112 ----
        #else
                #define IL_CVM_TOKEN
+               #define IL_CVM_FLAVOUR "Token Threaded"
                #if defined(PIC) && defined(HAVE_PIC_COMPUTED_GOTO)
                        #define IL_CVM_PIC_TOKEN
***************
*** 113,116 ****
--- 115,119 ----
  #else /* !HAVE_COMPUTED_GOTO */
        #define IL_CVM_SWITCH
+       #define IL_CVM_FLAVOUR "Switch Loop"
  #endif /* !HAVE_COMPUTED_GOTO */
  
***************
*** 185,188 ****
--- 188,192 ----
  #define       IL_CVM_DIRECT_UNROLLED_X86
  #define       IL_CVM_DIRECT_UNROLLED
+ #define       IL_CVM_FLAVOUR "Direct Unrolled (x86)"
  #endif
  #if defined(IL_CVM_DIRECT) && defined(CVM_ARM) && \
***************
*** 193,196 ****
--- 197,201 ----
  #define       IL_CVM_DIRECT_UNROLLED_ARM
  #define       IL_CVM_DIRECT_UNROLLED
+ #define       IL_CVM_FLAVOUR "Direct Unrolled (ARM)"
  #endif
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]