Re: [Mono-list] [Mono-dev] Mono preview 2.0 binary and DTrace

2008-08-04 Thread Massimiliano Mantione

On Sun, 2008-08-03 at 21:57 +0200, Andreas Färber wrote:
> What I will be looking into next is method-enter/method-exit probes  
> for tracing managed function flow, but it seems more complicated (the  
> JIT would need to always emit a call to a helper function, supplying  
> it the data to conditionally pass out - otherwise the dynamic part of  
> DTrace wouldn't work) and thus cannot be on by default for performance  
> reasons, just like in Java.

IMO, the correct way of doing this would be to implement it in a
profiler module, and it's amazingly easy doing so.

But actually the logging profiler does just that if you invoke it with
the "c" option: it logs all method enter and exit events.
It uses per-thread buffers (periodically flushed) to minimize overhead
and locking, each event takes between 2 and 5 bytes in the log file
(including the full timestamp!), and even this way the overhead is
really high.
I doubt dtrace could be any faster... but if it is I'd like to know how
it does it :-)

What the profiler misses, in this case, is a GUI that is oriented
towards "browsing the log", maybe with a timeline, showing the threads
in parallel, and with a filter and fast search functions...

The data is all in the log, the problem is those log files can take
several hundreds of Mb on disk (with the events compacted that way), so
IMO keeping all the data in RAM in the GUI would be the wrong approach
(because each event would take much more than 5 bytes!).
This is the main reason why this kind of tool has not yet been written:
doing it well for the general case (a typical program run during more
than ten minutes) is not trivial.

But if you need only one line in a text file for each method enter-exit,
take the Mono.Profiler code, put a couple of WriteLine inside
MethodEnter and MethodExit in the EventProcessor, be sure to print also
"stack.Depth", and you have your trace :-)
As a bonus, if you want to be able to distinguish threads, also print
"stack.ThreadId".
It is worse than "mono --trace" because you don't have the method
arguments, but it is much more efficient during execution so there are
more cases when this is actually doable.

I *know* this is not dtrace, it does not profile the whole system but
only Mono... but this works also on Linux.

Ciao,
  Massi


___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Mono preview 2.0 binary and DTrace

2008-08-04 Thread Zoltan Varga
Hi,

  On mono HEAD, dtrace is now enabled under solaris and macosx if the
dtrace utility is
detected by configure.

   Zoltan

On Sun, Aug 3, 2008 at 4:08 PM, Andreas Färber <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Are you talking of the once announced binary snapshots of trunk
> Mono.framework, so that you would make some Novell-internal setting to
> configure with --enable-dtrace?
>
> Or do you suggest me to change trunk's configure.in to enable DTrace when
> specifically Mac OS X v10.5+ is detected and no --disable-dtrace was passed?
> Changes other than that I am skeptical about.
>
> Btw Universal Binaries shouldn't be a problem, since iirc you use lipo to
> combine two separate builds and the mono.d file would be
> platform-independent so no special handling necessary.
>
> Andreas
>
> Am 02.08.2008 um 20:14 schrieb Geoff Norton:
>
>> Zoltan,
>>
>>  I'm fine with this on trunk, but I still think barring any compelling
>> reason we should leave the branch as is.
>>
>> -g
>>
>> On Sat, 2008-08-02 at 19:20 +0200, Zoltan Varga wrote:
>>>
>>> Hi,
>>>
>>>  Looking at dtrace.h, all the current probes seem to be in
>>> non-critical code-paths, so they
>>> are unlikely to have a perf impact. We could make --enable-dtrace=true
>>> the default in HEAD,
>>> so it gets some testing.
>>>
>>> Zoltan
>>>
>>> On Sat, Aug 2, 2008 at 7:16 PM, Geoff Norton <[EMAIL PROTECTED]> wrote:

 On Sat, 2008-08-02 at 18:30 +0200, Andreas Färber wrote:

> Not fully true, there is of course a minimal degradation (~5 nop
> instructions on Solaris), but it should be hardly noticeable. I have
> taken care to only call helper functions when the probe is active.
>
> Was the answer on IRC in any way official? I could think of three
> possible reasons:
>
> a) Worries about performance degradation.

 Yes

> b) No one updated the build system.

 True but minor

> c) The build machine isn't DTrace-capable.

 d) We havn't tested it fully in our QA process, nor has it been
 available long enough for us to feel comfortable turning it on at this
 stage.  We also would need to invesgate how to do it in our universal
 binaries, etc.  Its a lot of testing and it unfortunately will not make
 2.0 unless there is a compelling argument against this and support from
 the runtime team and from the QA team.

 -g


 ___
 Mono-devel-list mailing list
 [EMAIL PROTECTED]
 http://lists.ximian.com/mailman/listinfo/mono-devel-list

