OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [libstdc++-v3/] [doc/] [html/] [manual/] [bk01pt12ch32s05.html] - Blame information for rev 424

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 424 jeremybenn
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation Issues</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10;      C++&#10;    , &#10;      library&#10;    , &#10;      profile&#10;    " /><meta name="keywords" content="&#10;      ISO C++&#10;    , &#10;      library&#10;    " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s04.html" title="Empirical Cost Model" /><link rel="next" href="bk01pt12ch32s06.html" title="Developer Information" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation Issues</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s04.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s06.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Implementation Issues"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.implementation"></a>Implementation Issues</h2></div></div></div><div class="sect2" title="Stack Traces"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.stack"></a>Stack Traces</h3></div></div></div><p>
4
  Accurate stack traces are needed during profiling since we group events by
5
  call context and dynamic instance.  Without accurate traces, diagnostics
6
  may be hard to interpret.  For instance, when giving advice to the user
7
  it is imperative to reference application code, not library code.
8
  </p><p>
9
  Currently we are using the libc <code class="code">backtrace</code> routine to get
10
  stack traces.
11
  <code class="code">_GLIBCXX_PROFILE_STACK_DEPTH</code> can be set
12
  to 0 if you are willing to give up call context information, or to a small
13
  positive value to reduce run time overhead.
14
  </p></div><div class="sect2" title="Symbolization of Instruction Addresses"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.symbols"></a>Symbolization of Instruction Addresses</h3></div></div></div><p>
15
  The profiling and analysis phases use only instruction addresses.
16
  An external utility such as addr2line is needed to postprocess the result.
17
  We do not plan to add symbolization support in the profile extension.
18
  This would require access to symbol tables, debug information tables,
19
  external programs or libraries and other system dependent information.
20
  </p></div><div class="sect2" title="Concurrency"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.concurrency"></a>Concurrency</h3></div></div></div><p>
21
  Our current model is simplistic, but precise.
22
  We cannot afford to approximate because some of our diagnostics require
23
  precise matching of operations to container instance and call context.
24
  During profiling, we keep a single information table per diagnostic.
25
  There is a single lock per information table.
26
  </p></div><div class="sect2" title="Using the Standard Library in the Instrumentation Implementation"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.stdlib-in-proflib"></a>Using the Standard Library in the Instrumentation Implementation</h3></div></div></div><p>
27
  As much as we would like to avoid uses of stdlibc++ within our
28
  instrumentation library, containers such as unordered_map are very
29
  appealing.  We plan to use them as long as they are named properly
30
  to avoid ambiguity.
31
  </p></div><div class="sect2" title="Malloc Hooks"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.malloc-hooks"></a>Malloc Hooks</h3></div></div></div><p>
32
  User applications/libraries can provide malloc hooks.
33
  When the implementation of the malloc hooks uses stdlibc++, there can
34
  be an infinite cycle between the profile mode instrumentation and the
35
  the malloc hook code.
36
  </p><p>
37
  We protect against reentrance to the profile mode instrumentation code,
38
  which should avoid this problem in most cases.
39
  The protection mechanism is thread safe and exception safe.
40
  This mechanism does not prevent reentrance to the malloc hook itself,
41
  which could still result in deadlock, if, for instance, the malloc hook
42
  uses non-recursive locks.
43
  XXX: A definitive solution to this problem would be for the profile extension
44
  to use a custom allocator internally, and perhaps not to use libstdc++.
45
  </p></div><div class="sect2" title="Construction and Destruction of Global Objects"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.construction-destruction"></a>Construction and Destruction of Global Objects</h3></div></div></div><p>
46
  The profiling library state is initialized at the first call to a profiling
47
  method.  This allows us to record the construction of all global objects.
48
  However, we cannot do the same at destruction time.  The trace is written
49
  by a function registered by <code class="code">atexit</code>, thus invoked by
50
  <code class="code">exit</code>.
51
  </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch32s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch32s06.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Empirical Cost Model </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Developer Information</td></tr></table></div></body></html>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.