This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| import os | |
| import sys | |
| import time | |
| import signal | |
| import subprocess | |
| stap_script = """ | |
| global counter = 0 | |
| global SOCK_STREAM = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /data/project/py/Python-2.7.3/python | |
| import signal | |
| import os | |
| import time | |
| path = "/data/project/py/Python-2.7.3/python" | |
| masterpid = os.getpid() | |
| breakonce = False | |
| def sigint_handler(signum, frame): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import marshal | |
| def main(): | |
| if len(sys.argv) < 2: | |
| print "usage: profile2csv file -> profile.csv" | |
| f = open(sys.argv[1], "r") | |
| k = marshal.loads(f.read()) | |
| f.close() | |
| f = open("profile.csv", "w") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from time import time | |
| from struct import pack | |
| from zlib import compressobj | |
| from zlib import crc32 | |
| import zlib | |
| compresslevel = 9 | |
| _crc = crc32("") & 0xffffffffL | |
| compresser = compressobj(compresslevel, | |
| zlib.DEFLATED, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| LZ4 - Fast LZ compression algorithm | |
| Copyright (C) 2011-2013, Yann Collet. | |
| BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are | |
| met: | |
| * Redistributions of source code must retain the above copyright |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| background-color: whiteSmoke; | |
| } | |
| #navPanel { | |
| margin-top: 3%; | |
| } | |
| #queryResult { | |
| top: 10px; left: 10px; | |
| display: block; | |
| width: 500px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os.path | |
| import pdb | |
| import sys | |
| import io | |
| from struct import unpack | |
| from time import ctime | |
| #flags | |
| CE_STAGEMASK = 0x3000 | |
| CE_EXTENDED = 0x4000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #a very stupid weibo sdk | |
| #-*-encoding=utf-8-*- | |
| import io | |
| import os | |
| import pdb | |
| import urllib | |
| import json | |
| import time | |
| from simple_http import get | |
| from simple_http import post |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| import os | |
| import sys | |
| import signal | |
| stap_script = """ | |
| global i = 0; | |
| global j = 0; | |
| global k = 0; | |
| probe process("/data/project/c/nginx-build/sbin/nginx").function("ngx_worker_process_cycle") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import os | |
| import signal | |
| from traceback import extract_stack | |
| from collections import OrderedDict | |
| """ | |
| MODE_SYSTRACE, ncalls | |
| MODE_TIMER, capture stack every SAMPLE_INTERVAL | |
| trace pure python code only, don't use syscall | |
| """ |