andrew000 commited on
Commit
dd3f80b
·
verified ·
1 Parent(s): 7ad8357

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +248 -3
  2. train.parquet +3 -0
README.md CHANGED
@@ -1,3 +1,248 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ task_categories:
4
+ - text-generation
5
+ - feature-extraction
6
+ language:
7
+ - en
8
+ tags:
9
+ - system-calls
10
+ - strace
11
+ - linux
12
+ - syscalls
13
+ - operating-systems
14
+ - code
15
+ pretty_name: Linux Strace Traces Dataset
16
+ size_categories:
17
+ - n<1K
18
+ ---
19
+
20
+ # Linux Strace Traces Dataset
21
+
22
+ A comprehensive collection of strace traces from common Linux utilities, designed for training AI models on system call patterns, program behavior analysis, and operating system interactions.
23
+
24
+ ## Dataset Description
25
+
26
+ This dataset contains **357 strace traces** captured from 119 different Linux command-line utilities, with each utility executed 3 times to capture runtime variations. Each trace includes detailed system call information with timestamps, arguments, and execution times.
27
+
28
+ ### Dataset Statistics
29
+
30
+ - **Total traces**: 357 (119 unique commands × 3 runs each)
31
+ - **Categories**: 8
32
+ - **Format**: Parquet (Hugging Face native)
33
+ - **Raw size**: ~40 MB
34
+ - **Compressed size**: ~5 MB (Parquet)
35
+ - **License**: MIT
36
+
37
+ ### Runtime Diversity
38
+
39
+ Each command was executed 3 times to capture natural variations in program execution:
40
+ - Different process IDs (PIDs)
41
+ - Different memory addresses (ASLR randomization)
42
+ - Different timestamps with microsecond precision
43
+ - Slight variations in syscall timing
44
+
45
+ This diversity helps train more robust AI models that can generalize across different execution contexts.
46
+
47
+ ### Categories
48
+
49
+ 1. **File I/O Operations** (75 traces = 25 commands × 3 runs)
50
+ - File reading: `cat`, `head`, `tail`, `less`
51
+ - File manipulation: `cp`, `mv`, `touch`, `rm`
52
+ - Directory operations: `mkdir`, `rmdir`, `find`
53
+ - File information: `stat`, `file`, `ls`, `du`, `df`
54
+
55
+ 2. **Text Processing** (69 traces = 23 commands × 3 runs)
56
+ - Pattern matching: `grep` (simple, case-insensitive, recursive, count)
57
+ - Text transformation: `sed`, `awk`, `tr`
58
+ - Sorting & filtering: `sort`, `uniq`, `cut`, `paste`
59
+ - Analysis: `wc`, `diff`, `cmp`
60
+
61
+ 3. **Process & System Info** (51 traces = 17 commands × 3 runs)
62
+ - Process listing: `ps`, `top`, `pgrep`
63
+ - System information: `uptime`, `who`, `whoami`, `id`, `uname`, `hostname`
64
+ - Environment: `env`, `printenv`
65
+ - Time: `date`, `cal`
66
+ - Resources: `free`, `vmstat`
67
+
68
+ 4. **Networking** (33 traces = 11 commands × 3 runs)
69
+ - Network requests: `ping`, `curl`, `wget`
70
+ - DNS queries: `host`, `dig`, `nslookup`
71
+ - Network info: `ip`, `ss`, `netstat`
72
+
73
+ 5. **Compression & Archives** (36 traces = 12 commands × 3 runs)
74
+ - Tar operations: create, extract, list (with/without gzip)
75
+ - Compression: `gzip`, `bzip2`
76
+ - Zip operations: `zip`, `unzip`
77
+
78
+ 6. **Scripting & Execution** (45 traces = 15 commands × 3 runs)
79
+ - Shell execution: `bash`, `sh`
80
+ - Python execution: scripts and inline commands
81
+ - Utilities: `sleep`, `echo`, `printf`, `yes`, `seq`
82
+ - Tests: `true`, `false`, `test`, `expr`
83
+
84
+ 7. **Permissions & Ownership** (18 traces = 6 commands × 3 runs)
85
+ - Permission modification: `chmod` (numeric, symbolic, recursive)
86
+ - Permission viewing: `ls -l`
87
+ - Umask operations
88
+
89
+ 8. **Data Operations** (30 traces = 10 commands × 3 runs)
90
+ - Random data: `dd` with `/dev/urandom` and `/dev/zero`
91
+ - Encoding: `base64` (encode/decode)
92
+ - Hashing: `md5sum`, `sha1sum`, `sha256sum`
93
+ - Binary analysis: `hexdump`, `od`, `strings`
94
+
95
+ ## Dataset Structure
96
+
97
+ ### Data Fields
98
+
99
+ - `id` (string): Unique identifier for the trace (e.g., "cat_simple_run1")
100
+ - `category` (string): Category of the utility (e.g., "file_io")
101
+ - `command` (string): Full command executed (e.g., "cat test.txt")
102
+ - `strace` (string): Complete strace output with system calls
103
+ - `duration` (float): Execution time in seconds
104
+ - `timestamp` (string): ISO 8601 timestamp of trace capture
105
+ - `num_lines` (int): Number of lines in the strace output
106
+ - `size_bytes` (int): Size of the strace output in bytes
107
+ - `run_number` (int): Run iteration (1, 2, or 3)
108
+
109
+ ### Data Splits
110
+
111
+ This dataset contains a single split:
112
+ - `train`: 357 examples (119 unique commands × 3 runs)
113
+
114
+ ### Example
115
+
116
+ ```python
117
+ from datasets import load_dataset
118
+
119
+ dataset = load_dataset("YOUR_USERNAME/strace-dataset")
120
+
121
+ # View first example
122
+ example = dataset['train'][0]
123
+ print(f"Command: {example['command']}")
124
+ print(f"Category: {example['category']}")
125
+ print(f"Duration: {example['duration']}s")
126
+ print(f"Strace output (first 500 chars):\n{example['strace'][:500]}")
127
+ ```
128
+
129
+ ## Dataset Creation
130
+
131
+ ### Source Data
132
+
133
+ All traces were generated in a controlled, isolated environment using the `strace` utility with the following flags:
134
+ - `-f`: Follow child processes
135
+ - `-s 256`: Capture up to 256 bytes of string arguments
136
+ - `-tt`: Absolute timestamps with microsecond precision
137
+ - `-T`: Show time spent in each syscall
138
+
139
+ ### Data Collection Process
140
+
141
+ 1. Temporary workspace created with test files (text, binary, CSV, etc.)
142
+ 2. Each utility executed with typical arguments/use cases
143
+ 3. Strace captured all system calls during execution
144
+ 4. Test data cleaned up after collection
145
+ 5. No sensitive information or system-specific paths included
146
+
147
+ ### Safety & Privacy
148
+
149
+ - ✅ No sensitive data (passwords, keys, tokens)
150
+ - ✅ No user-specific information
151
+ - ✅ No production system paths
152
+ - ✅ All operations performed in temporary directories
153
+ - ✅ Safe for open-source release
154
+
155
+ ## Use Cases
156
+
157
+ ### Training AI Models
158
+
159
+ - **System call prediction**: Predict next system calls based on program behavior
160
+ - **Anomaly detection**: Identify unusual syscall patterns
161
+ - **Program behavior modeling**: Learn normal execution patterns
162
+ - **Security analysis**: Detect potential malicious behavior
163
+
164
+ ### Analysis & Research
165
+
166
+ - Understanding program execution flows
167
+ - Comparing syscall patterns across utilities
168
+ - Educational resource for OS concepts
169
+ - Benchmark for trace analysis tools
170
+
171
+ ### Code Examples
172
+
173
+ #### Load and explore the dataset
174
+
175
+ ```python
176
+ from datasets import load_dataset
177
+ import pandas as pd
178
+
179
+ # Load dataset
180
+ ds = load_dataset("andrew000/straces")
181
+
182
+ # Convert to pandas for analysis
183
+ df = pd.DataFrame(ds['train'])
184
+
185
+ # Group by category
186
+ print(df.groupby('category').size())
187
+
188
+ # Find longest-running commands
189
+ print(df.nlargest(5, 'duration')[['command', 'duration']])
190
+
191
+ # Analyze strace patterns
192
+ for example in ds['train']:
193
+ if 'openat' in example['strace']:
194
+ print(f"{example['command']} opens files")
195
+ ```
196
+
197
+ #### Extract specific syscalls
198
+
199
+ ```python
200
+ import re
201
+
202
+ def extract_syscalls(strace_output):
203
+ """Extract syscall names from strace output."""
204
+ pattern = r'\d+\s+[\d:.]+\s+(\w+)\('
205
+ return list(set(re.findall(pattern, strace_output)))
206
+
207
+ # Find all syscalls used by cat
208
+ cat_example = [ex for ex in ds['train'] if ex['id'] == 'cat_simple'][0]
209
+ syscalls = extract_syscalls(cat_example['strace'])
210
+ print(f"cat uses these syscalls: {syscalls}")
211
+ ```
212
+
213
+ ## Limitations
214
+
215
+ - Traces captured on a specific Linux system (kernel version may affect syscalls)
216
+ - Limited to common command-line utilities
217
+ - No multi-threaded or complex concurrent workloads
218
+ - Dataset size: 357 traces (medium-sized dataset)
219
+
220
+ ## Future Work
221
+
222
+ - Add more utilities and use cases
223
+ - Include long-running processes
224
+ - Multi-threaded application traces
225
+ - Different input sizes for scalability analysis
226
+ - Traces from different Linux distributions/kernels
227
+
228
+ ## Citation
229
+
230
+ If you use this dataset in your research, please cite:
231
+
232
+ ```bibtex
233
+ @dataset{strace_traces_2025,
234
+ title={Linux Strace Traces Dataset},
235
+ author={andrew000},
236
+ year={2025},
237
+ publisher={Hugging Face},
238
+ howpublished={\url{https://huggingface.co/datasets/andrew000/straces}}
239
+ }
240
+ ```
241
+
242
+ ## License
243
+
244
+ MIT License - See LICENSE file for details
245
+
246
+ ## Acknowledgments
247
+
248
+ Generated using the `strace` utility on Linux. All traces are from standard open-source utilities.
train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0659bbcd08957d50903196b954d820235da899fe55f9bc7ab3e15d69d4a8725
3
+ size 5105712