mirror of
https://github.com/clearlinux/clr-debug-info.git
synced 2026-09-06 13:51:38 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5b4030f7c | ||
|
|
de9e0ce5c5 | ||
|
|
9e400bd149 | ||
|
|
f5a65358af | ||
|
|
c82a007960 | ||
|
|
02ece110b5 | ||
|
|
3a6bf4a167 | ||
|
|
fc61591870 | ||
|
|
2f26fc55c7 | ||
|
|
dfff530803 | ||
|
|
9685fcb632 | ||
|
|
14495e064b | ||
|
|
7b64fb601d | ||
|
|
b24d93fe3d | ||
|
|
5b7c484b64 | ||
|
|
d23b8e17bd | ||
|
|
b120d1c38f | ||
|
|
bbc34ad790 | ||
|
|
caf84d9b5f | ||
|
|
bc276b4920 | ||
|
|
78485dc583 | ||
|
|
ce02c64c0c | ||
|
|
f272c08d4f | ||
|
|
3babbe4b7b | ||
|
|
aad87bbdc1 | ||
|
|
4505d32c68 | ||
|
|
67a9735acb | ||
|
|
1c043d5bd7 | ||
|
|
8c01f4012f | ||
|
|
955c1b7e99 | ||
|
|
a92e6f386a | ||
|
|
670069d659 | ||
|
|
be74f893e6 | ||
|
|
7a5e4a9acd | ||
|
|
07a4c3d305 | ||
|
|
ab0e59628f | ||
|
|
af4a3f64f0 | ||
|
|
8c65e96479 | ||
|
|
7ea9a50b19 | ||
|
|
e16ab76926 | ||
|
|
090cb27a34 | ||
|
|
cbaf943fca | ||
|
|
32ae400e7d | ||
|
|
82f03f8e22 | ||
|
|
c1f45d9f3c | ||
|
|
bcff8fae39 | ||
|
|
66bab25bcd | ||
|
|
49ac392f01 | ||
|
|
71f4e789c4 | ||
|
|
f776162882 | ||
|
|
a2abd8d2a9 | ||
|
|
8844b0b0e1 | ||
|
|
ca63e1be25 | ||
|
|
078e9987d5 | ||
|
|
97431314b5 | ||
|
|
07e1f033e1 | ||
|
|
45f22398ca | ||
|
|
b538b457ce | ||
|
|
09affa9bf5 | ||
|
|
2a217476f7 | ||
|
|
4d6639148f | ||
|
|
83509e34c7 | ||
|
|
43d54d03e6 |
@@ -4,8 +4,6 @@ Description=Clear Linux debuginfo daemon
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/clr_debug_daemon
|
ExecStart=/usr/bin/clr_debug_daemon
|
||||||
DefaultDependencies=no
|
|
||||||
Nice=10
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ After=clr_debug_daemon.service
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/clr_debug_fuse
|
ExecStart=/usr/bin/clr_debug_fuse
|
||||||
DefaultDependencies=no
|
|
||||||
Nice=10
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_PREREQ([2.66])
|
AC_PREREQ([2.66])
|
||||||
AC_INIT(clr-debug-info, 38, arjan@linux.intel.com)
|
AC_INIT(clr-debug-info, 32, arjan@linux.intel.com)
|
||||||
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
|
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
|
||||||
AM_SILENT_RULES([yes])
|
AM_SILENT_RULES([yes])
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ void try_to_get(const char *path, int pid, time_t timestamp)
|
|||||||
if (ret == 0 && cred.pid == pid) {
|
if (ret == 0 && cred.pid == pid) {
|
||||||
printf("Recursion\n");
|
printf("Recursion\n");
|
||||||
close(sockfd);
|
close(sockfd);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
command = NULL;
|
command = NULL;
|
||||||
|
|||||||
+1
-1
@@ -113,7 +113,7 @@ bool nc_copy_file(const char *src, const char *dst, mode_t mode, bool remove_tar
|
|||||||
while (true) {
|
while (true) {
|
||||||
if ((r = read(src_fd, &buffer, sizeof(buffer))) < 0) {
|
if ((r = read(src_fd, &buffer, sizeof(buffer))) < 0) {
|
||||||
ret = false;
|
ret = false;
|
||||||
goto end;
|
break;
|
||||||
}
|
}
|
||||||
if (write(dest_fd, buffer, sizeof(buffer)) != r) {
|
if (write(dest_fd, buffer, sizeof(buffer)) != r) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
+5
-7
@@ -123,8 +123,8 @@ static inline unsigned nc_hashmap_get_hash(NcHashmap *self, const void *key)
|
|||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nc_hashmap_insert_bucket(NcHashmap *self, NcHashmapEntry *buckets, int n_buckets,
|
static bool nc_hashmap_insert_bucket(NcHashmap *self, NcHashmapEntry *buckets, int n_buckets,
|
||||||
unsigned hash, const void *key, void *value)
|
unsigned hash, const void *key, void *value)
|
||||||
{
|
{
|
||||||
NcHashmapEntry *row = &(buckets[hash % n_buckets]);
|
NcHashmapEntry *row = &(buckets[hash % n_buckets]);
|
||||||
NcHashmapEntry *head = NULL;
|
NcHashmapEntry *head = NULL;
|
||||||
@@ -458,12 +458,10 @@ bool nc_hashmap_iter_next(NcHashmapIter *citer, void **key, void **value)
|
|||||||
}
|
}
|
||||||
item = &(map->buckets[iter->bucket]);
|
item = &(map->buckets[iter->bucket]);
|
||||||
}
|
}
|
||||||
if (item) {
|
if (item && item->occ) {
|
||||||
if (item->occ) {
|
goto success;
|
||||||
goto success;
|
|
||||||
}
|
|
||||||
item = item->next;
|
|
||||||
}
|
}
|
||||||
|
item = item->next;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
+5
-18
@@ -55,8 +55,8 @@
|
|||||||
|
|
||||||
static pthread_mutex_t dupes_mutex = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t dupes_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
char *urls[2] = { "https://cdn.download.clearlinux.org/debuginfo/",
|
char *urls[2] = { "https://debuginfo.clearlinux.org/debuginfo/",
|
||||||
"https://cdn.download.clearlinux.org/debuginfo/" };
|
"https://debuginfo.clearlinux.org/debuginfo/" };
|
||||||
int urlcounter = 1;
|
int urlcounter = 1;
|
||||||
|
|
||||||
static NcHashmap *hash = NULL;
|
static NcHashmap *hash = NULL;
|
||||||
@@ -189,19 +189,6 @@ static int curl_get_file(const char *url, const char *prefix, time_t timestamp)
|
|||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, file);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, file);
|
||||||
curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Some sane timeout values to prevent stalls
|
|
||||||
*
|
|
||||||
* Connect timeout is for first connection to the server.
|
|
||||||
* The low speed timeout is for slow downloads. Since many
|
|
||||||
* files are several mB large, we want to prevent them from
|
|
||||||
* taking forever. (1kB/sec avg over 30secs).
|
|
||||||
*/
|
|
||||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 30);
|
|
||||||
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 30);
|
|
||||||
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1024);
|
|
||||||
|
|
||||||
if (timestamp) {
|
if (timestamp) {
|
||||||
curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
|
curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
|
||||||
@@ -237,7 +224,7 @@ static int curl_get_file(const char *url, const char *prefix, time_t timestamp)
|
|||||||
stat(filename, &statbuf);
|
stat(filename, &statbuf);
|
||||||
if (statbuf.st_size > 0 &&
|
if (statbuf.st_size > 0 &&
|
||||||
asprintf(&command,
|
asprintf(&command,
|
||||||
"tar -C /var/cache/debuginfo/%s --no-same-owner --no-same-permissions -xf %s",
|
"tar -C /var/cache/debuginfo/%s --no-same-owner -xf %s",
|
||||||
prefix,
|
prefix,
|
||||||
filename) >= 0) {
|
filename) >= 0) {
|
||||||
if (system(command) != 0) {
|
if (system(command) != 0) {
|
||||||
@@ -282,6 +269,7 @@ static void *server_thread(void *arg)
|
|||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
goto thread_end;
|
goto thread_end;
|
||||||
}
|
}
|
||||||
|
prefix = buf;
|
||||||
c = strchr(buf, ':');
|
c = strchr(buf, ':');
|
||||||
if (!c) {
|
if (!c) {
|
||||||
goto thread_end;
|
goto thread_end;
|
||||||
@@ -334,7 +322,6 @@ static void *server_thread(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gettimeofday(&after, NULL);
|
gettimeofday(&after, NULL);
|
||||||
#if 0
|
|
||||||
if (timedelta(before, after) > 0.6)
|
if (timedelta(before, after) > 0.6)
|
||||||
printf("Request for %s took %5.2f seconds (%i - %i)\n",
|
printf("Request for %s took %5.2f seconds (%i - %i)\n",
|
||||||
url,
|
url,
|
||||||
@@ -342,7 +329,7 @@ static void *server_thread(void *arg)
|
|||||||
(1.0 * after.tv_usec - before.tv_usec) / 1000000.0,
|
(1.0 * after.tv_usec - before.tv_usec) / 1000000.0,
|
||||||
ret,
|
ret,
|
||||||
(int)timestamp);
|
(int)timestamp);
|
||||||
#endif
|
|
||||||
/* tell the other side we're done with the download */
|
/* tell the other side we're done with the download */
|
||||||
wr = write(fd, "ok", 3);
|
wr = write(fd, "ok", 3);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user