>>
>
>
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] [Mono-dev] Mono preview 2.0 binary and DTrace

2008-08-04 Thread Zoltan Varga
Hi,

  Looking at dtrace.h, all the current probes seem to be in
non-critical code-paths, so they
are unlikely to have a perf impact. We could make --enable-dtrace=true
the default in HEAD,
so it gets some testing.

  Zoltan

On Sat, Aug 2, 2008 at 7:16 PM, Geoff Norton <[EMAIL PROTECTED]> wrote:
> On Sat, 2008-08-02 at 18:30 +0200, Andreas Färber wrote:
>
>> Not fully true, there is of course a minimal degradation (~5 nop
>> instructions on Solaris), but it should be hardly noticeable. I have
>> taken care to only call helper functions when the probe is active.
>>
>> Was the answer on IRC in any way official? I could think of three
>> possible reasons:
>>
>> a) Worries about performance degradation.
>
> Yes
>
>> b) No one updated the build system.
>
> True but minor
>
>> c) The build machine isn't DTrace-capable.
>
> d) We havn't tested it fully in our QA process, nor has it been
> available long enough for us to feel comfortable turning it on at this
> stage.  We also would need to invesgate how to do it in our universal
> binaries, etc.  Its a lot of testing and it unfortunately will not make
> 2.0 unless there is a compelling argument against this and support from
> the runtime team and from the QA team.
>
> -g
>
>
> ___
> Mono-devel-list mailing list
> [EMAIL PROTECTED]
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] TypeConverter cannot convert from System.String in 2.0 preview 1

2008-08-04 Thread Andrus
> If it runs on MS.NET but doesn't run on mono then it's a bug of ours.
> Can you please make a *small* self-contained test case out of your
> application by extracting only the part that causes the exception and
> then file a bug with it (attach it to the bug) -
> http://mono-project.com/Bugs. Then post the bug number.

Done !

https://bugzilla.novell.com/show_bug.cgi?id=414445
https://bugzilla.novell.com/show_bug.cgi?id=414446

Andrus.



___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Runing NUnit with version 1.2.9

2008-08-04 Thread Charlie Poole
Hi Robert,

Interesting... I assumed the config bug was mine and that I would ave to
supply a separate config for mono. Sounds like I don't.

Charlie

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Robert Jordan
> Sent: Monday, August 04, 2008 1:57 AM
> To: Mono-list@lists.ximian.com
> Subject: Re: [Mono-list] Runing NUnit with version 1.2.9
> 
> Rolando Martinez wrote:
> > Hello,
> > 
> > Thanks you Charlie for your help. That was very useful for me...
> > And now I have another question, Why is the reason with 
> this change of 
> > "Encoding"?. My question is because now I have another 3rdparty
> > (MySql.Data.dll) wich is not working with this version
> > 
> > basically the mysql connector is not working due to:
> > 
> > public Driver(MySqlConnectionStringBuilder settings)
> > {
> > encoding = Encoding.GetEncoding(1252);   < ups
> 
> You have not installed mono's i18n assemblies. Some distros 
> are providing them with separate packages.
> 
> Robert
> 
> ___
> Mono-list maillist  -  Mono-list@lists.ximian.com 
> http://lists.ximian.com/mailman/listinfo/mono-list
> 



___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] No such host is known

2008-08-04 Thread Brandon Perry
I am doing some testing and I am getting this error:

System.Net.Sockets.SocketException: No such host is known


The app runs fine in VS and IIS, but running it with xsp2 gives me
this. Any suggestions or thoughts on what might be the problem? I can
supply more info if needed.


-- 
http://www.volatileminds.net
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] TypeConverter cannot convert from System.String in 2.0 preview 1

2008-08-04 Thread Ivan N. Zlatev
On Mon, Aug 4, 2008 at 5:08 PM, Andrus <[EMAIL PROTECTED]> wrote:
> My WinForms application does not start with 2.0 preview 1. Exception is
> below.

If it runs on MS.NET but doesn't run on mono then it's a bug of ours.
Can you please make a *small* self-contained test case out of your
application by extracting only the part that causes the exception and
then file a bug with it (attach it to the bug) -
http://mono-project.com/Bugs. Then post the bug number.

-- 
Kind Regards,
Ivan N. Zlatev

