aboutsummaryrefslogtreecommitdiffstats
path: root/package/libnl-tiny/src
Commit message (Expand)AuthorAgeFilesLines
* [package] libnl-tiny: port upstream bugfix 8ee16e6688657886f591f0841cb8e89274...Jo-Philipp Wich2012-04-011-1/+1
* libnl-tiny: export unl_genl_multicast_id()Felix Fietkau2012-01-142-1/+2
* libnl-tiny: fix a potential memleak in an error pathFelix Fietkau2012-01-121-4/+3
* libnl-tiny: remove some more functions to reduce binary sizeFelix Fietkau2011-02-133-2/+9
* libnl-tiny: decrease the size a bit more by removing some unnecessary functionsFelix Fietkau2011-02-134-41/+31
* libnl-tiny: fix compile error with eglibc (#8782)Felix Fietkau2011-02-011-0/+1
* libnl-tiny: add unl a convenience wrapper around the libnl apiFelix Fietkau2011-01-313-1/+337
* libnl-tiny: Fix for c++ compatibilityFelix Fietkau2011-01-263-8/+8
* libnl-tiny: fix a compiler warning that shows up with -pedanticFelix Fietkau2010-10-141-2/+6
* libnl-tiny: fix potential redefinition of offsetofFelix Fietkau2009-05-241-0/+2
* [package] libnl-tiny: add copy of linux/gen_stat.h, it's not available on brc...Jo-Philipp Wich2009-05-101-0/+67
* fix libnl-tiny compile with eglibcFelix Fietkau2009-05-041-0/+1
* libnl-tiny: sync genetlink.h with the kernel headerFelix Fietkau2009-04-301-0/+14
* add libnl-tiny as a small replacement for libnl with only genl support includedFelix Fietkau2009-04-3043-0/+9075
36699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
import gc
import threading
from pympler import muppy, refbrowser
from OpenSSL import SSL
# import os
#os.environ["TK_LIBRARY"] = r"C:\Python27\tcl\tcl8.5"
#os.environ["TCL_LIBRARY"] = r"C:\Python27\tcl\tcl8.5"

# Also noteworthy: guppy, objgraph

step = 0
__memory_locals__ = True


def str_fun(obj):
    if isinstance(obj, dict):
        if "__memory_locals__" in obj:
            return "(-locals-)"
        if "self" in obj and isinstance(obj["self"], refbrowser.InteractiveBrowser):
            return "(-browser-)"
    return str(id(obj)) + ": " + str(obj)[:100].replace("\r\n", "\\r\\n").replace("\n", "\\n")


def request(ctx, flow):
    global step, ssl
    print("==========")
    print("GC: {}".format(gc.collect()))
    print("Threads: {}".format(threading.active_count()))

    step += 1
    if step == 1:
        all_objects = muppy.get_objects()
        ssl = muppy.filter(all_objects, SSL.Connection)[0]
    if step == 2:
        ib = refbrowser.InteractiveBrowser(ssl, 2, str_fun, repeat=False)
        del ssl  # do this to unpollute view
        ib.main(True)
        # print("\r\n".join(str(x)[:100] for x in gc.get_referrers(ssl)))