World Library  
Flag as Inappropriate
Email this Article

Tracing (software)

Article Id: WHEBN0008752187
Reproduction Date:

Title: Tracing (software)  
Author: World Heritage Encyclopedia
Language: English
Subject: Instrumentation (computer programming), Instruments (application), Debugging, ProbeVue, Windows software trace preprocessor
Collection: Debugging
Publisher: World Heritage Encyclopedia
Publication
Date:
 

Tracing (software)

In software engineering, tracing is a specialized use of logging to record information about a program's execution. This information is typically used by programmers for debugging purposes, and additionally, depending on the type and detail of information contained in a trace log, by experienced system administrators or technical support personnel and software monitoring tools to diagnose common problems with software. Tracing is a cross-cutting concern.

There is not always a clear distinction between tracing and other forms of logging, except that the term tracing is almost never applied to logging that is a functional requirement of a program (therefore excluding logging of data from an external source, such as data acquisition in a high-energy physics experiment, and write ahead logging). Logs that record program usage (such as a server log) or operating system events primarily of interest to a system administrator (see for example Event Viewer) fall in a gray area with regards to terminology. This article deals with tracing that is primarily for debugging or diagnostic purposes.

Contents

  • Event logging versus tracing 1
  • Event logging 2
  • Software tracing 3
  • Technologies and techniques 4
  • See also 5
  • External references 6

Event logging versus tracing

Difficulties in making a clear distinction between event logging and software tracing arise from the fact that some of the same technologies are used for both, and further because many of the criteria that distinguish between the two are continuous rather than discrete. The following table lists some important, but by no means precise or universal, distinctions that are used by developers to select technologies for each purposes, and that guide the separate development of new technologies in each area:

Event logging Software tracing
Consumed primarily by system administrators Consumed primarily by developers
Logs "high level" information (e.g. failed installation of a program) Logs "low level" information (e.g. a thrown exception)
Must not be too "noisy" (contain many duplicate events or information not helpful to its intended audience) Can be noisy
A standards-based output format is often desirable, sometimes even required Few limitations on output format
Event log messages are often localized Localization is rarely a concern
Addition of new types of events, as well as new event messages, need not be agile Addition of new tracing messages must be agile

Event logging

Event logging provides system administrators with information useful for diagnostics and auditing. The different classes of events that will be logged, as well as what details will appear in the event messages, are often considered early in the development cycle. Many event logging technologies allow or even require each class of event to be assigned a unique "code", which is used by the event logging software or a separate viewer (e.g., Event Viewer) to format and output a human-readable message. This facilitates localization and allows system administrators to more easily obtain information on problems that occur.

Because event logging is used to log high-level information (often failure information), performance of the logging implementation is often less important.

A special concern, preventing duplicate events from being recorded "too often" is taken care of through event throttling.

Software tracing

Software tracing provides developers with information useful for debugging. This information is used both during the development cycle and after the software is released. Unlike event logging, software tracing usually does not have the concept of a "class" of event or an "event code". Other reasons that event logging solutions based on event codes are inappropriate for software tracing include:

  • Because software tracing is low-level, there are often many more types of messages that would need to be defined, many of which would only be used at one place in the code. The event code paradigm introduces significant development overhead for these "one-shot" messages.
  • The types of messages that are logged are often less stable through the development cycle than for event logging.
  • Because the tracing output is intended to be consumed by the developer, the messages don't need to be localized. Keeping tracing messages separate from other resources that need to be localized (such as event messages) is therefore important.
  • There are messages that should never be seen.
  • Tracing messages should be kept in the code, because they can add to the readability of the code. This is not always possible or feasible with event logging solutions.

Another important consideration for software tracing is performance. Because software tracing is low-level, the possible volume of trace messages is much higher. To address performance concerns, it often must be possible for software tracing to be turned off, either at compile-time or run-time.

Other special concerns:

  • In proprietary software, tracing data may include sensitive information about the product's source code.
  • If tracing is enabled or disabled at run-time, many methods of tracing require a significant amount of additional data be included in the binary, which can indirectly hurt performance even when tracing is disabled.
  • If tracing is enabled or disabled at compile-time, getting trace data for a problem on a customer machine depends on the customer being willing and able to install a special, tracing-enabled version of your software and then duplicating the problem.
  • Many uses of tracing have very stringent robustness requirements. This is both in the robustness of the trace output but also in that the use-case being traced should not be disrupted.
  • In operating systems, tracing is sometimes useful in situations (such as boot) where some of the technologies used to provide event logging may not be available.

Technologies and techniques

Software tracing:

Event logging:

Appropriate for both:

  • Apache logging
  • Event Tracing for Windows
  • Java logging APIs
  • Visual Basic logging (for Visual Basic .NET)
  • Logcheck: a free and open-source utility to manage logs
  • X-Trace (research project)
  • Instruction set simulation
  • C++ Logging (for cross platform C++ applications)

See also

External references

  • The Tracing Book
  • Trace Recording for Embedded Systems: Lessons Learned from Five Industrial Projects
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 


Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.