GithubHelp home page GithubHelp logo

facebookarchive / fbkutils Goto Github PK

View Code? Open in Web Editor NEW
328.0 46.0 69.0 17.28 MB

A variety of utilities built and maintained by Facebook's Linux Kernel Team that we wish to share with the community.

License: Other

C 2.61% Makefile 0.05% Python 80.66% PostScript 12.29% Shell 4.39%

fbkutils's Issues

AttributeError: 'dict' object has no attribute 'correctness_tests'

When executing schbench, or other benchmarks as far as I can tell, throws the following error:

AttributeError: 'dict' object has no attribute 'correctness_tests'

After some investigation seems to be that all benchmarks return a dict object containing the
metrics, and benchpress/cli/commands/run.py calls a non-existing function on it called correctness_tests().

Unsuccessful make

Attempting to run make, making sure I had glibc installed, this is the output of the make logs.

make[1]: Entering directory '/home/xlaits/git/fbkutils/netconsd/modules'
g++ logger.cc -std=c++11 -O2 -D_GNU_SOURCE -fno-strict-aliasing -Wall -Wextra -Wmissing-declarations -Wno-missing-field-initializers -Wno-unused-parameter -fPIC -I../../ncrx -I../include -lpthread -lrt -ldl -c -o logger.o
logger.cc: In constructor 'logtarget::logtarget(in6_addr*)':
logger.cc:78:12: error: 'stderr' was not declared in this scope
   78 |    fprintf(stderr, "FATAL: open() failed: %m\n");
      |            ^~~~~~
logger.cc:28:1: note: 'stderr' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
   27 | #include <jhash.h>
  +++ |+#include <cstdio>
   28 | 
logger.cc:78:4: error: 'fprintf' was not declared in this scope
   78 |    fprintf(stderr, "FATAL: open() failed: %m\n");
      |    ^~~~~~~
logger.cc: In function 'void write_log(logtarget&, msg_buf*, ncrx_msg*)':
logger.cc:119:3: error: 'dprintf' was not declared in this scope
  119 |   dprintf(tgt.fd, "%s\n", buf->buf);
      |   ^~~~~~~
logger.cc:121:3: error: 'dprintf' was not declared in this scope
  121 |   dprintf(tgt.fd, "%06lu %014lu %d %d %s%s%s%s%s\n", msg->seq,
      |   ^~~~~~~
make[1]: *** [Makefile:20: logger.so] Error 1
make[1]: Leaving directory '/home/xlaits/git/fbkutils/netconsd/modules'
make: *** [Makefile:47: mods] Error 2```

File explicitly closed can be replaced with"with open(file, 'r')" syntax

https://github.com/facebook/fbkutils/blob/988bbdc252cd4c094be7a6e4241ca5f732db41fe/netesto/local/processExp.py#L207-L216

The file fbkutils/netesto/local/processExp.py has the above code, which closes the file explictly. It can be replace by the following code. Why use with open syntax

with open(field_fn, 'r')  as fin:
   for iline in fin: 
     line = iline.strip() 
     if len(line) == 0: 
         continue 
     if line[0] != '#': 
         field = line.split(':') 
         fieldList.append(field[0]) 
         fieldOpDict[field[0]] = field[1] 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.