Add support for sample profiling in traceview.

Instead of method instrumentation, allow traceview to periodically
sample stack traces of threads. Disabled by default until we add
gui support for this new mode.

(cherry picked from commit 676f8a527fb62abd39663d55c7d9208f5ca03093)

Change-Id: Id8942d4186fc628ee7bd8d809d7239dec310054b
Merge "Add support for sample profiling in traceview."
Add dalvik support for sample profiling from traceview gui.

(cherry picked from commit 86bb14a3e4d7ef3b8b4240bbc2a8b989a1b8c7c0)

Change-Id: Idc0386b15019b8e152f029e2b8b9435e73afdd22
Merge "Add dalvik support for sample profiling from traceview gui."
Add -Wno-unused-but-set-variable to the Dalvik project.

This is to meet long term goal that we don't suppress any warnings in
the global makefile.

BUG: 10495043
Change-Id: I1eece42a9f2c43b614cfbeb1397c8071fb3db04a
(cherry picked from commit 0c4625a4e1464544625723b013b3febb1cc9359e)
Merge "Add -Wno-unused-but-set-variable to the Dalvik project."
Change IsMethodTracingActive to GetMethodTracingMode.

This allows traceview to tell whether tracing is active, and whether
it is sampling or method tracing.

(cherry picked from commit 9d3a0a2e253aecd07c4a053c19cf9b0ccaa2db49)

Change-Id: I7e00f90f80de248f07dfa94d7d0f028931e1a716
Merge "Change IsMethodTracingActive to GetMethodTracingMode."
Make dmtracedump available on windows pc.

Issue Details:
1.
When dmtracedump is executed on windows pc, command failed.
Error message is "ERROR: unable to read xxxxx bytes from trace file".
This is because trace file is opened in text mode.
2.
When dmtracedump outputs html, #0 method's name isn't "(toplevel)" but "(unknown)".
This is because the positions of (toplevel) and (unknown) in method list interchange on windows pc.
3.
Command of generating png file is invalid for windows.
Command example is "dot -Tpng -o 'foo.png' 'foo.dot'".
When it is executed, it failed.
Error message is "Error: dot: can't open foo.dot.".
This is because command prompt of windows can't open file surrounded by single quotation marks.
4.
dmtracedump failed to create temporary dot file on windows.
This is because temporary dot file is created in "/tmp".
"/tmp" doesn't exist on windows.

Solutions:
1.
Open trace file in binary mode.
2.
In order not to exchange the positoin of (toplevel) and (unknown),
we set the id of (toplevel) to -1 and we set the id of (unknown) to -2.
3.
Replace single qutation marks in command of generating png file to double qutation marks.
4.
Create temporary dot file in current directory.

Change-Id: I2503469fb488fe93cb7a0460ea3fef9b0e139d2d
Signed-off-by: odd.programmer <odd.programmer@gmail.com>
Merge "Make dmtracedump available on windows pc."
Support apps that pass JNI_VERSION_1_1 to GetEnv.

Bug: 10649815
Change-Id: I791039ed5b351d5dee340c43870422462e5528d9
Merge "Support apps that pass JNI_VERSION_1_1 to GetEnv."
Merge https://android.googlesource.com/platform/dalvik into jb-devel-mr2-release