Skip to content

Instantly share code, notes, and snippets.

View bluecmd's full-sized avatar

Christian Svensson bluecmd

  • Stockholm, Sweden
View GitHub Profile
@bluecmd
bluecmd / benchmark-comparison.trace.json
Last active October 19, 2026 11:03
SolidCraft #2809: prepared-instance reuse measurements and original cuboid capture
{"traceEvents":[{"ph":"M","name":"process_name","pid":1,"tid":0,"args":{"name":"before - isolated STEP item #19509"}},{"args":{"parent_id":null,"span_id":1},"cat":"load","name":"open.total","ph":"B","pid":1,"tid":2,"ts":21.985},{"args":{"parent_id":1,"span_id":3},"cat":"load","name":"open.read","ph":"B","pid":1,"tid":2,"ts":285.99},{"args":{"span_id":3},"cat":"load","name":"open.read","ph":"E","pid":1,"tid":2,"ts":42486.644},{"args":{"parent_id":1,"span_id":4},"cat":"load","name":"open.parse","ph":"B","pid":1,"tid":2,"ts":42589.858},{"args":{"bytes":60088102,"parent_id":4,"span_id":5},"cat":"load","name":"step.import_shared","ph":"B","pid":1,"tid":2,"ts":122241.06599999999},{"args":{"parent_id":5,"span_id":6,"workers":8},"cat":"load","name":"step.import","ph":"B","pid":1,"tid":2,"ts":146638.201},{"args":{"parent_id":6,"span_id":7},"cat":"load","name":"step.parse_and_plan","ph":"B","pid":1,"tid":2,"ts":146775.708},{"args":{"bytes":60088102,"parent_id":7,"span_id":8},"cat":"load","name":"step.p21_parse","ph":"B
@bluecmd
bluecmd / 00-README.md
Created October 18, 2026 22:56
SolidCraft CORE One STEP import profiling: periodic UV boundary expansion, repeated orientation meshing, ARM64 Perfetto traces

SolidCraft CORE One STEP load investigation

Measured at SolidCraft dd23be12d55483cae7f885ce4c14f070edb9bd6d, on an ARM64 DGX Spark CPU. See metadata.json for input hash and build settings. The full STEP model is not included.

Read this first (AI or human)

  • findings.json: compact typed conclusions, measurements, evidence links and unresolved questions.
  • exploratory.summary.json: validated stage aggregates, top entity IDs, cache hits, batch sizes, and explicitly incomplete spans.
  • exploratory.events.jsonl: append-only begin/end events, usable while the application is stuck. Each begin carries span_id, same-thread parent_id, and structured attributes. Times are monotonic microseconds. tid values are trace-local IDs, not Linux TIDs.
  • exploratory.trace.json: the same events plus track labels and a capture-stop marker, accepted by Perfetto. Open in https://ui.perfetto.dev or use Trace Processor with queries.sql.
{
"ACL_TABLE": {
"ACL-IPV4V6-PERMIT-ALL-EXCEPT-BGP": {
"policy_desc": "IXP Participant Affected by Maintenance",
"ports": [
"Ethernet192"
],
"stage": "ingress",
"type": "L3V4V6"
}
@bluecmd
bluecmd / prom-sai-metrics.py
Created May 7, 2024 17:32
Some SONIX SONiC Prometheus mods
#!/usr/bin/env python3
import collections
from redis.client import StrictRedis
import os
import time
while True:
with open('.sai.prom.new', 'w') as f:
r = StrictRedis(db=2, decode_responses=True)
appldb = StrictRedis(db=0, decode_responses=True)
@bluecmd
bluecmd / tuneable.c
Last active October 13, 2024 12:26
Simple utility to test tuneable SFP modules implementing SFF-8690
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdint.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
int fd = open(argv[1], O_RDWR);
if (fd < 0) {
perror("open");
@bluecmd
bluecmd / dmesg
Last active November 17, 2023 10:11
ALFA AWUS036ACU USB AC1200 Wireless Dongle data
[ 2625.068487] usb 3-1: new high-speed USB device number 5 using xhci_hcd
[ 2625.198966] usb 3-1: New USB device found, idVendor=0bda, idProduct=b812, bcdDevice= 2.10
[ 2625.198971] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2625.198972] usb 3-1: Product: 802.11ac NIC
[ 2625.198974] usb 3-1: Manufacturer: Realtek
[ 2625.198975] usb 3-1: SerialNumber: 123456
[ 2625.306462] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 2625.308354] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 2625.383895] rtw_8822bu 3-1:1.0: Firmware version 27.2.0, H2C version 13
[ 2626.076899] usbcore: registered new interface driver rtw_8822bu
@bluecmd
bluecmd / usr.share.audiobookshelf.audiobookshelf
Created August 25, 2023 17:06
AppArmor profile for audiobookshelf
$ cat /etc/apparmor.d/usr.share.audiobookshelf.audiobookshelf
#include <tunables/global>
# vim:syntax=apparmor
/usr/share/audiobookshelf/audiobookshelf {
#include <abstractions/base>
#include <abstractions/nameservice>
#include <abstractions/openssl>
#include <abstractions/user-tmp>
@bluecmd
bluecmd / test.dts
Created June 18, 2023 16:15
simple-mfd issue
cpld: cpld@6,0 {
compatible = "n821,cpld", "syscon", "simple-mfd";
reg = <0x06 0x00 0x50>;
#address-cells = <1>;
#size-cells = <1>;
cpldi2c: n821-cpld-i2c@30 {
compatible = "n821,cpld-i2c";
reg = <0x30 0x8>;
};
@bluecmd
bluecmd / gp700.py
Last active June 5, 2023 10:03
Dicon GP700 GPIB Scanning script for I-matrix
#!/usr/bin/env python3
import pyvisa
import subprocess
import re
import time
def optical_data(iface):
# no json support in ethtool for eeprom dump yet :(
for _ in range(10):
@bluecmd
bluecmd / exporter.py
Last active May 22, 2023 17:13
Example exporter for Smartoptics T-4900 / PacketLight PL1000
from prometheus_client import start_http_server
from prometheus_client.core import GaugeMetricFamily, CounterMetricFamily, REGISTRY
import math
import re
import requests
from urllib.parse import urlparse
class XpdrCollector(object):