summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/pseudo
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-12-17 16:13:35 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-12-17 16:14:08 +0000
commit81f3d46fa5f16bfb8a0ee2e5569370337abe948c (patch)
treeec91758a8fea58a9d254be7b1f47681dc4d613b0 /meta/recipes-devtools/pseudo
parent3abc81b79850f42e8e041feab3acd52b574026f9 (diff)
downloadpoky-81f3d46fa5f16bfb8a0ee2e5569370337abe948c.tar.gz
pseudo: Fixup for cache problem
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-devtools/pseudo')
-rw-r--r--meta/recipes-devtools/pseudo/pseudo/895fa7e359e8026a608fba052c2994e42901e45f.patch235
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_git.bb5
2 files changed, 238 insertions, 2 deletions
diff --git a/meta/recipes-devtools/pseudo/pseudo/895fa7e359e8026a608fba052c2994e42901e45f.patch b/meta/recipes-devtools/pseudo/pseudo/895fa7e359e8026a608fba052c2994e42901e45f.patch
new file mode 100644
index 0000000000..d8c229541e
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/pseudo/895fa7e359e8026a608fba052c2994e42901e45f.patch
@@ -0,0 +1,235 @@
1From 895fa7e359e8026a608fba052c2994e42901e45f Mon Sep 17 00:00:00 2001
2From: Mark Hatle <mark.hatle@windriver.com>
3Date: Fri, 17 Dec 2010 01:23:47 +0000
4Subject: Revert "Add a cache of the last object found in pseudo_op"
5
6This reverts commit 49d4d35918d457b0e9206679ecad3b9c84f11e66.
7
8Conflicts:
9
10 ChangeLog.txt
11---
12diff --git a/ChangeLog.txt b/ChangeLog.txt
13index 1db8c7d..200b32e 100644
14--- a/ChangeLog.txt
15+++ b/ChangeLog.txt
16@@ -9,7 +9,6 @@
17 * (mhatle) as a result of profiling, optimize inode search
18 * (mhatle) rearrange the pseudo_op file data operations to reduce
19 the number of selects.
20- * (mhatle) add the ability to cache the last select result
21 * (mhatle) change the indexing in pseudo_db.c
22
23 2010-12-14:
24diff --git a/pseudo.c b/pseudo.c
25index 3979fd8..6b965be 100644
26--- a/pseudo.c
27+++ b/pseudo.c
28@@ -425,9 +425,6 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag) {
29 int found_path = 0, found_ino = 0;
30 int prefer_ino = 0;
31
32- static pseudo_msg_t cache_msg = { .op = 0 };
33- static char * cache_path = NULL;
34-
35 if (!msg)
36 return 1;
37
38@@ -471,59 +468,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag) {
39
40 /* Lookup the full path, with inode and dev if available */
41 if (msg->pathlen && msg->dev && msg->ino) {
42- if (cache_msg.pathlen == msg->pathlen &&
43- cache_msg.dev == msg->dev &&
44- cache_msg.ino == msg->ino &&
45- !strcmp(cache_path, msg->path)) {
46- /* Found it in the cache! */
47-#ifdef NPROFILE
48- pseudo_diag("cache hit -- by_file_exact\n");
49-#endif
50- /* Change the cache to match the msg */
51- cache_msg.type = msg->type;
52- cache_msg.op = msg->op;
53- cache_msg.result = msg->result;
54- cache_msg.access = msg->access;
55- cache_msg.fd = msg->fd;
56-#ifdef NVALIDATE
57- if (!pdb_find_file_exact(msg)) {
58- if (cache_msg.pathlen != msg->pathlen ||
59- cache_msg.dev != msg->dev ||
60- cache_msg.ino != msg->ino ||
61- cache_msg.uid != msg->uid ||
62- cache_msg.gid != msg->gid ||
63- cache_msg.mode != msg->mode ||
64- cache_msg.rdev != msg->rdev ||
65- cache_msg.nlink != msg->nlink ||
66- cache_msg.deleting != msg->deleting) {
67- pseudo_diag("Cache mismatch [%s]: Database differs from cache\n"
68- " cache vs result:\n"
69- " dev (%llu,%llu) ino (%llu,%llu)\n"
70- " uid (%d,%d) gid (%d,%d) mode (0%o,0%o)\n"
71- " rdev (%llu,%llu) nlink (%d,%d) deleting (%d,%d)\n",
72- msg->pathlen ? msg->path : "no path",
73- (unsigned long long) cache_msg.dev, (unsigned long long) msg->dev,
74- (unsigned long long) cache_msg.ino, (unsigned long long) msg->ino,
75- (unsigned long long) cache_msg.uid, (unsigned int) msg->uid,
76- (unsigned long long) cache_msg.gid, (unsigned int) msg->gid,
77- cache_msg.mode, msg->mode,
78- (unsigned long long) cache_msg.rdev, (unsigned int) msg->rdev,
79- cache_msg.nlink, msg->nlink,
80- cache_msg.deleting, msg->deleting);
81- }
82- } else {
83- pseudo_diag("Cache mismatch [%s]: Not found in DB\n",
84- msg->pathlen ? msg->path : "no path");
85- }
86-#endif
87-
88- by_path = cache_msg;
89- by_ino = cache_msg;
90- /* no need to restore msg */
91- found_path = 1;
92- found_ino = 1;
93- path_by_ino = msg->path;
94- } else if (!pdb_find_file_exact(msg)) {
95+ if (!pdb_find_file_exact(msg)) {
96 /* restore header contents */
97 by_path = *msg;
98 by_ino = *msg;
99@@ -539,51 +484,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag) {
100 if (msg->pathlen) {
101 /* for now, don't canonicalize paths anymore */
102 /* used to do it here, but now doing it in client */
103- if (cache_msg.pathlen == msg->pathlen &&
104- !strcmp(cache_path, msg->path)) {
105-#ifdef NPROFILE
106- pseudo_diag("cache hit -- by_path\n");
107-#endif
108- /* Change the cache to match the msg */
109- cache_msg.type = msg->type;
110- cache_msg.op = msg->op;
111- cache_msg.result = msg->result;
112- cache_msg.access = msg->access;
113- cache_msg.fd = msg->fd;
114-#ifdef NVALIDATE
115- if (!pdb_find_file_exact(msg)) {
116- if (cache_msg.pathlen != msg->pathlen ||
117- cache_msg.dev != msg->dev ||
118- cache_msg.ino != msg->ino ||
119- cache_msg.uid != msg->uid ||
120- cache_msg.gid != msg->gid ||
121- cache_msg.mode != msg->mode ||
122- cache_msg.rdev != msg->rdev ||
123- cache_msg.nlink != msg->nlink ||
124- cache_msg.deleting != msg->deleting) {
125- pseudo_diag("Cache mismatch [%s]: Database differs from cache\n"
126- " cache vs result:\n"
127- " dev (%llu,%llu) ino (%llu,%llu)\n"
128- " uid (%d,%d) gid (%d,%d) mode (0%o,0%o)\n"
129- " rdev (%llu,%llu) nlink (%d,%d) deleting (%d,%d)\n",
130- msg->pathlen ? msg->path : "no path",
131- (unsigned long long) cache_msg.dev, (unsigned long long) msg->dev,
132- (unsigned long long) cache_msg.ino, (unsigned long long) msg->ino,
133- (unsigned long long) cache_msg.uid, (unsigned int) msg->uid,
134- (unsigned long long) cache_msg.gid, (unsigned int) msg->gid,
135- cache_msg.mode, msg->mode,
136- (unsigned long long) cache_msg.rdev, (unsigned int) msg->rdev,
137- cache_msg.nlink, msg->nlink,
138- cache_msg.deleting, msg->deleting);
139- }
140- } else {
141- pseudo_diag("Cache mismatch [%s]: Not found in DB\n",
142- msg->pathlen ? msg->path : "no path");
143- }
144-#endif
145- by_path = cache_msg;
146- found_path = 1;
147- } else if (!pdb_find_file_path(msg)) {
148+ if (!pdb_find_file_path(msg)) {
149 by_path = *msg;
150 found_path = 1;
151 } else {
152@@ -594,51 +495,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag) {
153 }
154 /* search on original inode -- in case of mismatch */
155 if (msg->dev && msg->ino) {
156- if (cache_msg.dev == msg->dev &&
157- cache_msg.ino == msg->ino) {
158-#ifdef NPROFILE
159- pseudo_diag("cache hit -- by_ino\n");
160-#endif
161- /* Change the cache to match the msg */
162- cache_msg.type = msg->type;
163- cache_msg.op = msg->op;
164- cache_msg.result = msg->result;
165- cache_msg.access = msg->access;
166- cache_msg.fd = msg->fd;
167-#ifdef NVALIDATE
168- if (!pdb_find_file_exact(msg)) {
169- if (cache_msg.pathlen != msg->pathlen ||
170- cache_msg.dev != msg->dev ||
171- cache_msg.ino != msg->ino ||
172- cache_msg.uid != msg->uid ||
173- cache_msg.gid != msg->gid ||
174- cache_msg.mode != msg->mode ||
175- cache_msg.rdev != msg->rdev ||
176- cache_msg.nlink != msg->nlink ||
177- cache_msg.deleting != msg->deleting) {
178- pseudo_diag("Cache mismatch [%s]: Database differs from cache\n"
179- " cache vs result:\n"
180- " dev (%llu,%llu) ino (%llu,%llu)\n"
181- " uid (%d,%d) gid (%d,%d) mode (0%o,0%o)\n"
182- " rdev (%llu,%llu) nlink (%d,%d) deleting (%d,%d)\n",
183- msg->pathlen ? msg->path : "no path",
184- (unsigned long long) cache_msg.dev, (unsigned long long) msg->dev,
185- (unsigned long long) cache_msg.ino, (unsigned long long) msg->ino,
186- (unsigned long long) cache_msg.uid, (unsigned int) msg->uid,
187- (unsigned long long) cache_msg.gid, (unsigned int) msg->gid,
188- cache_msg.mode, msg->mode,
189- (unsigned long long) cache_msg.rdev, (unsigned int) msg->rdev,
190- cache_msg.nlink, msg->nlink,
191- cache_msg.deleting, msg->deleting);
192- }
193- } else {
194- pseudo_diag("Cache mismatch [%s]: Not found in DB\n",
195- msg->pathlen ? msg->path : "no path");
196- }
197-#endif
198- found_ino = 1;
199- path_by_ino = cache_path;
200- } else if (!pdb_find_file_dev(&by_ino)) {
201+ if (!pdb_find_file_dev(&by_ino)) {
202 found_ino = 1;
203 path_by_ino = pdb_get_file_path(&by_ino);
204 }
205@@ -1016,28 +873,6 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag) {
206 break;
207 }
208
209- /* Cache previous values... */
210- if (msg->op != OP_MAY_UNLINK &&
211- msg->op != OP_DID_UNLINK &&
212- msg->op != OP_CANCEL_UNLINK &&
213- msg->op != OP_UNLINK) {
214-
215- cache_msg = *msg;
216-
217- free(cache_path);
218-
219- if (path_by_ino)
220- cache_path = strdup(path_by_ino);
221- else
222- cache_path = strdup(msg->path);
223- } else {
224- cache_msg.pathlen = 0;
225- cache_msg.dev = 0;
226- cache_msg.ino = 0;
227- free(cache_path);
228- cache_path = NULL;
229- }
230-
231 /* in the case of an exact match, we just used the pointer
232 * rather than allocating space
233 */
234--
235cgit v0.8.3.3-89-gbf82
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index 55055fa0d3..f9b10f0d36 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -6,10 +6,11 @@ LICENSE = "LGPL2.1"
6DEPENDS = "sqlite3" 6DEPENDS = "sqlite3"
7 7
8PV = "0.0+git${SRCPV}" 8PV = "0.0+git${SRCPV}"
9PR = "r15" 9PR = "r16"
10 10
11SRC_URI = "git://github.com/wrpseudo/pseudo.git;protocol=git \ 11SRC_URI = "git://github.com/wrpseudo/pseudo.git;protocol=git \
12 file://static_sqlite.patch" 12 file://static_sqlite.patch \
13 file://895fa7e359e8026a608fba052c2994e42901e45f.patch"
13 14
14FILES_${PN} = "${libdir}/libpseudo.so ${bindir}/* ${localstatedir}/pseudo" 15FILES_${PN} = "${libdir}/libpseudo.so ${bindir}/* ${localstatedir}/pseudo"
15PROVIDES += "virtual/fakeroot" 16PROVIDES += "virtual/fakeroot"