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
$ cargo install perfcnt | |
gives this when building raw-cpuid crate: | |
error[E0554]: #![feature] may not be used on the stable release channel | |
--> /home/sean/.cargo/registry/src/github.com-1ecc6299db9ec823/raw-cpuid-2.0.2/src/lib.rs:1:1 | |
| | |
1 | #![feature(prelude_import, asm)] | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
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 _multiprocessing | |
import multiprocessing | |
q = multiprocessing.Queue() | |
COUNT = 2**15 - 1 | |
if COUNT > _multiprocessing.SemLock.SEM_VALUE_MAX: | |
print('It is going to lock up') | |
else: |
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 | |
# | |
# A prototype for consistently handling command line options by | |
# interpreting them as a JSON object, following a schema. | |
# The result of command line option parsing is a "JSON object" which is | |
# can be passed around and manipulated as desired. | |
# | |
# Example: | |
# $ ./options.py --vectorizer-loop-enable=true --inliner-enable=true --inliner-threshold=6 | |
# { |
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 itertools | |
import re | |
import sys | |
try: | |
INPUT = sys.argv[1] | |
except: | |
print('Usage: {} <string-to-expand>'.format(sys.argv[0]), file=sys.stderr) | |
sys.exit(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
//usr/bin/true && clang $0 && exec ./a.out | |
//usr/bin/true && exit 1 | |
/* This program demonstrates how to dynamically create DTrace probes with | |
* fasttrap. It currently works on Mac x86(_64) but can be easily adapted | |
* to other platforms. | |
* | |
* Quickstart: | |
* To see it work, just execute it (that magic at the top will compile and | |
* run it). It will dynamically create a probe and print its probe |