Changeset e3df129 in rtems-tools


Ignore:
Timestamp:
Sep 29, 2015, 10:26:38 AM (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, master
Children:
f11d18b
Parents:
711f715
Message:

Add a lock model to support different lock models when tracing.

Logging to a file requires a 'trace' lock model be used. The 'trace'
lock model holds the lock for the entire trace time, for example
the entry or exit tracing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • linkers/rtems-tld.cpp

    r711f715 re3df129  
    172172    {
    173173      std::string  name;            /**< The name of this wrapper. */
     174      std::string  lock_model;      /**< The lock model if provided, default "alloc". */
    174175      std::string  lock_local;      /**< Code template to declare a local lock variable. */
    175176      std::string  lock_acquire;    /**< The lock acquire if provided. */
     
    596597       *                is being traced. This call is made without the lock being held
    597598       *                if a lock is defined.
     599       * # lock-model   The wrapper code lock model. Models are 'alloc', or capture'.
    598600       * # lock-local   The wrapper code to declare a local lock variable.
    599601       * # lock-acquire The wrapper code to acquire the lock.
     
    666668      parse (config, section, "code-blocks", "code",   code, false);
    667669
     670      if (section.has_record ("lock-model"))
     671        lock_model = rld::dequote (section.get_record_item ("lock-model"));
    668672      if (section.has_record ("lock-local"))
    669673        lock_local = rld::dequote (section.get_record_item ("lock-local"));
     
    13111315            }
    13121316
    1313             if (!generator_.lock_release.empty ())
     1317            if (!generator_.lock_release.empty () &&
     1318                (generator_.lock_model.empty () || (generator_.lock_model == "alloc")))
    13141319              c.write_line(generator_.lock_release);
    13151320
     
    13351340            }
    13361341
     1342            if (!generator_.lock_release.empty () && generator_.lock_model == "trace")
     1343              c.write_line(generator_.lock_release);
     1344
    13371345            l.clear ();
    13381346
     
    13631371            }
    13641372
    1365             if (!generator_.lock_release.empty ())
     1373            if (!generator_.lock_release.empty () &&
     1374                (generator_.lock_model.empty () || (generator_.lock_model == "alloc")))
    13661375              c.write_line(generator_.lock_release);
    13671376
     
    13801389              l = rld::find_replace (l, "@RET_LABEL@", "ret");
    13811390              c.write_line(l);
     1391            }
     1392
     1393            if (!generator_.lock_release.empty ())
     1394              c.write_line(generator_.lock_release);
     1395
     1396            if (sig.has_ret ())
    13821397              c.write_line(" return ret;");
    1383             }
    13841398
    13851399            c.write_line("}");
Note: See TracChangeset for help on using the changeset viewer.