You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Leif Hedstrom (JIRA)" <ji...@apache.org> on 2011/01/29 04:44:46 UTC

[jira] Created: (TS-659) Reduce cross dependencies in various modules

Reduce cross dependencies in various modules
--------------------------------------------

                 Key: TS-659
                 URL: https://issues.apache.org/jira/browse/TS-659
             Project: Traffic Server
          Issue Type: Bug
          Components: Core
            Reporter: Leif Hedstrom
             Fix For: 3.1


Right now, it's very difficult to build things (e.g. traffic_logcat) without including pretty much the entire code base. This is because of cross dependencies between various modules and libraries. So, where "logging" ought to be fairly self sustained, it really isn't. In an attempt to decouple this a little, I made a stub .cc file, which traffic_logcat and traffic_logstats uses. Yes this is ugly. Yes, it should be fixed (hence this bug). But it reduces the binary size for these binaries in the normal build from around 34MB to 4MB, each ...

As a help to isolate *some* of the cross dependencies, here's the ugly stub code:

{code}
#include "libts.h"
#include "LogObject.h"

#if defined(solaris)
#include <sys/types.h>
#include <unistd.h>
#endif


#include "P_Net.h"

int fds_limit = 8000;
UDPNetProcessor &udpNet;

ClassAllocator<UDPPacketInternal> udpPacketAllocator("udpPacketAllocator");

void
UDPConnection::Release()
{
  ink_release_assert(false);
}

void
UDPNetProcessor::FreeBandwidth(Continuation * udpConn)
{
  ink_release_assert(false);
}

NetProcessor& netProcessor;

Action *
UnixNetProcessor::connect_re_internal(Continuation * cont, unsigned int ip, int port,  NetVCOptions * opt)
{
  ink_release_assert(false);
  return NULL;
}


#include "InkAPIInternal.h"
ConfigUpdateCbTable *global_config_cbs = NULL;

void
ConfigUpdateCbTable::invoke(const char *name)
{
  ink_release_assert(false);
}

const char *
event_int_to_string(int event, int blen, char *buffer)
{
  ink_release_assert(false);
  return NULL;
}


struct Machine;
Machine *
this_machine()
{
  ink_release_assert(false);
  return NULL;
}


#include "LogConfig.h"
void
LogConfig::setup_collation(LogConfig * prev_config)
{
  ink_release_assert(false);
}

void
LogConfig::create_pre_defined_objects_with_filter(const PreDefinedFormatInfoList & pre_def_info_list, size_t num_filters,
                                                  LogFilter ** filter, const char *filt_name, bool force_extension)
{
  ink_release_assert(false);
}

int
LogHost::write(LogBuffer * lb, size_t * to_disk, size_t * to_net, size_t * to_pipe)
{
  ink_release_assert(false);
  return 0;
}

{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] [Updated] (TS-659) Reduce cross dependencies in various modules

Posted by "Leif Hedstrom (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-659?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leif Hedstrom updated TS-659:
-----------------------------

    Fix Version/s:     (was: 3.1.2)
                   3.2.0
    
> Reduce cross dependencies in various modules
> --------------------------------------------
>
>                 Key: TS-659
>                 URL: https://issues.apache.org/jira/browse/TS-659
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: Leif Hedstrom
>             Fix For: 3.2.0
>
>
> Right now, it's very difficult to build things (e.g. traffic_logcat) without including pretty much the entire code base. This is because of cross dependencies between various modules and libraries. So, where "logging" ought to be fairly self sustained, it really isn't. In an attempt to decouple this a little, I made a stub .cc file, which traffic_logcat and traffic_logstats uses. Yes this is ugly. Yes, it should be fixed (hence this bug). But it reduces the binary size for these binaries in the normal build from around 34MB to 4MB, each ...
> As a help to isolate *some* of the cross dependencies, here's the ugly stub code:
> {code}
> #include "libts.h"
> #include "LogObject.h"
> #if defined(solaris)
> #include <sys/types.h>
> #include <unistd.h>
> #endif
> #include "P_Net.h"
> int fds_limit = 8000;
> UDPNetProcessor &udpNet;
> ClassAllocator<UDPPacketInternal> udpPacketAllocator("udpPacketAllocator");
> void
> UDPConnection::Release()
> {
>   ink_release_assert(false);
> }
> void
> UDPNetProcessor::FreeBandwidth(Continuation * udpConn)
> {
>   ink_release_assert(false);
> }
> NetProcessor& netProcessor;
> Action *
> UnixNetProcessor::connect_re_internal(Continuation * cont, unsigned int ip, int port,  NetVCOptions * opt)
> {
>   ink_release_assert(false);
>   return NULL;
> }
> #include "InkAPIInternal.h"
> ConfigUpdateCbTable *global_config_cbs = NULL;
> void
> ConfigUpdateCbTable::invoke(const char *name)
> {
>   ink_release_assert(false);
> }
> const char *
> event_int_to_string(int event, int blen, char *buffer)
> {
>   ink_release_assert(false);
>   return NULL;
> }
> struct Machine;
> Machine *
> this_machine()
> {
>   ink_release_assert(false);
>   return NULL;
> }
> #include "LogConfig.h"
> void
> LogConfig::setup_collation(LogConfig * prev_config)
> {
>   ink_release_assert(false);
> }
> void
> LogConfig::create_pre_defined_objects_with_filter(const PreDefinedFormatInfoList & pre_def_info_list, size_t num_filters,
>                                                   LogFilter ** filter, const char *filt_name, bool force_extension)
> {
>   ink_release_assert(false);
> }
> int
> LogHost::write(LogBuffer * lb, size_t * to_disk, size_t * to_net, size_t * to_pipe)
> {
>   ink_release_assert(false);
>   return 0;
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira