Skip to content
Snippets Groups Projects
  1. May 01, 2015
    • Corey Farrell's avatar
      Astobj2: Fix initialization order of refdebug and AO2_DEBUG. · 8f3cee12
      Corey Farrell authored
      This ensures that refdebug is initialized before AO2_DEBUG if
      both are enabled, since AO2_DEBUG allocates a container.
      
      This change also makes AO2_DEBUG initialization critical, a
      failure will abort Asterisk startup.  This is needed since
      the failure would be caused by reg_containers allocation
      failure, and that would result in a segmentation fault by
      ao2_container_register later in startup.
      
      ASTERISK-25048 #close
      Reported by: Corey Farrell
      
      Change-Id: I9a243ea3fc5653b48b931ba6d61971cb2e530244
      8f3cee12
  2. Apr 29, 2015
    • Corey Farrell's avatar
      Astobj2: Add ao2_weakproxy_ref_object function. · c9c03998
      Corey Farrell authored
      This function allows code to run ao2_ref against the real
      object associated with a weakproxy.  It is useful when
      all of the following conditions are true:
      * You have a pointer to weakproxy.
      * You do not have or need a pointer to the real object.
      * You need to ensure the real object exists and is not
        destroyed during a process.
      
      In this case it's wasteful to store a pointer to the real
      object just for the sake of releasing it later.
      
      Change-Id: I38a319b83314de75be74207a8771aab269bcca46
      c9c03998
  3. Apr 27, 2015
    • Corey Farrell's avatar
      Astobj2: Allow reference debugging to be enabled/disabled by config. · 5c1d07ba
      Corey Farrell authored
      * The REF_DEBUG compiler flag no longer has any effect on code that uses
        Astobj2.  It is used to determine if reference debugging is enabled by
        default.  Reference debugging can be enabled or disabled in asterisk.conf.
      * Caller information is provided in logger errors for ao2 bad magic numbers.
      * Optimizes AO2 by merging internal functions with the public counterpart.
        This was possible now that we no longer require a dual ABI.
      
      ASTERISK-24974 #close
      Reported by: Corey Farrell
      
      Change-Id: Icf3552721fe999365ba8a8cf00a965aa6b897cc1
      5c1d07ba
  4. Apr 14, 2015
    • Corey Farrell's avatar
      astobj2: Add support for weakproxy objects. · cb6bf309
      Corey Farrell authored
      This implements "weak" references.  The weakproxy object is a real ao2 with
      normal reference counting of its own.  When a weakproxy is pointed to a normal
      object they hold references to each other.  The normal object is automatically
      freed when a single reference remains (the weakproxy).  The weakproxy also
      supports subscriptions that will notify callbacks when it does not point
      to any real object.
      
      ASTERISK-24936 #close
      Reported by: Corey Farrell
      
      Change-Id: Ib9f73c02262488d314d9d9d62f58165b9ec43c67
      cb6bf309
  5. Apr 13, 2015
    • Matt Jordan's avatar
      git migration: Refactor the ASTERISK_FILE_VERSION macro · 4a582616
      Matt Jordan authored
      Git does not support the ability to replace a token with a version
      string during check-in. While it does have support for replacing a
      token on clone, this is somewhat sub-optimal: the token is replaced
      with the object hash, which is not particularly easy for human
      consumption. What's more, in practice, the source file version was often
      not terribly useful. Generally, when triaging bugs, the overall version
      of Asterisk is far more useful than an individual SVN version of a file. As a
      result, this patch removes Asterisk's support for showing source file
      versions.
      
      Specifically, it does the following:
      
      * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
        remove passing the version in with the macro. Other facilities
        than 'core show file version' make use of the file names, such as
        setting a debug level only on a specific file. As such, the act of
        registering source files with the Asterisk core still has use. The
        macro rename now reflects the new macro purpose.
      
      * main/asterisk:
        - Refactor the file_version structure to reflect that it no longer
          tracks a version field.
        - Remove the "core show file version" CLI command. Without the file
          version, it is no longer useful.
        - Remove the ast_file_version_find function. The file version is no
          longer tracked.
        - Rename ast_register_file_version/ast_unregister_file_version to
          ast_register_file/ast_unregister_file, respectively.
      
      * main/manager: Remove value from the Version key of the ModuleCheck
        Action. The actual key itself has not been removed, as doing so would
        absolutely constitute a backwards incompatible change. However, since
        the file version is no longer tracked, there is no need to attempt to
        include it in the Version key.
      
      * UPGRADE: Add notes for:
        - Modification to the ModuleCheck AMI Action
        - Removal of the "core show file version" CLI command
      
      Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
      4a582616
  6. Mar 27, 2015
  7. Mar 26, 2015
  8. Sep 18, 2014
  9. Jul 18, 2014
  10. Jul 13, 2014
  11. Jul 11, 2014
  12. Jun 27, 2014
  13. Jun 06, 2014
  14. Apr 11, 2014
  15. Mar 04, 2014
  16. Jan 09, 2014
  17. Oct 24, 2013
  18. Sep 30, 2013
    • David M. Lee's avatar
      Multiple revisions 399887,400138,400178,400180-400181 · 2de42c2a
      David M. Lee authored
      ........
        r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line
        
        Minor performance bump by not allocate manager variable struct if we don't need it
      ........
        r400138 | dlee | 2013-09-30 10:24:00 -0500 (Mon, 30 Sep 2013) | 23 lines
        
        Stasis performance improvements
        
        This patch addresses several performance problems that were found in
        the initial performance testing of Asterisk 12.
        
        The Stasis dispatch object was allocated as an AO2 object, even though
        it has a very confined lifecycle. This was replaced with a straight
        ast_malloc().
        
        The Stasis message router was spending an inordinate amount of time
        searching hash tables. In this case, most of our routers had 6 or
        fewer routes in them to begin with. This was replaced with an array
        that's searched linearly for the route.
        
        We more heavily rely on AO2 objects in Asterisk 12, and the memset()
        in ao2_ref() actually became noticeable on the profile. This was
        #ifdef'ed to only run when AO2_DEBUG was enabled.
        
        After being misled by an erroneous comment in taskprocessor.c during
        profiling, the wrong comment was removed.
        
        Review: https://reviewboard.asterisk.org/r/2873/
      ........
        r400178 | dlee | 2013-09-30 13:26:27 -0500 (Mon, 30 Sep 2013) | 24 lines
        
        Taskprocessor optimization; switch Stasis to use taskprocessors
        
        This patch optimizes taskprocessor to use a semaphore for signaling,
        which the OS can do a better job at managing contention and waiting
        that we can with a mutex and condition.
        
        The taskprocessor execution was also slightly optimized to reduce the
        number of locks taken.
        
        The only observable difference in the taskprocessor implementation is
        that when the final reference to the taskprocessor goes away, it will
        execute all tasks to completion instead of discarding the unexecuted
        tasks.
        
        For systems where unnamed semaphores are not supported, a really
        simple semaphore implementation is provided. (Which gives identical
        performance as the original taskprocessor implementation).
        
        The way we ended up implementing Stasis caused the threadpool to be a
        burden instead of a boost to performance. This was switched to just
        use taskprocessors directly for subscriptions.
        
        Review: https://reviewboard.asterisk.org/r/2881/
      ........
        r400180 | dlee | 2013-09-30 13:39:34 -0500 (Mon, 30 Sep 2013) | 28 lines
        
        Optimize how Stasis forwards are dispatched
        
        This patch optimizes how forwards are dispatched in Stasis.
        
        Originally, forwards were dispatched as subscriptions that are invoked
        on the publishing thread. This did not account for the vast number of
        forwards we would end up having in the system, and the amount of work it
        would take to walk though the forward subscriptions.
        
        This patch modifies Stasis so that rather than walking the tree of
        forwards on every dispatch, when forwards and subscriptions are changed,
        the subscriber list for every topic in the tree is changed.
        
        This has a couple of benefits. First, this reduces the workload of
        dispatching messages. It also reduces contention when dispatching to
        different topics that happen to forward to the same aggregation topic
        (as happens with all of the channel, bridge and endpoint topics).
        
        Since forwards are no longer subscriptions, the bulk of this patch is
        simply changing stasis_subscription objects to stasis_forward objects
        (which, admittedly, I should have done in the first place.)
        
        Since this required me to yet again put in a growing array, I finally
        abstracted that out into a set of ast_vector macros in
        asterisk/vector.h.
        
        Review: https://reviewboard.asterisk.org/r/2883/
      ........
        r400181 | dlee | 2013-09-30 13:48:57 -0500 (Mon, 30 Sep 2013) | 28 lines
        
        Remove dispatch object allocation from Stasis publishing
        
        While looking for areas for performance improvement, I realized that an
        unused feature in Stasis was negatively impacting performance.
        
        When a message is sent to a subscriber, a dispatch object is allocated
        for the dispatch, containing the topic the message was published to, the
        subscriber the message is being sent to, and the message itself.
        
        The topic is actually unused by any subscriber in Asterisk today. And
        the subscriber is associated with the taskprocessor the message is being
        dispatched to.
        
        First, this patch removes the unused topic parameter from Stasis
        subscription callbacks.
        
        Second, this patch introduces the concept of taskprocessor local data,
        data that may be set on a taskprocessor and provided along with the data
        pointer when a task is pushed using the ast_taskprocessor_push_local()
        call. This allows the task to have both data specific to that
        taskprocessor, in addition to data specific to that invocation.
        
        With those two changes, the dispatch object can be removed completely,
        and the message is simply refcounted and sent directly to the
        taskprocessor.
        
        Review: https://reviewboard.asterisk.org/r/2884/
      ........
      
      Merged revisions 399887,400138,400178,400180-400181 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      2de42c2a
  19. Sep 27, 2013
  20. Sep 24, 2013
  21. Sep 13, 2013
  22. Sep 05, 2013
  23. Aug 23, 2013
  24. Aug 02, 2013
  25. Jun 08, 2013
    • Matthew Jordan's avatar
      Add backtrace generation to MALLOC_DEBUG memory corruption reports · c43f380d
      Matthew Jordan authored
      This patch allows astmm to access the backtrace generation code in Asterisk.
      When memory is allocated, a backtrace is created and stored with the memory
      region that tracks the allocation. If a memory corruption is detected, the
      backtrace is printed to the astmm log. The backtrace will make use of the
      BETTER_BACKTRACES build option if available.
      
      As a result, this patch moves the backtrace generation code into its own file
      and uses the non-wrapped versions of the C library memory allocation routines.
      This allows the memory allocation code to safely use the backtrace generation
      routines without infinitely recursing.
      
      Review: https://reviewboard.asterisk.org/r/2567
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      c43f380d
  26. May 14, 2013
  27. May 08, 2013
    • David M. Lee's avatar
      Initial support for endpoints. · e06e519a
      David M. Lee authored
      An endpoint is an external device/system that may offer/accept
      channels to/from Asterisk. While this is a very useful concept for end
      users, it is surprisingly not a core concept within Asterisk itself.
      
      This patch defines ast_endpoint as a separate object, which channel
      drivers may use to expose their concept of an endpoint. As the channel
      driver creates channels, it can use ast_endpoint_add_channel() to
      associate channels to the endpoint. This updated the endpoint
      appropriately, and forwards all of the channel's events to the
      endpoint's topic.
      
      In order to avoid excessive locking on the endpoint object itself, the
      mutable state is not accessible via getters. Instead, you can create a
      snapshot using ast_endpoint_snapshot_create() to get a consistent
      snapshot of the internal state.
      
      This patch also includes a set of topics and messages associated with
      endpoints, and implementations of the endpoint-related RESTful
      API. chan_sip was updated to create endpoints with SIP peers, but the
      state of the endpoints is not updated with the state of the peer.
      
      Along for the ride in this patch is a Stasis test API. This is a
      stasis_message_sink object, which can be subscribed to a Stasis
      topic. It has functions for blocking while waiting for conditions in
      the message sink to be fulfilled.
      
      (closes issue ASTERISK-21421)
      Review: https://reviewboard.asterisk.org/r/2492/
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      e06e519a
  28. Apr 25, 2013
    • Mark Michelson's avatar
      Merge the pimp_my_sip branch into trunk. · 74f23180
      Mark Michelson authored
      The pimp_my_sip branch is being merged at this point because
      it offers basic functionality, and from an API standpoint, things
      are complete.
      
      SIP work is *not* feature-complete; however, with the completion
      of the SUBSCRIBE/NOTIFY API, all APIs (except a PUBLISH API) have
      been created, and thus it is possible for developers to attempt
      to create new SIP work.
      
      API documentation can be found in the doxygen in the code, but
      usability documentation is still lacking.
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      74f23180
  29. Apr 03, 2013
  30. Jan 23, 2013
  31. Nov 21, 2012
  32. Nov 20, 2012
  33. Nov 09, 2012
  34. Oct 02, 2012
  35. Sep 12, 2012
    • Richard Mudgett's avatar
      Enhance astobj2 to support other types of containers. · fb1d9a90
      Richard Mudgett authored
      The new API allows for sorted containers, insertion options, duplicate
      handling options, and traversal order options.
      
      * Adds the ability for containers to be sorted when they are created.
      
      * Adds container creation options to handle duplicates when they are
      inserted.
      
      * Adds container creation option to insert objects at the beginning or end
      of the container traversal order.
      
      * Adds OBJ_PARTIAL_KEY to allow searching with a partial key.  The partial
      key works similarly to the OBJ_KEY flag.  (The real search speed
      improvement with this flag will come when red-black trees are added.)
      
      * Adds container traversal and iteration order options: Ascending and
      Descending.
      
      * Adds an AST_DEVMODE compile feature to check the stats and integrity of
      registered containers using the CLI "astobj2 container stats <name>" and
      "astobj2 container check <name>".  The channels container is normally
      registered since it is one of the most important containers in the system.
      
      * Adds ao2_iterator_restart() to allow iteration to be restarted from the
      beginning.
      
      * Changes the generic container object to have a v_method table pointer to
      support other types of containers.
      
      * Changes the container nodes holding objects to be ref counted.
      
      The ref counted nodes and v_method table pointer changes pave the way to
      allow other types of containers.
      
      * Includes a large astobj2 unit test enhancement that tests the new
      features.
      
      (closes issue ASTERISK-19969)
      Reported by: rmudgett
      
      Review: https://reviewboard.asterisk.org/r/2078/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      fb1d9a90
  36. Aug 01, 2012
Loading