trace

How to print each line of a script as it is run only for the top-level script being run?

爱⌒轻易说出口 提交于 2019-12-03 15:41:43
问题 python's trace module will allow you to run a script printing each line of code as it is run in both the script and all imported modules like so: python -m trace -trace myscript.py Is there a way to do the same thing, but only print the top-level calls, i.e. only print the lines in myscript.py as they are run? I am trying to debug an abort trap failure and I can't figure out where it's dying. Unfortunately, using the full --trace takes forever - the script normally takes 2-3 minutes to run,

How to get calling expression when tracing a Python function?

允我心安 提交于 2019-12-03 15:01:38
When inside tracing function, debugging a function call, is it possible to somehow retrieve the calling expression? I can get calling line number from traceback object but if there are several function calls (possibly to the same function) on that line (eg. as subexpression in a bigger expression) then how could I learn where this call came from? I would be happy even with the offset from start of the source line. traceback.tb_lasti seems to give more granual context (index of last bytecode tried) -- is it somehow possible to connect a bytecode to its exact source range? EDIT: Just to clarify

How to make DebugView work under .NET 4?

可紊 提交于 2019-12-03 14:38:55
问题 SysInternals' DebugView no longer works if used under .NET 4. Some research indicated that the new architecture of the framework did not allow for traces to be captured if a debugger was attached; in my case it's the Visual Studio debugger. Changing target framework from 4 to 3.5 makes it work again. Anybody knows a way of getting DebugView to work under .NET 4 while having the Visual Studio debugger attached? I tried clearing the Listeners collection of the Trace class, but no luck. 回答1:

How can I generate a complete trace.axd in ASP.NET MVC?

血红的双手。 提交于 2019-12-03 12:28:02
On my application, after enabling ASP.NET Tracing in an ASP.NET MVC application, the time calculation statistics were off by a factor of 5000. I have a page that is taking between 7 and 9 seconds to load. This is corroborated by both Firebug and the "time-taken" field in the IIS log files. (This is just the page returning to the client, not any layout, DOM, or script execution.) However, when I turn application-wide tracing on (via web.config) and view the trace output, the time taken from "Begin PreInit" to "End Render" is less than 0.001 seconds. I assume this is because Trace.axd was built

How can i open .trace file format(traceview) without DDMS?

心已入冬 提交于 2019-12-03 12:24:03
问题 I want to save a log of method calls. Traceview supports that function and I can get .trace file format. but, I need to open .trace file format without DDMS. If I can't open .trace file without DDMS, How can I get a log of method calls? (The best is .txt file format.) thanks. 回答1: It is an old thread. because I found here, so other guys may need this, too. Try this: traceview -r yourtrace.trace > 1.txt and look 1.txt has any useful thing to u. 回答2: "traceview" is a command-line utility. You

ASP.NET Web API Logging and Tracing

我们两清 提交于 2019-12-03 12:23:41
问题 Once one has a logging and tracing setup using log4net in place for ASP.NET Web API, what are the specific aspects that need to be logged and/or traced? I am asking this specifically from Web API perspective. Is there a series of MUST Log this or MUST trace this . Like, INFO traces about a controller's request, any NULL checks, etc. Is there a reference list that can be validated against to ensure optimum logging and tracing coverage in ASP.NET Web API ? 回答1: So I will assume your goal for

ASP.NET MVC Tracing Issues

断了今生、忘了曾经 提交于 2019-12-03 11:10:54
问题 Question How do I get ASP.NET MVC trace information to be consistent for in-page trace output as trace.axd? I may just be missing something obvious, please call it out if you see it. Background Info for Traditional ASP.NET So back in the regular ASP.NET days, you could simply add the following to your web.config: <system.diagnostics> <trace> <listeners> <add name="WebPageTraceListener" type="System.Web.WebPageTraceListener, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken

Tracing pthread scheduling

跟風遠走 提交于 2019-12-03 11:08:41
What I want to do is create some kind of graph detailing the execution of (two) threads in Linux. I don't need to see what the threads do, just when they are scheduled and for how long, a time line basically. I've spend the last few hours searching the internet for a way to trace the scheduling of pthreads. Unfortunately, the two projects I found require either kernel recompilation ( LTTng ) or glibc patching (NPTL Trace Tool) , both of which I can not do (large, centrally managed system, on which I have no sudo rights). Is there any other way to do something like this or will I have to resort

Trace the execution of ALL Javascript in a web app

♀尐吖头ヾ 提交于 2019-12-03 10:56:11
Here is the situation: A complex web app is not working, and it is possible to produce undesired behavior consistently. The cause of the problem is not known. Proposal: Trace the execution paths of all javascript code. Essentially, produce two monstrous logs which can then be fed into a diff algorithm to determine where the behavior related to the bug begins to diverge (as the cause is not apparent from application behavior, and both comprehending and obtaining a copy of the actual JS code being run is difficult, due to the many pages that must be switched to and copied out from the web

How to measure Python's asyncio code performance?

血红的双手。 提交于 2019-12-03 10:12:20
问题 I can't use normal tools and technics to measure the performance of a coroutine because the time it takes at await should not be taken in consideration (or it should just consider the overhead of reading from the awaitable but not the IO latency). So how do measure the time a coroutine takes ? How do I compare 2 implementations and find the more efficent ? What tools do I use ? 回答1: This answer originally contained two different solutions: the first one was based on monkey-patching and the