While browsing the Firefox source code, I see that a lot of logs are present. I'd like to find them on runtime to help me understand and debug something.
For example, when taking a look at nsHttpConnection.cpp, Here's what I can find :
...
LOG(("restarting transaction #%p\n", this));
mTunnelProvider = nullptr;
...
Where did the LOG lines go ? How do I find the log file containing all the logs generated by Firefox ?
In the case of the file nsHttpConnection.cpp, the LOG() functions are macros defined in HttpLog.h.
here's an excerpt :
#define LOG1(args) \
MOZ_LOG(mozilla::net::gHttpLog, mozilla::LogLevel::Error, args)
You can see them as shortcuts for the more complete MOZ_LOG functions.
LOG1() -> Error
LOG2() -> Warning
LOG3() -> Info
LOG() = LOG4() -> Debug
LOG5() -> Verbose
If you want to get the logs for the nsHttp module, you can set 2 environment variables, and then run firefox :
set MOZ_LOG=nsHttp:5
set MOZ_LOG_FILE=http.log
firefox
or run firefox with the command line parameters :
firefox -MOZ_LOG=nsHttp:5 -MOZ_LOG_FILE=nsHttp.log
This enables Verbose level information (and higher) and places all output in the file nsHttp.log.
The MOZ_LOG variable is composed of as <module>:level.
You can also use a more general module all to include them all.
i.e. to log all Error level informations in the file all.log:
firefox -MOZ_LOG=all:1 -MOZ_LOG_FILE=all.log
For more information on how the MOZ_LOG variable is configured, you can take a look at prlog.h
Related
I am trying to find out if it is possible to get Jmeter to generate standard deviations in its report WITHOUT THE GUI! (<<< Important!). Script based ONLY. I have perused the Internets and most Jmeter information is long since out of date, going back to 2007-2017.
It seems Jmeter has come along way since then incorporating most of the "plugins". I am running JMeter 5.3.
I basically generate tests with
jmeter -t test.jmx -l results.csv -jmeter.save.saveservice.output_format=csv
Then, as per the documentation I run,
jmeter -g results.csv -o report
But it seems options to give this command are not plentiful.
This command invocation generates an html site, and it generates areport/statistics.json file. However, this file merely contains elements of the "AggregateReport", which are
{
"transaction" : "Total",
"sampleCount" : 1000,
"errorCount" : 0,
"errorPct" : 0.0,
"meanResTime" : 42.56400000000011,
"medianResTime" : 37.0,
"minResTime" : 31.0,
"maxResTime" : 1327.0,
"pct1ResTime" : 49.0,
"pct2ResTime" : 64.0,
"pct3ResTime" : 95.93000000000006,
"throughput" : 20.10777768840988,
"receivedKBytesPerSec" : 17.002539863669266,
"sentKBytesPerSec" : 6.8610525856088636
}
which does NOT include the "Standard Deviation". I am at a loss of "Why not?", but that is another question.
I know people will tell me to add a "SummaryReport" Listener, but that only seems to be useful in the GUI, and this approach MUST be scripted based. I need to be able to read the results out of a file sometime long after the run has completed.
I cannot seem to find the any options to give Jmeter to generate a report that lists the Standard Deviation, or even to generate a file containing a "SummaryReport" in addition to the "AggregateReport".
It appears the only report that is generated is this deficient "AggregateReport".
Any insight?
One of those JMeter plugins you mention provides a command line tool to write the "AggregateReport" to a CSV file:
JMeterPluginsCMD.sh --plugin-type AggregateReport --input-jtl results.csv --generate-csv aggregate_report.csv
This requires the following three plugins to be installed:
https://jmeter-plugins.org/?search=jpgc-cmd
https://jmeter-plugins.org/?search=jpgc-synthesis
https://jmeter-plugins.org/?search=jpgc-filterresults
Command line options are listed here: https://jmeter-plugins.org/wiki/JMeterPluginsCMD/
Both the AggregateReport and the SynthesisReport include standard deviation.
I am using java8 and I did set JVM argument to set GC log path,but the safepoint log did not output to the specified file and they still in my console output.What should i do to let the safepoint-log output to a file just like GC log?
In java-8 you need two flags : -XX:+LogVMOutput ( internally a safepoint is refered as vmop as in "vm operation", that is why the weird flag name, I guess ). To redirect the output to a file you need -XX:LogFile=path.
Since java-9, there is "unified logging" that makes this far more easy and intuitive, IMO. For example:
-Xlog:safepoint*=debug:file=safepoint.log
I put the Pyro4 configuration as this in the starting part of my code:
Pyro4.config.THREADPOOL_SIZE = 1
Pyro4.config.THREADPOOL_SIZE_MIN = 1
I check if I tried to run two client code at the same time, it will say ' rejected: no free workers, increase server threadpool size'. It looks like the setting is working, but when I open the console to check the pyro configuration using "python -m Pyro4.configuration", it returns:
THREADPOOL_SIZE = 40
THREADPOOL_SIZE_MIN = 4
Does someone know why?
When you run python -m Pyro4.configuration, it will simply print the default settings (influenced only by any environment variables you may have set). I'm not sure why you think that this should know about the settings you added in your own code.
I need to recover the content of the show log module of Omnet++/Tkenv into a file, I added in the omnetpp.ini:
cmdenv-express-mode = false
cmdenv-output-file = log.txt
but I have two types of problems:
1) after the simulation, I did not find the "log.txt" If I do not create it
2) and when I created it before launching the simulation under ../omnetpp-4.6/log.txt also I find it empty
I used EV << to display the content of variables that I used, I need to resolve this problem in order to analyze the traffic so how can I do that please?
You have to start your simulation in Cmdenv mode. To do that go to Run | Run Configurations | select your configuration, then select Command line as User interface. The log file is created in simulations directory by default.
I have enabled the CONFIG_DYNAMIC_DEBUG option in kernel. After which we get control file in debug/dynamic_debug directory.
After we enable some debug logs in control file, where this log statements will be printed, in which log file ?
You can check kernel log level by cat /proc/sys/kernel/printk. Default is 4. Log levels are defined here https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/linux/kern_levels.h?id=refs/tags/v4.8-rc8#n7. As a test you can set it to highest to make sure that everything is logged: echo "7" > /proc/sys/kernel/printk.
You can also run cat /proc/kmsg while the dynamic debug statements are running. It /proc/kmsg holds kernel messages for them to be picked up by dmesg or something else.