> Maybe this is because I store Font object in user settings:
>
>[global::System.Configuration.UserScopedSettingAttribute()]
>[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
>[global::System.Configuration.DefaultSettingValueAttribute("Arial,
> 15pt")]
>public global::System.Drawing.Font TextBoxFont {
>get {
>return ((global::System.Drawing.Font)(this["TextBoxFont"]));
>}
>set {
>this["TextBoxFont"] = value;
>}
>}
>
>
> How to fix ?
>
> Andrus.
>
> Unhandled Exception: System.TypeInitializationException: An exception was
> thrown by the type initializer for
> MyApplication.Windows.Forms.Properties.Settings --->
> System.NotSupportedException: TypeConverter cannot convert from
> System.String.
>
>  at System.ComponentModel.TypeConverter.GetConvertFromException
> (System.Object value) [0x0]
>  at System.ComponentModel.TypeConverter.ConvertFrom (ITypeDescriptorContext
> context, System.Globalization.CultureInfo culture, System.Object value)
> [0x0]
>  at System.ComponentModel.TypeConverter.ConvertFrom (System.Object o)
> [0x0]
>  at System.ComponentModel.TypeConverter.ConvertFromString (System.String
> text) [0x0]
>  at System.Configuration.ApplicationSettingsBase.CreateSettingsProperty
> (System.Reflection.PropertyInfo prop,
> System.Configuration.SettingsPropertyCollection properties,
> System.Configuration.LocalFileSettingsProvider& local_provider) [0x0]
>  at System.Configuration.ApplicationSettingsBase.get_Properties ()
> [0x0]
>  at System.Configuration.ApplicationSettingsBase..ctor () [0x0]
>  at MyApplication.Windows.Forms.Properties.Settings..ctor () [0x0]
>  at MyApplication.Windows.Forms.Properties.Settings..cctor () [0x0]
>
>  --- End of inner exception stack trace ---
>
>  at MyApplication.Windows.Forms.UserLoginForm.InitializeComponent ()
> [0x0]
>  at MyApplication.Windows.Forms.UserLoginForm..ctor () [0x0]
>  at (wrapper remoting-invoke-with-check)
> MyApplication.Windows.Forms.UserLoginForm:.ctor ()
>  at MyApplication.Windows.Forms.AppMainEntry.Main () [0x0]
>
> ___
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] TypeConverter cannot convert from System.String in 2.0 preview 1

2008-08-04 Thread Andrus
My WinForms application does not start with 2.0 preview 1. Exception is
below.
Maybe this is because I store Font object in user settings:

[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Arial,
15pt")]
public global::System.Drawing.Font TextBoxFont {
get {
return ((global::System.Drawing.Font)(this["TextBoxFont"]));
}
set {
this["TextBoxFont"] = value;
}
}


How to fix ?

Andrus.

Unhandled Exception: System.TypeInitializationException: An exception was
thrown by the type initializer for
MyApplication.Windows.Forms.Properties.Settings --->
System.NotSupportedException: TypeConverter cannot convert from
System.String.

  at System.ComponentModel.TypeConverter.GetConvertFromException
(System.Object value) [0x0]
  at System.ComponentModel.TypeConverter.ConvertFrom (ITypeDescriptorContext
context, System.Globalization.CultureInfo culture, System.Object value)
[0x0]
  at System.ComponentModel.TypeConverter.ConvertFrom (System.Object o)
[0x0]
  at System.ComponentModel.TypeConverter.ConvertFromString (System.String
text) [0x0]
  at System.Configuration.ApplicationSettingsBase.CreateSettingsProperty
(System.Reflection.PropertyInfo prop,
System.Configuration.SettingsPropertyCollection properties,
System.Configuration.LocalFileSettingsProvider& local_provider) [0x0]
  at System.Configuration.ApplicationSettingsBase.get_Properties ()
[0x0]
  at System.Configuration.ApplicationSettingsBase..ctor () [0x0]
  at MyApplication.Windows.Forms.Properties.Settings..ctor () [0x0]
  at MyApplication.Windows.Forms.Properties.Settings..cctor () [0x0]

  --- End of inner exception stack trace ---

  at MyApplication.Windows.Forms.UserLoginForm.InitializeComponent ()
[0x0]
  at MyApplication.Windows.Forms.UserLoginForm..ctor () [0x0]
  at (wrapper remoting-invoke-with-check)
MyApplication.Windows.Forms.UserLoginForm:.ctor ()
  at MyApplication.Windows.Forms.AppMainEntry.Main () [0x0]

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Generics sharing vs delegates?

2008-08-04 Thread Chris Howie
On Mon, Aug 4, 2008 at 4:21 AM, Mike Cleaver <[EMAIL PROTECTED]> wrote:
> After a few seconds thought I realised that this is easier:
>
> public static T [] GetDirectives(IEnumerable
> directives) where T : AbstractDirective {
>List output = new List();
>foreach(AbstractDirective directive in directives) {
>if(directive is T) output.Add(directive as T);
>}
>return output.ToArray();
>}
>
> My app runs fine now as this was the only problem running 2.0p,
> strange that it occurs at all though?

Indeed.  I would file a bug report with a test case.  This behavior
does not seem at all desirable.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Deployment of a C# application

2008-08-04 Thread Chris Howie
On Mon, Aug 4, 2008 at 3:32 AM, theallan <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I wonder if anyone can offer a little advice to me for how I can deploy a C#
> application that I've put together? Basically what the program does is to
> take a file and parse it, and I would like to deploy it on an IIS
> web-server, or Apache with the Mono module. On Unix what I would do is to
> have the program as an interpreter, and at the top of the file I want parsed
> (marked as executable) I would have '#!/path/to/prog'. Is there any way I
> can do this with my Mono compiled exe file?

If your application is a proper CGI application (which means that you
can't use ASP.NET as far as I know, since it's not remotely close to
CGI at all) then you can do so by putting this at the top of your
scripts:

#!/usr/bin/mono /path/to/prog

Adjusting the path to Mono as necessary.  If your application uses
ASP.NET then there is no straightforward way to accomplish this.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Runing NUnit with version 1.2.9

2008-08-04 Thread Robert Jordan
Rolando Martinez wrote:
> Hello,
> 
> Thanks you Charlie for your help. That was very useful for me...
> And now I have another question, Why is the reason with this change of
> "Encoding"?. My question is because now I have another 3rdparty
> (MySql.Data.dll) wich is not working with this version
> 
> basically the mysql connector is not working due to:
> 
> public Driver(MySqlConnectionStringBuilder settings)
> {
> encoding = Encoding.GetEncoding(1252);   < ups

You have not installed mono's i18n assemblies. Some distros are
providing them with separate packages.

Robert

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Generics sharing vs delegates?

2008-08-04 Thread Mike Cleaver
After a few seconds thought I realised that this is easier:

public static T [] GetDirectives(IEnumerable  
directives) where T : AbstractDirective {
List output = new List();
foreach(AbstractDirective directive in directives) {
if(directive is T) output.Add(directive as T);
}
return output.ToArray();
}

My app runs fine now as this was the only problem running 2.0p,  
strange that it occurs at all though?

Thanks,
Mike Cleaver

On 03/08/2008, at 8:25 PM, Mike Cleaver wrote:

> Hey all,
>
> Congrats on another release,
> I've only installed on my mac at the moment (excellent packaging!) and
> have had a go at getting my project to run and for the most part it
> works perfectly.
>
> I have found one issue, which I'm trying to write a unit test for at
> the moment but expect that like other issues I've had (and solved) in
> the past it is probably more due to me doing something wrong:
> Running this static method -
>
>   public static T [] 
> GetDirectives(IEnumerable
> directives) where T : AbstractDirective {
>   Console.WriteLine("@@@ Orig T is " + typeof(T).Name);
>   List matches = new
> List(directives).FindAll(delegate(AbstractDirective
> directive) {
>   Console.WriteLine("@@@ 
> T is {0}", typeof(T).Name);
>   return directive is T;
>   });
>   Console.WriteLine("@@@ Final T is " + typeof(T).Name);
>   
>   return matches.ConvertAll(delegate(AbstractDirective 
> directive)
> { return directive as T; }).ToArray();
>   }
>
> I get the output -
> @@@ Orig T is RegisterDirective
> @@@ T is AssemblyDirective
> @@@ T is AssemblyDirective
> @@@ Final T is RegisterDirective
>
> The RegisterDirective and AssemblyDirective classes inherit the same
> abstract class AbstractDirective.  So what we are seeing is that the
> generic type T is different inside the delegate, it is not a type that
> is currently accounted for in the directives enumeration or anything,
> just a different class type.
>
> Can anyone tell me if they can see anything silly? I assume there is a
> better way to select a particular type from a list that I should be
> doing instead?
>
> Mike Cleaver
> [EMAIL PROTECTED]
>
>
> ___
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list

Mike Cleaver
[EMAIL PROTECTED]


___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Deployment of a C# application

2008-08-04 Thread theallan

Hello all,

I wonder if anyone can offer a little advice to me for how I can deploy a C#
application that I've put together? Basically what the program does is to
take a file and parse it, and I would like to deploy it on an IIS
web-server, or Apache with the Mono module. On Unix what I would do is to
have the program as an interpreter, and at the top of the file I want parsed
(marked as executable) I would have '#!/path/to/prog'. Is there any way I
can do this with my Mono compiled exe file?

I know that it is possible to set up a CGI application to do this in IIS,
but apparently you need to change the user that IIS is running under to
access environment variable, which seems nuts.

Many thanks,
Allan
-- 
View this message in context: 
http://www.nabble.com/Deployment-of-a-C--application-tp18806850p18806850.html
Sent from the Mono - General mailing list archive at Nabble.com.

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list