2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | paper-toolbar
18 |
19 |
20 |
21 |
22 |
23 |
24 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-menu-behavior/demo/simple-menu.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
33 |
34 |
51 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/webcomponentsjs/build.log:
--------------------------------------------------------------------------------
1 | BUILD LOG
2 | ---------
3 | Build Time: 2015-08-13T12:57:18-0700
4 |
5 | NODEJS INFORMATION
6 | ==================
7 | nodejs: v0.12.7
8 | gulp: 3.9.0
9 | gulp-audit: 1.0.0
10 | gulp-concat: 2.6.0
11 | gulp-header: 1.2.2
12 | gulp-uglify: 1.2.0
13 | run-sequence: 1.1.2
14 | web-component-tester: 3.3.10
15 |
16 | REPO REVISIONS
17 | ==============
18 | webcomponentsjs: 0fc12104ac6f39421c5105a3694aa740ed3835df
19 |
20 | BUILD HASHES
21 | ============
22 | CustomElements.js: 174a3a08af4a551dbd436f5dc527e29c4b989919
23 | CustomElements.min.js: 5d7f8991d0ce8a10307114de07d7ce0d1481f3a5
24 | HTMLImports.js: 6bb55981141fcf206496c34dad811e176f0d13f8
25 | HTMLImports.min.js: f956c8f8751b4e87fd93f5d4a3d053e6e8654d52
26 | MutationObserver.js: e0fce524fed93243c80971b72be846775bb74d53
27 | MutationObserver.min.js: 25c795fa01bd9d9feb3a52cf60ab2b6749b78c75
28 | ShadowDOM.js: 1874e157c0462484bbb34b812d6ec7a97cf63995
29 | ShadowDOM.min.js: 9a7fca60240b59961eba22b941ab0f890124e96b
30 | webcomponents-lite.js: 406c7a34b1ab536e7bdf943c22d4293fbbe464e9
31 | webcomponents-lite.min.js: 97f3d2215d0390bc2e246bd1c1f363b257050f70
32 | webcomponents.js: 8aa2b2a294e917ec792f6b52f27cfbf9b00f519f
33 | webcomponents.min.js: 4df2e85a7b0cd173494a9e8ab71660943734fcf9
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-header-panel/index.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | paper-header-panel
18 |
19 |
20 |
21 |
22 |
23 |
24 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-styles/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "paper-styles",
3 | "version": "1.0.11",
4 | "description": "Common (global) styles for Material Design elements.",
5 | "authors": [
6 | "The Polymer Authors"
7 | ],
8 | "keywords": [
9 | "web-component",
10 | "polymer",
11 | "style"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "git://github.com/PolymerElements/paper-styles.git"
16 | },
17 | "main": "paper-styles.html",
18 | "license": "http://polymer.github.io/LICENSE.txt",
19 | "homepage": "https://github.com/polymerelements/paper-styles/",
20 | "ignore": [
21 | "/.*"
22 | ],
23 | "dependencies": {
24 | "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
25 | "font-roboto": "PolymerElements/font-roboto#^1.0.1",
26 | "polymer": "Polymer/polymer#^1.0.0"
27 | },
28 | "devDependencies": {
29 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
30 | },
31 | "_release": "1.0.11",
32 | "_resolution": {
33 | "type": "version",
34 | "tag": "v1.0.11",
35 | "commit": "347542e9ebe3e6e5f0830ee10e1c20c12956ff2c"
36 | },
37 | "_source": "git://github.com/polymerelements/paper-styles.git",
38 | "_target": "^1.0.0",
39 | "_originalSource": "polymerelements/paper-styles"
40 | }
--------------------------------------------------------------------------------
/internal/cparse/enums.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package cparse
6 |
7 | import (
8 | "fmt"
9 | )
10 |
11 | type Enum struct {
12 | Tag Tok
13 | Ident Tok
14 | }
15 |
16 | // FindEnums finds top-level enumeration constants in toks.
17 | func FindEnums(tokens []Tok) ([]Enum, error) {
18 | t := toks(tokens)
19 | var enums []Enum
20 | for len(t) > 0 {
21 | switch {
22 | case t.Try(TokOp, "{"):
23 | t.SkipBalanced("}")
24 | case t.Try(TokOp, "("):
25 | t.SkipBalanced(")")
26 | case t.Try(TokOp, "["):
27 | t.SkipBalanced("]")
28 | case t.Try(TokKeyword, "enum"):
29 | // Found an enum. Skip tag, if any.
30 | tag, _ := t.TryIdent()
31 | if t.Try(TokOp, "{") {
32 | for {
33 | if t.Try(TokOp, "}") {
34 | break
35 | }
36 | id, ok := t.TryIdent()
37 | if !ok {
38 | return nil, fmt.Errorf("expected identifier")
39 | }
40 | enums = append(enums, Enum{tag, id})
41 | // Consume initializer.
42 | if t.Try(TokOp, "=") {
43 | t.SkipBalanced(",", "}")
44 | }
45 | t.Try(TokOp, ",")
46 | }
47 | }
48 | default:
49 | t.Skip(1)
50 | }
51 | }
52 | return enums, nil
53 | }
54 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-meta/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "iron-meta",
3 | "version": "1.0.3",
4 | "keywords": [
5 | "web-components",
6 | "polymer"
7 | ],
8 | "license": "http://polymer.github.io/LICENSE.txt",
9 | "description": "Useful for sharing information across a DOM tree",
10 | "private": true,
11 | "authors": [
12 | "The Polymer Authors"
13 | ],
14 | "repository": {
15 | "type": "git",
16 | "url": "git://github.com/PolymerElements/iron-meta.git"
17 | },
18 | "dependencies": {
19 | "polymer": "Polymer/polymer#^1.0.0"
20 | },
21 | "devDependencies": {
22 | "paper-styles": "polymerelements/paper-styles#^1.0.4",
23 | "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
24 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
25 | "web-component-tester": "*",
26 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
27 | },
28 | "homepage": "https://github.com/polymerelements/iron-meta",
29 | "_release": "1.0.3",
30 | "_resolution": {
31 | "type": "version",
32 | "tag": "v1.0.3",
33 | "commit": "91529259262b0d8f33fed44bc3fd47aedf35cb04"
34 | },
35 | "_source": "git://github.com/polymerelements/iron-meta.git",
36 | "_target": "^1.0.0",
37 | "_originalSource": "polymerelements/iron-meta"
38 | }
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-ajax/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "iron-ajax",
3 | "version": "1.0.4",
4 | "description": "Makes it easy to make ajax calls and parse the response",
5 | "private": true,
6 | "authors": [
7 | "The Polymer Authors"
8 | ],
9 | "keywords": [
10 | "web-components",
11 | "polymer",
12 | "ajax"
13 | ],
14 | "main": [
15 | "iron-ajax.html",
16 | "iron-request.html"
17 | ],
18 | "repository": {
19 | "type": "git",
20 | "url": "git://github.com/PolymerElements/iron-ajax.git"
21 | },
22 | "license": "http://polymer.github.io/LICENSE.txt",
23 | "homepage": "https://github.com/PolymerElements/iron-ajax",
24 | "ignore": [],
25 | "dependencies": {
26 | "promise-polyfill": "polymerlabs/promise-polyfill#^1.0.0",
27 | "polymer": "Polymer/polymer#^1.0.0"
28 | },
29 | "devDependencies": {
30 | "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
31 | "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
32 | "iron-image": "polymerelements/iron-image#^1.0.0",
33 | "paper-styles": "polymerelements/paper-styles#^1.0.0",
34 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
35 | "web-component-tester": "*",
36 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-ripple/hero.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-selector/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "iron-selector",
3 | "version": "1.0.2",
4 | "description": "Manages a set of elements that can be selected",
5 | "private": true,
6 | "license": "http://polymer.github.io/LICENSE.txt",
7 | "main": [
8 | "iron-selector.html"
9 | ],
10 | "authors": [
11 | "The Polymer Authors"
12 | ],
13 | "keywords": [
14 | "web-components",
15 | "polymer",
16 | "selector"
17 | ],
18 | "repository": {
19 | "type": "git",
20 | "url": "git://github.com/PolymerElements/iron-selector.git"
21 | },
22 | "dependencies": {
23 | "polymer": "Polymer/polymer#^1.0.0"
24 | },
25 | "devDependencies": {
26 | "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
27 | "test-fixture": "PolymerElements/test-fixture#^1.0.0",
28 | "web-component-tester": "*",
29 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
30 | },
31 | "homepage": "https://github.com/PolymerElements/iron-selector",
32 | "_release": "1.0.2",
33 | "_resolution": {
34 | "type": "version",
35 | "tag": "v1.0.2",
36 | "commit": "ea22d91d11ba6f72c01faa952d5e600f9d1773cf"
37 | },
38 | "_source": "git://github.com/PolymerElements/iron-selector.git",
39 | "_target": "^1.0.0",
40 | "_originalSource": "PolymerElements/iron-selector"
41 | }
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-icon-button/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "paper-icon-button",
3 | "private": true,
4 | "version": "1.0.3",
5 | "license": "http://polymer.github.io/LICENSE.txt",
6 | "description": "A material design icon button",
7 | "main": "paper-icon-button.html",
8 | "author": [
9 | "The Polymer Authors"
10 | ],
11 | "keywords": [
12 | "web-components",
13 | "polymer",
14 | "button",
15 | "icon",
16 | "control"
17 | ],
18 | "repository": {
19 | "type": "git",
20 | "url": "git://github.com/PolymerElements/paper-icon-button.git"
21 | },
22 | "dependencies": {
23 | "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
24 | "iron-icon": "polymerelements/iron-icon#^1.0.0",
25 | "iron-icons": "polymerelements/iron-icons#^1.0.0",
26 | "paper-behaviors": "polymerelements/paper-behaviors#^1.0.0",
27 | "paper-ripple": "polymerelements/paper-ripple#^1.0.0",
28 | "paper-styles": "polymerelements/paper-styles#^1.0.0",
29 | "polymer": "Polymer/polymer#^1.0.0"
30 | },
31 | "devDependencies": {
32 | "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
33 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
34 | "web-component-tester": "*",
35 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-card/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "paper-card",
3 | "version": "1.0.3",
4 | "description": "Material design piece of paper with unique related data",
5 | "authors": [
6 | "The Polymer Authors"
7 | ],
8 | "keywords": [
9 | "web-components",
10 | "polymer",
11 | "card"
12 | ],
13 | "main": [
14 | "paper-card.html"
15 | ],
16 | "private": true,
17 | "repository": {
18 | "type": "git",
19 | "url": "git://github.com/PolymerElements/paper-card.git"
20 | },
21 | "license": "http://polymer.github.io/LICENSE.txt",
22 | "homepage": "https://github.com/PolymerElements/paper-card",
23 | "ignore": [],
24 | "dependencies": {
25 | "polymer": "Polymer/polymer#^1.1.0",
26 | "paper-material": "PolymerElements/paper-material#^1.0.0"
27 | },
28 | "devDependencies": {
29 | "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
30 | "test-fixture": "PolymerElements/test-fixture#^1.0.0",
31 | "web-component-tester": "*",
32 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
33 | "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0",
34 | "paper-button": "PolymerElements/paper-button#^1.0.0",
35 | "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
36 | "paper-styles": "PolymerElements/paper-styles#^1.0.0"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-menu-behavior/demo/simple-menubar.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
37 |
38 |
55 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-behaviors/test/test-radio-button.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
26 |
27 |
30 |
31 |
32 |
33 |
42 |
--------------------------------------------------------------------------------
/scripts/membw:
--------------------------------------------------------------------------------
1 | #!/bin/zsh
2 |
3 | # Measure read/write memory bandwidth at memory controllers.
4 | #
5 | # Based on "Intel® Xeon® Processor E5 v2 and E7 v2 Product Families
6 | # Uncore Performance Monitoring Reference Manual".
7 |
8 | set -e
9 |
10 | family=$(grep '^cpu family' /proc/cpuinfo | awk '{print $4; exit}')
11 | model=$(grep '^model' /proc/cpuinfo | awk '{print $3; exit}')
12 | fm=$(printf "%02x" $family)_$(printf "%02x" $model)
13 |
14 | # TODO: This works for all E5 v2 and E7 v2. There are probably other
15 | # CPUIDs that apply.
16 | if [[ $fm != 06_3e ]]; then
17 | echo "Unsupported family/model $fm" >&2
18 | exit 1
19 | fi
20 |
21 | # Get iMC uncore boxes. In the E5 v2 there are four.
22 | imcs=($(cd -q /sys/bus/event_source/devices/; echo uncore_imc_*))
23 |
24 | # Construct the event list.
25 | events=()
26 | for imc in $imcs; do
27 | events=($events -e $imc/event=0x04,umask=0x03/ -e $imc/event=0x04,umask=0x0c/)
28 | done
29 |
30 | # Uncore events must be monitored system-wide.
31 | output=$(perf stat -a $events $* 2>&1)
32 | echo $output
33 |
34 | echo $output | awk '
35 | /uncore_imc_.*umask=0x03/ {read += $1}
36 | /uncore_imc_.*umask=0x0c/ {write += $1}
37 | /time elapsed/ {time = $1}
38 | END {
39 | print (64 * read / time / 1024 / 1024) " MiB read per second"
40 | print (64 * write / time / 1024 / 1024) " MiB written per second"
41 | }'
42 |
--------------------------------------------------------------------------------
/perfsession/ranges.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package perfsession
6 |
7 | import "sort"
8 |
9 | // Ranges stores data associated with ranges of uint64 values and
10 | // supports efficient lookup.
11 | type Ranges struct {
12 | rs []rangeEnt
13 | sorted bool
14 | }
15 |
16 | type rangeEnt struct {
17 | lo, hi uint64
18 | val interface{}
19 | }
20 |
21 | // Add inserts val for range [lo, hi).
22 | //
23 | // Add is undefined if [lo, hi) overlaps a range already in r.
24 | func (r *Ranges) Add(lo, hi uint64, val interface{}) {
25 | r.rs = append(r.rs, rangeEnt{lo, hi, val})
26 | r.sorted = false
27 | }
28 |
29 | // Get returns the range and the value for the range containing idx.
30 | func (r *Ranges) Get(idx uint64) (lo, hi uint64, val interface{}, ok bool) {
31 | if r == nil {
32 | return 0, 0, nil, false
33 | }
34 |
35 | rs := r.rs
36 | if !r.sorted {
37 | sort.Slice(rs, func(i, j int) bool {
38 | return rs[i].lo < rs[j].lo
39 | })
40 | r.sorted = true
41 | }
42 |
43 | i := sort.Search(len(rs), func(i int) bool {
44 | return idx < rs[i].hi
45 | })
46 | if i < len(rs) && rs[i].lo <= idx && idx < rs[i].hi {
47 | return rs[i].lo, rs[i].hi, rs[i].val, true
48 | }
49 | return 0, 0, nil, false
50 | }
51 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-behaviors/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "paper-behaviors",
3 | "version": "1.0.3",
4 | "description": "Common behaviors across the paper elements",
5 | "authors": [
6 | "The Polymer Authors"
7 | ],
8 | "main": [
9 | "paper-button-behavior.html",
10 | "paper-radio-button-behavior.html"
11 | ],
12 | "keywords": [
13 | "web-components",
14 | "web-component",
15 | "polymer",
16 | "paper",
17 | "behavior"
18 | ],
19 | "private": true,
20 | "repository": {
21 | "type": "git",
22 | "url": "git://github.com/PolymerElements/paper-behaviors"
23 | },
24 | "license": "http://polymer.github.io/LICENSE.txt",
25 | "homepage": "https://github.com/PolymerElements/paper-behaviors",
26 | "dependencies": {
27 | "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
28 | "polymer": "Polymer/polymer#^1.0.0"
29 | },
30 | "devDependencies": {
31 | "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
32 | "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
33 | "paper-material": "PolymerElements/paper-material#^1.0.0",
34 | "paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
35 | "test-fixture": "PolymerElements/test-fixture#^1.0.0",
36 | "web-component-tester": "*",
37 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-resizable-behavior/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "iron-resizable-behavior",
3 | "version": "1.0.2",
4 | "license": "http://polymer.github.io/LICENSE.txt",
5 | "description": "Coordinates the flow of resizeable elements",
6 | "private": true,
7 | "main": "iron-resizable-behavior.html",
8 | "authors": [
9 | "The Polymer Authors"
10 | ],
11 | "keywords": [
12 | "web-components",
13 | "polymer",
14 | "iron",
15 | "behavior"
16 | ],
17 | "repository": {
18 | "type": "git",
19 | "url": "git://github.com/PolymerElements/iron-resizable-behavior.git"
20 | },
21 | "dependencies": {
22 | "polymer": "Polymer/polymer#^1.0.0"
23 | },
24 | "devDependencies": {
25 | "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
26 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
27 | "web-component-tester": "*",
28 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
29 | },
30 | "homepage": "https://github.com/polymerelements/iron-resizable-behavior",
31 | "_release": "1.0.2",
32 | "_resolution": {
33 | "type": "version",
34 | "tag": "v1.0.2",
35 | "commit": "85de8ba28be2bf17c81d6436ef1119022b003674"
36 | },
37 | "_source": "git://github.com/polymerelements/iron-resizable-behavior.git",
38 | "_target": "^1.0.0",
39 | "_originalSource": "polymerelements/iron-resizable-behavior"
40 | }
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-selector/README.md:
--------------------------------------------------------------------------------
1 | iron-selector
2 | =============
3 |
4 | `iron-selector` is an element which can be used to manage a list of elements
5 | that can be selected. Tapping on the item will make the item selected. The `selected` indicates
6 | which item is being selected. The default is to use the index of the item.
7 |
8 | Example:
9 |
10 | ```html
11 |
12 | Item 1
13 | Item 2
14 | Item 3
15 |
16 | ```
17 |
18 | If you want to use the attribute value of an element for `selected` instead of the index,
19 | set `attrForSelected` to the name of the attribute. For example, if you want to select item by
20 | `name`, set `attrForSelected` to `name`.
21 |
22 | Example:
23 |
24 | ```html
25 |
26 | Foo
27 | Bar
28 | Zot
29 |
30 | ```
31 |
32 | `iron-selector` is not styled. Use the `iron-selected` CSS class to style the selected element.
33 |
34 | Example:
35 |
36 | ```html
37 |
42 |
43 | ...
44 |
45 |
46 | Item 1
47 | Item 2
48 | Item 3
49 |
50 | ```
51 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-iconset-svg/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "iron-iconset-svg",
3 | "description": "Manages a set of svg icons",
4 | "version": "1.0.4",
5 | "keywords": [
6 | "web-components",
7 | "polymer",
8 | "icon"
9 | ],
10 | "license": "http://polymer.github.io/LICENSE.txt",
11 | "private": true,
12 | "authors": [
13 | "The Polymer Authors"
14 | ],
15 | "repository": {
16 | "type": "git",
17 | "url": "git://github.com/PolymerElements/iron-iconset-svg.git"
18 | },
19 | "dependencies": {
20 | "polymer": "polymer/polymer#^1.0.0",
21 | "iron-meta": "polymerelements/iron-meta#^1.0.0"
22 | },
23 | "devDependencies": {
24 | "paper-styles": "polymerelements/paper-styles#^1.0.2",
25 | "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
26 | "iron-icon": "polymerelements/iron-icon#^1.0.0",
27 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
28 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
29 | "web-component-tester": "*"
30 | },
31 | "homepage": "https://github.com/polymerelements/iron-iconset-svg",
32 | "_release": "1.0.4",
33 | "_resolution": {
34 | "type": "version",
35 | "tag": "v1.0.4",
36 | "commit": "795aa82ac22971421bc4375efbd2419ebba9099f"
37 | },
38 | "_source": "git://github.com/polymerelements/iron-iconset-svg.git",
39 | "_target": "^1.0.0",
40 | "_originalSource": "polymerelements/iron-iconset-svg"
41 | }
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-button/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "paper-button",
3 | "version": "1.0.3",
4 | "description": "Material design button",
5 | "authors": [
6 | "The Polymer Authors"
7 | ],
8 | "keywords": [
9 | "web-components",
10 | "web-component",
11 | "polymer",
12 | "paper",
13 | "button"
14 | ],
15 | "main": "paper-button.html",
16 | "private": true,
17 | "repository": {
18 | "type": "git",
19 | "url": "git://github.com/PolymerElements/paper-button"
20 | },
21 | "license": "http://polymer.github.io/LICENSE.txt",
22 | "homepage": "https://github.com/PolymerElements/paper-button",
23 | "dependencies": {
24 | "paper-ripple": "polymerelements/paper-ripple#^1.0.0",
25 | "paper-material": "polymerelements/paper-material#^1.0.0",
26 | "paper-behaviors": "polymerelements/paper-behaviors#^1.0.0",
27 | "polymer": "Polymer/polymer#^1.0.0"
28 | },
29 | "devDependencies": {
30 | "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
31 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
32 | "iron-icon": "polymerelements/iron-icon#^1.0.0",
33 | "iron-icons": "polymerelements/iron-icons#^1.0.0",
34 | "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
35 | "paper-styles": "polymerelements/paper-styles#^1.0.0",
36 | "web-component-tester": "*",
37 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-ripple/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "paper-ripple",
3 | "version": "1.0.1",
4 | "license": "http://polymer.github.io/LICENSE.txt",
5 | "description": "Adds a material design ripple to any container",
6 | "private": true,
7 | "authors": [
8 | "The Polymer Authors"
9 | ],
10 | "keywords": [
11 | "web-components",
12 | "polymer",
13 | "ripple"
14 | ],
15 | "main": "paper-ripple.html",
16 | "dependencies": {
17 | "polymer": "Polymer/polymer#^1.0.0",
18 | "iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
19 | },
20 | "devDependencies": {
21 | "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
22 | "iron-icon": "polymerelements/iron-icon#^1.0.0",
23 | "iron-icons": "polymerelements/iron-icons#^1.0.0",
24 | "paper-styles": "polymerelements/paper-styles#^1.0.0",
25 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
26 | "web-component-tester": "*",
27 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
28 | },
29 | "homepage": "https://github.com/polymerelements/paper-ripple",
30 | "_release": "1.0.1",
31 | "_resolution": {
32 | "type": "version",
33 | "tag": "v1.0.1",
34 | "commit": "af19d904802437c305390bb03415c11661de3d0a"
35 | },
36 | "_source": "git://github.com/polymerelements/paper-ripple.git",
37 | "_target": "^1.0.0",
38 | "_originalSource": "polymerelements/paper-ripple"
39 | }
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-material/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "paper-material",
3 | "version": "1.0.1",
4 | "description": "A material design container that looks like a lifted sheet of paper",
5 | "private": true,
6 | "authors": [
7 | "The Polymer Authors"
8 | ],
9 | "keywords": [
10 | "web-components",
11 | "web-component",
12 | "polymer",
13 | "paper",
14 | "container"
15 | ],
16 | "main": [
17 | "paper-material.html"
18 | ],
19 | "repository": {
20 | "type": "git",
21 | "url": "git://github.com/PolymerElements/paper-material"
22 | },
23 | "license": "http://polymer.github.io/LICENSE.txt",
24 | "homepage": "https://github.com/PolymerElements/paper-material",
25 | "ignore": [],
26 | "dependencies": {
27 | "paper-styles": "polymerelements/paper-styles#^1.0.0",
28 | "polymer": "Polymer/polymer#^1.0.0"
29 | },
30 | "devDependencies": {
31 | "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
32 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
33 | "web-component-tester": "*",
34 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
35 | },
36 | "_release": "1.0.1",
37 | "_resolution": {
38 | "type": "version",
39 | "tag": "v1.0.1",
40 | "commit": "1663016f2b9f1deb197cfa93ef16d45d3de815c8"
41 | },
42 | "_source": "git://github.com/polymerelements/paper-material.git",
43 | "_target": "^1.0.0",
44 | "_originalSource": "polymerelements/paper-material"
45 | }
--------------------------------------------------------------------------------
/perffile/datasrclevelnum_string.go:
--------------------------------------------------------------------------------
1 | // Code generated by "stringer -type=DataSrcLevelNum"; DO NOT EDIT.
2 |
3 | package perffile
4 |
5 | import "strconv"
6 |
7 | func _() {
8 | // An "invalid array index" compiler error signifies that the constant values have changed.
9 | // Re-run the stringer command to generate them again.
10 | var x [1]struct{}
11 | _ = x[DataSrcLevelNumL1-1]
12 | _ = x[DataSrcLevelNumL2-2]
13 | _ = x[DataSrcLevelNumL3-3]
14 | _ = x[DataSrcLevelNumL4-4]
15 | _ = x[DataSrcLevelNumAnyCache-11]
16 | _ = x[DataSrcLevelNumLFB-12]
17 | _ = x[DataSrcLevelNumRAM-13]
18 | _ = x[DataSrcLevelNumPMEM-14]
19 | _ = x[DataSrcLevelNumNA-15]
20 | }
21 |
22 | const (
23 | _DataSrcLevelNum_name_0 = "DataSrcLevelNumL1DataSrcLevelNumL2DataSrcLevelNumL3DataSrcLevelNumL4"
24 | _DataSrcLevelNum_name_1 = "DataSrcLevelNumAnyCacheDataSrcLevelNumLFBDataSrcLevelNumRAMDataSrcLevelNumPMEMDataSrcLevelNumNA"
25 | )
26 |
27 | var (
28 | _DataSrcLevelNum_index_0 = [...]uint8{0, 17, 34, 51, 68}
29 | _DataSrcLevelNum_index_1 = [...]uint8{0, 23, 41, 59, 78, 95}
30 | )
31 |
32 | func (i DataSrcLevelNum) String() string {
33 | switch {
34 | case 1 <= i && i <= 4:
35 | i -= 1
36 | return _DataSrcLevelNum_name_0[_DataSrcLevelNum_index_0[i]:_DataSrcLevelNum_index_0[i+1]]
37 | case 11 <= i && i <= 15:
38 | i -= 11
39 | return _DataSrcLevelNum_name_1[_DataSrcLevelNum_index_1[i]:_DataSrcLevelNum_index_1[i+1]]
40 | default:
41 | return "DataSrcLevelNum(" + strconv.FormatInt(int64(i), 10) + ")"
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-behaviors/test/test-elements.html:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
26 |
27 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
67 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-button/README.md:
--------------------------------------------------------------------------------
1 | paper-button
2 | ============
3 |
4 | Material Design: Buttons
5 |
6 | `paper-button` is a button. When the user touches the button, a ripple effect emanates
7 | from the point of contact. It may be flat or raised. A raised button is styled with a
8 | shadow.
9 |
10 | Example:
11 | ```html
12 | flat button
13 | raised button
14 | No ripple effect
15 | ```
16 | You may use custom DOM in the button body to create a variety of buttons. For example, to
17 | create a button with an icon and some text:
18 |
19 | ```html
20 |
21 |
22 | custom button content
23 |
24 | ```
25 | ## Styling
26 |
27 | Style the button with CSS as you would a normal DOM element.
28 |
29 | ```css
30 | /* make #my-button green with yellow text */
31 | #my-button {
32 | background: green;
33 | color: yellow;
34 | }
35 | ```
36 | By default, the ripple is the same color as the foreground at 25% opacity. You may
37 | customize the color using this selector:
38 |
39 | ```css
40 | /* make #my-button use a blue ripple instead of foreground color */
41 | #my-button::shadow paper-ripple {
42 | color: blue;
43 | }
44 | ```
45 | The opacity of the ripple is not customizable via CSS.
46 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-menu-behavior/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "iron-menu-behavior",
3 | "version": "1.0.1",
4 | "description": "Provides accessible menu behavior",
5 | "authors": "The Polymer Authors",
6 | "keywords": [
7 | "web-components",
8 | "polymer",
9 | "behavior",
10 | "menu"
11 | ],
12 | "main": "iron-menu-behavior.html",
13 | "private": true,
14 | "repository": {
15 | "type": "git",
16 | "url": "git://github.com/PolymerElements/iron-menu-behavior"
17 | },
18 | "license": "http://polymer.github.io/LICENSE.txt",
19 | "homepage": "https://github.com/PolymerElements/iron-menu-behavior",
20 | "ignore": [],
21 | "dependencies": {
22 | "iron-selector": "PolymerElements/iron-selector#^1.0.0",
23 | "polymer": "Polymer/polymer#^1.0.0",
24 | "iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
25 | },
26 | "devDependencies": {
27 | "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
28 | "test-fixture": "PolymerElements/test-fixture#^1.0.0",
29 | "web-component-tester": "*",
30 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
31 | },
32 | "_release": "1.0.1",
33 | "_resolution": {
34 | "type": "version",
35 | "tag": "v1.0.1",
36 | "commit": "3809f0eb7461c8ca63640aaa238775b3a25aa578"
37 | },
38 | "_source": "git://github.com/polymerelements/iron-menu-behavior.git",
39 | "_target": "^1.0.0",
40 | "_originalSource": "polymerelements/iron-menu-behavior"
41 | }
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-behaviors/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "iron-behaviors",
3 | "version": "1.0.7",
4 | "description": "Provides a set of behaviors for the iron elements",
5 | "private": true,
6 | "authors": [
7 | "The Polymer Authors"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/PolymerElements/iron-behaviors.git"
12 | },
13 | "main": [
14 | "iron-button-state.html",
15 | "iron-control-state.html"
16 | ],
17 | "license": "http://polymer.github.io/LICENSE.txt",
18 | "dependencies": {
19 | "polymer": "Polymer/polymer#^1.0.0",
20 | "iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0"
21 | },
22 | "devDependencies": {
23 | "paper-styles": "polymerelements/paper-styles#^1.0.2",
24 | "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
25 | "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
26 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
27 | "web-component-tester": "*",
28 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
29 | },
30 | "homepage": "https://github.com/PolymerElements/iron-behaviors",
31 | "_release": "1.0.7",
32 | "_resolution": {
33 | "type": "version",
34 | "tag": "v1.0.7",
35 | "commit": "033889b20c6b9ebb45a1ff153fbd667e153fe3f7"
36 | },
37 | "_source": "git://github.com/PolymerElements/iron-behaviors.git",
38 | "_target": "^1.0.0",
39 | "_originalSource": "PolymerElements/iron-behaviors"
40 | }
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-meta/README.md:
--------------------------------------------------------------------------------
1 | iron-meta
2 | =========
3 |
4 | `iron-meta` is a generic element you can use for sharing information across the DOM tree.
5 | It uses [monostate pattern](http://c2.com/cgi/wiki?MonostatePattern) such that any
6 | instance of iron-meta has access to the shared
7 | information. You can use `iron-meta` to share whatever you want (or create an extension
8 | [like x-meta] for enhancements).
9 |
10 | The `iron-meta` instances containing your actual data can be loaded in an import,
11 | or constructed in any way you see fit. The only requirement is that you create them
12 | before you try to access them.
13 |
14 | Examples:
15 |
16 | If I create an instance like this:
17 |
18 | ```html
19 |
20 | ```
21 |
22 | Note that value="foo/bar" is the metadata I've defined. I could define more
23 | attributes or use child nodes to define additional metadata.
24 |
25 | Now I can access that element (and it's metadata) from any iron-meta instance
26 | via the byKey method, e.g.
27 |
28 | ```javascript
29 | meta.byKey('info').getAttribute('value');
30 | ```
31 |
32 | Pure imperative form would be like:
33 |
34 | ```javascript
35 | document.createElement('iron-meta').byKey('info').getAttribute('value');
36 | ```
37 |
38 | Or, in a Polymer element, you can include a meta in your template:
39 |
40 | ```html
41 |
42 | ```
43 |
44 | ```javascript
45 | this.$.meta.byKey('info').getAttribute('value');
46 | ```
47 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-icon/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "iron-icon",
3 | "private": true,
4 | "version": "1.0.3",
5 | "license": "http://polymer.github.io/LICENSE.txt",
6 | "description": "An element that supports displaying an icon",
7 | "main": "iron-icon.html",
8 | "author": [
9 | "The Polymer Authors"
10 | ],
11 | "keywords": [
12 | "web-components",
13 | "polymer",
14 | "icon"
15 | ],
16 | "repository": {
17 | "type": "git",
18 | "url": "git://github.com/PolymerElements/iron-icon.git"
19 | },
20 | "dependencies": {
21 | "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
22 | "iron-meta": "polymerelements/iron-meta#^1.0.0",
23 | "polymer": "Polymer/polymer#^1.0.0"
24 | },
25 | "devDependencies": {
26 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
27 | "iron-iconset": "polymerelements/iron-iconset#^1.0.0",
28 | "iron-icons": "polymerelements/iron-icons#^1.0.0",
29 | "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
30 | "web-component-tester": "*",
31 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
32 | },
33 | "homepage": "https://github.com/polymerelements/iron-icon",
34 | "_release": "1.0.3",
35 | "_resolution": {
36 | "type": "version",
37 | "tag": "v1.0.3",
38 | "commit": "818c2d2af2d3287a444e4cf0a19c2b5717d480e8"
39 | },
40 | "_source": "git://github.com/polymerelements/iron-icon.git",
41 | "_target": "^1.0.0",
42 | "_originalSource": "polymerelements/iron-icon"
43 | }
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-pages/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "iron-pages",
3 | "version": "1.0.3",
4 | "license": "http://polymer.github.io/LICENSE.txt",
5 | "description": "Organizes a set of pages and shows one at a time",
6 | "main": "iron-pages.html",
7 | "private": true,
8 | "authors": [
9 | "The Polymer Authors"
10 | ],
11 | "repository": {
12 | "type": "git",
13 | "url": "git://github.com/PolymerElements/iron-pages.git"
14 | },
15 | "keywords": [
16 | "web-components",
17 | "polymer",
18 | "container"
19 | ],
20 | "dependencies": {
21 | "iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0",
22 | "iron-selector": "polymerelements/iron-selector#^1.0.0",
23 | "polymer": "Polymer/polymer#^1.0.0"
24 | },
25 | "devDependencies": {
26 | "paper-styles": "polymerelements/paper-styles#^1.0.2",
27 | "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
28 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
29 | "web-component-tester": "*",
30 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
31 | },
32 | "homepage": "https://github.com/PolymerElements/iron-pages",
33 | "_release": "1.0.3",
34 | "_resolution": {
35 | "type": "version",
36 | "tag": "v1.0.3",
37 | "commit": "ca6e7892786d60d8cb6935d8376b27c3851fdbf5"
38 | },
39 | "_source": "git://github.com/PolymerElements/iron-pages.git",
40 | "_target": "~1.0.3",
41 | "_originalSource": "PolymerElements/iron-pages",
42 | "_direct": true
43 | }
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-a11y-keys-behavior/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "iron-a11y-keys-behavior",
3 | "version": "1.0.5",
4 | "description": "A behavior that enables keybindings for greater a11y.",
5 | "keywords": [
6 | "web-components",
7 | "web-component",
8 | "polymer",
9 | "a11y",
10 | "input"
11 | ],
12 | "authors": [
13 | "The Polymer Authors"
14 | ],
15 | "repository": {
16 | "type": "git",
17 | "url": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git"
18 | },
19 | "main": "iron-a11y-keys-behavior.html",
20 | "license": "http://polymer.github.io/LICENSE.txt",
21 | "dependencies": {
22 | "polymer": "Polymer/polymer#^1.0.0"
23 | },
24 | "devDependencies": {
25 | "paper-styles": "PolymerElements/paper-styles#^1.0.2",
26 | "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
27 | "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
28 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
29 | "web-component-tester": "*",
30 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
31 | },
32 | "homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior",
33 | "_release": "1.0.5",
34 | "_resolution": {
35 | "type": "version",
36 | "tag": "v1.0.5",
37 | "commit": "cf833eab5c55a26c5aa92e56d3fcb079120ce66a"
38 | },
39 | "_source": "git://github.com/polymerelements/iron-a11y-keys-behavior.git",
40 | "_target": "^1.0.0",
41 | "_originalSource": "polymerelements/iron-a11y-keys-behavior"
42 | }
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-meta/test/basic.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 | iron-meta-basic
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-behaviors/paper-inky-focus-behavior.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
45 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-header-panel/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "paper-header-panel",
3 | "version": "1.0.4",
4 | "description": "A header and content wrapper for layout with headers",
5 | "authors": [
6 | "The Polymer Authors"
7 | ],
8 | "keywords": [
9 | "web-components",
10 | "polymer",
11 | "layout"
12 | ],
13 | "main": [
14 | "paper-header-panel.html"
15 | ],
16 | "repository": {
17 | "type": "git",
18 | "url": "git://github.com/PolymerElements/paper-header-panel.git"
19 | },
20 | "private": true,
21 | "license": "http://polymer.github.io/LICENSE.txt",
22 | "homepage": "https://github.com/PolymerElements/paper-header-panel",
23 | "ignore": [],
24 | "dependencies": {
25 | "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
26 | "polymer": "Polymer/polymer#^1.0.0"
27 | },
28 | "devDependencies": {
29 | "web-component-tester": "*",
30 | "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
31 | "test-fixture": "PolymerElements/test-fixture#^1.0.0",
32 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
33 | "paper-styles": "PolymerElements/paper-styles#^1.0.0"
34 | },
35 | "_release": "1.0.4",
36 | "_resolution": {
37 | "type": "version",
38 | "tag": "v1.0.4",
39 | "commit": "e115448483684c30fb059afefbb944aa5fed7f24"
40 | },
41 | "_source": "git://github.com/PolymerElements/paper-header-panel.git",
42 | "_target": "~1.0.4",
43 | "_originalSource": "PolymerElements/paper-header-panel",
44 | "_direct": true
45 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 The Go Authors. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/perffile/branchsampletype_string.go:
--------------------------------------------------------------------------------
1 | // Code generated by "bitstringer -type=BranchSampleType"; DO NOT EDIT
2 |
3 | package perffile
4 |
5 | import "strconv"
6 |
7 | func (i BranchSampleType) String() string {
8 | if i == 0 {
9 | return "0"
10 | }
11 | s := ""
12 | if i&BranchSampleAbortTX != 0 {
13 | s += "AbortTX|"
14 | }
15 | if i&BranchSampleAny != 0 {
16 | s += "Any|"
17 | }
18 | if i&BranchSampleAnyCall != 0 {
19 | s += "AnyCall|"
20 | }
21 | if i&BranchSampleAnyReturn != 0 {
22 | s += "AnyReturn|"
23 | }
24 | if i&BranchSampleCall != 0 {
25 | s += "Call|"
26 | }
27 | if i&BranchSampleCallStack != 0 {
28 | s += "CallStack|"
29 | }
30 | if i&BranchSampleCond != 0 {
31 | s += "Cond|"
32 | }
33 | if i&BranchSampleHV != 0 {
34 | s += "HV|"
35 | }
36 | if i&BranchSampleHWIndex != 0 {
37 | s += "HWIndex|"
38 | }
39 | if i&BranchSampleInTX != 0 {
40 | s += "InTX|"
41 | }
42 | if i&BranchSampleIndCall != 0 {
43 | s += "IndCall|"
44 | }
45 | if i&BranchSampleIndJump != 0 {
46 | s += "IndJump|"
47 | }
48 | if i&BranchSampleKernel != 0 {
49 | s += "Kernel|"
50 | }
51 | if i&BranchSampleNoCycles != 0 {
52 | s += "NoCycles|"
53 | }
54 | if i&BranchSampleNoFlags != 0 {
55 | s += "NoFlags|"
56 | }
57 | if i&BranchSampleNoTX != 0 {
58 | s += "NoTX|"
59 | }
60 | if i&BranchSampleTypeSave != 0 {
61 | s += "TypeSave|"
62 | }
63 | if i&BranchSampleUser != 0 {
64 | s += "User|"
65 | }
66 | i &^= 262143
67 | if i == 0 {
68 | return s[:len(s)-1]
69 | }
70 | return s + "0x" + strconv.FormatUint(uint64(i), 16)
71 | }
72 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-meta/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | iron-meta
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
<iron-meta>
27 |
28 | The value stored at key="info" is .
29 |
30 |
31 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-icons/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "iron-icons",
3 | "version": "1.0.3",
4 | "description": "A set of icons for use with iron-icon",
5 | "authors": [
6 | "The Polymer Authors"
7 | ],
8 | "keywords": [
9 | "web-components",
10 | "polymer",
11 | "icon"
12 | ],
13 | "main": "iron-icons.html",
14 | "private": true,
15 | "repository": {
16 | "type": "git",
17 | "url": "git://github.com/PolymerElements/iron-icons"
18 | },
19 | "license": "http://polymer.github.io/LICENSE.txt",
20 | "homepage": "https://github.com/PolymerElements/paper-icons",
21 | "dependencies": {
22 | "iron-icon": "polymerelements/iron-icon#^1.0.0",
23 | "iron-iconset-svg": "polymerelements/iron-iconset-svg#^1.0.0",
24 | "polymer": "Polymer/polymer#^1.0.0"
25 | },
26 | "devDependencies": {
27 | "paper-styles": "polymerelements/paper-styles#^1.0.2",
28 | "iron-component-page": "polymerelements/iron-component-page#1.0.0",
29 | "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
30 | "iron-meta": "polymerelements/iron-meta#^1.0.0",
31 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
32 | },
33 | "ignore": [
34 | "util",
35 | "update-icons.sh"
36 | ],
37 | "_release": "1.0.3",
38 | "_resolution": {
39 | "type": "version",
40 | "tag": "v1.0.3",
41 | "commit": "036325be99c33c052ac807a705aacad70be1127f"
42 | },
43 | "_source": "git://github.com/polymerelements/iron-icons.git",
44 | "_target": "^1.0.0",
45 | "_originalSource": "polymerelements/iron-icons"
46 | }
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-toolbar/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "paper-toolbar",
3 | "version": "1.0.4",
4 | "license": "http://polymer.github.io/LICENSE.txt",
5 | "description": "A material design toolbar that is easily customizable",
6 | "private": true,
7 | "main": [
8 | "paper-toolbar.html"
9 | ],
10 | "authors": [
11 | "The Polymer Authors"
12 | ],
13 | "keywords": [
14 | "web-components",
15 | "polymer",
16 | "toolbar",
17 | "layout"
18 | ],
19 | "repository": {
20 | "type": "git",
21 | "url": "git://github.com/PolymerElements/paper-toolbar.git"
22 | },
23 | "dependencies": {
24 | "paper-styles": "PolymerElements/paper-styles#^1.0.0",
25 | "polymer": "Polymer/polymer#^1.0.0"
26 | },
27 | "devDependencies": {
28 | "iron-icons": "PolymerElements/iron-icons#^1.0.0",
29 | "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0",
30 | "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
31 | "test-fixture": "PolymerElements/test-fixture#^1.0.0",
32 | "web-component-tester": "*",
33 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
34 | },
35 | "homepage": "https://github.com/PolymerElements/paper-toolbar",
36 | "_release": "1.0.4",
37 | "_resolution": {
38 | "type": "version",
39 | "tag": "v1.0.4",
40 | "commit": "15096d1c9ee6cc547eaf078b431f3e07d0968367"
41 | },
42 | "_source": "git://github.com/PolymerElements/paper-toolbar.git",
43 | "_target": "~1.0.4",
44 | "_originalSource": "PolymerElements/paper-toolbar",
45 | "_direct": true
46 | }
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-tabs/README.md:
--------------------------------------------------------------------------------
1 | paper-tabs
2 | ============
3 |
4 | `paper-tabs` makes it easy to explore and switch between different views or functional aspects of
5 | an app, or to browse categorized data sets.
6 |
7 | Use `selected` property to get or set the selected tab.
8 |
9 | Example:
10 |
11 | ```html
12 |
13 | TAB 1
14 | TAB 2
15 | TAB 3
16 |
17 | ```
18 |
19 | See paper-tab for more information about
20 | `paper-tab`.
21 |
22 | A common usage for `paper-tabs` is to use it along with `iron-pages` to switch
23 | between different views.
24 |
25 | ```html
26 |
27 | Tab 1
28 | Tab 2
29 | Tab 3
30 |
31 |
32 |
33 | Page 1
34 | Page 2
35 | Page 3
36 |
37 | ```
38 |
39 | To use links in tabs, add `link` attribute to `paper-tab` and put an ``
40 | element in `paper-tab`.
41 |
42 | Example:
43 |
44 | ```html
45 |
46 |
47 | TAB ONE
48 |
49 |
50 | TAB TWO
51 |
52 |
53 | TAB THREE
54 |
55 |
56 | ```
57 |
--------------------------------------------------------------------------------
/cmd/memheat/draw.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package main
6 |
7 | import (
8 | "fmt"
9 | "image/color"
10 |
11 | "github.com/aclements/go-perf/scale"
12 | )
13 |
14 | type TicksFormat struct {
15 | tickLen, minorTickLen, textSep float64
16 | tickColor, labelColor color.Color
17 | labelFormat string
18 | }
19 |
20 | func (f *TicksFormat) HTicks(svg *SVG, scale scale.Interface, x scale.OutputScale, y float64) {
21 | x.Crop()
22 |
23 | major, minor := scale.Ticks(5)
24 |
25 | // Draw ticks
26 | if f.tickColor == nil {
27 | svg.SetStroke(color.Black)
28 | } else {
29 | svg.SetStroke(f.tickColor)
30 | }
31 | svg.NewPath()
32 | for _, sx := range major {
33 | if x, ok := x.Of(scale.Of(sx)); ok {
34 | svg.MoveTo(x, y)
35 | svg.LineToRel(0, -f.tickLen)
36 | }
37 | }
38 | for _, sx := range minor {
39 | if x, ok := x.Of(scale.Of(sx)); ok {
40 | svg.MoveTo(x, y)
41 | svg.LineToRel(0, -f.minorTickLen)
42 | }
43 | }
44 | svg.Stroke()
45 | svg.SetStroke(nil)
46 |
47 | // Draw labels
48 | lOpts := TextOpts{Anchor: AnchorMiddle}
49 | if f.labelFormat != "" {
50 | if f.labelColor == nil {
51 | svg.SetFill(color.Black)
52 | } else {
53 | svg.SetFill(f.labelColor)
54 | }
55 | for _, sx := range major {
56 | if x, ok := x.Of(scale.Of(sx)); ok {
57 | l := fmt.Sprintf(f.labelFormat, sx)
58 | svg.Text(x, y-f.tickLen-f.textSep, lOpts, l)
59 | }
60 | }
61 | svg.SetFill(nil)
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-icon-button/README.md:
--------------------------------------------------------------------------------
1 | paper-icon-button
2 | =================
3 |
4 | Material Design: Buttons
5 |
6 | `paper-icon-button` is a button with an image placed at the center. When the user touches
7 | the button, a ripple effect emanates from the center of the button.
8 |
9 | `paper-icon-button` includes a default icon set. Use `icon` to specify which icon
10 | from the icon set to use.
11 |
12 | ```html
13 |
14 | ```
15 |
16 | See [`iron-iconset`](#iron-iconset) for more information about
17 | how to use a custom icon set.
18 |
19 | Example:
20 |
21 | ```html
22 |
23 |
24 |
25 |
26 | ```
27 |
28 | Styling
29 | -------
30 |
31 | Style the button with CSS as you would a normal DOM element. If you are using the icons
32 | provided by `iron-icons`, they will inherit the foreground color of the button.
33 |
34 | ```html
35 |
36 |
37 | ```
38 |
39 | By default, the ripple is the same color as the foreground at 25% opacity. You may
40 | customize the color using this selector:
41 |
42 | ```css
43 | /* make #my-button use a blue ripple instead of foreground color */
44 | #my-button::shadow #ripple {
45 | color: blue;
46 | }
47 | ```
48 |
49 | The opacity of the ripple is not customizable via CSS.
50 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | go-perf is a set of tools for working with Linux perf.data profiles,
2 | as well as a set of Go packages for parsing and interpreting such
3 | profiles.
4 |
5 | memlat
6 | ------
7 |
8 | memlat is a web-based interactive browser for memory load latency
9 | profiles. Such profiles give deep and detailed insight in to the
10 | sources of memory stalls and conflicts, but are difficult to interpret
11 | using traditional profiling tools. See the
12 | [detailed documentation on godoc](http://godoc.org/github.com/aclements/go-perf/cmd/memlat).
13 |
14 | There is also a predecessor of memlat in `cmd/memheat`. This tool
15 | generates static SVG files summarizing memory load latency
16 | distributions by function and source line. This may be removed in the
17 | future.
18 |
19 | dump
20 | ----
21 |
22 | dump prints the detailed decoded contents of a perf.data profile. It's
23 | similar to `perf report -D`, but is somewhat less mysterious. It's
24 | particularly useful when developing with the perffile library because
25 | it prints everything in terms of perffile structures.
26 |
27 | Libraries
28 | ---------
29 |
30 | This repository also contains two Go packages for parsing and
31 | interpreting perf.data files.
32 |
33 | [perffile](http://godoc.org/github.com/aclements/go-perf/perffile)
34 | provides a parser for perf.data files. It can interpret all current
35 | record types and almost all metadata fields.
36 |
37 | [perfsession](http://godoc.org/github.com/aclements/go-perf/perfsession)
38 | provides utilities for tracking session state while processing a
39 | perf.data file. Its API is still evolving and should be considered
40 | unstable.
41 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-ajax/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "iron-ajax",
3 | "version": "1.0.4",
4 | "description": "Makes it easy to make ajax calls and parse the response",
5 | "private": true,
6 | "authors": [
7 | "The Polymer Authors"
8 | ],
9 | "keywords": [
10 | "web-components",
11 | "polymer",
12 | "ajax"
13 | ],
14 | "main": [
15 | "iron-ajax.html",
16 | "iron-request.html"
17 | ],
18 | "repository": {
19 | "type": "git",
20 | "url": "git://github.com/PolymerElements/iron-ajax.git"
21 | },
22 | "license": "http://polymer.github.io/LICENSE.txt",
23 | "homepage": "https://github.com/PolymerElements/iron-ajax",
24 | "ignore": [],
25 | "dependencies": {
26 | "promise-polyfill": "polymerlabs/promise-polyfill#^1.0.0",
27 | "polymer": "Polymer/polymer#^1.0.0"
28 | },
29 | "devDependencies": {
30 | "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
31 | "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
32 | "iron-image": "polymerelements/iron-image#^1.0.0",
33 | "paper-styles": "polymerelements/paper-styles#^1.0.0",
34 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
35 | "web-component-tester": "*",
36 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
37 | },
38 | "_release": "1.0.4",
39 | "_resolution": {
40 | "type": "version",
41 | "tag": "v1.0.4",
42 | "commit": "0aaba00fc2891040d2fbf35dcc9816b7655f2bed"
43 | },
44 | "_source": "git://github.com/PolymerElements/iron-ajax.git",
45 | "_target": "~1.0.4",
46 | "_originalSource": "PolymerElements/iron-ajax",
47 | "_direct": true
48 | }
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-behaviors/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | simple-button
18 |
19 |
20 |
21 |
22 |
23 |
30 |
31 |
32 |
33 |
34 |
Normal
35 |
36 | Hello World
37 |
38 | Toggles
39 |
40 | Hello World
41 |
42 | Disabled
43 |
44 | Hello World
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/iron-icons/hero.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/paper-tabs/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "paper-tabs",
3 | "version": "1.0.2",
4 | "license": "http://polymer.github.io/LICENSE.txt",
5 | "description": "Material design tabs",
6 | "private": true,
7 | "main": "paper-tabs.html",
8 | "authors": [
9 | "The Polymer Authors"
10 | ],
11 | "keywords": [
12 | "web-components",
13 | "polymer",
14 | "tabs",
15 | "control"
16 | ],
17 | "repository": {
18 | "type": "git",
19 | "url": "git://github.com/PolymerElements/paper-tabs.git"
20 | },
21 | "dependencies": {
22 | "iron-behaviors": "polymerelements/iron-behaviors#^1.0.0",
23 | "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
24 | "iron-icon": "polymerelements/iron-icon#^1.0.0",
25 | "iron-iconset-svg": "polymerelements/iron-iconset-svg#^1.0.0",
26 | "iron-menu-behavior": "polymerelements/iron-menu-behavior#^1.0.0",
27 | "iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0",
28 | "paper-ripple": "polymerelements/paper-ripple#^1.0.0",
29 | "paper-styles": "polymerelements/paper-styles#^1.0.0",
30 | "polymer": "Polymer/polymer#^1.0.0",
31 | "paper-icon-button": "polymerelements/paper-icon-button#^1.0.0"
32 | },
33 | "devDependencies": {
34 | "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
35 | "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
36 | "paper-toolbar": "polymerelements/paper-toolbar#^1.0.0",
37 | "test-fixture": "polymerelements/test-fixture#^1.0.0",
38 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
39 | "web-component-tester": "*"
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/internal/cparse/pp.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package cparse
6 |
7 | import (
8 | "fmt"
9 | "io"
10 | "os"
11 | "os/exec"
12 | "regexp"
13 | "strings"
14 | )
15 |
16 | type BuildEnv struct {
17 | CCArgs []string
18 | }
19 |
20 | var macroRe = regexp.MustCompile(`^#define ([_a-zA-Z][_a-zA-Z0-9]*)`)
21 |
22 | // FindMacros returns the names of all macros defined by the C source
23 | // in r.
24 | func FindMacros(env *BuildEnv, r io.Reader) ([]string, error) {
25 | ccArgs := append([]string(nil), env.CCArgs...)
26 | ccArgs = append(ccArgs, "-x", "c", "-E", "-dM", "-")
27 | cc := exec.Command("cc", ccArgs...)
28 | cc.Stdin = r
29 | cc.Stderr = os.Stderr
30 | out, err := cc.Output()
31 | if err != nil {
32 | return nil, err
33 | }
34 | var macros []string
35 | lines := strings.Split(string(out), "\n")
36 | for _, line := range lines {
37 | if line == "" {
38 | continue
39 | }
40 | m := macroRe.FindStringSubmatch(line)
41 | if m == nil {
42 | return nil, fmt.Errorf("failed to parse macro %q", line)
43 | }
44 | macros = append(macros, m[1])
45 | }
46 | return macros, nil
47 | }
48 |
49 | // Preprocess invokes the C preprocessor to pre-process the C source
50 | // in r.
51 | func Preprocess(env *BuildEnv, r io.Reader) ([]byte, error) {
52 | // Invoke C compiler for pre-processing.
53 | ccArgs := append([]string(nil), env.CCArgs...)
54 | ccArgs = append(ccArgs, "-x", "c", "-E", "-")
55 | cc := exec.Command("cc", ccArgs...)
56 | cc.Stdin = r
57 | cc.Stderr = os.Stderr
58 | return cc.Output()
59 | }
60 |
--------------------------------------------------------------------------------
/cmd/memlat/static/bower_components/polymer/LICENSE.txt:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2014 The Polymer Authors. All rights reserved.
2 | //
3 | // Redistribution and use in source and binary forms, with or without
4 | // modification, are permitted provided that the following conditions are
5 | // met:
6 | //
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above
10 | // copyright notice, this list of conditions and the following disclaimer
11 | // in the documentation and/or other materials provided with the
12 | // distribution.
13 | // * Neither the name of Google Inc. nor the names of its
14 | // contributors may be used to endorse or promote products derived from
15 | // this software without specific prior written permission.
16 | //
17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/perffile/cpuset.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package perffile
6 |
7 | import (
8 | "fmt"
9 | "sort"
10 | "strconv"
11 | "strings"
12 | )
13 |
14 | // A CPUSet represents a set of CPUs by CPU index.
15 | type CPUSet []int
16 |
17 | func parseCPUSet(str string) (CPUSet, error) {
18 | var err error
19 | out := CPUSet{}
20 | for _, r := range strings.Split(str, ",") {
21 | var lo, hi int
22 | dash := strings.Index(r, "-")
23 | if dash == -1 {
24 | lo, err = strconv.Atoi(r)
25 | if err != nil {
26 | return nil, err
27 | }
28 | hi = lo
29 | } else {
30 | lo, err = strconv.Atoi(r[:dash])
31 | if err != nil {
32 | return nil, err
33 | }
34 | hi, err = strconv.Atoi(r[dash+1:])
35 | if err != nil {
36 | return nil, err
37 | }
38 | }
39 | for cpu := lo; cpu <= hi; cpu++ {
40 | out = append(out, cpu)
41 | }
42 | }
43 | sort.Ints(out)
44 | i, j := 0, 0
45 | for ; i < len(out); i++ {
46 | if i != j && out[i] == out[j] {
47 | continue
48 | }
49 | out[j] = out[i]
50 | j++
51 | }
52 | return out, nil
53 | }
54 |
55 | func (c CPUSet) String() string {
56 | if len(c) == 0 {
57 | return ""
58 | }
59 |
60 | out := ""
61 | lo, hi := c[0], c[0]-1
62 | flush := func() {
63 | if lo == hi {
64 | out = fmt.Sprintf("%s,%d", out, lo)
65 | } else {
66 | out = fmt.Sprintf("%s,%d-%d", out, lo, hi)
67 | }
68 | }
69 | for _, cpu := range c {
70 | if cpu == hi+1 {
71 | hi = cpu
72 | } else {
73 | flush()
74 | lo, hi = cpu, cpu
75 | }
76 | }
77 | flush()
78 | return out[1:]
79 | }
80 |
--------------------------------------------------------------------------------