aboutsummaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorBen Clayton <bclayton@google.com>2015-03-23 11:38:50 +0000
committerBen Clayton <bclayton@google.com>2015-03-23 14:14:03 +0000
commit108c32d61ef4650baf6794e5781d7f06d45ba008 (patch)
tree8fc6e8aa79568a9eefb35c6354325175c9a826ca /database
parentb31032c8b3f14397c7cb5cfa2d2a281db54313ee (diff)
downloadgpu-108c32d61ef4650baf6794e5781d7f06d45ba008.tar.gz
Create a DB record for all the captures held in the DB
Change-Id: I01250caccfc7bc87437a3765be8dabdaa535e245
Diffstat (limited to 'database')
-rw-r--r--database/database.go32
1 files changed, 0 insertions, 32 deletions
diff --git a/database/database.go b/database/database.go
index 8bfb87bbf..330fd2a40 100644
--- a/database/database.go
+++ b/database/database.go
@@ -20,10 +20,7 @@ package database
import (
"bytes"
"fmt"
- "io/ioutil"
- "os"
"path/filepath"
- "strings"
"sync"
"android.googlesource.com/platform/tools/gpu/binary"
@@ -42,7 +39,6 @@ type Database interface {
Store(binary.Object, log.Logger) (binary.ID, error)
Load(binary.ID, log.Logger, binary.Object) error
Contains(binary.ID, log.Logger) bool
- Captures() (map[string]binary.ID, error)
Close()
}
@@ -287,31 +283,3 @@ func (d *database) Close() {
d.metaStore.Close()
d.dataStore.Close()
}
-
-func (d *database) Captures() (map[string]binary.ID, error) {
- result := make(map[string]binary.ID)
- files, err := ioutil.ReadDir(d.path)
- if err != nil {
- return result, err
- }
- for _, file := range files {
- filename := file.Name()
- if filepath.Ext(filename) == extension {
- name := strings.TrimSuffix(filename, extension)
- path := filepath.Join(d.path, filename)
- if r, err := os.Open(path); err != nil {
- return result, err
- } else {
- defer r.Close()
- d := cyclic.Decoder(vle.Reader(r))
- id := binary.ID{}
- if err := id.Decode(d); err != nil {
- return result, err
- } else {
- result[name] = id
- }
- }
- }
- }
- return result, nil
-}